Skip to content

remove_from_global_cluster

remove_from_global_cluster(
    *,
    config_overrides: Optional[DocDBClientConfig] = None,
    global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    db_cluster_identifier: Optional[String] = None,
) -> RemoveFromGlobalClusterResult

Detaches an Amazon DocumentDB secondary cluster from a global cluster. The cluster becomes a standalone cluster with read-write capability instead of being read-only and receiving data from a primary in a different region.

This action only applies to Amazon DocumentDB clusters.

Parameters:

  • global_cluster_identifier (Optional[GlobalClusterIdentifier], default: None ) –

    The cluster identifier to detach from the Amazon DocumentDB global cluster.

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

    The Amazon Resource Name (ARN) identifying the cluster that was detached from the Amazon DocumentDB global cluster.

Raises:

Source code in docs_src/capo_docdb/_services/doc_db.py
def remove_from_global_cluster(
    self,
    *,
    config_overrides: Optional[DocDBClientConfig] = None,
    global_cluster_identifier: Optional[
        "capo_docdb.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    db_cluster_identifier: Optional["capo_docdb.types.string.String"] = None,
) -> "capo_docdb.types.remove_from_global_cluster_result.RemoveFromGlobalClusterResult":
    """<p>Detaches an Amazon DocumentDB secondary cluster from a global cluster. The cluster becomes a standalone cluster with read-write capability instead of being read-only and receiving data from a primary in a different region. </p> <note> <p>This action only applies to Amazon DocumentDB clusters.</p> </note>

    Args:
        global_cluster_identifier: <p>The cluster identifier to detach from the Amazon DocumentDB global cluster. </p>
        db_cluster_identifier: <p>The Amazon Resource Name (ARN) identifying the cluster that was detached from the Amazon DocumentDB global cluster. </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.global_cluster_not_found_fault.GlobalClusterNotFoundFault: <p>The <code>GlobalClusterIdentifier</code> doesn't refer to an existing global cluster.</p>
        capo_docdb.errors.invalid_global_cluster_state_fault.InvalidGlobalClusterStateFault: <p>The requested operation can't be performed while the cluster is in this state.</p>
        capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_docdb.types.remove_from_global_cluster_message.RemoveFromGlobalClusterMessage]",
    ) -> OperationResponse[
        "capo_docdb.types.remove_from_global_cluster_result.RemoveFromGlobalClusterResult"
    ]:
        import capo_docdb._operations.amazon_rd_sv19.remove_from_global_cluster

        output, http_response = (
            capo_docdb._operations.amazon_rd_sv19.remove_from_global_cluster.remove_from_global_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveFromGlobalCluster")
    )
    input_: capo_docdb.types.remove_from_global_cluster_message.RemoveFromGlobalClusterMessage = {}
    if global_cluster_identifier is not None:
        input_["global_cluster_identifier"] = global_cluster_identifier
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output