Describe, Update and Delete Confluent Manager for Apache Flink Applications¶
There are different ways to interact with a Confluent Manager for Apache Flink Application resource.
Describe an application¶
You can check the current state of an Application by fetching the resource. The following example shows how to use the REST API or the Confluent CLI to describe an application:
The following example show how to use the REST API to describe an application:
curl -v -H "Content-Type: application/json" \
http://cmf:8080/cmf/api/v1/environments/env-1/applications/app-1
The following example shows how to use the Confluent CLI with the describe
command to describe an application:
confluent --environment env-1 flink application describe app-1
Update an application¶
You can make changes to an application by updating it. Common operations are rescaling, suspending and resuming an application.
- To scale an application up or down, you have to adjust the
spec.job.parallelism
field. - You can suspend an application by setting the
spec.job.state
field tosuspended
and it is resumed by setting the field torunning
. - You can resume an application by setting the
spec.job.state
field torunning
.
CMF provides Application Instances to track application updates. Each update results in a new application instance.
The following example shows how to update an application with the REST API. The example
uses a POST request to update the resource with an adjusted resource file app-1.json
:
curl -v -H "Content-Type: application/json" \
-X POST http://cmf:8080/cmf/api/v1/environments/env-1/applications \
-d @/path/to/app-1.json
The following example shows e Confluent CLI with the update
to update an
application with the adjusted resource file app-1.json
:
confluent --environment env-1 flink statement rescale stmt-1 --parallelism 2
confluent --environment env-1 flink application update /path/to/app-1.json
Delete an application¶
You can delete an application by deleting the application resource using the REST API or the Confluent CLI. This will also delete the corresponding Flink cluster.
The following example shows how you can delete a statement with the REST API:
curl -v -H "Content-Type: application/json" \
-X DELETE http://cmf:8080/cmf/api/v1/environments/env-1/applications/app-1
The following example shows how you can delete a statement with the Confluent CLI:
confluent --environment env-1 flink application delete app-1
Inspect an application with the Flink WebUI¶
Apache Flink provides a WebUI that you can use to inspect a Flink job. By default, this WebUI is not accessible, but the Confluent CLI features a command to port-forward requests to the Flink WebUI, and make it available locally.
The following command starts port forwarding, which exposes the Flink WebUI on port 8088:
confluent --environment env-1 --port 8088 flink application web-ui-forward app-1
You can access the WebUI of the application’s Flink cluster with a browser at http://localhost:8088.