Getting started with Cloudera SQL Stream Builder REST API
The Cloudera SQL Stream Builder (SSB) REST API gives you programmatic access to the same projects, tables, data sources, and jobs that you manage in the Streaming SQL Console.
The SSB REST API uses JSON for request and response bodies. It supports the GET, POST, PUT, PATCH, and DELETE methods. You can automate most of the tasks that you do in the Streaming SQL Console, such as creating tables, deploying jobs, and stopping jobs. Jobs that you start through the REST API always run in application mode. For more information, see Using Cloudera SQL Stream Builder REST API.
Base URL
Each engine instance has its own SSB REST API. The API uses the same host as the Streaming SQL Console:
https://<instance-name>-ssb-sse.<domain>/api/v2
- [***INSTANCE-NAME***] is the name of the Cloudera Streaming Analytics engine instance.
- [***DOMAIN***] is the domain of the compute cluster of the engine instance.
The host is the host of the endpoint of type Landing Page of the engine instance. For more information, see Accessing Cloudera SQL Stream Builder.
The current
version of the API is version 2. All paths in this documentation start with
/api/v2.
Authentication
The SSB REST API accepts an Anywhere Cloud access token as a bearer
token in the Authorization header. Send the token to the SSB host,
https://<instance-name>-ssb-sse.<domain>, which is the landing page of
the engine instance. For how to get a token, see Creating tokens for using the
API in the Anywhere Cloud documentation. For more information,
see Programmatic API access. Opaque Anywhere Cloud API keys
do not authenticate requests to the SSB REST API.
Projects and permissions
Most endpoints belong to a project, and their paths contain the project ID:
/api/v2/projects/<project-id>/...
A request runs in the project that its path names, with the permissions that you have in that project. Your permissions are the same as in the Streaming SQL Console. For more information, see Managing project members and Finding project IDs.
Operations
The API groups its operations by the resources that they manage:
Sampling Operations are not available in this release.
| Area | Operations |
|---|---|
| Projects | Projects, project environments, project members, invitations and permissions, project files, and source control synchronization |
| Catalog | Data sources, tables, connectors, and data formats |
| SQL and jobs | SQL validation and execution, SSB jobs, Flink jobs, session clusters, and SQL history |
| Artifacts | Uploaded artifacts and user-defined functions |
| Kubernetes | Kubernetes Custom Resource Operations |
| Session clusters | Flink Session Cluster Operations |
| Keytabs | User Keytab Operations |
| Administration | User settings and the active project of the current user, administration operations, global configuration, and the heartbeat endpoint |
For the full list of endpoints, their parameters, and their response codes, open the API Explorer. For more information, see Using Swagger.
The API Explorer lists some endpoints for features that are not available in this release, such as notifications and sampling. Do not use them. For more information, see Unsupported features.
Request and response format
Request and response bodies are JSON objects. Property names use snake case, for example
job_name and project_id. Send the Content-Type:
application/json header with each request that has a body.
Anywhere Cloud REST APIs
The Anywhere Cloud platform has its own REST APIs, for example to manage engine instances. They are separate from the SSB REST API. You can review the available API endpoints in the following REST API reference documentation:
