toil.lib.ec2nodes
¶
Module Contents¶
Classes¶
Functions¶
|
Determines if a unicode string (that may include commas) is a number. |
|
Parses EC2 JSON storage param string into a number. |
|
Returns EC2 'memory' string as a float. |
|
Downloads and writes the AWS Billing JSON to a file using the AWS pricing API. |
|
Takes a JSON and returns a list of InstanceType objects representing EC2 instance params. |
Generates a new python file of fetchable EC2 Instances by region with current prices and specs. |
Attributes¶
- toil.lib.ec2nodes.logger¶
- toil.lib.ec2nodes.dirname¶
- toil.lib.ec2nodes.EC2Regions¶
- class toil.lib.ec2nodes.InstanceType(name, cores, memory, disks, disk_capacity, architecture)[source]¶
- Parameters:
- __slots__ = ('name', 'cores', 'memory', 'disks', 'disk_capacity', 'architecture')¶
- toil.lib.ec2nodes.isNumber(s)[source]¶
Determines if a unicode string (that may include commas) is a number.
- toil.lib.ec2nodes.parseStorage(storageData)[source]¶
Parses EC2 JSON storage param string into a number.
- Examples:
“2 x 160 SSD” “3 x 2000 HDD” “EBS only” “1 x 410” “8 x 1.9 NVMe SSD” “900 GB NVMe SSD”
- toil.lib.ec2nodes.parseMemory(memAttribute)[source]¶
Returns EC2 ‘memory’ string as a float.
Format should always be ‘#’ GiB (example: ‘244 GiB’ or ‘1,952 GiB’). Amazon loves to put commas in their numbers, so we have to accommodate that. If the syntax ever changes, this will raise.
- toil.lib.ec2nodes.fetchEC2Index(filename)[source]¶
Downloads and writes the AWS Billing JSON to a file using the AWS pricing API.
See: https://aws.amazon.com/blogs/aws/new-aws-price-list-api/
- Returns:
A dict of InstanceType objects, where the key is the string: aws instance name (example: ‘t2.micro’), and the value is an InstanceType object representing that aws instance name.
- Parameters:
filename (str) –
- Return type:
None
- toil.lib.ec2nodes.fetchEC2InstanceDict(awsBillingJson, region)[source]¶
Takes a JSON and returns a list of InstanceType objects representing EC2 instance params.
- Parameters:
- Returns:
- Return type:
Dict[str, InstanceType]