:doc:`DeadlineCloud <../../deadline>` / Client / create_budget

*************
create_budget
*************



.. py:method:: DeadlineCloud.Client.create_budget(**kwargs)

  

  Creates a budget to set spending thresholds for your rendering activity.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/deadline-2023-10-12/CreateBudget>`_  


  **Request Syntax**
  ::

    response = client.create_budget(
        clientToken='string',
        farmId='string',
        usageTrackingResource={
            'queueId': 'string'
        },
        displayName='string',
        description='string',
        approximateDollarLimit=...,
        actions=[
            {
                'type': 'STOP_SCHEDULING_AND_COMPLETE_TASKS'|'STOP_SCHEDULING_AND_CANCEL_TASKS',
                'thresholdPercentage': ...,
                'description': 'string'
            },
        ],
        schedule={
            'fixed': {
                'startTime': datetime(2015, 1, 1),
                'endTime': datetime(2015, 1, 1)
            }
        },
        tags={
            'string': 'string'
        }
    )
    
  :type clientToken: string
  :param clientToken: 

    The unique token which the server uses to recognize retries of the same request.

    This field is autopopulated if not provided.

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

    The farm ID to include in this budget.

    

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

    The queue ID provided to this budget to track usage.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``queueId``. 

  
    - **queueId** *(string) --* 

      The queue ID.

      

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

    The display name of the budget.

     

    .. warning::

       

      This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.

      

    

  
  :type description: string
  :param description: 

    The description of the budget.

     

    .. warning::

       

      This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.

      

    

  
  :type approximateDollarLimit: float
  :param approximateDollarLimit: **[REQUIRED]** 

    The dollar limit based on consumed usage.

    

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

    The budget actions to specify what happens when the budget runs out.

    

  
    - *(dict) --* 

      The budget action to add.

      

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

        The type of budget action to add.

        

      
      - **thresholdPercentage** *(float) --* **[REQUIRED]** 

        The percentage threshold for the budget action to add.

        

      
      - **description** *(string) --* 

        A description for the budget action to add.

         

        .. warning::

           

          This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.

          

        

      
    

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

    The schedule to associate with this budget.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``fixed``. 

  
    - **fixed** *(dict) --* 

      The fixed start and end time of the budget's schedule.

      

    
      - **startTime** *(datetime) --* **[REQUIRED]** 

        When the budget starts.

        

      
      - **endTime** *(datetime) --* **[REQUIRED]** 

        When the budget ends.

        

      
    
  
  :type tags: dict
  :param tags: 

    Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

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

    

    - *(dict) --* 
      

      - **budgetId** *(string) --* 

        The budget ID.

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

  
  *   :py:class:`DeadlineCloud.Client.exceptions.InternalServerErrorException`

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

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

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

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

  