Skip to content

tag_resource

tag_resource(
    resource_arn: ResourceArn,
    resource_tags: ResourceTagList,
    *,
    config_overrides: Optional[BCMDashboardsClientConfig] = None,
) -> TagResourceResponse

Adds or updates tags for a specified dashboard resource.

Parameters:

  • resource_arn (ResourceArn) –

    The unique identifier for the resource.

  • resource_tags (ResourceTagList) –

    The tags to add to the dashboard resource.

Raises:

  • InternalServerException –

    An internal error occurred while processing the request. Retry your request. If the problem persists, contact Amazon Web Services Support.

  • ResourceNotFoundException –

    The specified resource (dashboard, policy, or widget) was not found. Verify the ARN and try again.

  • ThrottlingException –

    The request was denied due to request throttling. Reduce the frequency of requests and use exponential backoff.

  • ValidationException –

    The input parameters do not satisfy the requirements. Check the error message for specific validation details.

  • UnknownServiceError –

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

Examples:

Adding tag(s) to a resource

>>> client.tag_resource(resource_arn='arn:aws:bcm-dashboards::123456789012:dashboard/abcd1234-ab12-12ab-1ab2-abcd1234efgh', resource_tags=[{'key': 'keyOne', 'value': 'valueOne'}])
Source code in docs_src/capo_bcm_dashboards/_services/bcm_dashboards.py
def tag_resource(
    self,
    resource_arn: "capo_bcm_dashboards.types.resource_arn.ResourceArn",
    resource_tags: "capo_bcm_dashboards.types.resource_tag_list.ResourceTagList",
    *,
    config_overrides: Optional[BCMDashboardsClientConfig] = None,
) -> "capo_bcm_dashboards.types.tag_resource_response.TagResourceResponse":
    """<p>Adds or updates tags for a specified dashboard resource.</p>

    Args:
        resource_arn: <p>The unique identifier for the resource.</p>
        resource_tags: <p>The tags to add to the dashboard resource.</p>

    Raises:
        capo_bcm_dashboards.errors.internal_server_exception.InternalServerException: <p>An internal error occurred while processing the request. Retry your request. If the problem persists, contact Amazon Web Services Support.</p>
        capo_bcm_dashboards.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource (dashboard, policy, or widget) was not found. Verify the ARN and try again.</p>
        capo_bcm_dashboards.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Reduce the frequency of requests and use exponential backoff.</p>
        capo_bcm_dashboards.errors.validation_exception.ValidationException: <p>The input parameters do not satisfy the requirements. Check the error message for specific validation details.</p>
        capo_bcm_dashboards.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Adding tag(s) to a resource

        >>> client.tag_resource(resource_arn='arn:aws:bcm-dashboards::123456789012:dashboard/abcd1234-ab12-12ab-1ab2-abcd1234efgh', resource_tags=[{'key': 'keyOne', 'value': 'valueOne'}])
    """

    def _handler(
        req: "OperationRequest[capo_bcm_dashboards.types.tag_resource_request.TagResourceRequest]",
    ) -> OperationResponse[
        "capo_bcm_dashboards.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_bcm_dashboards._operations.awsbcm_dashboards_service.tag_resource

        output, http_response = (
            capo_bcm_dashboards._operations.awsbcm_dashboards_service.tag_resource.tag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output