Using SQL Stream Builder REST API
You can use the REST API to monitor, manage and configure the SQL Stream jobs with GET and POST HTTP methods. You can use the SQL Stream Builder (SSB) REST API in command line or use a REST API Tool.
- GET to query information about the specified endpoint
- POST to create resources for the specified endpoint
- DELETE to remove objects from the specified endpoint
The REST API Reference document contains the available endpoints for SQL Stream Builder.
- From Cloudera Manager:
- Go to your cluster in Cloudera Manager.
- Select SQL Stream Builder from the list of services.
- Click Web UI.
- Select SQLStreamBuilder API Explorer.
- From Streaming SQL Console:
- Access Streaming SQL Console.
- Click API Explorer from the main menu.
You can use the SSB REST API with Command Line Interface (CLI), but you can also use a REST API Tool, for example Postman.
- SQL Operations: You can execute and analyze the SQL queries
- Session Operations: You can manage and reset the SSB session
- Sampling Operations: You can configure the sampling behavior and retrieve sampling results.
- Job Operations: You can create and stop jobs, and also retrieve job information
- Flink Session Cluster Operations: You can manage and reset the Flink session
- Flink Job Management: You can run flink applications
- Artifact Management: You can add and delete jar files and configuration files, and also retrieve information about them
Using REST API with CLI
When using the SSB REST API with CLI Tool, you need to create the POST or GET commands with curl, and also include the Manager host FQDN of the Data Hub cluster, the name of the Data Hub cluster, and the required operation for the endpoint. If necessary, you can include the Streaming SQL Engine port. The submitted commands return the information, or complete the process you have requested and display the status in the CLI.
curl -ik -u '<workload_username>:<workload_password>' \ 'https://<dh_cluster_manager_host_fqdn>/<dh_cluster_name>/cdp-proxy-api/ssb-sse-api/api/v1/ssb/jobs'
Using REST API Tool
The base path has to be the same for all endpoints. In terms of authentication, make sure you set “Basic Auth”, and use your workload username and password as credentials.