9 Replies Latest reply on Jan 22, 2019 5:17 PM by equalswql

    VerbArgument Example for 'AddResourceToView'


      Hello Thwack Community,


      Looking to automate the creation of custom query / swql resources. Here is what I have from the Metadata.VerbArgument table in SWQL Studio filtering on the 'AddResourceToView' activity -


      **REQUIRED - Name: viewID  = ViewID to add resource to - I’m good on this.


      **REQUIRED -  Name: config = This is what I need Assuming what is needed: PropertyName, PropertyValue

      Can someone provide an example string/format/syntax to get me started with creating a resource?


      Name: moveColliding = Not sure what this does


      Great Thanks,  =swql

        • Re: VerbArgument Example for 'AddResourceToView'

          The "config" argument should be a string containing xml like this:


          <resource name="Top CPUs by Percent Load" file="/Orion/NetPerfMon/Resources/MultiSourceCharts/MultipleObjectChart.ascx" column="2" position="3" title="Top CPUs by Percent Load" subtitle="">
              <property name="ChartName" value="AvgCPUMultiLoad"/>
              <property name="EntityName" value="Orion.Nodes"/>
              <property name="FilterEntities" value="False"/>
              <property name="ManualSelect" value="False"/>
              <property name="Period" value="Today"/>
              <property name="SampleSize" value="30M"/>
              <property name="ShowSum" value="NoSum"/>
              <property name="AutoHide" value="1"/>


          The specific property elements you need depend on what kind of resource you are adding. To figure this out, I would recommend adding a resource to a view manually (by clicking in the website) and then querying ResourceProperties in the database to see what names and values it uses.


          "moveColliding" sets the policy for what to do when the resource you are adding specifies the same column and position as an existing resource. If true: existing resources in that column at that position and lower have their position incremented to make room. If false, I'm not sure what it does. It's an optional parameter and the default is true. I would just omit it.

          3 of 3 people found this helpful