Skip to content

tag_resource

tag_resource(
    resource_arn: TagResourceArn,
    tags: TagList,
    *,
    config_overrides: Optional[SchedulerClientConfig] = None,
) -> TagResourceOutput

Assigns one or more tags (key-value pairs) to the specified EventBridge Scheduler resource. You can only assign tags to schedule groups.

Parameters:

  • resource_arn (TagResourceArn) –

    The Amazon Resource Name (ARN) of the schedule group that you are adding tags to.

  • tags (TagList) –

    The list of tags to associate with the schedule group.

Raises:

Source code in docs_src/capo_scheduler/_services/scheduler.py
def tag_resource(
    self,
    resource_arn: "capo_scheduler.types.tag_resource_arn.TagResourceArn",
    tags: "capo_scheduler.types.tag_list.TagList",
    *,
    config_overrides: Optional[SchedulerClientConfig] = None,
) -> "capo_scheduler.types.tag_resource_output.TagResourceOutput":
    """<p>Assigns one or more tags (key-value pairs) to the specified EventBridge Scheduler resource. You can only assign tags to schedule groups.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the schedule group that you are adding tags to.</p>
        tags: <p>The list of tags to associate with the schedule group.</p>

    Raises:
        capo_scheduler.errors.conflict_exception.ConflictException: <p>Updating or deleting the resource can cause an inconsistent state.</p>
        capo_scheduler.errors.internal_server_exception.InternalServerException: <p>Unexpected error encountered while processing the request.</p>
        capo_scheduler.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource which does not exist.</p>
        capo_scheduler.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_scheduler.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_scheduler.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_scheduler.types.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse[
        "capo_scheduler.types.tag_resource_output.TagResourceOutput"
    ]:
        import capo_scheduler._operations.aws_chronos_service.tag_resource

        output, http_response = (
            capo_scheduler._operations.aws_chronos_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_scheduler.types.tag_resource_input.TagResourceInput = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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