Stops an ongoing service deployment.
The following stop types are avaiable:
For more information, see Stopping Amazon ECS service deployments in the Amazon Elastic Container Service Developer Guide.
Parameters:
-
service_deployment_arn
(String)
–
The ARN of the service deployment that you want to stop.
-
stop_type
(Optional[StopServiceDeploymentStopType], default:
None
)
–
How you want Amazon ECS to stop the service.
The valid values are ROLLBACK.
Raises:
-
AccessDeniedException
–
You don't have authorization to perform the requested action.
-
ClientException
–
These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
-
ConflictException
–
The request could not be processed because of conflict in the current state of the resource.
-
InvalidParameterException
–
The specified parameter isn't valid. Review the available parameters for the API request.
For more information about service event errors, see Amazon ECS service event messages.
-
ServerException
–
These errors are usually caused by a server issue.
-
ServiceDeploymentNotFoundException
–
The service deploy ARN that you specified in the ContinueServiceDeployment doesn't exist. You can use ListServiceDeployments to retrieve the service deployment ARNs.
-
UnsupportedFeatureException
–
The specified task isn't supported in this Region.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To stop a service deployment
This example stops the service deployment using the ROLLBACK option.
>>> await client.stop_service_deployment(service_deployment_arn='arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1r', stop_type='ROLLBACK')
Source code in docs_src/capo_ecs/_services/async_ecs.py
| async def stop_service_deployment(
self,
service_deployment_arn: "capo_ecs.types.string.String",
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
stop_type: Optional[
"capo_ecs.types.stop_service_deployment_stop_type.StopServiceDeploymentStopType"
] = None,
) -> (
"capo_ecs.types.stop_service_deployment_response.StopServiceDeploymentResponse"
):
"""<p>Stops an ongoing service deployment.</p> <p>The following stop types are avaiable:</p> <ul> <li> <p>ROLLBACK - This option rolls back the service deployment to the previous service revision. </p> <p>You can use this option even if you didn't configure the service deployment for the rollback option. </p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/stop-service-deployment.html">Stopping Amazon ECS service deployments</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
Args:
service_deployment_arn: <p>The ARN of the service deployment that you want to stop.</p>
stop_type: <p>How you want Amazon ECS to stop the service. </p> <p>The valid values are <code>ROLLBACK</code>.</p>
Raises:
capo_ecs.errors.access_denied_exception.AccessDeniedException: <p>You don't have authorization to perform the requested action.</p>
capo_ecs.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.</p>
capo_ecs.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource. </p>
capo_ecs.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter isn't valid. Review the available parameters for the API request.</p> <p>For more information about service event errors, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-event-messages-list.html">Amazon ECS service event messages</a>. </p>
capo_ecs.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
capo_ecs.errors.service_deployment_not_found_exception.ServiceDeploymentNotFoundException: <p>The service deploy ARN that you specified in the <code>ContinueServiceDeployment</code> doesn't exist. You can use <code>ListServiceDeployments</code> to retrieve the service deployment ARNs.</p>
capo_ecs.errors.unsupported_feature_exception.UnsupportedFeatureException: <p>The specified task isn't supported in this Region.</p>
capo_ecs.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To stop a service deployment
This example stops the service deployment using the ROLLBACK option.
>>> await client.stop_service_deployment(service_deployment_arn='arn:aws:ecs:us-east-1:123456789012:service-deployment/MyCluster/MyService/r9i43YFjvgF_xlg7m2eJ1r', stop_type='ROLLBACK')
"""
async def _handler(
req: "AsyncOperationRequest[capo_ecs.types.stop_service_deployment_request.StopServiceDeploymentRequest]",
) -> AsyncOperationResponse[
"capo_ecs.types.stop_service_deployment_response.StopServiceDeploymentResponse"
]:
import capo_ecs._operations.amazon_ec2_container_service_v20141113.stop_service_deployment
(
output,
http_response,
) = await capo_ecs._operations.amazon_ec2_container_service_v20141113.stop_service_deployment.async_stop_service_deployment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopServiceDeployment")
)
input_: capo_ecs.types.stop_service_deployment_request.StopServiceDeploymentRequest = {
"service_deployment_arn": service_deployment_arn
}
if stop_type is not None:
input_["stop_type"] = stop_type
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|