Skip to content

create_rotation async

create_rotation(
    name: RotationName,
    contact_ids: RotationContactsArnList,
    time_zone_id: TimeZoneId,
    recurrence: RecurrenceSettings,
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    start_time: Optional[DateTime] = None,
    tags: Optional[TagsList] = None,
    idempotency_token: Optional[IdempotencyToken] = None,
) -> CreateRotationResult

Creates a rotation in an on-call schedule.

Parameters:

  • name (RotationName) –

    The name of the rotation.

  • contact_ids (RotationContactsArnList) –

    The Amazon Resource Names (ARNs) of the contacts to add to the rotation.

    Only the PERSONAL contact type is supported. The contact types ESCALATION and ONCALL_SCHEDULE are not supported for this operation.

    The order that you list the contacts in is their shift order in the rotation schedule. To change the order of the contact's shifts, use the UpdateRotation operation.

  • start_time (Optional[DateTime], default: None ) –

    The date and time that the rotation goes into effect.

  • time_zone_id (TimeZoneId) –

    The time zone to base the rotation’s activity on in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.

    Designators for time zones that don’t support Daylight Savings Time rules, such as Pacific Standard Time (PST), are not supported.

  • recurrence (RecurrenceSettings) –

    Information about the rule that specifies when a shift's team members rotate.

  • tags (Optional[TagsList], default: None ) –

    Optional metadata to assign to the rotation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For more information, see Tagging Incident Manager resources in the Incident Manager User Guide.

  • 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/async_ssm_contacts.py
async def create_rotation(
    self,
    name: "capo_ssm_contacts.types.rotation_name.RotationName",
    contact_ids: "capo_ssm_contacts.types.rotation_contacts_arn_list.RotationContactsArnList",
    time_zone_id: "capo_ssm_contacts.types.time_zone_id.TimeZoneId",
    recurrence: "capo_ssm_contacts.types.recurrence_settings.RecurrenceSettings",
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    start_time: Optional["capo_ssm_contacts.types.date_time.DateTime"] = None,
    tags: Optional["capo_ssm_contacts.types.tags_list.TagsList"] = None,
    idempotency_token: Optional[
        "capo_ssm_contacts.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_ssm_contacts.types.create_rotation_result.CreateRotationResult":
    """<p>Creates a rotation in an on-call schedule.</p>

    Args:
        name: <p>The name of the rotation.</p>
        contact_ids: <p>The Amazon Resource Names (ARNs) of the contacts to add to the rotation.</p> <note> <p>Only the <code>PERSONAL</code> contact type is supported. The contact types <code>ESCALATION</code> and <code>ONCALL_SCHEDULE</code> are not supported for this operation. </p> </note> <p>The order that you list the contacts in is their shift order in the rotation schedule. To change the order of the contact's shifts, use the <a>UpdateRotation</a> operation.</p>
        start_time: <p>The date and time that the rotation goes into effect.</p>
        time_zone_id: <p>The time zone to base the rotation’s activity on in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the <a href="https://www.iana.org/time-zones">Time Zone Database</a> on the IANA website.</p> <note> <p>Designators for time zones that don’t support Daylight Savings Time rules, such as Pacific Standard Time (PST), are not supported.</p> </note>
        recurrence: <p>Information about the rule that specifies when a shift's team members rotate.</p>
        tags: <p>Optional metadata to assign to the rotation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html">Tagging Incident Manager resources</a> in the <i>Incident Manager User Guide</i>.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm_contacts.types.create_rotation_request.CreateRotationRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm_contacts.types.create_rotation_result.CreateRotationResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.create_rotation

        (
            output,
            http_response,
        ) = await capo_ssm_contacts._operations.ssm_contacts.create_rotation.async_create_rotation(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRotation")
    )
    input_: capo_ssm_contacts.types.create_rotation_request.CreateRotationRequest = {
        "name": name,
        "contact_ids": contact_ids,
        "time_zone_id": time_zone_id,
        "recurrence": recurrence,
    }
    if start_time is not None:
        input_["start_time"] = start_time
    if tags is not None:
        input_["tags"] = tags
    if idempotency_token is not None:
        input_["idempotency_token"] = idempotency_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output