Stops the specified WorkSpaces.
You cannot stop a WorkSpace unless it has a running mode of AutoStop or Manual and a state of AVAILABLE, IMPAIRED, UNHEALTHY, or ERROR.
Parameters:
-
stop_workspace_requests
(StopWorkspaceRequests)
–
The WorkSpaces to stop. You can specify up to 25 WorkSpaces.
Raises:
Source code in docs_src/capo_workspaces/_services/work_spaces.py
| def stop_workspaces(
self,
stop_workspace_requests: "capo_workspaces.types.stop_workspace_requests.StopWorkspaceRequests",
*,
config_overrides: Optional[WorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.stop_workspaces_result.StopWorkspacesResult":
"""<p>Stops the specified WorkSpaces.</p> <p>You cannot stop a WorkSpace unless it has a running mode of <code>AutoStop</code> or <code>Manual</code> and a state of <code>AVAILABLE</code>, <code>IMPAIRED</code>, <code>UNHEALTHY</code>, or <code>ERROR</code>.</p>
Args:
stop_workspace_requests: <p>The WorkSpaces to stop. You can specify up to 25 WorkSpaces.</p>
Raises:
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_workspaces.types.stop_workspaces_request.StopWorkspacesRequest]",
) -> OperationResponse[
"capo_workspaces.types.stop_workspaces_result.StopWorkspacesResult"
]:
import capo_workspaces._operations.workspaces_service.stop_workspaces
output, http_response = (
capo_workspaces._operations.workspaces_service.stop_workspaces.stop_workspaces(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopWorkspaces")
)
input_: capo_workspaces.types.stop_workspaces_request.StopWorkspacesRequest = {
"stop_workspace_requests": stop_workspace_requests
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|