5 Replies Latest reply on Apr 10, 2018 6:24 PM by mesverrum

    VerbArgument Example for 'AddResourceToView'

    equalswql

      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'
          tdanner

          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="">
            <properties>
              <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"/>
            </properties>
          </resource>
          

           

          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
            • Re: VerbArgument Example for 'AddResourceToView'
              equalswql

              Thank you @tdanner!!

               

              ( I have to be careful to not refer to you as dtanner ala the full and fuller house series of lore respectively.) :

              tdannerthwack.jpg

              I really appreciate the help - this example will likely assist me with using other verbs as well.

               

              Thank you,

              =swql

              • Re: VerbArgument Example for 'AddResourceToView'
                xtraspecialj

                Old post, I know, but I came across it while trying to find a solution for my related issue.  However, my issue is pretty much the opposite of this in that I am looking for a way to automate removing a resource from a ton of views.

                 

                The new "Incoming Connections" view resource seems to cause our Application Details views to take forever to load.  Once I remove that resource from a view it loads just fine.  The problem is that we have dozens and dozens of custom Application Details views for our many application monitor templates we've assigned to nodes and given custom views.  I know I can probably just do a DELETE statement against the SQL database Resources table (there doesn't seem to be anything in the ResourceProperties table for this particular Resource type), but I go out of my way to not ever edit the SQL database directly unless there is no choice. 

                 

                So, is there an Orion SDK way to remove Resources from Views, or is a SQL DELETE statement my only choice?

                 

                Also, is there a plan to bring the ResourceProperties table from the SQL database into SWQL?  It's curious that it isn't in SWQL and I'm sure having it in SWQL would help those who want to automate the creation/addition of Resources for Views.