Skip to content

ElastiCacheClient#

Index > ElastiCache > ElastiCacheClient

Auto-generated documentation for ElastiCache type annotations stubs module mypy-boto3-elasticache.

ElastiCacheClient#

Type annotations and code completion for boto3.client("elasticache"). boto3 documentation

# ElastiCacheClient usage example

from boto3.session import Session
from mypy_boto3_elasticache.client import ElastiCacheClient

def get_elasticache_client() -> ElastiCacheClient:
    return Session().client("elasticache")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("elasticache").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("elasticache")

try:
    do_something(client)
except (
    client.exceptions.APICallRateForCustomerExceededFault,
    client.exceptions.AuthorizationAlreadyExistsFault,
    client.exceptions.AuthorizationNotFoundFault,
    client.exceptions.CacheClusterAlreadyExistsFault,
    client.exceptions.CacheClusterNotFoundFault,
    client.exceptions.CacheParameterGroupAlreadyExistsFault,
    client.exceptions.CacheParameterGroupNotFoundFault,
    client.exceptions.CacheParameterGroupQuotaExceededFault,
    client.exceptions.CacheSecurityGroupAlreadyExistsFault,
    client.exceptions.CacheSecurityGroupNotFoundFault,
    client.exceptions.CacheSecurityGroupQuotaExceededFault,
    client.exceptions.CacheSubnetGroupAlreadyExistsFault,
    client.exceptions.CacheSubnetGroupInUse,
    client.exceptions.CacheSubnetGroupNotFoundFault,
    client.exceptions.CacheSubnetGroupQuotaExceededFault,
    client.exceptions.CacheSubnetQuotaExceededFault,
    client.exceptions.ClientError,
    client.exceptions.ClusterQuotaForCustomerExceededFault,
    client.exceptions.DefaultUserAssociatedToUserGroupFault,
    client.exceptions.DefaultUserRequired,
    client.exceptions.DuplicateUserNameFault,
    client.exceptions.GlobalReplicationGroupAlreadyExistsFault,
    client.exceptions.GlobalReplicationGroupNotFoundFault,
    client.exceptions.InsufficientCacheClusterCapacityFault,
    client.exceptions.InvalidARNFault,
    client.exceptions.InvalidCacheClusterStateFault,
    client.exceptions.InvalidCacheParameterGroupStateFault,
    client.exceptions.InvalidCacheSecurityGroupStateFault,
    client.exceptions.InvalidCredentialsException,
    client.exceptions.InvalidGlobalReplicationGroupStateFault,
    client.exceptions.InvalidKMSKeyFault,
    client.exceptions.InvalidParameterCombinationException,
    client.exceptions.InvalidParameterValueException,
    client.exceptions.InvalidReplicationGroupStateFault,
    client.exceptions.InvalidServerlessCacheSnapshotStateFault,
    client.exceptions.InvalidServerlessCacheStateFault,
    client.exceptions.InvalidSnapshotStateFault,
    client.exceptions.InvalidSubnet,
    client.exceptions.InvalidUserGroupStateFault,
    client.exceptions.InvalidUserStateFault,
    client.exceptions.InvalidVPCNetworkStateFault,
    client.exceptions.NoOperationFault,
    client.exceptions.NodeGroupNotFoundFault,
    client.exceptions.NodeGroupsPerReplicationGroupQuotaExceededFault,
    client.exceptions.NodeQuotaForClusterExceededFault,
    client.exceptions.NodeQuotaForCustomerExceededFault,
    client.exceptions.ReplicationGroupAlreadyExistsFault,
    client.exceptions.ReplicationGroupAlreadyUnderMigrationFault,
    client.exceptions.ReplicationGroupNotFoundFault,
    client.exceptions.ReplicationGroupNotUnderMigrationFault,
    client.exceptions.ReservedCacheNodeAlreadyExistsFault,
    client.exceptions.ReservedCacheNodeNotFoundFault,
    client.exceptions.ReservedCacheNodeQuotaExceededFault,
    client.exceptions.ReservedCacheNodesOfferingNotFoundFault,
    client.exceptions.ServerlessCacheAlreadyExistsFault,
    client.exceptions.ServerlessCacheNotFoundFault,
    client.exceptions.ServerlessCacheQuotaForCustomerExceededFault,
    client.exceptions.ServerlessCacheSnapshotAlreadyExistsFault,
    client.exceptions.ServerlessCacheSnapshotNotFoundFault,
    client.exceptions.ServerlessCacheSnapshotQuotaExceededFault,
    client.exceptions.ServiceLinkedRoleNotFoundFault,
    client.exceptions.ServiceUpdateNotFoundFault,
    client.exceptions.SnapshotAlreadyExistsFault,
    client.exceptions.SnapshotFeatureNotSupportedFault,
    client.exceptions.SnapshotNotFoundFault,
    client.exceptions.SnapshotQuotaExceededFault,
    client.exceptions.SubnetInUse,
    client.exceptions.SubnetNotAllowedFault,
    client.exceptions.TagNotFoundFault,
    client.exceptions.TagQuotaPerResourceExceeded,
    client.exceptions.TestFailoverNotAvailableFault,
    client.exceptions.UserAlreadyExistsFault,
    client.exceptions.UserGroupAlreadyExistsFault,
    client.exceptions.UserGroupNotFoundFault,
    client.exceptions.UserGroupQuotaExceededFault,
    client.exceptions.UserNotFoundFault,
    client.exceptions.UserQuotaExceededFault,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_elasticache.client import Exceptions

def handle_error(exc: Exceptions.APICallRateForCustomerExceededFault) -> None:
    ...

Methods#

add_tags_to_resource#

A tag is a key-value pair where the key and value are case-sensitive.

Type annotations and code completion for boto3.client("elasticache").add_tags_to_resource method. boto3 documentation

# add_tags_to_resource method definition

def add_tags_to_resource(
    self,
    *,
    ResourceName: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> TagListMessageTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See TagListMessageTypeDef
# add_tags_to_resource method usage example with argument unpacking

kwargs: AddTagsToResourceMessageRequestTypeDef = {  # (1)
    "ResourceName": ...,
    "Tags": ...,
}

parent.add_tags_to_resource(**kwargs)
  1. See AddTagsToResourceMessageRequestTypeDef

authorize_cache_security_group_ingress#

Allows network ingress to a cache security group.

Type annotations and code completion for boto3.client("elasticache").authorize_cache_security_group_ingress method. boto3 documentation

# authorize_cache_security_group_ingress method definition

def authorize_cache_security_group_ingress(
    self,
    *,
    CacheSecurityGroupName: str,
    EC2SecurityGroupName: str,
    EC2SecurityGroupOwnerId: str,
) -> AuthorizeCacheSecurityGroupIngressResultTypeDef:  # (1)
    ...
  1. See AuthorizeCacheSecurityGroupIngressResultTypeDef
# authorize_cache_security_group_ingress method usage example with argument unpacking

kwargs: AuthorizeCacheSecurityGroupIngressMessageRequestTypeDef = {  # (1)
    "CacheSecurityGroupName": ...,
    "EC2SecurityGroupName": ...,
    "EC2SecurityGroupOwnerId": ...,
}

parent.authorize_cache_security_group_ingress(**kwargs)
  1. See AuthorizeCacheSecurityGroupIngressMessageRequestTypeDef

batch_apply_update_action#

Apply the service update.

Type annotations and code completion for boto3.client("elasticache").batch_apply_update_action method. boto3 documentation

# batch_apply_update_action method definition

def batch_apply_update_action(
    self,
    *,
    ServiceUpdateName: str,
    ReplicationGroupIds: Sequence[str] = ...,
    CacheClusterIds: Sequence[str] = ...,
) -> UpdateActionResultsMessageTypeDef:  # (1)
    ...
  1. See UpdateActionResultsMessageTypeDef
# batch_apply_update_action method usage example with argument unpacking

kwargs: BatchApplyUpdateActionMessageRequestTypeDef = {  # (1)
    "ServiceUpdateName": ...,
}

parent.batch_apply_update_action(**kwargs)
  1. See BatchApplyUpdateActionMessageRequestTypeDef

batch_stop_update_action#

Stop the service update.

Type annotations and code completion for boto3.client("elasticache").batch_stop_update_action method. boto3 documentation

# batch_stop_update_action method definition

def batch_stop_update_action(
    self,
    *,
    ServiceUpdateName: str,
    ReplicationGroupIds: Sequence[str] = ...,
    CacheClusterIds: Sequence[str] = ...,
) -> UpdateActionResultsMessageTypeDef:  # (1)
    ...
  1. See UpdateActionResultsMessageTypeDef
# batch_stop_update_action method usage example with argument unpacking

kwargs: BatchStopUpdateActionMessageRequestTypeDef = {  # (1)
    "ServiceUpdateName": ...,
}

parent.batch_stop_update_action(**kwargs)
  1. See BatchStopUpdateActionMessageRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("elasticache").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("elasticache").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

complete_migration#

Complete the migration of data.

Type annotations and code completion for boto3.client("elasticache").complete_migration method. boto3 documentation

# complete_migration method definition

def complete_migration(
    self,
    *,
    ReplicationGroupId: str,
    Force: bool = ...,
) -> CompleteMigrationResponseTypeDef:  # (1)
    ...
  1. See CompleteMigrationResponseTypeDef
# complete_migration method usage example with argument unpacking

kwargs: CompleteMigrationMessageRequestTypeDef = {  # (1)
    "ReplicationGroupId": ...,
}

parent.complete_migration(**kwargs)
  1. See CompleteMigrationMessageRequestTypeDef

copy_serverless_cache_snapshot#

Creates a copy of an existing serverless cache’s snapshot.

Type annotations and code completion for boto3.client("elasticache").copy_serverless_cache_snapshot method. boto3 documentation

# copy_serverless_cache_snapshot method definition

def copy_serverless_cache_snapshot(
    self,
    *,
    SourceServerlessCacheSnapshotName: str,
    TargetServerlessCacheSnapshotName: str,
    KmsKeyId: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CopyServerlessCacheSnapshotResponseTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CopyServerlessCacheSnapshotResponseTypeDef
# copy_serverless_cache_snapshot method usage example with argument unpacking

kwargs: CopyServerlessCacheSnapshotRequestRequestTypeDef = {  # (1)
    "SourceServerlessCacheSnapshotName": ...,
    "TargetServerlessCacheSnapshotName": ...,
}

parent.copy_serverless_cache_snapshot(**kwargs)
  1. See CopyServerlessCacheSnapshotRequestRequestTypeDef

copy_snapshot#

Makes a copy of an existing snapshot.

Type annotations and code completion for boto3.client("elasticache").copy_snapshot method. boto3 documentation

# copy_snapshot method definition

def copy_snapshot(
    self,
    *,
    SourceSnapshotName: str,
    TargetSnapshotName: str,
    TargetBucket: str = ...,
    KmsKeyId: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CopySnapshotResultTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CopySnapshotResultTypeDef
# copy_snapshot method usage example with argument unpacking

kwargs: CopySnapshotMessageRequestTypeDef = {  # (1)
    "SourceSnapshotName": ...,
    "TargetSnapshotName": ...,
}

parent.copy_snapshot(**kwargs)
  1. See CopySnapshotMessageRequestTypeDef

create_cache_cluster#

Creates a cluster.

Type annotations and code completion for boto3.client("elasticache").create_cache_cluster method. boto3 documentation

# create_cache_cluster method definition

def create_cache_cluster(
    self,
    *,
    CacheClusterId: str,
    ReplicationGroupId: str = ...,
    AZMode: AZModeType = ...,  # (1)
    PreferredAvailabilityZone: str = ...,
    PreferredAvailabilityZones: Sequence[str] = ...,
    NumCacheNodes: int = ...,
    CacheNodeType: str = ...,
    Engine: str = ...,
    EngineVersion: str = ...,
    CacheParameterGroupName: str = ...,
    CacheSubnetGroupName: str = ...,
    CacheSecurityGroupNames: Sequence[str] = ...,
    SecurityGroupIds: Sequence[str] = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (2)
    SnapshotArns: Sequence[str] = ...,
    SnapshotName: str = ...,
    PreferredMaintenanceWindow: str = ...,
    Port: int = ...,
    NotificationTopicArn: str = ...,
    AutoMinorVersionUpgrade: bool = ...,
    SnapshotRetentionLimit: int = ...,
    SnapshotWindow: str = ...,
    AuthToken: str = ...,
    OutpostMode: OutpostModeType = ...,  # (3)
    PreferredOutpostArn: str = ...,
    PreferredOutpostArns: Sequence[str] = ...,
    LogDeliveryConfigurations: