Stops the running cluster that is specified by DBClusterIdentifier. The cluster must be in the available state. For more information, see Stopping and Starting an Amazon DocumentDB Cluster.
Parameters:
-
db_cluster_identifier
(Optional[String], default:
None
)
–
The identifier of the cluster to stop. Example: docdb-2019-05-28-15-24-52
Raises:
Source code in docs_src/capo_docdb/_services/async_doc_db.py
| async def stop_db_cluster(
self,
*,
config_overrides: Optional[AsyncDocDBClientConfig] = None,
db_cluster_identifier: Optional["capo_docdb.types.string.String"] = None,
) -> "capo_docdb.types.stop_db_cluster_result.StopDBClusterResult":
"""<p>Stops the running cluster that is specified by <code>DBClusterIdentifier</code>. The cluster must be in the <i>available</i> state. For more information, see <a href="https://docs.aws.amazon.com/documentdb/latest/devguide/db-cluster-stop-start.html">Stopping and Starting an Amazon DocumentDB Cluster</a>.</p>
Args:
db_cluster_identifier: <p>The identifier of the cluster to stop. Example: <code>docdb-2019-05-28-15-24-52</code> </p>
Raises:
capo_docdb.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing cluster. </p>
capo_docdb.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The cluster isn't in a valid state.</p>
capo_docdb.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p> The specified instance isn't in the <i>available</i> state. </p>
capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_docdb.types.stop_db_cluster_message.StopDBClusterMessage]",
) -> AsyncOperationResponse[
"capo_docdb.types.stop_db_cluster_result.StopDBClusterResult"
]:
import capo_docdb._operations.amazon_rd_sv19.stop_db_cluster
(
output,
http_response,
) = await capo_docdb._operations.amazon_rd_sv19.stop_db_cluster.async_stop_db_cluster(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopDBCluster")
)
input_: capo_docdb.types.stop_db_cluster_message.StopDBClusterMessage = {}
if db_cluster_identifier is not None:
input_["db_cluster_identifier"] = db_cluster_identifier
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|