Skip to content

apply_environment_managed_action async

apply_environment_managed_action(
    action_id: String,
    *,
    config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
    environment_name: Optional[String] = None,
    environment_id: Optional[String] = None,
) -> ApplyEnvironmentManagedActionResult

Applies a scheduled managed action immediately. A managed action can be applied only if its status is Scheduled. Get the status and action ID of a managed action with DescribeEnvironmentManagedActions.

Parameters:

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

    The name of the target environment.

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

    The environment ID of the target environment.

  • action_id (String) –

    The action ID of the scheduled managed action to execute.

Raises:

Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
async def apply_environment_managed_action(
    self,
    action_id: "capo_elastic_beanstalk.types.string.String",
    *,
    config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
    environment_name: Optional["capo_elastic_beanstalk.types.string.String"] = None,
    environment_id: Optional["capo_elastic_beanstalk.types.string.String"] = None,
) -> "capo_elastic_beanstalk.types.apply_environment_managed_action_result.ApplyEnvironmentManagedActionResult":
    """<p>Applies a scheduled managed action immediately. A managed action can be applied only if its status is <code>Scheduled</code>. Get the status and action ID of a managed action with <a>DescribeEnvironmentManagedActions</a>.</p>

    Args:
        environment_name: <p>The name of the target environment.</p>
        environment_id: <p>The environment ID of the target environment.</p>
        action_id: <p>The action ID of the scheduled managed action to execute.</p>

    Raises:
        capo_elastic_beanstalk.errors.elastic_beanstalk_service_exception.ElasticBeanstalkServiceException: <p>A generic service exception has occurred.</p>
        capo_elastic_beanstalk.errors.managed_action_invalid_state_exception.ManagedActionInvalidStateException: <p>Cannot modify the managed action in its current state.</p>
        capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_beanstalk.types.apply_environment_managed_action_request.ApplyEnvironmentManagedActionRequest]",
    ) -> AsyncOperationResponse[
        "capo_elastic_beanstalk.types.apply_environment_managed_action_result.ApplyEnvironmentManagedActionResult"
    ]:
        import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.apply_environment_managed_action

        (
            output,
            http_response,
        ) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.apply_environment_managed_action.async_apply_environment_managed_action(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ApplyEnvironmentManagedAction")
    )
    input_: capo_elastic_beanstalk.types.apply_environment_managed_action_request.ApplyEnvironmentManagedActionRequest = {
        "action_id": action_id
    }
    if environment_name is not None:
        input_["environment_name"] = environment_name
    if environment_id is not None:
        input_["environment_id"] = environment_id

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