Deletes the specified daemon. The daemon must be in an ACTIVE state to be deleted. Deleting a daemon stops all running daemon tasks on the associated container instances. Amazon ECS drains existing container instances and provisions new instances without the deleted daemon. Amazon ECS automatically launches replacement tasks for your Amazon ECS services.
ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.
Parameters:
-
daemon_arn
(String)
–
The Amazon Resource Name (ARN) of the daemon to delete.
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.
-
ClusterNotFoundException
–
The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.
-
DaemonNotActiveException
–
The specified daemon isn't active. You can't update a daemon that's inactive. If you have previously deleted a daemon, you can re-create it with CreateDaemon.
-
DaemonNotFoundException
–
The specified daemon wasn't found. You can view your available daemons with ListDaemons. Amazon ECS daemons are cluster specific and Region specific.
-
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.
-
UnsupportedFeatureException
–
The specified task isn't supported in this Region.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To delete a daemon
This example deletes the my-monitoring-daemon daemon.
>>> await client.delete_daemon(daemon_arn='arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon')
Source code in docs_src/capo_ecs/_services/async_ecs.py
| async def delete_daemon(
self,
daemon_arn: "capo_ecs.types.string.String",
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
) -> "capo_ecs.types.delete_daemon_response.DeleteDaemonResponse":
"""<p>Deletes the specified daemon. The daemon must be in an <code>ACTIVE</code> state to be deleted. Deleting a daemon stops all running daemon tasks on the associated container instances. Amazon ECS drains existing container instances and provisions new instances without the deleted daemon. Amazon ECS automatically launches replacement tasks for your Amazon ECS services.</p> <note> <p>ECS Managed Daemons is only supported for Amazon ECS Managed Instances Capacity Providers.</p> </note>
Args:
daemon_arn: <p>The Amazon Resource Name (ARN) of the daemon to delete.</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.cluster_not_found_exception.ClusterNotFoundException: <p>The specified cluster wasn't found. You can view your available clusters with <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html">ListClusters</a>. Amazon ECS clusters are Region specific.</p>
capo_ecs.errors.daemon_not_active_exception.DaemonNotActiveException: <p>The specified daemon isn't active. You can't update a daemon that's inactive. If you have previously deleted a daemon, you can re-create it with <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateDaemon.html">CreateDaemon</a>.</p>
capo_ecs.errors.daemon_not_found_exception.DaemonNotFoundException: <p>The specified daemon wasn't found. You can view your available daemons with <a href="https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListDaemons.html">ListDaemons</a>. Amazon ECS daemons are cluster specific and Region specific.</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.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 delete a daemon
This example deletes the my-monitoring-daemon daemon.
>>> await client.delete_daemon(daemon_arn='arn:aws:ecs:us-east-1:123456789012:daemon/my-cluster/my-monitoring-daemon')
"""
async def _handler(
req: "AsyncOperationRequest[capo_ecs.types.delete_daemon_request.DeleteDaemonRequest]",
) -> AsyncOperationResponse[
"capo_ecs.types.delete_daemon_response.DeleteDaemonResponse"
]:
import capo_ecs._operations.amazon_ec2_container_service_v20141113.delete_daemon
(
output,
http_response,
) = await capo_ecs._operations.amazon_ec2_container_service_v20141113.delete_daemon.async_delete_daemon(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteDaemon")
)
input_: capo_ecs.types.delete_daemon_request.DeleteDaemonRequest = {
"daemon_arn": daemon_arn
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|