Removes one or more nodes from a DAX cluster.
You cannot use DecreaseReplicationFactor to remove the last node in a DAX cluster. If you need to do this, use DeleteCluster instead.
Parameters:
-
cluster_name
(String)
–
The name of the DAX cluster from which you want to remove nodes.
-
new_replication_factor
(Integer)
–
The new number of nodes for the DAX cluster.
-
availability_zones
(Optional[AvailabilityZoneList], default:
None
)
–
The Availability Zone(s) from which to remove nodes.
-
node_ids_to_remove
(Optional[NodeIdentifierList], default:
None
)
–
The unique identifiers of the nodes to be removed from the cluster.
Raises:
Source code in docs_src/capo_dax/_services/async_dax.py
| async def decrease_replication_factor(
self,
cluster_name: "capo_dax.types.string.String",
new_replication_factor: "capo_dax.types.integer.Integer",
*,
config_overrides: Optional[AsyncDAXClientConfig] = None,
availability_zones: Optional[
"capo_dax.types.availability_zone_list.AvailabilityZoneList"
] = None,
node_ids_to_remove: Optional[
"capo_dax.types.node_identifier_list.NodeIdentifierList"
] = None,
) -> "capo_dax.types.decrease_replication_factor_response.DecreaseReplicationFactorResponse":
"""<p>Removes one or more nodes from a DAX cluster.</p> <note> <p>You cannot use <code>DecreaseReplicationFactor</code> to remove the last node in a DAX cluster. If you need to do this, use <code>DeleteCluster</code> instead.</p> </note>
Args:
cluster_name: <p>The name of the DAX cluster from which you want to remove nodes.</p>
new_replication_factor: <p>The new number of nodes for the DAX cluster.</p>
availability_zones: <p>The Availability Zone(s) from which to remove nodes.</p>
node_ids_to_remove: <p>The unique identifiers of the nodes to be removed from the cluster.</p>
Raises:
capo_dax.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The requested cluster ID does not refer to an existing DAX cluster.</p>
capo_dax.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The requested DAX cluster is not in the <i>available</i> state.</p>
capo_dax.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
capo_dax.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
capo_dax.errors.node_not_found_fault.NodeNotFoundFault: <p>None of the nodes in the cluster have the given node ID.</p>
capo_dax.errors.service_linked_role_not_found_fault.ServiceLinkedRoleNotFoundFault: <p>The specified service linked role (SLR) was not found.</p>
capo_dax.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_dax.types.decrease_replication_factor_request.DecreaseReplicationFactorRequest]",
) -> AsyncOperationResponse[
"capo_dax.types.decrease_replication_factor_response.DecreaseReplicationFactorResponse"
]:
import capo_dax._operations.amazon_daxv3.decrease_replication_factor
(
output,
http_response,
) = await capo_dax._operations.amazon_daxv3.decrease_replication_factor.async_decrease_replication_factor(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DecreaseReplicationFactor")
)
input_: capo_dax.types.decrease_replication_factor_request.DecreaseReplicationFactorRequest = {
"cluster_name": cluster_name,
"new_replication_factor": new_replication_factor,
}
if availability_zones is not None:
input_["availability_zones"] = availability_zones
if node_ids_to_remove is not None:
input_["node_ids_to_remove"] = node_ids_to_remove
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|