vRealize Suite Lifecycle Manager supports collector groups in vRealize Operations Manager. Using the API, you can add, update, or delete collector groups as a Day 2 action.
You can also add collector groups when you deploy vRealize Operations Manager. See Deploy your Products using the vRealize Suite Lifecycle Manager API.
Prerequisites
Before managing a collector group:
- Verify that all general prerequisites have been satisfied and that you have your environment ID. See the prerequisites for Performing Day 2 operations using vRealize Suite Lifecycle Manager APIs.
- If you are updating or deleting a collector group, use your environment ID to get the collector group ID in vRealize Operations Manager.
- Assign the environment ID and product ID variables.
environmentId = "<your_environment_ID>" productId = "vrops"
- List the product details for vRealize Operations Manager in your environment.
curl -X GET \ '$url/lcm/lcops/api/v2/environments/$environmentId/products/$productId' \ -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \ -H 'Content-Type: application/json' \ | jq "."
- Examine the response to locate your collector group ID.
... "collectorGroups": { "operationsType": "null", "collectorGroups": [ { "id":"d79e5a37-b08e-4649-8665-750049147060", "name":"Test collector group 1", "description":null, "nodes":[ { "type": "REMOTE", "properties":{ "hostName": "lcm-35-8.sqa.local", "id":"5", ... "deployOption":"smallrc" } }, { "type": "CLOUD_PROXY", "properties": { "hostName":"lcm-35-9.sqa.local", "id":"6", ... "deployOption":"smallcp" } } ] } ] "collectorsName":[ "Test collector group 1" ] }, ...
In this example, the collector group ID is d79e5a37-b08e-4649-8665-750049147060.
- Assign the collector group ID variable.
collectorGroupId = "d79e5a37-b08e-4649-8665-750049147060"
- Assign the environment ID and product ID variables.
How do I add a collector group?
curl -X POST \ '$url/lcm/lcops/api/v2/environments/$environmentId/products/vrops/collectorgroups' \ -H 'Authorization: Basic YWRtaW5AbG9jYWw6Vk13YXJlMSE=' \ -H 'Content-Type: application/json' \ -d '{ "operationType": "add", "collectorGroups": [ { "name": "Test collector group 2", "nodes": [ { "type": "remotecollector", "properties": { "collectorId": "7" } }, { "type": "cloudproxy", "properties": { "collectorId": "8" } } ] } ] }' | jq "."
How do I update a collector group?
To update a collection group, you use "operationType": "update" and provide an existing collector group ID. You can update the name for the collector group and update the nodes in the group. You only provide values for the parameters that you want to update. Updating nodes removes existing nodes from the group.
curl -X POST \ '$url/lcm/lcops/api/v2/environments/$environmentId/products/vrops/collectorgroups' \ -H 'Authorization: Basic YWRtaW5AbG9jYWw6Vk13YXJlMSE=' \ -H 'Content-Type: application/json' \ -d '{ "operationType": "update", "collectorGroups": [ { "id": "d79e5a37-b08e-4649-8665-750049147060", "name": "Test collector group 3", "nodes": [ { "properties": { "collectorId": "9" } }, { "properties": { "collectorId": "10" } } ] } ] }' | jq "."
How do I delete a collector group?
curl -X POST \ '$url/lcm/lcops/api/v2/environments/$environmentId/products/vrops/collectorgroups' \ -H 'Authorization: Basic YWRtaW5AbG9jYWw6Vk13YXJlMSE=' \ -H 'Content-Type: application/json' \ -d '{ "operationType": "delete", "collectorGroups": [ { "id": "d79e5a37-b08e-4649-8665-750049147060" } ] }' | jq "."