mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-08 20:57:45 +00:00
SDK templates
This commit is contained in:
28
cmd/sdk/powershell/paginate.ps1
Normal file
28
cmd/sdk/powershell/paginate.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
$JSON = @"
|
||||
{
|
||||
"indices": [
|
||||
"identities"
|
||||
],
|
||||
"query": {
|
||||
"query": "*",
|
||||
"fields": [
|
||||
"name"
|
||||
]
|
||||
},
|
||||
"sort": [
|
||||
"-displayName"
|
||||
]
|
||||
}
|
||||
"@
|
||||
|
||||
$Search = ConvertFrom-JsonToSearch -Json $JSON
|
||||
|
||||
try {
|
||||
|
||||
Invoke-PaginateSearch -Increment 50 -Limit 10000 -Search $Search
|
||||
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling Invoke-PaginateSearch: {0}" -f $_.ErrorDetails)
|
||||
Write-Host ("Response headers: {0}" -f $_.Exception.Response.Headers)
|
||||
}
|
||||
14
cmd/sdk/powershell/paginateAccounts.ps1
Normal file
14
cmd/sdk/powershell/paginateAccounts.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
$Parameters = @{
|
||||
"Filters" = 'name co "Andrew"'
|
||||
}
|
||||
|
||||
# Accounts List
|
||||
try {
|
||||
|
||||
Invoke-Paginate -Function "Get-Accounts" -Increment 250 -Limit 1000 -InitialOffset 0 -Parameters $Parameters
|
||||
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling Invoke-Paginate: {0}" -f $_.ErrorDetails)
|
||||
Write-Host ("Response headers: {0}" -f $_.Exception.Response.Headers)
|
||||
}
|
||||
14
cmd/sdk/powershell/patchEntitlement.ps1
Normal file
14
cmd/sdk/powershell/patchEntitlement.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
$ENT = @(
|
||||
@{
|
||||
op = "replace"
|
||||
path = "/privileged"
|
||||
value = $false
|
||||
}
|
||||
)
|
||||
|
||||
try {
|
||||
Update-BetaEntitlement -Id "2c9180848366cdc701837b78f5ce58be" -JsonPatchOperation $ENT
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling Update-BetaEntitlement: {0}" -f $_.ErrorDetails)
|
||||
Write-Host ("Response headers: {0}" -f $_.Exception.Response.Headers)
|
||||
}
|
||||
14
cmd/sdk/powershell/sdk.ps1
Normal file
14
cmd/sdk/powershell/sdk.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
$Limit = 250 # Int32 | Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 250)
|
||||
$Offset = 0 # Int32 | Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 0)
|
||||
$Count = $true # Boolean | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to $false)
|
||||
$Filters = 'sourceId eq "f4e73766efdf4dc6acdeed179606d694"' # String | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **id**: *eq, in* **identityId**: *eq* **name**: *eq, in* **nativeIdentity**: *eq, in* **sourceId**: *eq, in* **uncorrelated**: *eq* (optional)
|
||||
|
||||
# Accounts List
|
||||
try {
|
||||
|
||||
Get-Accounts -Limit $Limit -Offset $Offset -Count $Count -Filters $Filters
|
||||
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling Get-Accounts: {0}" -f $_.ErrorDetails)
|
||||
Write-Host ("Response headers: {0}" -f $_.Exception.Response.Headers)
|
||||
}
|
||||
22
cmd/sdk/powershell/search.ps1
Normal file
22
cmd/sdk/powershell/search.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
$Json = @"
|
||||
{
|
||||
"indices": [
|
||||
"identities"
|
||||
],
|
||||
"query": {
|
||||
"query": "*",
|
||||
"fields": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
}
|
||||
"@
|
||||
|
||||
$Search = ConvertFrom-JsonToSearch -Json $Json
|
||||
|
||||
try {
|
||||
Search-Post -Search $Search
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling Search-Post: {0}" -f $_.ErrorDetails)
|
||||
Write-Host ("Response headers: {0}" -f $_.Exception.Response.Headers)
|
||||
}
|
||||
24
cmd/sdk/powershell/transform.ps1
Normal file
24
cmd/sdk/powershell/transform.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
# Create transform
|
||||
$JSON = @"
|
||||
{
|
||||
"name": "New Transform",
|
||||
"type": "lookup",
|
||||
"attributes" : {
|
||||
"table" : {
|
||||
"USA": "Americas",
|
||||
"FRA": "EMEA",
|
||||
"AUS": "APAC",
|
||||
"default": "Unknown Region"
|
||||
}
|
||||
}
|
||||
}
|
||||
"@
|
||||
|
||||
$Transform = ConvertFrom-JsonToTransform -Json $JSON
|
||||
|
||||
try {
|
||||
New-Transform -Transform $Transform
|
||||
} catch {
|
||||
Write-Host ("Exception occurred when calling New-Transform: {0}" -f $_.ErrorDetails)
|
||||
Write-Host ("Response headers: {0}" -f $_.Exception.Response.Headers)
|
||||
}
|
||||
Reference in New Issue
Block a user