Automation accounts are used to access VMware Cloud Foundation APIs in automation scripts.

Procedure

  1. Log in to the SDDC Manager UI as a user with the ADMIN role.
    For more about roles, see User and Group Management.
  2. In the navigation pane, click Developer Center > API Explorer.
  3. Get the ID for the ADMIN role.
    1. Expand APIs for managing Users.
    2. Expand GET /v1/roles and click Execute.
    3. In the Response, click PageOfRole and Role (ADMIN).
    4. Copy the ID for the ADMIN role.
      Get the ID for the ADMIN role
  4. Create a service account with the ADMIN role and get the service account's API key.
    1. Expand POST /v1/users and click User.
    2. Replace the Value with:
      [
        {
          "name": "service_account",
          "type": "SERVICE",
          "role":
            {
              "id": "317cb292-802f-ca6a-e57e-3ac2b707fe34"
            }
        }
      ]
      Paste the ADMIN role ID from step 3.

      Add a service account
    3. Click Execute.
    4. In the Response, click PageOfUser and User (service_account).
    5. Copy the API key for the service account.
      Copy the API key for the service account
  5. Use the service account's API key to generate an access token.
    1. Expand APIs for managing access and refresh tokens.
    2. Expand POST /v1/tokens.
    3. Click TokenCreationSpec.
    4. Replace Value with:
      {
          "apiKey": "qsfqnYgyxXQ892Jk90HXyuEMgE3SgfTS"
      }
      Paste the service account's API key from step 4.

      Generate tokens
    5. Click Execute.
    6. In the Response, click TokenPair and RefreshToken and save the access and refresh tokens.
      Save the tokens from the response