cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Adding values to an existing custom property using curl.

Jump to solution

Hi

I´m new to using json and curl, and any help would be greatly appreciated, I've been reading through the github page and forums but still I am very confused because all of this is very new to me.

My goal is to use curl to add new values to an existing custom property list of values.

So... I have two Custom Properties called Customer and Customer Billed. My ultimate goal is the get our ticketing system to send a string with curl to the solarwinds api, and that string would be added as a custom property value under these two custom properties (Customer and Customer Billed).

So I thought I would try this in baby steps and tried to create a new Custom Property called CarrierName, and tried to update the value list, using the example below with postman:

Adding values to an existing custom property
But whenever I run this this with postman, it overwrites the existing values with the ones defined in the brackets (aaaTest, bbbTest and cccTest), but I need to add them to the existing list.

https://<servername>:<port>/SolarWinds/InformationService/v3/Json/Invoke/Orion.NodesCustomProperties/ModifyCustomProperty

[

          "CarrierName",

         "This is a test carrier",

         4000,

         [

              "aaaTest",

              "bbbTest",

              "cccTest"

         ]

]

If I can get this to work, my plan is to convert this code, with postman, to curl that would hopefully be usable to add a new value to the the value list for that custom property. Then figure out a way how to do that with both custom properties (Customer and Customer Billed).

And again.... Any help would be greatly appreciated.

0 Kudos
1 Solution
Level 19

Currently the only way to update the list of values for a custom property is this ModifyCustomProperty call. And as you have observed, it replaces the list of values rather than append to it. So to add a new value without removing the old ones, you must first fetch the old list, add your new value to it, and then call ModifyCustomProperty with the complete list of values. See https://github.com/solarwinds/OrionSDK/wiki/Managing-Custom-Properties#modifying-custom-properties  for more details.

View solution in original post

1 Reply
Level 19

Currently the only way to update the list of values for a custom property is this ModifyCustomProperty call. And as you have observed, it replaces the list of values rather than append to it. So to add a new value without removing the old ones, you must first fetch the old list, add your new value to it, and then call ModifyCustomProperty with the complete list of values. See https://github.com/solarwinds/OrionSDK/wiki/Managing-Custom-Properties#modifying-custom-properties  for more details.

View solution in original post