Skip to content

update_capacity_manager_organizations_access async

update_capacity_manager_organizations_access(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    organizations_access: Optional[BoxedBoolean] = None,
    dry_run: Optional[Boolean] = None,
    client_token: Optional[String] = None,
) -> UpdateCapacityManagerOrganizationsAccessResult

Updates the Organizations access setting for EC2 Capacity Manager. This controls whether Capacity Manager can aggregate data from all accounts in your Amazon Web Services Organization or only from the current account.

Parameters:

  • organizations_access (Optional[BoxedBoolean], default: None ) –

    Specifies whether to enable or disable cross-account access for Amazon Web Services Organizations. When enabled, Capacity Manager aggregates data from all accounts in your organization.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def update_capacity_manager_organizations_access(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    organizations_access: Optional[
        "capo_ec2.types.boxed_boolean.BoxedBoolean"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.update_capacity_manager_organizations_access_result.UpdateCapacityManagerOrganizationsAccessResult":
    """<p> Updates the Organizations access setting for EC2 Capacity Manager. This controls whether Capacity Manager can aggregate data from all accounts in your Amazon Web Services Organization or only from the current account. </p>

    Args:
        organizations_access: <p> Specifies whether to enable or disable cross-account access for Amazon Web Services Organizations. When enabled, Capacity Manager aggregates data from all accounts in your organization. </p>
        dry_run: <p> Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>. </p>
        client_token: <p> Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. </p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.update_capacity_manager_organizations_access_request.UpdateCapacityManagerOrganizationsAccessRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.update_capacity_manager_organizations_access_result.UpdateCapacityManagerOrganizationsAccessResult"
    ]:
        import capo_ec2._operations.amazon_ec2.update_capacity_manager_organizations_access

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.update_capacity_manager_organizations_access.async_update_capacity_manager_organizations_access(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateCapacityManagerOrganizationsAccess"),
    )
    input_: capo_ec2.types.update_capacity_manager_organizations_access_request.UpdateCapacityManagerOrganizationsAccessRequest = {}
    if organizations_access is not None:
        input_["organizations_access"] = organizations_access
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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