Skip to content

tag_resource async

tag_resource(
    resource_arn: Arn,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncSageMakerGeospatialClientConfig] = None,
) -> TagResourceResponse

The resource you want to tag.

Parameters:

  • resource_arn (Arn) –

    The Amazon Resource Name (ARN) of the resource you want to tag.

  • tags (Tags) –

    Each tag consists of a key and a value.

Raises:

Source code in docs_src/capo_sagemaker_geospatial/_services/async_sage_maker_geospatial.py
async def tag_resource(
    self,
    resource_arn: "capo_sagemaker_geospatial.types.arn.Arn",
    tags: "capo_sagemaker_geospatial.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncSageMakerGeospatialClientConfig] = None,
) -> "capo_sagemaker_geospatial.types.tag_resource_response.TagResourceResponse":
    """<p>The resource you want to tag.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource you want to tag.</p>
        tags: <p>Each tag consists of a key and a value.</p>

    Raises:
        capo_sagemaker_geospatial.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_sagemaker_geospatial.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_sagemaker_geospatial.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource which does not exist.</p>
        capo_sagemaker_geospatial.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_sagemaker_geospatial.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_sagemaker_geospatial.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_sagemaker_geospatial._operations.sage_maker_geospatial.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_sagemaker_geospatial.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