src.core.nodefetchers.awsfetcher package

Submodules

src.core.nodefetchers.awsfetcher.awsfetcher module

class src.core.nodefetchers.awsfetcher.awsfetcher.AwsFetcher(**kwargs)[source]

Bases: object

Class for fetching libe backends from AWS

Contains methods to fetch live backends from AWS using the boto3 library To make this class work properly, ep2 config must have aws section with access_key_id and secret_access_token specified along with aws region and ip_type which is required (public or private)

Parameters:**kwargs (dictionary) – Dictionary containing params
fetch()[source]

Method for fetching backends

This method takes help of BotoHandler for fetching backends from AWS and return them to the caller

Returns:List of backends
Return type:list

src.core.nodefetchers.awsfetcher.botohandler module

class src.core.nodefetchers.awsfetcher.botohandler.BotoHandler[source]

Bases: object

Class for handling aws node fetching operations

Methods in this class handle aws operations for retreiving the list of active backends. It first uses boto3 asg client for describing the asg of interest. Once we have the instance ids in that asg, we use ec2 client for describing those instances for getting their public/private ips

static get_auto_scaling_client(**kwargs)[source]

Method for initialising asg boto client

Parameters:**kwargs (object) – kwargs must contains config dictionary, logger object.
Returns:boto3 asg client
Return type:boto3.client
static get_ec2_client(**kwargs)[source]

Method for initialising ec2 boto client

Parameters:**kwargs (object) – kwargs must contains config dictionary, logger object.
Returns:boto3 ec2 client
Return type:boto3.client
static get_instance_ips_for_asg(**kwargs)[source]

Method for getting aws live instance IPs

Parameters:**kwargs (object) – kwargs must contains config dictionary, logger object.
Returns:List of live backend IPs
Return type:list

Module contents