Skip to content

promote_read_replica_db_cluster async

promote_read_replica_db_cluster(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_cluster_identifier: Optional[String] = None,
) -> PromoteReadReplicaDBClusterResult

Promotes a read replica DB cluster to a standalone DB cluster.

Parameters:

  • db_cluster_identifier (Optional[String], default: None ) –

    The identifier of the DB cluster read replica to promote. This parameter isn't case-sensitive.

    Constraints:

    • Must match the identifier of an existing DB cluster read replica.

    Example: my-cluster-replica1

Raises:

Source code in docs_src/capo_rds/_services/async_rds.py
async def promote_read_replica_db_cluster(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_cluster_identifier: Optional["capo_rds.types.string.String"] = None,
) -> "capo_rds.types.promote_read_replica_db_cluster_result.PromoteReadReplicaDBClusterResult":
    """<p>Promotes a read replica DB cluster to a standalone DB cluster.</p>

    Args:
        db_cluster_identifier: <p>The identifier of the DB cluster read replica to promote. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing DB cluster read replica.</p> </li> </ul> <p>Example: <code>my-cluster-replica1</code> </p>

    Raises:
        capo_rds.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <code>DBClusterIdentifier</code> doesn't refer to an existing DB cluster.</p>
        capo_rds.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.promote_read_replica_db_cluster_message.PromoteReadReplicaDBClusterMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.promote_read_replica_db_cluster_result.PromoteReadReplicaDBClusterResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.promote_read_replica_db_cluster

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.promote_read_replica_db_cluster.async_promote_read_replica_db_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_rds.types.promote_read_replica_db_cluster_result.PromoteReadReplicaDBClusterResult",
    ) -> dict[str, Any]:
        import capo_rds.types.promote_read_replica_db_cluster_result

        return (
            capo_rds.types.promote_read_replica_db_cluster_result.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "PromoteReadReplicaDBCluster", redact_output=_redact_output
        ),
    )
    input_: capo_rds.types.promote_read_replica_db_cluster_message.PromoteReadReplicaDBClusterMessage = {}
    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