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.

Adding values to an existing custom property

Hi, I'm new to SolarWinds and I am hoping that someone can help me with a problem that I am having and cannot find an answer to.

I have an existing custom property drop down control populated with values and I would like to add additional values via the Rest Api.  I am making the following call:

https://<Myserver>:<MyPort>/SolarWinds/InformationService/v3/Json/Create/Orion.CustomPropertyValues

and passing the following JSON payload:

{

    "Table": "NodesCustomProperties",

    "Field": "CarrierName",

    "Value": "aaaTest"

}

Making this call via PostMan returns the following

{

    "Message": "Entity Orion.CustomPropertyValues does not contain any key properties.\r\nParameter name: entityType",

    "ExceptionType": "System.ArgumentException",

    "FullException": "System.ArgumentException: Entity Orion.CustomPropertyValues does not contain any key properties.\r\nParameter name: entityType\r\n   at SolarWinds.InformationService.Core.CrudProcessor.<CreateInternal>d__18.MoveNext()\r\n   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)\r\n   at SolarWinds.InformationService.Core.CrudProcessor.Create(String entityType, IDictionary`2 properties, IQueryExecutionContext context)\r\n   at SolarWinds.InformationService.Core.InformationService.Create(String entityType, IDictionary`2 properties)"

}

If anyone can point me in the right direction, I would appreciate it. 

  • Thank you for the quick answer Tim.  Since I am already weeks down the RESTAPI rabbit hole, do you know if there is a way to do this using REST?

  • Yes, all API operations are available over REST. I don't have sample code for that particular combination, but you can look at other examples of calling verbs over REST.

  • Okay so i recently did a bunch of this using curl in a bash script, the way i had to update custom properties on nodes is as follows.

    I made a POST call to:

    https://<myServer>:<MyPort>/SolarWinds/InformationService/v3/Json/swis://L1SOrion.l1s.local/Orion/Orion.Nodes/NodeID=1/CustomProperties

    input the proper nodeid followed by /CustomProperties

    Then the only data i had to put in the body is {"CarrierName": "TestNet"}

    Hope it helps.

    After Looking at some of my scripts, another option you could do is this:

    POSThttps://<MyServer>:<MyPort>/SolarWinds/InformationService/v3/Json/BulkUpdate

    and then in the Body of the request put in the following info

    { "uris":[

         "<NodeURI>/CustomProperties"

    ],

    "properties":

      {

      "CustomBandwidth": "True",

      "InBandwidth": "1000000000",

      "OutBandwidth": "1000000000",

      "ISP": "TestNet"

      }

      }

    And that will allopw you to update multiple custom properties at once for that node.

    Again, Hope it helps

  • Thank you everyone for your help with this.  Based on all the submissions, I was able to piece together the following which resolved the problem.

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

    [

              "CarrierName",

             "This is a test carrier",

             4000,

             [

                  "aaaTest",

                  "bbbTest",

                  "cccTest"

             ]

    ]