Skip to content

update_farm async

update_farm(
    farm_id: FarmId,
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    display_name: Optional[ResourceName] = None,
    description: Optional[Description] = None,
    cost_scale_factor: Optional[CostScaleFactor] = None,
) -> UpdateFarmResponse

Updates a farm.

Parameters:

  • farm_id (FarmId) –

    The farm ID to update.

  • display_name (Optional[ResourceName], default: None ) –

    The display name of the farm to update.

    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 to update.

    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.

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

Raises:

Source code in docs_src/capo_deadline/_services/async_deadline.py
async def update_farm(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    display_name: Optional["capo_deadline.types.resource_name.ResourceName"] = None,
    description: Optional["capo_deadline.types.description.Description"] = None,
    cost_scale_factor: Optional[
        "capo_deadline.types.cost_scale_factor.CostScaleFactor"
    ] = None,
) -> "capo_deadline.types.update_farm_response.UpdateFarmResponse":
    """<p>Updates a farm.</p>

    Args:
        farm_id: <p>The farm ID to update.</p>
        display_name: <p>The display name of the farm to update.</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 to update.</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>
        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.</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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_deadline.types.update_farm_request.UpdateFarmRequest]",
    ) -> AsyncOperationResponse[
        "capo_deadline.types.update_farm_response.UpdateFarmResponse"
    ]:
        import capo_deadline._operations.deadline.update_farm

        (
            output,
            http_response,
        ) = await capo_deadline._operations.deadline.update_farm.async_update_farm(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

        return capo_deadline.types.update_farm_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFarm", redact_input=_redact_input)
    )
    input_: capo_deadline.types.update_farm_request.UpdateFarmRequest = {
        "farm_id": farm_id
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if cost_scale_factor is not None:
        input_["cost_scale_factor"] = cost_scale_factor

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output