Skip to content

update_enrollment_configuration

update_enrollment_configuration(
    status: EnrollmentStatus,
    *,
    config_overrides: Optional[ComputeOptimizerAutomationClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateEnrollmentConfigurationResponse

Updates your account’s Compute Optimizer Automation enrollment configuration.

Parameters:

  • status (EnrollmentStatus) –

    The desired enrollment status.

    • Active - Enables the Automation feature for your account.

    • Inactive - Disables the Automation feature for your account and stops all of your automation rules. If you opt in again later, all rules will be inactive, and you must enable the rules you want to run. You must wait at least 24 hours after opting out to opt in again.

    The Pending and Failed options can't be used to update the enrollment status of an account. They are returned in the response of a request to update the enrollment status of an account.

    If you are a member account, you can't disable Automation while an organization enrollment configuration applies. If no organization enrollment configuration applies, you also can't disable Automation while your organization rule mode is AnyAllowed. Ask your administrator to delete the organization enrollment configuration or disassociate your account, as applicable.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.

Raises:

Source code in docs_src/capo_compute_optimizer_automation/_services/compute_optimizer_automation.py
def update_enrollment_configuration(
    self,
    status: "capo_compute_optimizer_automation.types.enrollment_status.EnrollmentStatus",
    *,
    config_overrides: Optional[ComputeOptimizerAutomationClientConfig] = None,
    client_token: Optional[
        "capo_compute_optimizer_automation.types.client_token.ClientToken"
    ] = None,
) -> "capo_compute_optimizer_automation.types.update_enrollment_configuration_response.UpdateEnrollmentConfigurationResponse":
    """<p>Updates your account’s Compute Optimizer Automation enrollment configuration. </p>

    Args:
        status: <p>The desired enrollment status. </p> <ul> <li> <p>Active - Enables the Automation feature for your account.</p> </li> <li> <p>Inactive - Disables the Automation feature for your account and stops all of your automation rules. If you opt in again later, all rules will be inactive, and you must enable the rules you want to run. You must wait at least 24 hours after opting out to opt in again.</p> </li> </ul> <note> <p>The <code>Pending</code> and <code>Failed</code> options can't be used to update the enrollment status of an account. They are returned in the response of a request to update the enrollment status of an account.</p> <p>If you are a member account, you can't disable Automation while an organization enrollment configuration applies. If no organization enrollment configuration applies, you also can't disable Automation while your organization rule mode is <code>AnyAllowed</code>. Ask your administrator to delete the organization enrollment configuration or disassociate your account, as applicable.</p> </note>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.</p>

    Raises:
        capo_compute_optimizer_automation.errors.access_denied_exception.AccessDeniedException: <p> You do not have sufficient permissions to perform this action. </p>
        capo_compute_optimizer_automation.errors.forbidden_exception.ForbiddenException: <p> You are not authorized to perform this action. </p>
        capo_compute_optimizer_automation.errors.idempotency_token_in_use_exception.IdempotencyTokenInUseException: <p> The specified client token is already in use. </p>
        capo_compute_optimizer_automation.errors.idempotent_parameter_mismatch_exception.IdempotentParameterMismatchException: <p>Exception thrown when the same client token is used with different parameters, indicating a mismatch in idempotent request parameters.</p>
        capo_compute_optimizer_automation.errors.internal_server_exception.InternalServerException: <p> An internal error occurred while processing the request. </p>
        capo_compute_optimizer_automation.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p> One or more parameter values are not valid. </p>
        capo_compute_optimizer_automation.errors.not_management_account_exception.NotManagementAccountException: <p> The operation can only be performed by an organization's management account or a delegated administrator. </p>
        capo_compute_optimizer_automation.errors.opt_in_required_exception.OptInRequiredException: <p> The account must be opted in to Compute Optimizer Automation before performing this action. </p>
        capo_compute_optimizer_automation.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified resource was not found. </p>
        capo_compute_optimizer_automation.errors.service_unavailable_exception.ServiceUnavailableException: <p> The service is temporarily unavailable. </p>
        capo_compute_optimizer_automation.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
        capo_compute_optimizer_automation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_compute_optimizer_automation.types.update_enrollment_configuration_request.UpdateEnrollmentConfigurationRequest]",
    ) -> OperationResponse[
        "capo_compute_optimizer_automation.types.update_enrollment_configuration_response.UpdateEnrollmentConfigurationResponse"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.aws_json1_0.update_enrollment_configuration

            output, http_response = (
                capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.aws_json1_0.update_enrollment_configuration.update_enrollment_configuration(
                    req.options, req.input
                )
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.rpcv2_cbor.update_enrollment_configuration

            output, http_response = (
                capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.rpcv2_cbor.update_enrollment_configuration.update_enrollment_configuration(
                    req.options, req.input
                )
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEnrollmentConfiguration")
    )
    input_: capo_compute_optimizer_automation.types.update_enrollment_configuration_request.UpdateEnrollmentConfigurationRequest = {
        "status": status
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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