Causes the environment to restart the application container server running on each Amazon EC2 instance.
Parameters:
-
environment_id
(Optional[EnvironmentId], default:
None
)
–
The ID of the environment to restart the server for.
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 restart the server for.
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 restart application servers
The following operation restarts application servers on all instances in an environment named my-env:
>>> await client.restart_app_server(environment_name='my-env')
Source code in docs_src/capo_elastic_beanstalk/_services/async_elastic_beanstalk.py
| async def restart_app_server(
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>Causes the environment to restart the application container server running on each Amazon EC2 instance.</p>
Args:
environment_id: <p>The ID of the environment to restart the server for.</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 restart the server for.</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.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To restart application servers
The following operation restarts application servers on all instances in an environment named my-env:
>>> await client.restart_app_server(environment_name='my-env')
"""
async def _handler(
req: "AsyncOperationRequest[capo_elastic_beanstalk.types.restart_app_server_message.RestartAppServerMessage]",
) -> AsyncOperationResponse[None]:
import capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.restart_app_server
(
output,
http_response,
) = await capo_elastic_beanstalk._operations.aws_elastic_beanstalk_service.restart_app_server.async_restart_app_server(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("RestartAppServer")
)
input_: capo_elastic_beanstalk.types.restart_app_server_message.RestartAppServerMessage = {}
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
|