Automation accounts are used to access VMware Cloud Foundation APIs in automation scripts.
Procedure
- Log in to the SDDC Manager UI as a user with the ADMIN role.
For more about roles, see Managing Users and Groups in VMware Cloud Foundation.
- In the navigation pane, click Developer Center > API Explorer.
- Get the ID for the ADMIN role.
- Expand APIs for managing Users.
- Expand GET /v1/roles and click Execute.
- In the Response, click PageOfRole and Role (ADMIN).
- Copy the ID for the ADMIN role.
- Create a service account with the ADMIN role and get the service account's API key.
- Expand POST /v1/users and click User.
- Replace the Value with:
[ { "name": "service_account", "type": "SERVICE", "role": { "id": "317cb292-802f-ca6a-e57e-3ac2b707fe34" } } ]
Paste the ADMIN role ID from step 3.
- Click Execute.
- In the Response, click PageOfUser and User (service_account).
- Copy the API key for the service account.
- Use the service account's API key to generate an access token.
- Expand APIs for managing access and refresh tokens.
- Expand POST /v1/tokens.
- Click TokenCreationSpec.
- Replace Value with:
{ "apiKey": "qsfqnYgyxXQ892Jk90HXyuEMgE3SgfTS" }
Paste the service account's API key from step 4.
- Click Execute.
- In the Response, click TokenPair and RefreshToken and save the access and refresh tokens.