:doc:`RedshiftServerless <../../redshift-serverless>` / Client / delete_scheduled_action

***********************
delete_scheduled_action
***********************



.. py:method:: RedshiftServerless.Client.delete_scheduled_action(**kwargs)

  

  Deletes a scheduled action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteScheduledAction>`_  


  **Request Syntax**
  ::

    response = client.delete_scheduled_action(
        scheduledActionName='string'
    )
    
  :type scheduledActionName: string
  :param scheduledActionName: **[REQUIRED]** 

    The name of the scheduled action to delete.

    

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

    
    ::

      {
          'scheduledAction': {
              'endTime': datetime(2015, 1, 1),
              'namespaceName': 'string',
              'nextInvocations': [
                  datetime(2015, 1, 1),
              ],
              'roleArn': 'string',
              'schedule': {
                  'at': datetime(2015, 1, 1),
                  'cron': 'string'
              },
              'scheduledActionDescription': 'string',
              'scheduledActionName': 'string',
              'scheduledActionUuid': 'string',
              'startTime': datetime(2015, 1, 1),
              'state': 'ACTIVE'|'DISABLED',
              'targetAction': {
                  'createSnapshot': {
                      'namespaceName': 'string',
                      'retentionPeriod': 123,
                      'snapshotNamePrefix': 'string',
                      'tags': [
                          {
                              'key': 'string',
                              'value': 'string'
                          },
                      ]
                  }
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **scheduledAction** *(dict) --* 

        The deleted scheduled action object.

        
        

        - **endTime** *(datetime) --* 

          The end time of

          
        

        - **namespaceName** *(string) --* 

          The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.

          
        

        - **nextInvocations** *(list) --* 

          An array of timestamps of when the next scheduled actions will trigger.

          
          

          - *(datetime) --* 
      
        

        - **roleArn** *(string) --* 

          The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots. (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see `Using Identity-Based Policies for Amazon Redshift <https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html>`__ in the Amazon Redshift Management Guide

          
        

        - **schedule** *(dict) --* 

          The schedule for a one-time (at timestamp format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.

           

          
          * Format of at timestamp is ``yyyy-mm-ddThh:mm:ss``. For example, ``2016-03-04T17:27:00``.
           
          * Format of cron expression is ``(Minutes Hours Day-of-month Month Day-of-week Year)``. For example, ``"(0 10 ? * MON *)"``. For more information, see `Cron Expressions <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions>`__ in the *Amazon CloudWatch Events User Guide*.
          

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``at``, ``cron``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                    'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


        
          

          - **at** *(datetime) --* 

            The timestamp of when Amazon Redshift Serverless should run the scheduled action. Timestamp is in UTC. Format of at expression is ``yyyy-mm-ddThh:mm:ss``. For example, ``2016-03-04T17:27:00``.

            
          

          - **cron** *(string) --* 

            The cron expression to use to schedule a recurring scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.

             

            Format of cron expressions is ``(Minutes Hours Day-of-month Month Day-of-week Year)``. For example, ``"(0 10 ? * MON *)"``. For more information, see `Cron Expressions <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions>`__ in the *Amazon CloudWatch Events User Guide*.

            
      
        

        - **scheduledActionDescription** *(string) --* 

          The description of the scheduled action.

          
        

        - **scheduledActionName** *(string) --* 

          The name of the scheduled action.

          
        

        - **scheduledActionUuid** *(string) --* 

          The uuid of the scheduled action.

          
        

        - **startTime** *(datetime) --* 

          The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.

          
        

        - **state** *(string) --* 

          The state of the scheduled action.

          
        

        - **targetAction** *(dict) --* 

          A JSON format string of the Amazon Redshift Serverless API operation with input parameters. The following is an example of a target action.

           

          ``"{"CreateSnapshot": {"NamespaceName": "sampleNamespace","SnapshotName": "sampleSnapshot", "retentionPeriod": "1"}}"``

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``createSnapshot``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                    'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


        
          

          - **createSnapshot** *(dict) --* 

            The parameters that you can use to configure a `scheduled action <https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_CreateScheduledAction.html>`__ to create a snapshot. For more information about creating a scheduled action, see `CreateScheduledAction <https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_CreateScheduledAction.html>`__.

            
            

            - **namespaceName** *(string) --* 

              The name of the namespace for which you want to configure a scheduled action to create a snapshot.

              
            

            - **retentionPeriod** *(integer) --* 

              The retention period of the snapshot created by the scheduled action.

              
            

            - **snapshotNamePrefix** *(string) --* 

              A string prefix that is attached to the name of the snapshot created by the scheduled action. The final name of the snapshot is the string prefix appended by the date and time of when the snapshot was created.

              
            

            - **tags** *(list) --* 

              An array of `Tag objects <https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_Tag.html>`__ to associate with the snapshot.

              
              

              - *(dict) --* 

                A map of key-value pairs.

                
                

                - **key** *(string) --* 

                  The key to use in the tag.

                  
                

                - **value** *(string) --* 

                  The value of the tag.

                  
            
          
        
      
    
  
  **Exceptions**
  
  *   :py:class:`RedshiftServerless.Client.exceptions.InternalServerException`

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

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

  