Forum Discussion

Joe_Williams's avatar
3 years ago

Creating Collector Groups via API

Is it not possible to add/create custom properties in Collector groups via the API?

I set it manually and fetch the properties to verify how I should put it in. I end up with a structure like this
 

collectorbody = {"name": "Test Group", "description": "Test group for automation",
                 "custom_properties": [{"name": "servicenow.companyid", "value": "ACME001"}]}


But when I create the group, it doesn't seem to take the property.
I have also tried to update the collector group after the fact and that still doesn't appear to work.

3 Replies

  • Looking at the v2 documentation it looks like it should be "customProperties" without an underscore.

    https://www.logicmonitor.com/swagger-ui-master/dist/#/Collector Groups/addCollectorGroup

    {
      "autoBalance": "string",
      "customProperties": [
        {
          "name": "addr",
          "value": "127.0.0.1"
        }
      ],
      "name": "Collector (Network Devices)",
      "autoBalanceInstanceCountThreshold": 0,
      "autoBalanceStrategy": "string",
      "description": "Group for collectors dedicated to Network Devices"
    }
  • Well nevermind, even tho the python SDK returns it as custom_properties, in the payload it is customProperties.

  • 1 minute ago, Mike Moniz said:

    Looking at the v2 documentation it looks like it should be "customProperties" without an underscore.

    https://www.logicmonitor.com/swagger-ui-master/dist/#/Collector Groups/addCollectorGroup

    {
      "autoBalance": "string",
      "customProperties": [
        {
          "name": "addr",
          "value": "127.0.0.1"
        }
      ],
      "name": "Collector (Network Devices)",
      "autoBalanceInstanceCountThreshold": 0,
      "autoBalanceStrategy": "string",
      "description": "Group for collectors dedicated to Network Devices"
    }

    Yeah i was working off of the output from the SDK, which puts it as custom_properties. Saw the issue just as you posted lol.