Package: cdpcli
Cloudera CDP Command Line InterfaceThis package provides a unified command line interface to the Cloudera Data
Platform (CDP) control plane API.PrerequisitesPython 3.6 or higherEarlier versions of Python are no longer supported for new releases, as of
January 2021. Previous CLI releases shall continue to work under earlier Python
versions.Starting with version 0.9.24, the requests and urllib3 libraries are no longer
bundled with the CLI. When upgrading, watch for those new dependencies to be
installed.InstallationTo install usingpipfrom thecdpcli PyPI project:$ pip install cdpcliTo install from source:$ git clone git@github.com:cloudera/cdpcli.git
$ cd cdpcli
$ pip install .Beta CLIAn alternative CLI exposing beta functionality is available in its own package.$ pip install cdpcli-betaDo not install both the regular and beta CLIs in the same Python environment,
as they use the same entry points and therefore conflict.Any features exposed in the beta CLI that are not available in the regular CLI
are still under development. They are not yet supported, may not work, and are
subject to change in incompatible ways, including removal. Do not rely on beta
features for production use.ConfiguringAPI calls through the CDP CLI require a key pair issued from the CDP control
plane. Use the CDP console to generate keys, followingdocumented
instructions.
Then, runcdp configureto provide the credentials to the CLI.$ cdp configure
CDP Access Key ID [None]: xxx
CDP Private Key [None]: yyyCredentials are stored under the "default" profile in$HOME/.cdp/credentials,
using the ini file format.[default]
cdp_access_key_id = xxx
cdp_private_key = yyyProfilesIf you need to access the API as more than one user, set up a named profile for
each user. Each profile stores a separate set of credentials.$ cdp configure --profile my-other-userThe credentials for a profile are stored in$HOME/.cdp/credentialsunder a
section named for the profile.Credential Environment VariablesAn alternative to storing credentials in$HOME/.cdp/credentialsis to pass
them using the environment variablesCDP_ACCESS_KEY_IDandCDP_PRIVATE_KEY.
However, these variables are ignored when the--profileoption is used when
running the CLI (see below).Base Endpoint URL and Form FactorThe CLI may be used to accessCDP Private Cloudcontrol planes. Contact your control plane administrator to obtain the required
base endpoint URL value for your installation. Set the value in$HOME/.cdp/config, another configuration file that uses the ini file format.
Create a section named for the profile which should work with the private cloud
control plane.[profile private1]
cdp_endpoint_url = https://cdp-private.example.comThe CLI guesses whether it is using CDP Public Cloud or CDP Private Cloud based
on the base endpoint URL. If you find that it is guessing incorrectly, you can
configure use of eitherform factorin$HOME/.cdp/config. Valid form factor
values are "public" and "private".[profile private1]
form_factor = privateRunningBasic syntax:cdp [options] <command> <subcommand> [parameters]Examples:$ cdp iam get-user
$ cdp environments describe-environments --environment-name myenv1HelpFor general help, use any of these commands.$ cdp help
$ cdp --help
$ cdp # no argumentsMost CLI commands correspond to API services. Subcommands correspond to
operations in services.For help on any command, run itshelpsubcommand, or pass the--helpparameter.For help on any subcommand, pass thehelpor--helpparameter.The same help content is available in onlineAPI documentation.ProfilesBy default, the CLI uses credentials in the "default" profile. Use a different
profile by passing the--profileoption.$ cdp --profile my-other-user iam get-userBase Endpoint URL and Form FactorBy default, the CLI works withCDP Public Cloudand calculates API endpoints accordingly. If you are using CDP Private Cloud, be
sure to provide the base endpoint URL for your private cloud control plane. You
can do so by setting it in$HOME/.cdp/configfor the desired profile, or
through the--endpoint-urloption, which supersedes the configuration.$ cdp --endpoint-url https://other.cdp-private.example.com ...The CLI guesses whether it is using CDP Public Cloud or CDP Private Cloud based
on the base endpoint URL. If you find that it is guessing incorrectly, you can
force use of eitherform factorby either setting it in$HOME/.cdp/configfor the desired profile, or through the--form-factoroption, which supersedes
the configuration. Specifying a form factor does not alter the base endpoint URL
in use.$ cdp --form-factor private ...LicenseThe CDP CLI is licensed under theApache License, Version 2.0with asupplemental license disclaimer.