Cancels a cluster job. You can only cancel a cluster job while it's in the AwaitingQuorum status. You'll have at least an hour after creating a cluster job to cancel it.
Parameters:
-
cluster_id
(ClusterId)
–
The 39-character ID for the cluster that you want to cancel, for example CID123e4567-e89b-12d3-a456-426655440000.
Raises:
Examples:
To cancel a cluster job
This operation cancels a cluster job. You can only cancel a cluster job while it's in the AwaitingQuorum status.
>>> client.cancel_cluster(cluster_id='CID123e4567-e89b-12d3-a456-426655440000')
Source code in docs_src/capo_snowball/_services/snowball.py
| def cancel_cluster(
self,
cluster_id: "capo_snowball.types.cluster_id.ClusterId",
*,
config_overrides: Optional[SnowballClientConfig] = None,
) -> "capo_snowball.types.cancel_cluster_result.CancelClusterResult":
"""<p>Cancels a cluster job. You can only cancel a cluster job while it's in the <code>AwaitingQuorum</code> status. You'll have at least an hour after creating a cluster job to cancel it.</p>
Args:
cluster_id: <p>The 39-character ID for the cluster that you want to cancel, for example <code>CID123e4567-e89b-12d3-a456-426655440000</code>.</p>
Raises:
capo_snowball.errors.invalid_job_state_exception.InvalidJobStateException: <p>The action can't be performed because the job's current state doesn't allow that action to be performed.</p>
capo_snowball.errors.invalid_resource_exception.InvalidResourceException: <p>The specified resource can't be found. Check the information you provided in your last request, and try again.</p>
capo_snowball.errors.kms_request_failed_exception.KMSRequestFailedException: <p>The provided Key Management Service key lacks the permissions to perform the specified <a>CreateJob</a> or <a>UpdateJob</a> action.</p>
capo_snowball.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To cancel a cluster job
This operation cancels a cluster job. You can only cancel a cluster job while it's in the AwaitingQuorum status.
>>> client.cancel_cluster(cluster_id='CID123e4567-e89b-12d3-a456-426655440000')
"""
def _handler(
req: "OperationRequest[capo_snowball.types.cancel_cluster_request.CancelClusterRequest]",
) -> OperationResponse[
"capo_snowball.types.cancel_cluster_result.CancelClusterResult"
]:
import capo_snowball._operations.awsie_snowball_job_management_service.cancel_cluster
output, http_response = (
capo_snowball._operations.awsie_snowball_job_management_service.cancel_cluster.cancel_cluster(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelCluster")
)
input_: capo_snowball.types.cancel_cluster_request.CancelClusterRequest = {
"cluster_id": cluster_id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|