Skip to content

tag_resource async

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

Adds metadata tags to a DataBrew resource, such as a dataset, project, recipe, job, or schedule.

Parameters:

  • resource_arn (Arn) –

    The DataBrew resource to which tags should be added. The value for this parameter is an Amazon Resource Name (ARN). For DataBrew, you can tag a dataset, a job, a project, or a recipe.

  • tags (TagMap) –

    One or more tags to be assigned to the resource.

Raises:

Source code in docs_src/capo_databrew/_services/async_data_brew.py
async def tag_resource(
    self,
    resource_arn: "capo_databrew.types.arn.Arn",
    tags: "capo_databrew.types.tag_map.TagMap",
    *,
    config_overrides: Optional[AsyncDataBrewClientConfig] = None,
) -> "capo_databrew.types.tag_resource_response.TagResourceResponse":
    """<p>Adds metadata tags to a DataBrew resource, such as a dataset, project, recipe, job, or schedule.</p>

    Args:
        resource_arn: <p>The DataBrew resource to which tags should be added. The value for this parameter is an Amazon Resource Name (ARN). For DataBrew, you can tag a dataset, a job, a project, or a recipe.</p>
        tags: <p>One or more tags to be assigned to the resource.</p>

    Raises:
        capo_databrew.errors.internal_server_exception.InternalServerException: <p>An internal service failure occurred.</p>
        capo_databrew.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_databrew.errors.validation_exception.ValidationException: <p>The input parameters for this request failed validation.</p>
        capo_databrew.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_databrew._operations.aws_glue_data_brew.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_databrew.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