Generating tokens and accessing Cloudera Lakehouse Optimizer REST APIs

After you assign Cloudera Lakehouse Optimizer application roles, generate a bearer token in the Anywhere Cloud Console and call the external Cloudera Lakehouse Optimizer REST API base URL.

For REST calls from outside the platform (for example, curl on your workstation or automation), use the external HTTPS endpoint shown on your Cloudera Lakehouse Optimizer deployment and pass a bearer token. Internal REST endpoints are for service-to-service communication only and are not for customer API access.

  1. Assign Cloudera Lakehouse Optimizer application roles as described in Configuring roles for Cloudera Lakehouse Optimizer users.
    You need at least the monitor role to open the Cloudera Lakehouse Optimizer landing page and API explorer; use administrator or operator roles to invoke protected maintenance APIs.
  2. Identify the external REST base URL for your deployment.
    1. In the Anywhere Cloud Console, click Apps and open the Deployed Engines tab.
    2. Open your Cloudera Lakehouse Optimizer instance and, in Endpoints, copy the external HTTPS endpoint and the Cloudera Lakehouse Optimizer landing page (API explorer) link.
      The external URL is the base for …/clo/api/v1/ calls with a bearer token. See Accessing Cloudera Lakehouse Optimizer for the full endpoint workflow.
  3. Generate a bearer token in the Anywhere Cloud Console.
    1. Open Security > Users and Groups.
    2. Select the user that will call Cloudera Lakehouse Optimizer APIs (for example, your signed-in user) and open API and access keys.
    3. Choose one of the following methods:
      • API key tokens: Click Create new to create a JWT bearer token. Use this value as the Authorization: Bearer token in REST requests.
      • Generate a key: Create an access key and secret key (long-running API key). Use these machine credentials according to your organization's security policy; some workflows exchange them for a short-lived bearer token through a separate platform API call.
  4. Call Cloudera Lakehouse Optimizer REST APIs with the bearer token.

    Set the base URL to your external endpoint and include the token on each request:

    export BASE="<external CLO host>/clo/api/v1"
    export TOKEN="<paste JWT bearer token>"
    curl -sk -H "Authorization: Bearer $TOKEN" "$BASE/startup"

    To list operations and try requests interactively, open the API explorer from the Cloudera Lakehouse Optimizer landing page (the same host as openapi.json). For health and default policy checks after deploy, see Verifying service health and viewing default Cloudera Lakehouse Optimizer policy.

    To download the OpenAPI specification:

    curl -sk -H "Authorization: Bearer $TOKEN" \
      "$BASE/openapi.json" -o openapi.json
  5. Optional: Use Restish or other API clients.
    For non-graphical clients, configure OAuth client credentials or bearer tokens and register the openapi.json URL. See the optional Restish steps in Accessing Cloudera Lakehouse Optimizer.