Creating a Flink Job Savepoint
Function
This API is used to trigger a savepoint for a running Flink job to save the current job state. This API is asynchronous. The response only indicates that the snapshot creation request has been received. The actual snapshot generation status can be queried by calling the Listing Flink Job Savepoints API.
Calling Method
For details, see Calling APIs.
URI
POST /v2/workspaces/{workspace_id}/flink-jobs/{job_id}/flink-savepoints
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| workspace_id | Yes | String | Definition: Workspace ID, used for resource isolation. For details about how to obtain the workspace ID, see Obtaining a Workspace ID. Constraints: N/A Range: 32 to 36 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
| job_id | Yes | String | Definition: Flink job ID, used to uniquely identify a Flink job. For details, see Listing Flink Jobs. Constraints: N/A Range: UUIDv7 format, fixed at 36 characters. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token, used for API authentication and authorization. It can be obtained by calling the Obtaining an IAM User Token API. Constraints: N/A Range: Up to 65,534 characters. Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| description | No | String | Definition: Job snapshot description. Constraints: N/A Range: 0 to 512 characters. Default Value: N/A |
| format | No | String | Definition: Savepoint storage format. Constraints: N/A Range Default Value: NATIVE. |
| drain_mode_enabled | No | Boolean | Definition: Whether to enable Drain mode. If enabled, watermarks are sent to all operators before triggering a savepoint to complete window calculations, and then the state snapshot is saved. Constraints: N/A Range Default Value: false |
Response Parameters
Status code: 201
| Parameter | Type | Description |
|---|---|---|
| savepoint_id | String | Definition: Savepoint unique identifier. Range: UUIDv7 format, fixed at 36 characters. Only lowercase letters, digits, and hyphens (-) are allowed. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 1 to 256 characters. |
| error_msg | String | Definition: Error message, used to explain the cause of an error. Range: 1 to 1,024 characters. |
| solution_msg | String | Definition: Resolution suggestion, used to provide a solution for the error. Range: 0 to 1,024 characters. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 1 to 256 characters. |
| error_msg | String | Definition: Error message, used to explain the cause of an error. Range: 1 to 1,024 characters. |
| solution_msg | String | Definition: Resolution suggestion, used to provide a solution for the error. Range: 0 to 1,024 characters. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 1 to 256 characters. |
| error_msg | String | Definition: Error message, used to explain the cause of an error. Range: 1 to 1,024 characters. |
| solution_msg | String | Definition: Resolution suggestion, used to provide a solution for the error. Range: 0 to 1,024 characters. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 1 to 256 characters. |
| error_msg | String | Definition: Error message, used to explain the cause of an error. Range: 1 to 1,024 characters. |
| solution_msg | String | Definition: Resolution suggestion, used to provide a solution for the error. Range: 0 to 1,024 characters. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, used to identify a specific error type. Range: 1 to 256 characters. |
| error_msg | String | Definition: Error message, used to explain the cause of an error. Range: 1 to 1,024 characters. |
| solution_msg | String | Definition: Resolution suggestion, used to provide a solution for the error. Range: 0 to 1,024 characters. |
Example Requests
Create a savepoint snapshot for the running Flink job, saving the job state in NATIVE format.
POST /v2/workspaces/{workspace_id}/flink-jobs/{job_id}/flink-savepoints
{
"description" : "Pre-upgrade backup.",
"format" : "NATIVE"
} Example Responses
Status code: 201
{
"savepoint_id" : "019f68a2-5e11-xxxx-xxxx-6e670d65ab03"
} Status code: 400
{
"error_code" : "AIDataLake.01011001",
"error_msg" : "Invalid parameter",
"solution_msg" : "Please check the input parameters according to the documentation."
} Status code: 401
{
"error_code" : "AIDataLake.01011003",
"error_msg" : "Auth Token not exists in header",
"solution_msg" : "Please check if auth Token is included in the request header."
} Status code: 403
{
"error_code" : "AIDataLake.01011005",
"error_msg" : "Current account has no permission",
"solution_msg" : "Please connect administrators to add permission."
} Status code: 404
{
"error_code" : "AIDataLake.01051001",
"error_msg" : "Flink job 019f609a-e90c-xxxx-xxxx-a4ec9018e7f2 does not exist",
"solution_msg" : "Please check if Flink job 019f609a-e90c-xxxx-xxxx-a4ec9018e7f2 is entered correctly or has been deleted."
} Status code: 500
{
"error_code" : "AIDataLake.01010001",
"error_msg" : "Internal system error",
"solution_msg" : "Contact operations for analysis."
} Status Codes
| Status Code | Description |
|---|---|
| 201 | Request submitted. |
| 400 | Invalid request parameters. |
| 401 | Authentication failed. |
| 403 | Insufficient permissions. |
| 404 | The Flink job does not exist. |
| 500 | Internal system error. |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot