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
Log in to CCI
- Log in with your username.
Logging in with your username is the simplest option. The login will prompt you for a password or you can define a variable to store your password, for example:
export KUBECTL_CCI_PASSWORD=<User_Password>
If a variable for the password is assigned, the CCI login command checks the value and you are not prompted for a password each time you log in with:
kubectl cci login -u <your_username> --server appliance.domain.com --insecure-skip-tls-verify
- Log in with an API token (optional).
You can also use an API token to authenticate your session. To obtain the API refresh token, perform the following steps:
- 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
. - 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"}
After obtaining your API token, use it to log in to the CCI server.
kubectl cci login -t <YOUR_API_TOKEN> --server appliance.domain.com --insecure-skip-tls-verify
- Secure a channel between the web browser and the VMware Aria Automation server. Open a browser and enter the URL such as:
Create Kubeconfig Context
After you log in to CCI, you 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
.