This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Invoking Orion.APM.ApplicationTemplate UpdateApplicationTemplateSettings

Hello Orion SDK Community,

I'm attempting to update a SAM template by invoking the UpdateApplicationTemplateSettings verb.

Although the operation completes successfully (I get a response), no changes are shown in the application template.

Not sure what I'm missing here, I'm guessing there is something simple I'm missing.

Assuming that $swis is a valid connection string, please see the below code.

I appreciate anyone's help with this.

$sometemplate = "335"

$app_temp_setting = ([xml]"

<ApplicationTemplateSetting>

      <Name>HelloWorld</Name>

      <Description>This is a message from HelloWorld</Description>

      <Frequency>350</Frequency>

      <Timeout>350</Timeout>

      <DebugLoggingEnabled>True</DebugLoggingEnabled>

      <NumberOfLogFilesToKeep>31</NumberOfLogFilesToKeep>

      <Use64Bit>False</Use64Bit>

  </ApplicationTemplateSetting>").DocumentElement

  Invoke-SwisVerb $swis Orion.APM.ApplicationTemplate UpdateApplicationTemplateSettings @($sometemplate,$app_temp_setting)

Thank you,

=swql

  • There are three issues with your XML. First, it needs to be in the right namespace. For this object, that is 'http://schemas.solarwinds.com/2007/08/APM'. Second, the Frequency and Timeout values are TimeSpan objects, which use the ISO 8601 duration format. 350 seconds is 5 minutes and 50 seconds, so that would be PT5M50S. Third, the booleans have to be lowercase. Putting that together, you get this:

    $app_temp_setting = ([xml]"

    <ApplicationTemplateSetting xmlns='http://schemas.solarwinds.com/2007/08/APM'>

          <Name>HelloWorld</Name>

          <Description>This is a message from HelloWorld</Description>

          <Frequency>PT5M50S</Frequency>

          <Timeout>PT5M50S</Timeout>

          <DebugLoggingEnabled>true</DebugLoggingEnabled>

          <NumberOfLogFilesToKeep>31</NumberOfLogFilesToKeep>

          <Use64Bit>false</Use64Bit>

      </ApplicationTemplateSetting>").DocumentElement

  • tdanner​ Thank you again for the assistance... I'm still learning obviously and these are rookie mistakes.. that being said, I'll be sure to scrutinize the XML Schema for these details next time emoticons_wink.png

  • The JSON serializer is much more forgiving on these sorts of things. I'm thinking about adding an option to SwisPowerShell to use json instead. XML would still be the default for compatibility with existing scripts.