The Cloud Consumption Interface includes a command line interface that administrators and developers can use to perform CCI tasks programmatically.
As a VMware Aria Automation administrator, you use the command line interface to create cloud accounts, create and configure projects, regions, and Supervisor namespace classes. Users have some limited access to the CCI kubectl CLI commands.
Download the CCI kubectl plug-in
To use the Kubernetes command line tool (kubectl), download the CCI plug-in. The plug-in provides a way for kubectl to interact with CCI, for example when you log in to CCI.
- Log in to VMware Aria Automation.
- Click to launch Service Broker.
- If you are a user and the Overview page appears, click :DOWNLOAD CLI PLUGIN.
- If you are an administrator or a user who did not download from the Overview page, click the Consume tab, and click Supervisor Namespace.
- The download method depends on your environment.
- If you see the Getting Started with supervisor namespaces page, click DOWNLOAD PLUGIN.
- If you see the Supervisor Namespaces page:
- Click New Supervisor Namespace.
- On the Create a namespace page, click .
chmod +x kubectl-cci && mv kubectl-cci /usr/local/bin
Obtain an API Token
To get the token used to authenticate your session, you use the VMware Aria Automation Identity Service API.
Before you begin, secure a channel between the web browser and the VMware Aria Automation server. Open a browser and enter the URL such as: https://appliance.domain.com
. Then perform the following steps.
- Use the VMware Aria Automation Identity Service API to obtain the API token.
Note: The API token is also known as the refresh token. It is valid for 90 days. You cannot revoke the refresh token.
curl --insecure --location --request POST \ 'https://<Your_Aria_Automation_FQDN>/csp/gateway/am/api/login?access_token' \ --header 'Content-Type: application/json' \ --data-raw '{ "username": "<Your_Username>", "password": "<Your_Password>" "domain": "<Your_Domain>"}'
echo
- The output is a compact string of characters as in the following example:
{"refresh_token":"ZhzVZnoLEsg7OK4WMef9rUzfsZnWNm6a"}
Log in and create Kubeconfig Context
Use your API token to log in to CCI server.
kubectl cci login -t <YOUR_API_TOKEN> --server appliance.domain.com --insecure-skip-tls-verify
For convenience, you can choose to log in to CCI using a username instead of a token. Then the login will prompt you for a password or you can define a variable to store your password.
export KUBECTL_CCI_PASSWORD=<User_Password>The CCI login command checks the value and you are not prompted for user credentials each time you login with:
kubectl cci login -u <your_username> --server appliance.domain.com --insecure-skip-tls-verify
Set your context to cci for management operations such as creating supervisor namespaces, regions, or supervisor namespace classes.
kubectl config use-context cci
kubectl config use-context cci:project_name:supervisor_namespace
--skip-set-context
argument. In this way, you will avoid creating kubeconfig contexts for all existing supervisor namespaces managed by
VMware Aria Automation.
kubectl cci set-context --project cci-explore --supervisor-namespace elastic-sky
To view additional information about a command, use kubectl cci [command] --help
.