Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
avatar
Cloudera Employee

Accessing CDP Endpoints using Postman or cURL

When automating, testing, or validating APIs within the Cloudera Data Platform within our AWS, Azure, or GCP infrastructures, most developers utilize either curl or postman.  In this article, we will highlight the proper API endpoints, proper credentialing through Knox, and the setting of workload passwords.  

 

Details Needed to Access Endpoints

There are several details to access specific application endpoints within CDP:

  1. The Endpoint URL for the Specific Application
  2. Your specific username
  3. Your Workload Password

The Endpoint URL for the Specific Application

Each application within a CDP environment will generate a unique URL for both GUI and API development.  As an example for DataHub Clusters, you can view the API endpoints by clicking on the Cluster details, scrolling to the bottom, and selecting "Endpoints." 

 

Screen Shot 2020-08-21 at 4.30.08 PM.png

Within the Endpoints section, you'll find the appropriate API endpoints for each of the applications on that specific cluster.

Your Specific Username

As you connect into CDP using an identity provider, you need to fully verify your username.  To verify your username, click on your name and view your profile.  Within the profile, it will list your username.

Screen Shot 2020-08-21 at 4.35.24 PM.png

In this example, my workload user name is 'jkibler'.

Your Workload Password

On the same profile screen, you can manage your workload password.  Click "Set Workload Password" and assign a password for your account.  You will need to wait for the password to sync completely before proceeding.

Using cURL

Within your command line, you can use standard curl with a username and command-line password.  As an example, I'm querying one of my SOLR endpoints with my username:

 

curl -u [workload user name] -L -i "https://jkibler-solr-eval-....cloudera.site/jkibler-solr-eval/cdp-proxy-api/solr/jkibler/select?q=*%..."

When you execute this command, a command-line password prompt will appear for you to enter your password.

Using Postman

 Within postman, generate a GET request with the full endpoint.  Within Authorization, place your [username] and [workload password] into the Basic Authentication type.  Then, select "Update Request."

 

At this point, you can "send" the request.

Screen Shot 2020-08-21 at 5.11.12 PM.png

1,918 Views