Skip to content

modify_global_cluster

modify_global_cluster(
    *,
    config_overrides: Optional[DocDBClientConfig] = None,
    global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    new_global_cluster_identifier: Optional[GlobalClusterIdentifier] = None,
    deletion_protection: Optional[BooleanOptional] = None,
) -> ModifyGlobalClusterResult

Modify a setting for an Amazon DocumentDB global cluster. You can change one or more configuration parameters (for example: deletion protection), or the global cluster identifier by specifying these parameters and the new values in the request.

This action only applies to Amazon DocumentDB clusters.

Parameters:

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

    The identifier for the global cluster being modified. This parameter isn't case-sensitive.

    Constraints:

    • Must match the identifier of an existing global cluster.

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

    The new identifier for a global cluster when you modify a global cluster. This value is stored as a lowercase string.

    • Must contain from 1 to 63 letters, numbers, or hyphens

      The first character must be a letter

      Can't end with a hyphen or contain two consecutive hyphens

    Example: my-cluster2

  • deletion_protection (Optional[BooleanOptional], default: None ) –

    Indicates if the global cluster has deletion protection enabled. The global cluster can't be deleted when deletion protection is enabled.

Raises:

Source code in docs_src/capo_docdb/_services/doc_db.py
def modify_global_cluster(
    self,
    *,
    config_overrides: Optional[DocDBClientConfig] = None,
    global_cluster_identifier: Optional[
        "capo_docdb.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    new_global_cluster_identifier: Optional[
        "capo_docdb.types.global_cluster_identifier.GlobalClusterIdentifier"
    ] = None,
    deletion_protection: Optional[
        "capo_docdb.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_docdb.types.modify_global_cluster_result.ModifyGlobalClusterResult":
    """<p>Modify a setting for an Amazon DocumentDB global cluster. You can change one or more configuration parameters (for example: deletion protection), or the global cluster identifier by specifying these parameters and the new values in the request.</p> <note> <p>This action only applies to Amazon DocumentDB clusters.</p> </note>

    Args:
        global_cluster_identifier: <p>The identifier for the global cluster being modified. This parameter isn't case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing global cluster.</p> </li> </ul>
        new_global_cluster_identifier: <p>The new identifier for a global cluster when you modify a global cluster. This value is stored as a lowercase string.</p> <ul> <li> <p>Must contain from 1 to 63 letters, numbers, or hyphens</p> <p>The first character must be a letter</p> <p>Can't end with a hyphen or contain two consecutive hyphens</p> </li> </ul> <p>Example: <code>my-cluster2</code> </p>
        deletion_protection: <p>Indicates if the global cluster has deletion protection enabled. The global cluster can't be deleted when deletion protection is enabled. </p>

    Raises:
        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.modify_global_cluster_message.ModifyGlobalClusterMessage]",
    ) -> OperationResponse[
        "capo_docdb.types.modify_global_cluster_result.ModifyGlobalClusterResult"
    ]:
        import capo_docdb._operations.amazon_rd_sv19.modify_global_cluster

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyGlobalCluster")
    )
    input_: capo_docdb.types.modify_global_cluster_message.ModifyGlobalClusterMessage = {}
    if global_cluster_identifier is not None:
        input_["global_cluster_identifier"] = global_cluster_identifier
    if new_global_cluster_identifier is not None:
        input_["new_global_cluster_identifier"] = new_global_cluster_identifier
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection

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