Creates a snapshot of a DB cluster.
Parameters:
-
db_cluster_snapshot_identifier
(Optional[String], default:
None
)
–
The identifier of the DB cluster snapshot. This parameter is stored as a lowercase string.
Constraints:
-
Must contain from 1 to 63 letters, numbers, or hyphens.
-
First character must be a letter.
-
Cannot end with a hyphen or contain two consecutive hyphens.
Example: my-cluster1-snapshot1
-
db_cluster_identifier
(Optional[String], default:
None
)
–
The identifier of the DB cluster to create a snapshot for. This parameter is not case-sensitive.
Constraints:
Example: my-cluster1
-
tags
(Optional[TagList], default:
None
)
–
The tags to be assigned to the DB cluster snapshot.
Raises:
Source code in docs_src/capo_neptune/_services/neptune.py
| def create_db_cluster_snapshot(
self,
*,
config_overrides: Optional[NeptuneClientConfig] = None,
db_cluster_snapshot_identifier: Optional[
"capo_neptune.types.string.String"
] = None,
db_cluster_identifier: Optional["capo_neptune.types.string.String"] = None,
tags: Optional["capo_neptune.types.tag_list.TagList"] = None,
) -> "capo_neptune.types.create_db_cluster_snapshot_result.CreateDBClusterSnapshotResult":
"""<p>Creates a snapshot of a DB cluster.</p>
Args:
db_cluster_snapshot_identifier: <p>The identifier of the DB cluster snapshot. This parameter is stored as a lowercase string.</p> <p>Constraints:</p> <ul> <li> <p>Must contain from 1 to 63 letters, numbers, or hyphens.</p> </li> <li> <p>First character must be a letter.</p> </li> <li> <p>Cannot end with a hyphen or contain two consecutive hyphens.</p> </li> </ul> <p>Example: <code>my-cluster1-snapshot1</code> </p>
db_cluster_identifier: <p>The identifier of the DB cluster to create a snapshot for. This parameter is not case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing DBCluster.</p> </li> </ul> <p>Example: <code>my-cluster1</code> </p>
tags: <p>The tags to be assigned to the DB cluster snapshot.</p>
Raises:
capo_neptune.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.</p>
capo_neptune.errors.db_cluster_snapshot_already_exists_fault.DBClusterSnapshotAlreadyExistsFault: <p>User already has a DB cluster snapshot with the given identifier.</p>
capo_neptune.errors.invalid_db_cluster_snapshot_state_fault.InvalidDBClusterSnapshotStateFault: <p>The supplied value is not a valid DB cluster snapshot state.</p>
capo_neptune.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The DB cluster is not in a valid state.</p>
capo_neptune.errors.snapshot_quota_exceeded_fault.SnapshotQuotaExceededFault: <p>Request would result in user exceeding the allowed number of DB snapshots.</p>
capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_neptune.types.create_db_cluster_snapshot_message.CreateDBClusterSnapshotMessage]",
) -> OperationResponse[
"capo_neptune.types.create_db_cluster_snapshot_result.CreateDBClusterSnapshotResult"
]:
import capo_neptune._operations.amazon_rd_sv19.create_db_cluster_snapshot
output, http_response = (
capo_neptune._operations.amazon_rd_sv19.create_db_cluster_snapshot.create_db_cluster_snapshot(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateDBClusterSnapshot")
)
input_: capo_neptune.types.create_db_cluster_snapshot_message.CreateDBClusterSnapshotMessage = {}
if db_cluster_snapshot_identifier is not None:
input_["db_cluster_snapshot_identifier"] = db_cluster_snapshot_identifier
if db_cluster_identifier is not None:
input_["db_cluster_identifier"] = db_cluster_identifier
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|