We upgraded to Orion 2019.4 earlier this year. One of the biggest reasons for doing so was that the release notes showed an item:
- Orion SDK enhancements: Automate ‘List Resources’ and import results
https://documentation.solarwinds.com/en/success_center/orionplatform/Content/Release_Notes/Orion_Platform_2019-4_release_notes.htm#NewFeaturesOrion
There is no link to any information about how this is accomplished. I do not see any documentation at all. However, I did stumble across an API example which I think was supposed to be an example here:
https://github.com/solarwinds/OrionSDK/blob/master/Samples/PowerShell/ImportListResources.ps1
This script does not really have any explanation or comments about what it is doing or why. However, it fails on every node even if I set the timeout to 8000.
PS C:\it> .\ImportListResources.ps1 $swis 254 60
Creating schedule list resources job...
Invoke-SwisVerb : ProvideFault failed, check fault information.
At C:\it\ImportListResources.ps1:43 char:15
+ ... $result = Invoke-SwisVerb $swis "orion.nodes" "ScheduleListResource ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
Invoke-SwisVerb : 'GetScheduledListResourcesStatus' operation canceled. Unable to parse jobId:
At C:\it\ImportListResources.ps1:48 char:15
+ ... $status = Invoke-SwisVerb $swis "orion.nodes" "GetScheduledListReso ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
Waiting until job status will be 'ReadyForImport'...
Timeout elapsed when waiting for status 'ReadyForImport'
At C:\it\ImportListResources.ps1:57 char:9
+ throw ("Timeout elapsed when waiting for status 'ReadyForImpo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Timeout elapsed...ReadyForImport':String) [], RuntimeException
+ FullyQualifiedErrorId : Timeout elapsed when waiting for status 'ReadyForImport'
Does anyone know of some better documentation on this process? When new nodes are added, i want to make sure that the resources like drives are monitored automatically. Manually adding resources to a node through a web pages which takes minutes for each one is a big waste of time if can be automated.
Thanks!