REST APIs for Confluent Manager for Apache Flink¶
You can use the Confluent REST API to manage these resources for Confluent Manager for Apache Flink® (CMF):
- Environments
- Applications
In addition to the REST API, you can manage the above resources by using these Confluent tools:
Prerequisites¶
The REST API requires networked access to CMF.
As part of the installation process, a Kubernetes service is created that exposes CMF behind an outward-facing endpoint. By default, the service exposes CMF on port 8080.
If you have configured authentication and/or authorization, each API request must be authenticated and you need permissions on the respective resource.
For more information, see:
Endpoints (v1)¶
All endpoints are served under /cmf/api/v1
.
Identifiers¶
All resources are identified by name. Each name must be unique in its scope and follow the following restrictions:
- Minimum length: 4
- Maximum length: 253
- Pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
API reference¶
This section contains the REST API reference for Confluent Manager for Apache Flink®.
-
POST
/environments
¶ Create or update an Environment
Example request:
POST /environments HTTP/1.1 Host: example.com Content-Type: application/json { "name": "string", "flinkApplicationDefaults": {}, "kubernetesNamespace": "string" }
Status Codes: - 201 Created –
The Environment was successfully created or updated.
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "name": "string", "created_time": "2024-12-20T15:46:45.510118", "updated_time": "2024-12-20T15:46:45.510118", "flinkApplicationDefaults": {}, "kubernetesNamespace": "string" }
- 400 Bad Request –
Bad request.
Example response:
HTTP/1.1 400 Bad Request Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 201 Created –
-
GET
/environments
¶ Retrieve a paginated list of all environments.
Query Parameters: - page (integer) – Zero-based page index (0..N)
- size (integer) – The size of the page to be returned
- sort (array) – Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
Example request:
GET /environments HTTP/1.1 Host: example.com
Status Codes: - 200 OK –
List of environments found. If no environments are found, an empty list is returned.
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "pageable": { "page": 1, "size": 1, "sort": { "sorted": true, "unsorted": true, "empty": true } }, "metadata": { "size": 1 }, "items": [ { "name": "string", "created_time": "2024-12-20T15:46:45.510118", "updated_time": "2024-12-20T15:46:45.510118", "flinkApplicationDefaults": {}, "kubernetesNamespace": "string" } ] }
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
Response Headers: - ETag – An ID for this version of the response.
-
GET
/environments/{envName}
¶ Get/Describe an environment with the given name.
Parameters: - envName (string) – Name of the Environment to be retrieved.
Example request:
GET /environments/{envName} HTTP/1.1 Host: example.com
Status Codes: - 200 OK –
Environment found and returned.
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "name": "string", "created_time": "2024-12-20T15:46:45.510118", "updated_time": "2024-12-20T15:46:45.510118", "flinkApplicationDefaults": {}, "kubernetesNamespace": "string" }
- 404 Not Found –
Environment not found.
Example response:
HTTP/1.1 404 Not Found Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
-
DELETE
/environments/{envName}
¶ Parameters: - envName (string) – Name of the Environment to be deleted.
Status Codes: - 200 OK – Environment found and deleted.
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 404 Not Found –
Environment not found.
Example response:
HTTP/1.1 404 Not Found Content-Type: application/json { "errors": [ { "message": "string" } ] }
-
POST
/environments/{envName}/applications
¶ Creates a new Flink Application or updates an existing one in the given Environment.
Parameters: - envName (string) – Name of the Environment
Example request:
POST /environments/{envName}/applications HTTP/1.1 Host: example.com Content-Type: application/json { "apiVersion": "string", "kind": "string", "metadata": {}, "spec": {}, "status": {} }
Status Codes: - 201 Created –
The Application was successfully created or updated.
Example response:
HTTP/1.1 201 Created Content-Type: application/json { "apiVersion": "string", "kind": "string", "metadata": {}, "spec": {}, "status": {} }
- 400 Bad Request –
Bad request.
Example response:
HTTP/1.1 400 Bad Request Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 422 Unprocessable Entity –
Request valid but invalid content.
Example response:
HTTP/1.1 422 Unprocessable Entity Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
-
GET
/environments/{envName}/applications
¶ Retrieve a paginated list of all applications in the given Environment.
Parameters: - envName (string) – Name of the Environment
Query Parameters: - page (integer) – Zero-based page index (0..N)
- size (integer) – The size of the page to be returned
- sort (array) – Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.
Example request:
GET /environments/{envName}/applications HTTP/1.1 Host: example.com
Status Codes: - 200 OK –
Application found and returned.
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "pageable": { "page": 1, "size": 1, "sort": { "sorted": true, "unsorted": true, "empty": true } }, "metadata": { "size": 1 }, "items": [ { "apiVersion": "string", "kind": "string", "metadata": {}, "spec": {}, "status": {} } ] }
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
Response Headers: - ETag – An ID for this version of the response.
-
GET
/environments/{envName}/applications/{appName}
¶ Retrieve an Application of the given name in the given Environment.
Parameters: - envName (string) – Name of the Environment
- appName (string) – Name of the Application
Example request:
GET /environments/{envName}/applications/{appName} HTTP/1.1 Host: example.com
Status Codes: - 200 OK –
Application found and returned.
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "apiVersion": "string", "kind": "string", "metadata": {}, "spec": {}, "status": {} }
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
- 404 Not Found –
Application not found.
Example response:
HTTP/1.1 404 Not Found Content-Type: application/json { "errors": [ { "message": "string" } ] }
Response Headers: - ETag – An ID for this version of the response.
-
DELETE
/environments/{envName}/applications/{appName}
¶ Deletes an Application of the given name in the given Environment.
Parameters: - envName (string) – Name of the Environment
- appName (string) – Name of the Application
Status Codes: - 200 OK – Application found and deleted.
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
-
POST
/environments/{envName}/applications/{appName}/start
¶ Starts an earlier submitted Flink Application
Parameters: - envName (string) – Name of the Environment
- appName (string) – Name of the Application
Status Codes: - 200 OK –
Application started
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "apiVersion": "string", "kind": "string", "metadata": {}, "spec": {}, "status": {} }
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
-
POST
/environments/{envName}/applications/{appName}/suspend
¶ Suspends an earlier started Flink Application
Parameters: - envName (string) – Name of the Environment
- appName (string) – Name of the Application
Status Codes: - 200 OK –
Application suspended
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "apiVersion": "string", "kind": "string", "metadata": {}, "spec": {}, "status": {} }
- 304 Not Modified – Not modified.
- 500 Internal Server Error –
Server error.
Example response:
HTTP/1.1 500 Internal Server Error Content-Type: application/json { "errors": [ { "message": "string" } ] }
Troubleshooting¶
Resource not found: If you encounter the error Resource not found… when making a GET call, it may be due to the wrong URL. Specifically, the requested REST resource might not exist.
For example:
When making the GET call:
GET http://localhost:8080/hello
You will receive the error:
Resource not found: [hello]
Similarly, if you make the GET call:
GET http://localhost:8080/ or GET http://localhost:8080
You will receive the error:
Resource not found: []
This occurs because you are requesting an empty resource.