:doc:`Redshift <../../redshift>` / Client / create_usage_limit

******************
create_usage_limit
******************



.. py:method:: Redshift.Client.create_usage_limit(**kwargs)

  

  Creates a usage limit for a specified Amazon Redshift feature on a cluster. The usage limit is identified by the returned usage limit identifier.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateUsageLimit>`_  


  **Request Syntax**
  ::

    response = client.create_usage_limit(
        ClusterIdentifier='string',
        FeatureType='spectrum'|'concurrency-scaling'|'cross-region-datasharing'|'extra-compute-for-automatic-optimization',
        LimitType='time'|'data-scanned',
        Amount=123,
        Period='daily'|'weekly'|'monthly',
        BreachAction='log'|'emit-metric'|'disable',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ClusterIdentifier: string
  :param ClusterIdentifier: **[REQUIRED]** 

    The identifier of the cluster that you want to limit usage.

    

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

    The Amazon Redshift feature that you want to limit.

    

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

    The type of limit. Depending on the feature type, this can be based on a time duration or data size. If ``FeatureType`` is ``spectrum``, then ``LimitType`` must be ``data-scanned``. If ``FeatureType`` is ``concurrency-scaling``, then ``LimitType`` must be ``time``. If ``FeatureType`` is ``cross-region-datasharing``, then ``LimitType`` must be ``data-scanned``. If ``FeatureType`` is ``extra-compute-for-automatic-optimization``, then ``LimitType`` must be ``time``.

    

  
  :type Amount: integer
  :param Amount: **[REQUIRED]** 

    The limit amount. If time-based, this amount is in minutes. If data-based, this amount is in terabytes (TB). The value must be a positive number.

    

  
  :type Period: string
  :param Period: 

    The time period that the amount applies to. A ``weekly`` period begins on Sunday. The default is ``monthly``.

    

  
  :type BreachAction: string
  :param BreachAction: 

    The action that Amazon Redshift takes when the limit is reached. The default is log. For more information about this parameter, see  UsageLimit.

    

  
  :type Tags: list
  :param Tags: 

    A list of tag instances.

    

  
    - *(dict) --* 

      A tag consisting of a name/value pair for a resource.

      

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

        The key, or name, for the resource tag.

        

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

        The value for the resource tag.

        

      
    

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

    
    ::

      {
          'UsageLimitId': 'string',
          'ClusterIdentifier': 'string',
          'FeatureType': 'spectrum'|'concurrency-scaling'|'cross-region-datasharing'|'extra-compute-for-automatic-optimization',
          'LimitType': 'time'|'data-scanned',
          'Amount': 123,
          'Period': 'daily'|'weekly'|'monthly',
          'BreachAction': 'log'|'emit-metric'|'disable',
          'Tags': [
              {
                  'Key': 'string',
                  'Value': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Describes a usage limit object for a cluster.

      
      

      - **UsageLimitId** *(string) --* 

        The identifier of the usage limit.

        
      

      - **ClusterIdentifier** *(string) --* 

        The identifier of the cluster with a usage limit.

        
      

      - **FeatureType** *(string) --* 

        The Amazon Redshift feature to which the limit applies.

        
      

      - **LimitType** *(string) --* 

        The type of limit. Depending on the feature type, this can be based on a time duration or data size.

        
      

      - **Amount** *(integer) --* 

        The limit amount. If time-based, this amount is in minutes. If data-based, this amount is in terabytes (TB).

        
      

      - **Period** *(string) --* 

        The time period that the amount applies to. A ``weekly`` period begins on Sunday. The default is ``monthly``.

        
      

      - **BreachAction** *(string) --* 

        The action that Amazon Redshift takes when the limit is reached. Possible values are:

         

        
        * **log** - To log an event in a system table. The default is log.
         
        * **emit-metric** - To emit CloudWatch metrics.
         
        * **disable** - To disable the feature until the next usage period begins.
        

        
      

      - **Tags** *(list) --* 

        A list of tag instances.

        
        

        - *(dict) --* 

          A tag consisting of a name/value pair for a resource.

          
          

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

            The key, or name, for the resource tag.

            
          

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

            The value for the resource tag.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`Redshift.Client.exceptions.ClusterNotFoundFault`

  
  *   :py:class:`Redshift.Client.exceptions.InvalidClusterStateFault`

  
  *   :py:class:`Redshift.Client.exceptions.LimitExceededFault`

  
  *   :py:class:`Redshift.Client.exceptions.UsageLimitAlreadyExistsFault`

  
  *   :py:class:`Redshift.Client.exceptions.InvalidUsageLimitFault`

  
  *   :py:class:`Redshift.Client.exceptions.TagLimitExceededFault`

  
  *   :py:class:`Redshift.Client.exceptions.UnsupportedOperationFault`

  