:doc:`SSMContacts <../../ssm-contacts>` / Client / create_rotation

***************
create_rotation
***************



.. py:method:: SSMContacts.Client.create_rotation(**kwargs)

  

  Creates a rotation in an on-call schedule.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ssm-contacts-2021-05-03/CreateRotation>`_  


  **Request Syntax**
  ::

    response = client.create_rotation(
        Name='string',
        ContactIds=[
            'string',
        ],
        StartTime=datetime(2015, 1, 1),
        TimeZoneId='string',
        Recurrence={
            'MonthlySettings': [
                {
                    'DayOfMonth': 123,
                    'HandOffTime': {
                        'HourOfDay': 123,
                        'MinuteOfHour': 123
                    }
                },
            ],
            'WeeklySettings': [
                {
                    'DayOfWeek': 'MON'|'TUE'|'WED'|'THU'|'FRI'|'SAT'|'SUN',
                    'HandOffTime': {
                        'HourOfDay': 123,
                        'MinuteOfHour': 123
                    }
                },
            ],
            'DailySettings': [
                {
                    'HourOfDay': 123,
                    'MinuteOfHour': 123
                },
            ],
            'NumberOfOnCalls': 123,
            'ShiftCoverages': {
                'string': [
                    {
                        'Start': {
                            'HourOfDay': 123,
                            'MinuteOfHour': 123
                        },
                        'End': {
                            'HourOfDay': 123,
                            'MinuteOfHour': 123
                        }
                    },
                ]
            },
            'RecurrenceMultiplier': 123
        },
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        IdempotencyToken='string'
    )
    
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the rotation.

    

  
  :type ContactIds: list
  :param ContactIds: **[REQUIRED]** 

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

     

    .. note::

      

      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.

    

  
    - *(string) --* 

    

  :type StartTime: datetime
  :param StartTime: 

    The date and time that the rotation goes into effect.

    

  
  :type TimeZoneId: string
  :param TimeZoneId: **[REQUIRED]** 

    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 <https://www.iana.org/time-zones>`__ on the IANA website.

     

    .. note::

      

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

      

    

  
  :type Recurrence: dict
  :param Recurrence: **[REQUIRED]** 

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

    

  
    - **MonthlySettings** *(list) --* 

      Information about on-call rotations that recur monthly.

      

    
      - *(dict) --* 

        Information about on-call rotations that recur monthly.

        

      
        - **DayOfMonth** *(integer) --* **[REQUIRED]** 

          The day of the month when monthly recurring on-call rotations begin.

          

        
        - **HandOffTime** *(dict) --* **[REQUIRED]** 

          The time of day when a monthly recurring on-call shift rotation begins.

          

        
          - **HourOfDay** *(integer) --* **[REQUIRED]** 

            The hour when an on-call rotation shift begins or ends.

            

          
          - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

            The minute when an on-call rotation shift begins or ends.

            

          
        
      
  
    - **WeeklySettings** *(list) --* 

      Information about on-call rotations that recur weekly.

      

    
      - *(dict) --* 

        Information about rotations that recur weekly.

        

      
        - **DayOfWeek** *(string) --* **[REQUIRED]** 

          The day of the week when weekly recurring on-call shift rotations begins.

          

        
        - **HandOffTime** *(dict) --* **[REQUIRED]** 

          The time of day when a weekly recurring on-call shift rotation begins.

          

        
          - **HourOfDay** *(integer) --* **[REQUIRED]** 

            The hour when an on-call rotation shift begins or ends.

            

          
          - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

            The minute when an on-call rotation shift begins or ends.

            

          
        
      
  
    - **DailySettings** *(list) --* 

      Information about on-call rotations that recur daily.

      

    
      - *(dict) --* 

        Details about when an on-call rotation shift begins or ends.

        

      
        - **HourOfDay** *(integer) --* **[REQUIRED]** 

          The hour when an on-call rotation shift begins or ends.

          

        
        - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

          The minute when an on-call rotation shift begins or ends.

          

        
      
  
    - **NumberOfOnCalls** *(integer) --* **[REQUIRED]** 

      The number of contacts, or shift team members designated to be on call concurrently during a shift. For example, in an on-call schedule that contains ten contacts, a value of ``2`` designates that two of them are on call at any given time.

      

    
    - **ShiftCoverages** *(dict) --* 

      Information about the days of the week that the on-call rotation coverage includes.

      

    
      - *(string) --* 

      
        - *(list) --* 

        
          - *(dict) --* 

            Information about when an on-call shift begins and ends.

            

          
            - **Start** *(dict) --* 

              Information about when the on-call rotation shift begins.

              

            
              - **HourOfDay** *(integer) --* **[REQUIRED]** 

                The hour when an on-call rotation shift begins or ends.

                

              
              - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

                The minute when an on-call rotation shift begins or ends.

                

              
            
            - **End** *(dict) --* 

              Information about when the on-call rotation shift ends.

              

            
              - **HourOfDay** *(integer) --* **[REQUIRED]** 

                The hour when an on-call rotation shift begins or ends.

                

              
              - **MinuteOfHour** *(integer) --* **[REQUIRED]** 

                The minute when an on-call rotation shift begins or ends.

                

              
            
          
      
  

    - **RecurrenceMultiplier** *(integer) --* **[REQUIRED]** 

      The number of days, weeks, or months a single rotation lasts.

      

    
  
  :type Tags: list
  :param Tags: 

    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 <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.

    

  
    - *(dict) --* 

      A container of a key-value name pair.

      

    
      - **Key** *(string) --* 

        Name of the object key.

        

      
      - **Value** *(string) --* 

        Value of the tag.

        

      
    

  :type IdempotencyToken: string
  :param IdempotencyToken: 

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

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'RotationArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **RotationArn** *(string) --* 

        The Amazon Resource Name (ARN) of the created rotation.

        
  
  **Exceptions**
  
  *   :py:class:`SSMContacts.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`SSMContacts.Client.exceptions.InternalServerException`

  
  *   :py:class:`SSMContacts.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`SSMContacts.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`SSMContacts.Client.exceptions.ThrottlingException`

  
  *   :py:class:`SSMContacts.Client.exceptions.ValidationException`

  