Skip to content

update_model async

update_model(
    model_name: ModelName,
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    labels_input_configuration: Optional[LabelsInputConfiguration] = None,
    role_arn: Optional[IamRoleArn] = None,
    model_diagnostics_output_configuration: Optional[
        ModelDiagnosticsOutputConfiguration
    ] = None,
) -> None

Updates a model in the account.

Parameters:

  • model_name (ModelName) –

    The name of the model to update.

  • role_arn (Optional[IamRoleArn], default: None ) –

    The ARN of the model to update.

  • model_diagnostics_output_configuration (Optional[ModelDiagnosticsOutputConfiguration], default: None ) –

    The Amazon S3 location where you want Amazon Lookout for Equipment to save the pointwise model diagnostics for the model. You must also specify the RoleArn request parameter.

Raises:

  • AccessDeniedException –

    The request could not be completed because you do not have access to the resource.

  • ConflictException –

    The request could not be completed due to a conflict with the current state of the target resource.

  • InternalServerException –

    Processing of the request has failed because of an unknown error, exception or failure.

  • ResourceNotFoundException –

    The resource requested could not be found. Verify the resource ID and retry your request.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized.

  • UnknownServiceError –

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

Examples:

Updates a model

>>> await client.update_model(model_name='sample-model', labels_input_configuration={'LabelGroupName': 'sample-label-group'})
Source code in docs_src/capo_lookoutequipment/_services/async_lookout_equipment.py
async def update_model(
    self,
    model_name: "capo_lookoutequipment.types.model_name.ModelName",
    *,
    config_overrides: Optional[AsyncLookoutEquipmentClientConfig] = None,
    labels_input_configuration: Optional[
        "capo_lookoutequipment.types.labels_input_configuration.LabelsInputConfiguration"
    ] = None,
    role_arn: Optional[
        "capo_lookoutequipment.types.iam_role_arn.IamRoleArn"
    ] = None,
    model_diagnostics_output_configuration: Optional[
        "capo_lookoutequipment.types.model_diagnostics_output_configuration.ModelDiagnosticsOutputConfiguration"
    ] = None,
) -> None:
    """<p>Updates a model in the account.</p>

    Args:
        model_name: <p>The name of the model to update.</p>
        role_arn: <p>The ARN of the model to update.</p>
        model_diagnostics_output_configuration: <p>The Amazon S3 location where you want Amazon Lookout for Equipment to save the pointwise model diagnostics for the model. You must also specify the <code>RoleArn</code> request parameter.</p>

    Raises:
        capo_lookoutequipment.errors.access_denied_exception.AccessDeniedException: <p>The request could not be completed because you do not have access to the resource. </p>
        capo_lookoutequipment.errors.conflict_exception.ConflictException: <p> The request could not be completed due to a conflict with the current state of the target resource. </p>
        capo_lookoutequipment.errors.internal_server_exception.InternalServerException: <p> Processing of the request has failed because of an unknown error, exception or failure. </p>
        capo_lookoutequipment.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource requested could not be found. Verify the resource ID and retry your request. </p>
        capo_lookoutequipment.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_lookoutequipment.errors.validation_exception.ValidationException: <p> The input fails to satisfy constraints specified by Amazon Lookout for Equipment or a related Amazon Web Services service that's being utilized. </p>
        capo_lookoutequipment.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Updates a model

        >>> await client.update_model(model_name='sample-model', labels_input_configuration={'LabelGroupName': 'sample-label-group'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lookoutequipment.types.update_model_request.UpdateModelRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.update_model

        (
            output,
            http_response,
        ) = await capo_lookoutequipment._operations.aws_lookout_equipment_frontend_service.update_model.async_update_model(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateModel")
    )
    input_: capo_lookoutequipment.types.update_model_request.UpdateModelRequest = {
        "model_name": model_name
    }
    if labels_input_configuration is not None:
        input_["labels_input_configuration"] = labels_input_configuration
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if model_diagnostics_output_configuration is not None:
        input_["model_diagnostics_output_configuration"] = (
            model_diagnostics_output_configuration
        )

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