Forum Discussion

pmeyer's avatar
7 years ago

Collector REST API Requests

I would like the REST API to support

  • Scheduling a collector version update
  • Applying a one-time collector version update
  • Working with the Collector Custom Properties (recently added I think, but don't see anything in the online documentation about support in REST API).
  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    Hey Phil,

    You can actually do all of those with v1 of the API (via onetimeUpgradeInfo, automaticUpgradeInfo, and customProperties fields, respectively), it's just cumbersome to update the Collector via PUT. With v2 of our REST API, which is about to be released, we'll offer update via PATCH, which should make all three of those actions significantly easier. The v1 API docs can probably also use more detail regarding manipulating those three fields - I can update those. 

    Thanks,

    Sarah

  • What is the value that 'onetimeUpgradeInfo' should be set to?  I tried setting it to '27003' (as an integer), and the call comes back as 'Invalid json body'.

    {
        "collectorGroupName":  null,
        "description":  "lsfregprd-Collector for vpc-0e4ddd0f271668f34",
        "onetimeUpgradeInfo":  27003,
        "enableFailBack":  true,
        "suppressAlertClear":  false,
        "escalatingChainId":  3,
        "backupAgentId":  0,
        "enableFailOverOnCollectorDevice":  false,
        "collectorGroupId":  null,
        "resendIval":  0
    }

     

  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    It's a JSON object that should include the following fields: majorVersion, minorVersion, startEpoch, description. 

    So if you're trying to add a one time upgrade to 27.003, it might look like this:

    {"majorVersion":27,"minorVersion": 3,"startEpoch": 1538420400,"description":"upgrading to the 27003"}

     

  • Thanks.  The script is successfully setting one-time upgrades for the collectors.