Skip to content

tag_resource async

tag_resource(
    resource_arn: GraphArn,
    tags: TagMap,
    *,
    config_overrides: Optional[AsyncDetectiveClientConfig] = None,
) -> TagResourceResponse

Applies tag values to a behavior graph.

Parameters:

  • resource_arn (GraphArn) –

    The ARN of the behavior graph to assign the tags to.

  • tags (TagMap) –

    The tags to assign to the behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.

Raises:

Source code in docs_src/capo_detective/_services/async_detective.py
async def tag_resource(
    self,
    resource_arn: "capo_detective.types.graph_arn.GraphArn",
    tags: "capo_detective.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncDetectiveClientConfig] = None,
) -> "capo_detective.types.tag_resource_response.TagResourceResponse":
    """<p>Applies tag values to a behavior graph.</p>

    Args:
        resource_arn: <p>The ARN of the behavior graph to assign the tags to.</p>
        tags: <p>The tags to assign to the behavior graph. You can add up to 50 tags. For each tag, you provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each tag value can contain up to 256 characters.</p>

    Raises:
        capo_detective.errors.access_denied_exception.AccessDeniedException: <p>The request issuer does not have permission to access this resource or perform this operation.</p>
        capo_detective.errors.internal_server_exception.InternalServerException: <p>The request was valid but failed because of a problem with the service.</p>
        capo_detective.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request refers to a nonexistent resource.</p>
        capo_detective.errors.validation_exception.ValidationException: <p>The request parameters are invalid.</p>
        capo_detective.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_detective.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_detective.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_detective._operations.amazon_detective.tag_resource

        (
            output,
            http_response,
        ) = await capo_detective._operations.amazon_detective.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_detective.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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