Skip to content

decrease_node_groups_in_global_replication_group async

decrease_node_groups_in_global_replication_group(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    global_replication_group_id: Optional[String] = None,
    node_group_count: Optional[Integer] = None,
    global_node_groups_to_remove: Optional[GlobalNodeGroupIdList] = None,
    global_node_groups_to_retain: Optional[GlobalNodeGroupIdList] = None,
    apply_immediately: Optional[Boolean] = None,
) -> DecreaseNodeGroupsInGlobalReplicationGroupResult

Decreases the number of node groups in a Global datastore

Parameters:

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

    The name of the Global datastore

  • node_group_count (Optional[Integer], default: None ) –

    The number of node groups (shards) that results from the modification of the shard configuration

  • global_node_groups_to_remove (Optional[GlobalNodeGroupIdList], default: None ) –

    If the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. GlobalNodeGroupsToRemove is a list of NodeGroupIds to remove from the cluster. ElastiCache will attempt to remove all node groups listed by GlobalNodeGroupsToRemove from the cluster.

  • global_node_groups_to_retain (Optional[GlobalNodeGroupIdList], default: None ) –

    If the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. GlobalNodeGroupsToRetain is a list of NodeGroupIds to retain from the cluster. ElastiCache will attempt to retain all node groups listed by GlobalNodeGroupsToRetain from the cluster.

  • apply_immediately (Optional[Boolean], default: None ) –

    Indicates that the shard reconfiguration process begins immediately. At present, the only permitted value for this parameter is true.

Raises:

Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def decrease_node_groups_in_global_replication_group(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    global_replication_group_id: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    node_group_count: Optional["capo_elasticache.types.integer.Integer"] = None,
    global_node_groups_to_remove: Optional[
        "capo_elasticache.types.global_node_group_id_list.GlobalNodeGroupIdList"
    ] = None,
    global_node_groups_to_retain: Optional[
        "capo_elasticache.types.global_node_group_id_list.GlobalNodeGroupIdList"
    ] = None,
    apply_immediately: Optional["capo_elasticache.types.boolean.Boolean"] = None,
) -> "capo_elasticache.types.decrease_node_groups_in_global_replication_group_result.DecreaseNodeGroupsInGlobalReplicationGroupResult":
    """<p>Decreases the number of node groups in a Global datastore</p>

    Args:
        global_replication_group_id: <p>The name of the Global datastore</p>
        node_group_count: <p>The number of node groups (shards) that results from the modification of the shard configuration</p>
        global_node_groups_to_remove: <p>If the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. GlobalNodeGroupsToRemove is a list of NodeGroupIds to remove from the cluster. ElastiCache will attempt to remove all node groups listed by GlobalNodeGroupsToRemove from the cluster. </p>
        global_node_groups_to_retain: <p>If the value of NodeGroupCount is less than the current number of node groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is required. GlobalNodeGroupsToRetain is a list of NodeGroupIds to retain from the cluster. ElastiCache will attempt to retain all node groups listed by GlobalNodeGroupsToRetain from the cluster. </p>
        apply_immediately: <p>Indicates that the shard reconfiguration process begins immediately. At present, the only permitted value for this parameter is true. </p>

    Raises:
        capo_elasticache.errors.global_replication_group_not_found_fault.GlobalReplicationGroupNotFoundFault: <p>The Global datastore does not exist</p>
        capo_elasticache.errors.invalid_global_replication_group_state_fault.InvalidGlobalReplicationGroupStateFault: <p>The Global datastore is not available or in primary-only state.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.decrease_node_groups_in_global_replication_group_message.DecreaseNodeGroupsInGlobalReplicationGroupMessage]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.decrease_node_groups_in_global_replication_group_result.DecreaseNodeGroupsInGlobalReplicationGroupResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.decrease_node_groups_in_global_replication_group

        (
            output,
            http_response,
        ) = await capo_elasticache._operations.amazon_elasti_cache_v9.decrease_node_groups_in_global_replication_group.async_decrease_node_groups_in_global_replication_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DecreaseNodeGroupsInGlobalReplicationGroup"),
    )
    input_: capo_elasticache.types.decrease_node_groups_in_global_replication_group_message.DecreaseNodeGroupsInGlobalReplicationGroupMessage = {}
    if global_replication_group_id is not None:
        input_["global_replication_group_id"] = global_replication_group_id
    if node_group_count is not None:
        input_["node_group_count"] = node_group_count
    if global_node_groups_to_remove is not None:
        input_["global_node_groups_to_remove"] = global_node_groups_to_remove
    if global_node_groups_to_retain is not None:
        input_["global_node_groups_to_retain"] = global_node_groups_to_retain
    if apply_immediately is not None:
        input_["apply_immediately"] = apply_immediately

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output