Deletes the specified configuration types from an organization enrollment configuration. After deletion, Automation stays enabled for affected accounts and earlier account associations aren't restored. Affected accounts inherit the organization rule mode from the closest parent that has an organization enrollment configuration, or get None allowed if no parent has one.
Only the management account or a delegated administrator can perform this action.
Parameters:
-
target
(OrganizationTarget)
–
The account, organizational unit (OU), or organization root whose organization enrollment configuration you want to delete.
-
configuration_types
(OrganizationEnrollmentConfigurationTypes)
–
The organization enrollment configuration types to delete from the target.
-
client_token
(Optional[ClientToken], default:
None
)
–
A unique identifier to ensure idempotency of the request.
Raises:
Source code in docs_src/capo_compute_optimizer_automation/_services/compute_optimizer_automation.py
| def delete_organization_enrollment_configuration(
self,
target: "capo_compute_optimizer_automation.types.organization_target.OrganizationTarget",
configuration_types: "capo_compute_optimizer_automation.types.organization_enrollment_configuration_types.OrganizationEnrollmentConfigurationTypes",
*,
config_overrides: Optional[ComputeOptimizerAutomationClientConfig] = None,
client_token: Optional[
"capo_compute_optimizer_automation.types.client_token.ClientToken"
] = None,
) -> "capo_compute_optimizer_automation.types.delete_organization_enrollment_configuration_response.DeleteOrganizationEnrollmentConfigurationResponse":
"""<p> Deletes the specified configuration types from an organization enrollment configuration. After deletion, Automation stays enabled for affected accounts and earlier account associations aren't restored. Affected accounts inherit the organization rule mode from the closest parent that has an organization enrollment configuration, or get None allowed if no parent has one. </p> <note> <p>Only the management account or a delegated administrator can perform this action.</p> </note>
Args:
target: <p> The account, organizational unit (OU), or organization root whose organization enrollment configuration you want to delete. </p>
configuration_types: <p> The organization enrollment configuration types to delete from the target. </p>
client_token: <p> A unique identifier to ensure idempotency of the request. </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.conflict_exception.ConflictException: <p> The request conflicts with a concurrent change to the same resource. Retry the request. </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.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.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.delete_organization_enrollment_configuration_request.DeleteOrganizationEnrollmentConfigurationRequest]",
) -> OperationResponse[
"capo_compute_optimizer_automation.types.delete_organization_enrollment_configuration_response.DeleteOrganizationEnrollmentConfigurationResponse"
]:
if req.options.protocol == "awsJson1_0":
import capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.aws_json1_0.delete_organization_enrollment_configuration
output, http_response = (
capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.aws_json1_0.delete_organization_enrollment_configuration.delete_organization_enrollment_configuration(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.rpcv2_cbor.delete_organization_enrollment_configuration
output, http_response = (
capo_compute_optimizer_automation._operations.compute_optimizer_automation_service.rpcv2_cbor.delete_organization_enrollment_configuration.delete_organization_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("DeleteOrganizationEnrollmentConfiguration"),
)
input_: capo_compute_optimizer_automation.types.delete_organization_enrollment_configuration_request.DeleteOrganizationEnrollmentConfigurationRequest = {
"target": target,
"configuration_types": configuration_types,
}
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
|