Cruise Control REST API endpoints
You can configure and check the status of Cruise Control using the REST API with GET and POST endpoints. You must be aware of the required action or query, and submit a curl command in the command line to use the Cruise Control REST API.
Prerequisite for CDP Public Cloud
The ADMIN, USER and VIEWER levels define which endpoint a user can call when managing Cruise Control. After provisioning your Streams Messaging cluster, you must set an access level for user authentication in Cloudera Manager to be able to call the Cruise Control API endpoint.
- Navigate to Management Console > Environments, and select the environment where you have created your cluster.
- Select Cloudera Manager from the services.
- Select Clusters > Cruise Control.
- Click Configuration.
- Search for one of the following access levels based on which level you want to add the
user:
Security property Description ADMIN Level Users auth_admins The list of ADMIN level users to have access to all endpoints. The ADMIN level also contains the permissions of the USER and VIEWER level. USER Level Users auth_users The list of USER level users to have access to all the GET endpoints except bootstrap and train. The USER level also contains the permissions of the VIEWER level. VIEWER Level Users auth_viewers The list of VIEWER level users to have access to the most lightweight kafka_cluster_state
,user_tasks
andreview_board
endpoints. - Click Save Changes.
- Restart the Cruise Control service.
Using the Cruise Control REST API endpoints
curl
, and also include the Cruise Control hostname, port, and the required
endpoint.curl -X -u <workload_username>:<workload_password> GET "https://[***MY-DATA-HUB- CLUSTER.COM***]/cdp-proxy-api/cruise-control/kafkacruisecontrol/kafka_cluster_state”
The following table summarizes the available operations for GET and POST endpoints. The description column only provides a brief summary of the endpoints. For the detailed description of the Cruise Control REST API, see the official REST API documentation.
Endpoint | Action | Description |
---|---|---|
/kafkacruisecontrol/bootstrap |
You can start the startup process of Cruise Control and reload all data from Kafka. | This feature can only be used in development mode. The bootstrap endpoint clears the
internal state. You can run the bootstrap endpoint in the following modes:
|
/kafkacruisecontrol/kafka_cluster_state |
You can query partition and replica state. | This includes information for each broker and each partition. |
/kafkacruisecontrol/load |
You can query the current cluster load. | The Load Monitor needs to be in RUNNING state. This includes the
load-per-broker and load-per-host information. Only shows valid partitions with enough
metric samples. |
/kafkacruisecontrol/partition_load |
You can query partition resource utilization. | The partition load is sorted based on the given resource. |
/kafkacruisecontrol/permissions |
You can query the list of permissions set for the current user | This endpoint can be used to review the configured permissions of the current user that include ADMIN, USER and VIEWER levels. Permissions are not used when security is enabled for Cruise Control. |
/kafkacruisecontrol/proposals |
You can query the optimization proposals generated on the workload model. | The proposals can be generated based on either the snapshot window or the valid partitions. |
/kafkacruisecontrol/review_board |
You can check the review processes of Cruise Control. | This endpoint shows the status of ongoing review processes in Cruise Control. |
/kafkacruisecontrol/state |
You can query the state of Kafka Cruise Control. | This includes the state of monitor, executor, analyzer, and anomaly detector. |
/kafkacruisecontrol/train |
You can use the endpoint to train the partition of Cruise Control for CPU estimation. | This endpoint uses a regression algorithm to train the CPU estimation of the Cruise Control partition. This is an experimental feature. |
/kafkacruisecontrol/user_tasks |
You can query the user request result. | This includes a full list of all the active and completed tasks in Cruise Control. |