Skip to content

update_compute_quota async

update_compute_quota(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    compute_quota_id: Optional[ComputeQuotaId] = None,
    target_version: Optional[Integer] = None,
    compute_quota_config: Optional[ComputeQuotaConfig] = None,
    compute_quota_target: Optional[ComputeQuotaTarget] = None,
    activation_state: Optional[ActivationState] = None,
    description: Optional[EntityDescription] = None,
) -> UpdateComputeQuotaResponse

Update the compute allocation definition.

Parameters:

  • compute_quota_id (Optional[ComputeQuotaId], default: None ) –

    ID of the compute allocation definition.

  • target_version (Optional[Integer], default: None ) –

    Target version.

  • compute_quota_config (Optional[ComputeQuotaConfig], default: None ) –

    Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.

  • compute_quota_target (Optional[ComputeQuotaTarget], default: None ) –

    The target entity to allocate compute resources to.

  • activation_state (Optional[ActivationState], default: None ) –

    The state of the compute allocation being described. Use to enable or disable compute allocation.

    Default is Enabled.

  • description (Optional[EntityDescription], default: None ) –

    Description of the compute allocation definition.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def update_compute_quota(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    compute_quota_id: Optional[
        "capo_sagemaker.types.compute_quota_id.ComputeQuotaId"
    ] = None,
    target_version: Optional["capo_sagemaker.types.integer.Integer"] = None,
    compute_quota_config: Optional[
        "capo_sagemaker.types.compute_quota_config.ComputeQuotaConfig"
    ] = None,
    compute_quota_target: Optional[
        "capo_sagemaker.types.compute_quota_target.ComputeQuotaTarget"
    ] = None,
    activation_state: Optional[
        "capo_sagemaker.types.activation_state.ActivationState"
    ] = None,
    description: Optional[
        "capo_sagemaker.types.entity_description.EntityDescription"
    ] = None,
) -> (
    "capo_sagemaker.types.update_compute_quota_response.UpdateComputeQuotaResponse"
):
    """<p>Update the compute allocation definition.</p>

    Args:
        compute_quota_id: <p>ID of the compute allocation definition.</p>
        target_version: <p>Target version.</p>
        compute_quota_config: <p>Configuration of the compute allocation definition. This includes the resource sharing option, and the setting to preempt low priority tasks.</p>
        compute_quota_target: <p>The target entity to allocate compute resources to.</p>
        activation_state: <p>The state of the compute allocation being described. Use to enable or disable compute allocation.</p> <p>Default is <code>Enabled</code>.</p>
        description: <p>Description of the compute allocation definition.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_compute_quota_request.UpdateComputeQuotaRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_compute_quota_response.UpdateComputeQuotaResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_compute_quota

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.update_compute_quota.async_update_compute_quota(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateComputeQuota")
    )
    input_: capo_sagemaker.types.update_compute_quota_request.UpdateComputeQuotaRequest = {}
    if compute_quota_id is not None:
        input_["compute_quota_id"] = compute_quota_id
    if target_version is not None:
        input_["target_version"] = target_version
    if compute_quota_config is not None:
        input_["compute_quota_config"] = compute_quota_config
    if compute_quota_target is not None:
        input_["compute_quota_target"] = compute_quota_target
    if activation_state is not None:
        input_["activation_state"] = activation_state
    if description is not None:
        input_["description"] = description

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