DeadlineCloud / Client / create_budget

create_budget#

DeadlineCloud.Client.create_budget(**kwargs)#

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

See also: AWS API Documentation

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)
        }
    }
)
Parameters:
  • clientToken (string) –

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

    This field is autopopulated if not provided.

  • farmId (string) –

    [REQUIRED]

    The farm ID to include in this budget.

  • usageTrackingResource (dict) –

    [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.

  • displayName (string) –

    [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.

  • description (string) –

    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.

  • approximateDollarLimit (float) –

    [REQUIRED]

    The dollar limit based on consumed usage.

  • actions (list) –

    [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.

  • schedule (dict) –

    [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.

Return type:

dict

Returns:

Response Syntax

{
    'budgetId': 'string'
}

Response Structure

  • (dict) –

    • budgetId (string) –

      The budget ID.

Exceptions

  • DeadlineCloud.Client.exceptions.AccessDeniedException

  • DeadlineCloud.Client.exceptions.InternalServerErrorException

  • DeadlineCloud.Client.exceptions.ResourceNotFoundException

  • DeadlineCloud.Client.exceptions.ThrottlingException

  • DeadlineCloud.Client.exceptions.ValidationException

  • DeadlineCloud.Client.exceptions.ServiceQuotaExceededException