VMware Aria Suite Lifecycle supports collector groups in VMware Aria Operations. 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 VMware Aria Operations. See Deploy your Products using the VMware Aria Suite Lifecycle 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 VMware Aria Suite Lifecycle APIs.
  • If you are updating or deleting a collector group, use your environment ID to get the collector group ID in VMware Aria Operations.
    1. Assign the environment ID and product ID variables.
      environmentId = "<your_environment_ID>"
      productId = "vrops"
    2. List the product details for VMware Aria Operations 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 "."
    3. 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.

    4. Assign the collector group ID variable.
      collectorGroupId = "d79e5a37-b08e-4649-8665-750049147060"

How do I add a collector group?

To add a collector group, you use "operationType":"add" and provide a group name. You can add an empty collector group without node types, or specify the node types to add. The following example shows how to add a collector group with remote collector and cloud proxy node types. The collector ID values are IDs for remote collector and cloud proxy nodes in your VMware Aria Operations environment.
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.

The following example shows how to update a collector group with a new name Test collector group 3 and new nodes with "collectorId": "9" and "collectorId": "10".
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?

To delete a collector group, you use "operationType": "delete" and provide the collector group ID.
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 "."