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.

Note: Before downloading the CCI kubectl plug-in, you must have the Kubernetes tool installed. For information about the Kubernetes tool, see https://kubernetes.io/docs/tasks/tools/.
To download the CCI kubectl plug-in:
  1. Log in to VMware Aria Automation.
  2. Click to launch Service Broker.
  3. If you are a user and the Overview page appears, click :DOWNLOAD CLI PLUGIN. From the Overview page, click Download CLI Plugin.
  4. If you are an administrator or a user who did not download from the Overview page, click the Consume tab, and click Supervisor Namespace.
  5. The download method depends on your environment.
    • If you see the Getting Started with supervisor namespaces page, click DOWNLOAD PLUGIN.From the Getting Started with supervisor namespaces page, click Download Plugin.
    • If you see the Supervisor Namespaces page:
      1. Click New Supervisor Namespace.
      2. On the Create a namespace page, click DOWNLOAD PLUGIN > DOWNLOAD CLI PLUGIN > .
In a Mac, Linux, or Windows environment, you set the kubectl-cci plug-in as an executable then copy it to your execution path along with the kubectl executable file. For example, in a Mac or Linux environment, use the following command:
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.

  1. 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
  2. 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.

For example, if you define a variable with:
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
Set your context to cci:project_name:supervisor_namespace to interact with a supervisor namespace.
kubectl config use-context cci:project_name:supervisor_namespace
Note: If your CCI login command is configured with the Automation Service Broker admin role, you can choose to use the --skip-set-context argument. In this way, you will avoid creating kubeconfig contexts for all existing supervisor namespaces managed by VMware Aria Automation.
The following example shows how to create a kubeconfig context manually for a specific Supervisor Namespace from a specific project.
kubectl cci set-context --project cci-explore --supervisor-namespace elastic-sky

To view additional information about a command, use kubectl cci [command] --help.