CancelDataRepositoryTask
Cancels an existing Amazon FSx for Lustre data repository task if that task is in either the
PENDING
or EXECUTING
state. When you cancel a task, Amazon FSx does the following.
-
Any files that FSx has already exported are not reverted.
-
FSx continues to export any files that are "in-flight" when the cancel operation is received.
-
FSx does not export any files that have not yet been exported.
Request Syntax
{
"TaskId": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- TaskId
-
Specifies the data repository task to cancel.
Type: String
Length Constraints: Minimum length of 12. Maximum length of 128.
Pattern:
^(task-[0-9a-f]{17,})$
Required: Yes
Response Syntax
{
"Lifecycle": "string",
"TaskId": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- Lifecycle
-
The lifecycle status of the data repository task, as follows:
-
PENDING
- Amazon FSx has not started the task. -
EXECUTING
- Amazon FSx is processing the task. -
FAILED
- Amazon FSx was not able to complete the task. For example, there may be files the task failed to process. The DataRepositoryTaskFailureDetails property provides more information about task failures. -
SUCCEEDED
- FSx completed the task successfully. -
CANCELED
- Amazon FSx canceled the task and it did not complete. -
CANCELING
- FSx is in process of canceling the task.
Type: String
Valid Values:
PENDING | EXECUTING | FAILED | SUCCEEDED | CANCELED | CANCELING
-
- TaskId
-
The ID of the task being canceled.
Type: String
Length Constraints: Minimum length of 12. Maximum length of 128.
Pattern:
^(task-[0-9a-f]{17,})$
Errors
For information about the errors that are common to all actions, see Common Errors.
- BadRequest
-
A generic error indicating a failure with a client request.
HTTP Status Code: 400
- DataRepositoryTaskEnded
-
The data repository task could not be canceled because the task has already ended.
HTTP Status Code: 400
- DataRepositoryTaskNotFound
-
The data repository task or tasks you specified could not be found.
HTTP Status Code: 400
- InternalServerError
-
A generic error indicating a server-side failure.
HTTP Status Code: 500
- UnsupportedOperation
-
The requested operation is not supported for this resource or API.
HTTP Status Code: 400
Examples
Cancel a Data Repository Task
The following request cancels a specific data repository task by using the TaskId request parameter.
Sample Request
POST /2015-02-01/cancel-data-repository-task HTTP/1.1
{
"TaskId": ["task-0123456789abcdef0"]
}
Sample Response
HTTP/1.1 200 success
x-amzn-RequestId: 12345678-1234-abcd-5678-0123456789abc
{
"Status": "CANCELING",
"TaskId": "task-0123456789abcdef0"
}
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: