Assign API Template via REST Examples?

Does anybody have an example or link to the SDK that covers the "Orion.APIPoller.ApiPoller.AssignTemplate" Invoke method?

"Configuration" & "Parameters"  is really what Im looking for. 

-----update------

I got some help from  

What I needed to use is Orion.ApiPoller.ApiPoller CreateApiPollerFromTemplate 

This basic $configuration works, Polling Interval needs to be set after..  you can get some idea where to start with Dev Tools in a Browser while navigating in SolarWinds and checking the payloads.

Set the Cred Type and ID as needed.  You can ref. Orion.APIPoller.RequestDetails to get started.

$configuration = @{
    CredentialType = 'OAuth2Shared'
    CredentialID = '1'
    VerifySslCertificate = 'True'
    UseProxy = 'False'
    }

$nodeid = 1
$entity = 'orion.nodes'
$parameters = @{}

You then need to back tic ` escape " to make a STRING of the XML.  

#Base/Template XML
$template_xml = "<?xml version=`"1.0`" encoding=`"utf-8`"?><Template xmlns:xsi=`"www.w3.org/.../XMLSchema-instance`" xmlns:xsd=`"">www.w3.org/.../XMLSchema`"><DisplayName>AzVMName - Microsoft Azure Virtual Machine - Permium OS Disk Metrics </DisplayName>   
#shortened for example, again check an existing TemplateData from Orion.APIPoller.Templates
#close it out with a </Template> ie.   </RequestDetailsCollection></Template>
#Find & Replace to create custom XML Template
$template_xml = $template_xml.Replace('AzVMName', $VM_Name)
$template_xml = $template_xml.Replace('SUBSCRIPTION_ID', $SUB_ID)
$template_xml = $template_xml.Replace('USERGROUP_ID', $RSG_ID)
Write-Host $template_xml

$API_ID = Invoke-SwisVerb $swis Orion.ApiPoller.ApiPoller CreateApiPollerFromTemplate @($entity, $nodeid, $template_xml, $configuration, $parameters) 

#Get API URI to Set correct Polling Interval
$API_URI = Get-SwisData $swis "Select URI from Orion.APIPoller.PollingConfiguration where APIPollerID = '$API_ID'"
   
#Set API Polling Interval
$P_Interval = @{ PollingInterval = 15 }
Set-SwisObject $swis -Uri $API_URI -Properties $P_Interval
  • I think this can be pulled from an existing one, but I'm not sure and probably wont be in a place to test for a while
    If so, they're both an array of key value pairs, so it'd be like SettingX: SetToY where you want to update the auth method on template A to style B instead. In that case querying what settings are in place currently should let you have an editable structure.

  • I got the Config part.. its just the Auth Setting, which can be referenced from existing APIs on Orion.APIPoller.RequestDetails.

    Playing with "Parameters" now..   I may just blank it out if its not required. I feel its only doing a find/replace/insert on  ${variables}

    I can do the same in powershell to the XML, but it would be nice to see how this should work and leverage the interface.