Skip to content

create_rotation_override

create_rotation_override(
    rotation_id: SsmContactsArn,
    new_contact_ids: RotationOverrideContactsArnList,
    start_time: DateTime,
    end_time: DateTime,
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    idempotency_token: Optional[IdempotencyToken] = None,
) -> CreateRotationOverrideResult

Creates an override for a rotation in an on-call schedule.

Parameters:

  • rotation_id (SsmContactsArn) –

    The Amazon Resource Name (ARN) of the rotation to create an override for.

  • new_contact_ids (RotationOverrideContactsArnList) –

    The Amazon Resource Names (ARNs) of the contacts to replace those in the current on-call rotation with.

    If you want to include any current team members in the override shift, you must include their ARNs in the new contact ID list.

  • start_time (DateTime) –

    The date and time when the override goes into effect.

  • end_time (DateTime) –

    The date and time when the override ends.

  • idempotency_token (Optional[IdempotencyToken], default: None ) –

    A token that ensures that the operation is called only once with the specified details.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/ssm_contacts.py
def create_rotation_override(
    self,
    rotation_id: "capo_ssm_contacts.types.ssm_contacts_arn.SsmContactsArn",
    new_contact_ids: "capo_ssm_contacts.types.rotation_override_contacts_arn_list.RotationOverrideContactsArnList",
    start_time: "capo_ssm_contacts.types.date_time.DateTime",
    end_time: "capo_ssm_contacts.types.date_time.DateTime",
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    idempotency_token: Optional[
        "capo_ssm_contacts.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_ssm_contacts.types.create_rotation_override_result.CreateRotationOverrideResult":
    """<p>Creates an override for a rotation in an on-call schedule.</p>

    Args:
        rotation_id: <p>The Amazon Resource Name (ARN) of the rotation to create an override for.</p>
        new_contact_ids: <p>The Amazon Resource Names (ARNs) of the contacts to replace those in the current on-call rotation with.</p> <p>If you want to include any current team members in the override shift, you must include their ARNs in the new contact ID list.</p>
        start_time: <p>The date and time when the override goes into effect.</p>
        end_time: <p>The date and time when the override ends.</p>
        idempotency_token: <p>A token that ensures that the operation is called only once with the specified details.</p>

    Raises:
        capo_ssm_contacts.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_contacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred while processing the request.</p>
        capo_ssm_contacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
        capo_ssm_contacts.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_ssm_contacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_contacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_contacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm_contacts.types.create_rotation_override_request.CreateRotationOverrideRequest]",
    ) -> OperationResponse[
        "capo_ssm_contacts.types.create_rotation_override_result.CreateRotationOverrideResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.create_rotation_override

        output, http_response = (
            capo_ssm_contacts._operations.ssm_contacts.create_rotation_override.create_rotation_override(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRotationOverride")
    )
    input_: capo_ssm_contacts.types.create_rotation_override_request.CreateRotationOverrideRequest = {
        "rotation_id": rotation_id,
        "new_contact_ids": new_contact_ids,
        "start_time": start_time,
        "end_time": end_time,
    }
    if idempotency_token is not None:
        input_["idempotency_token"] = idempotency_token

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