Skip to content

describe_task_definition async

describe_task_definition(
    task_definition: String,
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    include: Optional[TaskDefinitionFieldList] = None,
) -> DescribeTaskDefinitionResponse

Describes a task definition. You can specify a family and revision to find information about a specific task definition, or you can simply specify the family to find the latest ACTIVE revision in that family.

You can only describe INACTIVE task definitions while an active task or service references them.

Parameters:

  • task_definition (String) –

    The family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition to describe.

  • include (Optional[TaskDefinitionFieldList], default: None ) –

    Determines whether to see the resource tags for the task definition. If TAGS is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.

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.

  • 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.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To describe a task definition This example provides a description of the specified task definition.

>>> await client.describe_task_definition(task_definition='hello_world:8')
Source code in docs_src/capo_ecs/_services/async_ecs.py
async def describe_task_definition(
    self,
    task_definition: "capo_ecs.types.string.String",
    *,
    config_overrides: Optional[AsyncECSClientConfig] = None,
    include: Optional[
        "capo_ecs.types.task_definition_field_list.TaskDefinitionFieldList"
    ] = None,
) -> "capo_ecs.types.describe_task_definition_response.DescribeTaskDefinitionResponse":
    """<p>Describes a task definition. You can specify a <code>family</code> and <code>revision</code> to find information about a specific task definition, or you can simply specify the family to find the latest <code>ACTIVE</code> revision in that family.</p> <note> <p>You can only describe <code>INACTIVE</code> task definitions while an active task or service references them.</p> </note>

    Args:
        task_definition: <p>The <code>family</code> for the latest <code>ACTIVE</code> revision, <code>family</code> and <code>revision</code> (<code>family:revision</code>) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition to describe.</p>
        include: <p>Determines whether to see the resource tags for the task definition. If <code>TAGS</code> is specified, the tags are included in the response. If this field is omitted, tags aren't included in the response.</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.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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a task definition
        This example provides a description of the specified task definition.

        >>> await client.describe_task_definition(task_definition='hello_world:8')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ecs.types.describe_task_definition_request.DescribeTaskDefinitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_ecs.types.describe_task_definition_response.DescribeTaskDefinitionResponse"
    ]:
        import capo_ecs._operations.amazon_ec2_container_service_v20141113.describe_task_definition

        (
            output,
            http_response,
        ) = await capo_ecs._operations.amazon_ec2_container_service_v20141113.describe_task_definition.async_describe_task_definition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ecs.types.describe_task_definition_response.DescribeTaskDefinitionResponse",
    ) -> dict[str, Any]:
        import capo_ecs.types.describe_task_definition_response

        return capo_ecs.types.describe_task_definition_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeTaskDefinition", redact_output=_redact_output),
    )
    input_: capo_ecs.types.describe_task_definition_request.DescribeTaskDefinitionRequest = {
        "task_definition": task_definition
    }
    if include is not None:
        input_["include"] = include

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output