fluxcloud.main.cloud package

Submodules

fluxcloud.main.cloud.base module

class fluxcloud.main.cloud.base.CloudData(items)[source]

Bases: object

An “abstract” class that stores a single data object

This also stores the encoder for any cloud object so we can encode it.

Encoder

alias of fluxcloud.main.cloud.base.CloudDataEncoder

create_lookup()[source]

If we have a name attribute and a list of data, cache a lookup for later

class fluxcloud.main.cloud.base.CloudDataEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

Make our group and instance classes json serializable.

Always return the data!

default(o)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class fluxcloud.main.cloud.base.CloudProvider[source]

Bases: object

A base class for a cloud provider

fail_message(message)[source]

Shared message and empty return if auth not set

instances()[source]

Retrieve all instances for a cloud.

load_instances(data)[source]

Load instance data from json.

name = 'cloud'
class fluxcloud.main.cloud.base.Instance(items)[source]

Bases: fluxcloud.main.cloud.base.CloudData

Base of an instance.

This class defines the different common attributes that we want to expose. If a cloud instance (json) result differs, it should override this function.

attr_description()[source]
attr_zone()[source]
property attribute_getters

function names we can call to get an instance attribute.

property cloud

Return the name of the cloud (module) derived from path.

generate_row()[source]

Given an instance name, return a row with the cloud name and other attributes.

property name
class fluxcloud.main.cloud.base.InstanceGroup(items)[source]

Bases: fluxcloud.main.cloud.base.CloudData

A cloud instance group.

An instance group stores raw data, and allows for query or other interaction over instances.

Instance

alias of dict

add_instance_prices(prices)[source]

Add pricing information to instances

filter_region(region)[source]

Filter by a region (not required)

generate_row(name)[source]

Given an instance name, return a row with the cloud name and other attributes.

iter_instances()[source]

Each client knows how to instantiate its instance type

class fluxcloud.main.cloud.base.Prices(items)[source]

Bases: fluxcloud.main.cloud.base.CloudData

Cloud pricing

Module contents