Getting started with the CDP API
Getting started with the CDP API involves determining the best method for using the API, generating an API access key, and understanding permissions in the CDP API.
API access methods
CDP offers a CLI client, and all API commands have a CLI equivalent. See the CLI documentation for more details.
Java programmers might prefer to use the CDP SDK for Java. For more information, see the SDK documentation.
Alternatively, you can access API endpoints directly through your chosen HTTP client, such
as curl. Cloudera offers cdpcurl
, which is a Python command line tool that
you can use to directly make CDP API calls, or embed in an application.
cdpcurl
returns JSON output for ease of use. It is based on awscurl and installation and usage are similar. Like the CDP CLI
and SDK, cdpcurl
has built-in CDP request signing to construct the headers
required to make an API call. However, if you want to use a different HTTP client, such as
curl, you can use a script within cdpcurl
to generate the required
headers.
You can also use the CDP API service definition files to create your own client-side code. The service definitions are in OpenAPI / Swagger 2.0 format and can be accessed here.
Generating an API access key
A CDP user account must have API access credentials (an API access key and private key) to
access the CDP API through the CLI or other means. To use the CLI client, you configure the
CDP client with the API access key and private key. To make API calls with
cdpcurl
, you pass the API access key and private key to
cdpcurl
.
Permissions
You are restricted to making API calls that are permissible based upon your user roles and resource roles. For more information on user roles, see the topic Understanding Roles and Resource Roles in the Management Console documentation.