Skip to content

create_farm

create_farm(
    display_name: ResourceName,
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
    cost_scale_factor: Optional[CostScaleFactor] = None,
    tags: Optional[Tags] = None,
) -> CreateFarmResponse

Creates a farm to allow space for queues and fleets. Farms are the space where the components of your renders gather and are pieced together in the cloud. Farms contain budgets and allow you to enforce permissions. Deadline Cloud farms are a useful container for large projects.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

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

  • display_name (ResourceName) –

    The display name of the farm.

    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 (Optional[Description], default: None ) –

    The description of the farm.

    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.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The ARN of the KMS key to use on the farm.

  • cost_scale_factor (Optional[CostScaleFactor], default: None ) –

    A multiplier applied to the farm's calculated costs for usage data and budget tracking. A value less than 1 represents a discount, a value greater than 1 represents a premium, and a value of 1 represents no adjustment. The default value is 1.

  • tags (Optional[Tags], default: None ) –

    The tags to add to your farm. 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.

Raises:

Source code in docs_src/capo_deadline/_services/deadline.py
def create_farm(
    self,
    display_name: "capo_deadline.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    client_token: Optional["capo_deadline.types.client_token.ClientToken"] = None,
    description: Optional["capo_deadline.types.description.Description"] = None,
    kms_key_arn: Optional["capo_deadline.types.kms_key_arn.KmsKeyArn"] = None,
    cost_scale_factor: Optional[
        "capo_deadline.types.cost_scale_factor.CostScaleFactor"
    ] = None,
    tags: Optional["capo_deadline.types.tags.Tags"] = None,
) -> "capo_deadline.types.create_farm_response.CreateFarmResponse":
    """<p>Creates a farm to allow space for queues and fleets. Farms are the space where the components of your renders gather and are pieced together in the cloud. Farms contain budgets and allow you to enforce permissions. Deadline Cloud farms are a useful container for large projects.</p>

    Args:
        client_token: <p>The unique token which the server uses to recognize retries of the same request.</p>
        display_name: <p>The display name of the farm.</p> <important> <p>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.</p> </important>
        description: <p>The description of the farm.</p> <important> <p>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.</p> </important>
        kms_key_arn: <p>The ARN of the KMS key to use on the farm.</p>
        cost_scale_factor: <p>A multiplier applied to the farm's calculated costs for usage data and budget tracking. A value less than 1 represents a discount, a value greater than 1 represents a premium, and a value of 1 represents no adjustment. The default value is 1.</p>
        tags: <p>The tags to add to your farm. 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.</p>

    Raises:
        capo_deadline.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_deadline.errors.internal_server_error_exception.InternalServerErrorException: <p>Deadline Cloud can't process your request right now. Try again later.</p>
        capo_deadline.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_deadline.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your Amazon Web Services account.</p>
        capo_deadline.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota.</p>
        capo_deadline.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_deadline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_deadline.types.create_farm_request.CreateFarmRequest]",
    ) -> OperationResponse[
        "capo_deadline.types.create_farm_response.CreateFarmResponse"
    ]:
        import capo_deadline._operations.deadline.create_farm

        output, http_response = (
            capo_deadline._operations.deadline.create_farm.create_farm(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_deadline.types.create_farm_request.CreateFarmRequest",
    ) -> dict[str, Any]:
        import capo_deadline.types.create_farm_request

        return capo_deadline.types.create_farm_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFarm", redact_input=_redact_input)
    )
    input_: capo_deadline.types.create_farm_request.CreateFarmRequest = {
        "display_name": display_name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if cost_scale_factor is not None:
        input_["cost_scale_factor"] = cost_scale_factor
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output