Aria Operations - Adding a vCenter adapter account via API (Swagger)
search cancel

Aria Operations - Adding a vCenter adapter account via API (Swagger)

book

Article ID: 320334

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

This article provides a guide to:
  • Adding a vCenter adapter to Aria Operations via Swagger.
  • Accepting the certificate presented to this adapter via Swagger.
  • Starting collection for the newly created adapter via Swagger.


Resolution

Adding a vCenter adapter to Aria Operations via Swagger:


Browse to following address replacing <Ops_FQDN>:
 

https://<Ops_FQDN>/suite-api/


Click the Authorize button on the right of the screen and provide your credentials to use the API.
Expand the section "Adapters"
Click on "POST /api/adapters Create an Adapter Instance"
Click on "Try it out"
Edit the value for 

  • "value" : "VC_IP_Address"

and in the credential section provide the username and password for connecting to the vCenter:

  • "value" : "user_name"
  • "value" : "passwd"

Note: You may also have to remove the field "physicalDatacenterId


Here is the final example used to successfully create the adapter (Replace <VCENTER_FQDN>, <ADMINISTRATORS_USERNAME>, <ADMINISTRATORS_PASSWORD>):

{
  "name" : "VCSA7 recreated with API",
  "description" : "A vCenter Adapter Instance",
  "collectorId" : "1",
  "adapterKindKey" : "VMWARE",
  "resourceIdentifiers" : [ {
    "name" : "AUTODISCOVERY",
    "value" : "true"
  }, {
    "name" : "PROCESSCHANGEEVENTS",
    "value" : "true"
  }, {
    "name" : "VCURL",
    "value" : "<VCENTER_FQDN>"
  } ],
  "credential" : {
    "name" : "VCSA Creds recreated with API",
    "adapterKindKey" : "VMWARE",
    "credentialKindKey" : "PRINCIPALCREDENTIAL",
    "fields" : [ {
      "name" : "USER",
      "value" : "<ADMINISTRATORS_USERNAME>" 
    }, {
      "name" : "PASSWORD",
      "value" : "<ADMINISTRATORS_PASSWORD>"
    } ]
  }
}


Click the Execute button and copy the details from the response
The "thumbprint" and "id" fields from the successful response are required for the following call.


 

Accepting the certificate presented to this adapter via Swagger:

 

Click on "PATCH /api/adapters Create an Adapter Instance"
Click on "Try it out"
Edit the fields using the data from the last response.
You will need to edit the following fields:

  • "name": Use the name you used when creating the adapter
  • "value": Change the ip value to be the ip/fqdn of the vCenter e.g. https://vcsa7.gslabs.local/sdk
  • "thumbprint": Use the thumbprint given in the previous response
  • "id": Use the id given in the previous response

Note: You may also again have to remove the field "physicalDatacenterId

Here is the final example used to successfully accept the adapter certificate (Replace <VCSA_FQDN>, thumbprint and id):

{
  "resourceKey" : {
    "name": "VCSA adapter recreated with API",
    "adapterKindKey" : "VMWARE",
    "resourceKindKey" : "VMwareAdapter Instance",
    "resourceIdentifiers" : [ {
      "identifierType" : {
        "name" : "AUTODISCOVERY",
        "dataType" : "STRING",
        "isPartOfUniqueness" : true
      },
      "value" : "true"
    }, {
      "identifierType" : {
        "name" : "PROCESSCHANGEEVENTS",
        "dataType" : "STRING",
        "isPartOfUniqueness" : true
      },
      "value" : "true"
    }, {
      "identifierType" : {
        "name" : "VCURL",
        "dataType" : "STRING",
        "isPartOfUniqueness" : true
      },
      "value" : "https://<VCSA_FQDN>/sdk"
    } ]
  },
  "description" : "update certificates for adapter instance...",
  "adapter-certificates" : [ {
    "thumbprint" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  } ],
  "id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}



 

Starting collection for the newly created adapter via Swagger:


Click on "PUT /api​/adapters​/{adapterId}​/monitoringstate​/start Start the adapter instance from monitoring its resource"
Click on "Try it out"
Edit the adapterId field to use the ID for the adapter you have just created. 
Click Execute and the vCenter adapter will start collecting.