4 Replies Latest reply on Jan 8, 2018 5:39 AM by Ranjith P K

    TrueSight Rest API - update to policies

    Philippe Plomteux

      Hello,

       

      Happy 2018 !

       

      The TrueSight Rest API can be used to create monitoring policies. This works nicely, but I cannot find a way to remove things that were included in the policy when it was created.

      For example, I can create a basic policy that includes one pconfig variable and value :

       

      [rulesetConfiguration] =>

      (

        [rulesets] =>

             (

        [0] =>

                  (

                       [variable] => /My/Pconfig/Variable

                       [operation] => REPLACE

                      [value] => MyValue

                  )

             )

        )

       

      Now how do I remove (or update) /My/Pconfig/Variable from the policy (using REST API) ? It seems content can only be added, but not deleted ?

      Same applies to monitors, etc.

       

      Is there an exhaustive documentation out there ?

      Thank you !

       

      Philippe

        • 2. Re: TrueSight Rest API - update to policies
          Philippe Plomteux

          Ranjith,

          Thank you for your input. Will review this further.

          Philippe

          • 3. Re: TrueSight Rest API - update to policies
            Philippe Plomteux

            Ranjith,

            Thanks again.

            add,update,overwrite actions work as expected.

            I could not make the "remove" action work however.

            EG, trying to apply the following policy fails. I tried various variants.

             

            Array (     [id] => 728f898b-9016-43f9-aea8-49a997e58566     [name] => Test27     [type] => monitoring     [description] => Created by PAP     [tenant] => Array         (             [name] => bmcrealm             [id] => bmcrealm         )      [precedence] => 999     [agentSelectionCriteria] => agentName EQUALS "server1" OR agentName EQUALS "server2"      [associatedUserGroup] => Administrators     [owner] => admin     [creationTime] => 1514134606226     [rulesetConfiguration] => Array         (             [rulesets] => Array                 (                     [0] => Array                         (                             [variable] => /A/B/C                             [operation] => REPLACE                             [value] => foo                         )                      [1] => Array                         (                             [variable] => /D/E/F                             [operation] => REPLACE                             [value] => bar                         )                  )              [action] => remove         )      [enabled] =>      [shared] => 1 )

             

            Additional examples, or an exhaustive doc, would help.

            Thanks again !

            Philippe

            • 4. Re: TrueSight Rest API - update to policies
              Ranjith P K

              Hi Philippe,

               

              Could you please provide me the complete URL, which you are using?

               

              Also could you please try with

               

              => DELETE

               

              Regards

              Ranjith