airflow.providers.amazon.aws.hooks.elasticache_replication_group
¶
Module Contents¶
Classes¶
Interact with AWS ElastiCache |
- class airflow.providers.amazon.aws.hooks.elasticache_replication_group.ElastiCacheReplicationGroupHook(max_retries: int = 10, exponential_back_off_factor: float = 1, initial_poke_interval: float = 60, *args, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook
Interact with AWS ElastiCache
- Parameters
max_retries (int) -- Max retries for checking availability of and deleting replication group If this is not supplied then this is defaulted to 10
exponential_back_off_factor (float) -- Multiplication factor for deciding next sleep time If this is not supplied then this is defaulted to 1
initial_poke_interval (float) -- Initial sleep time in seconds If this is not supplied then this is defaulted to 60 seconds
- create_replication_group(self, config: dict) dict [source]¶
Call ElastiCache API for creating a replication group
- delete_replication_group(self, replication_group_id: str) dict [source]¶
Call ElastiCache API for deleting a replication group
- describe_replication_group(self, replication_group_id: str) dict [source]¶
Call ElastiCache API for describing a replication group
- get_replication_group_status(self, replication_group_id: str) str [source]¶
Get current status of replication group
- is_replication_group_available(self, replication_group_id: str) bool [source]¶
Helper for checking if replication group is available or not
- wait_for_availability(self, replication_group_id: str, initial_sleep_time: Optional[float] = None, exponential_back_off_factor: Optional[float] = None, max_retries: Optional[int] = None)[source]¶
Check if replication group is available or not by performing a describe over it
- Parameters
replication_group_id (str) -- ID of replication group to check for availability
initial_sleep_time (float) -- Initial sleep time in seconds If this is not supplied then this is defaulted to class level value
exponential_back_off_factor (float) -- Multiplication factor for deciding next sleep time If this is not supplied then this is defaulted to class level value
max_retries (int) -- Max retries for checking availability of replication group If this is not supplied then this is defaulted to class level value
- Returns
True if replication is available else False
- Return type
- wait_for_deletion(self, replication_group_id: str, initial_sleep_time: Optional[float] = None, exponential_back_off_factor: Optional[float] = None, max_retries: Optional[int] = None)[source]¶
Helper for deleting a replication group ensuring it is either deleted or can't be deleted
- Parameters
replication_group_id (str) -- ID of replication to delete
initial_sleep_time (float) -- Initial sleep time in second If this is not supplied then this is defaulted to class level value
exponential_back_off_factor (float) -- Multiplication factor for deciding next sleep time If this is not supplied then this is defaulted to class level value
max_retries (int) -- Max retries for checking availability of replication group If this is not supplied then this is defaulted to class level value
- Returns
Response from ElastiCache delete replication group API and flag to identify if deleted or not
- Return type
- ensure_delete_replication_group(self, replication_group_id: str, initial_sleep_time: Optional[float] = None, exponential_back_off_factor: Optional[float] = None, max_retries: Optional[int] = None)[source]¶
Delete a replication group ensuring it is either deleted or can't be deleted
- Parameters
replication_group_id (str) -- ID of replication to delete
initial_sleep_time (float) -- Initial sleep time in second If this is not supplied then this is defaulted to class level value
exponential_back_off_factor (float) -- Multiplication factor for deciding next sleep time If this is not supplied then this is defaulted to class level value
max_retries (int) -- Max retries for checking availability of replication group If this is not supplied then this is defaulted to class level value
- Returns
Response from ElastiCache delete replication group API
- Return type
- Raises
AirflowException -- If replication group is not deleted