Skip to content

update_limit async

update_limit(
    farm_id: FarmId,
    limit_id: LimitId,
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    display_name: Optional[ResourceName] = None,
    description: Optional[Description] = None,
    max_count: Optional[MaxCount] = None,
) -> UpdateLimitResponse

Updates the properties of the specified limit.

Parameters:

  • farm_id (FarmId) –

    The unique identifier of the farm that contains the limit.

  • limit_id (LimitId) –

    The unique identifier of the limit to update.

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

    The new display name of the limit.

    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 new description of the limit.

    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.

  • max_count (Optional[MaxCount], default: None ) –

    The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.

    If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.

    The maxCount must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.

Raises:

Source code in docs_src/capo_deadline/_services/async_deadline.py
async def update_limit(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    limit_id: "capo_deadline.types.limit_id.LimitId",
    *,
    config_overrides: Optional[AsyncdeadlineClientConfig] = None,
    display_name: Optional["capo_deadline.types.resource_name.ResourceName"] = None,
    description: Optional["capo_deadline.types.description.Description"] = None,
    max_count: Optional["capo_deadline.types.max_count.MaxCount"] = None,
) -> "capo_deadline.types.update_limit_response.UpdateLimitResponse":
    """<p>Updates the properties of the specified limit. </p>

    Args:
        farm_id: <p>The unique identifier of the farm that contains the limit.</p>
        limit_id: <p>The unique identifier of the limit to update.</p>
        display_name: <p>The new display name of the limit.</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 new description of the limit.</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>
        max_count: <p>The maximum number of resources constrained by this limit. When all of the resources are in use, steps that require the limit won't be scheduled until the resource is available.</p> <p>If more than the new maximum number is currently in use, running jobs finish but no new jobs are started until the number of resources in use is below the new maximum number.</p> <p>The <code>maxCount</code> must not be 0. If the value is -1, there is no restriction on the number of resources that can be acquired for this limit.</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_limit_request.UpdateLimitRequest]",
    ) -> AsyncOperationResponse[
        "capo_deadline.types.update_limit_response.UpdateLimitResponse"
    ]:
        import capo_deadline._operations.deadline.update_limit

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

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

        return capo_deadline.types.update_limit_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateLimit", redact_input=_redact_input),
    )
    input_: capo_deadline.types.update_limit_request.UpdateLimitRequest = {
        "farm_id": farm_id,
        "limit_id": limit_id,
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if max_count is not None:
        input_["max_count"] = max_count

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