Deletes and recreates all of the Amazon Web Services resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.
Parameters:
-
environment_id
(Optional[EnvironmentId], default:
None
)
–
The ID of the environment to rebuild.
Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, Elastic Beanstalk returns MissingRequiredParameter error.
-
environment_name
(Optional[EnvironmentName], default:
None
)
–
The name of the environment to rebuild.
Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, Elastic Beanstalk returns MissingRequiredParameter error.
Raises:
Examples:
To rebuild an environment
The following operation terminates and recreates the resources in an environment named my-env:
>>> await client.rebuild_environment(environment_name='my-env')
Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
| async def rebuild_environment(
self,
*,
config_overrides: Optional[AsyncElasticBeanstalkClientConfig] = None,
environment_id: Optional[
"capo_elastic_beanstalk.types.environment_id.EnvironmentId"
] = None,
environment_name: Optional[
"capo_elastic_beanstalk.types.environment_name.EnvironmentName"
] = None,
) -> None:
"""<p>Deletes and recreates all of the Amazon Web Services resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.</p>
Args:
environment_id: <p>The ID of the environment to rebuild.</p> <p> Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, Elastic Beanstalk returns <code>MissingRequiredParameter</code> error. </p>
environment_name: <p>The name of the environment to rebuild.</p> <p> Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, Elastic Beanstalk returns <code>MissingRequiredParameter</code> error. </p>
Raises:
capo_elastic_beanstalk.errors.insufficient_privileges_exception.InsufficientPrivilegesException: <p>The specified account does not have sufficient privileges for one or more Amazon Web Services services.</p>
capo_elastic_beanstalk.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To rebuild an environment
The following operation terminates and recreates the resources in an environment named my-env:
>>> await client.rebuild_environment(environment_name='my-env')
"""
async def _handler(
req: "AsyncOperationRequest[capo_elastic_beanstalk.types.rebuild_environment_message.RebuildEnvironmentMessage]",
) -> AsyncOperationResponse[None]:
import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.rebuild_environment
(
output,
http_response,
) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.rebuild_environment.async_rebuild_environment(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("RebuildEnvironment")
)
input_: capo_elastic_beanstalk.types.rebuild_environment_message.RebuildEnvironmentMessage = {}
if environment_id is not None:
input_["environment_id"] = environment_id
if environment_name is not None:
input_["environment_name"] = environment_name
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|