How to use the cloudbridge.cloud.interfaces.resources.ObjectLifeCycleMixin function in cloudbridge

To help you get started, we’ve selected a few cloudbridge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
"""
    Standard states for a floating ip.

    :cvar UNKNOWN: Floating IP state unknown.
    :cvar AVAILABLE: Floating IP is available.
    :cvar IN_USE: Floating IP is attached to a device.
    :cvar ERROR: Floating IP is in an error state.
    """
    UNKNOWN = "unknown"
    AVAILABLE = "available"
    IN_USE = "in_use"
    ERROR = "error"


class FloatingIP(ObjectLifeCycleMixin, CloudResource):
    """
    Represents a floating (i.e., static) IP address.
    """
    __metaclass__ = ABCMeta

    @abstractproperty
    def public_ip(self):
        """
        Public IP address.

        :rtype: ``str``
        :return: IP address.
        """
        pass

    @abstractproperty
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
Standard states for a subnet.

    :cvar UNKNOWN: Subnet state unknown.
    :cvar PENDING: Subnet is being created.
    :cvar AVAILABLE: Subnet is available.
    :cvar DOWN: Subnet is not operational.
    :cvar ERROR: Subnet is in error state.
    """
    UNKNOWN = "unknown"
    PENDING = "pending"
    AVAILABLE = "available"
    DOWN = "down"
    ERROR = "error"


class Subnet(ObjectLifeCycleMixin, LabeledCloudResource):
    """
    Represents a subnet, as part of a Network.
    """
    __metaclass__ = ABCMeta

    @LabeledCloudResource.label.setter
    @abstractmethod
    def label(self, value):
        """
        Set the resource label.

        :type value: ``str``
        :param value: The value to set the label to.
        """
        pass
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
:cvar DELETED: Instance is deleted. No further operations possible.
    :cvar STOPPED: Instance is stopped. Instance can be resumed.
    :cvar ERROR: Instance is in an error state. No further operations possible.

    """
    UNKNOWN = "unknown"
    PENDING = "pending"
    CONFIGURING = "configuring"
    RUNNING = "running"
    REBOOTING = "rebooting"
    DELETED = "deleted"
    STOPPED = "stopped"
    ERROR = "error"


class Instance(ObjectLifeCycleMixin, LabeledCloudResource):

    __metaclass__ = ABCMeta

    @LabeledCloudResource.label.setter
    @abstractmethod
    def label(self, value):
        """
        Set the instance label.

        :type value: ``str``
        :param value: The value to set the label to.
        """
        pass

    @abstractproperty
    def public_ips(self):
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
:param is_root: Determines which device will serve as the root device.
                        If more than one device is defined as root, an
                        ``InvalidConfigurationException`` will be thrown.

        :type  size: ``int``
        :param size: The size of the volume to create. An implementation may
                     ignore this parameter for certain sources like 'Volume'.

        :type  delete_on_terminate: ``bool``
        :param delete_on_terminate: Determines whether to delete or keep the
                                    volume on instance termination.
        """
        pass


class MachineImage(ObjectLifeCycleMixin, LabeledCloudResource):

    __metaclass__ = ABCMeta

    @abstractproperty
    def description(self):
        """
        Get the image description.

        :rtype: ``str``
        :return: Description for this image as returned by the cloud
                 middleware.
        """
        pass

    @abstractproperty
    def min_disk(self):
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
Standard states for a network.

    :cvar UNKNOWN: Network state unknown.
    :cvar PENDING: Network is being created.
    :cvar AVAILABLE: Network is available.
    :cvar DOWN: Network is not operational.
    :cvar ERROR: Network is in error state.
    """
    UNKNOWN = "unknown"
    PENDING = "pending"
    AVAILABLE = "available"
    DOWN = "down"
    ERROR = "error"


class Network(ObjectLifeCycleMixin, LabeledCloudResource):
    """
    Represents a software-defined network, like the Virtual Private Cloud.
    """
    __metaclass__ = ABCMeta

    @LabeledCloudResource.label.setter
    @abstractmethod
    def label(self, value):
        """
        Set the resource label.
        """
        pass

    @abstractproperty
    def external(self):
        """
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
is public/a singleton, this operation will do nothing.
        """
        pass

    @abstractproperty
    def floating_ips(self):
        """
        Provides access to floating IPs connected to this internet gateway.

        :rtype: :class:`.FloatingIPSubService`
        :return: A FloatingIPSubService object
        """
        pass


class InternetGateway(ObjectLifeCycleMixin, Gateway):
    """
    Represents an Internet gateway resource.
    """
    __metaclass__ = ABCMeta


class AttachmentInfo(object):
    """
    Contains attachment information for a volume.
    """

    @abstractproperty
    def volume(self):
        """
        Get the volume instance related to this attachment.
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
:cvar DELETED: Instance is deleted. No further operations possible.
    :cvar STOPPED: Instance is stopped. Instance can be resumed.
    :cvar ERROR: Instance is in an error state. No further operations possible.

    """
    UNKNOWN = "unknown"
    PENDING = "pending"
    CONFIGURING = "configuring"
    RUNNING = "running"
    REBOOTING = "rebooting"
    DELETED = "deleted"
    STOPPED = "stopped"
    ERROR = "error"


class Instance(ObjectLifeCycleMixin, LabeledCloudResource):

    __metaclass__ = ABCMeta

    @LabeledCloudResource.label.setter
    @abstractmethod
    def label(self, value):
        """
        Set the instance label.
        """
        pass

    @abstractproperty
    def public_ips(self):
        """
        Get all the public IP addresses for this instance.
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
:cvar AVAILABLE: Volume is available and can be attached to an instance.
    :cvar IN_USE: Volume is attached and in-use.
    :cvar DELETED: Volume has been deleted. No further operations possible.
    :cvar ERROR: Volume is in an error state. No further operations possible.

    """
    UNKNOWN = "unknown"
    CREATING = "creating"
    CONFIGURING = "configuring"
    AVAILABLE = "available"
    IN_USE = "in-use"
    DELETED = "deleted"
    ERROR = "error"


class Volume(ObjectLifeCycleMixin, LabeledCloudResource):
    """
    Represents a block storage device (aka volume).
    """

    __metaclass__ = ABCMeta

    @LabeledCloudResource.label.setter
    @abstractmethod
    def label(self, value):
        """
        Set the volume label.
        """
        pass

    @abstractproperty
    def description(self):
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
:cvar UNKNOWN: Snapshot state unknown.
    :cvar PENDING: Snapshot is pending.
    :cvar CONFIGURING: Snapshot is being configured in some way.
    :cvar AVAILABLE: Snapshot has been completed and is ready for use.
    :cvar ERROR: Snapshot is in an error state. No further operations possible.

    """
    UNKNOWN = "unknown"
    PENDING = "pending"
    CONFIGURING = "configuring"
    AVAILABLE = "available"
    ERROR = "error"


class Snapshot(ObjectLifeCycleMixin, LabeledCloudResource):
    """
    Represents a snapshot of a block storage device.
    """

    __metaclass__ = ABCMeta

    @LabeledCloudResource.label.setter
    @abstractmethod
    def label(self, value):
        """
        Set the snapshot label.
        """
        pass

    @abstractproperty
    def description(self):
github CloudVE / cloudbridge / cloudbridge / cloud / interfaces / resources.py View on Github external
Standard states for a subnet.

    :cvar UNKNOWN: Subnet state unknown.
    :cvar PENDING: Subnet is being created.
    :cvar AVAILABLE: Subnet is available.
    :cvar DOWN: Subnet is not operational.
    :cvar ERROR: Subnet is in error state.
    """
    UNKNOWN = "unknown"
    PENDING = "pending"
    AVAILABLE = "available"
    DOWN = "down"
    ERROR = "error"


class Subnet(ObjectLifeCycleMixin, CloudResource):
    """
    Represents a subnet, as part of a Network.
    """
    __metaclass__ = ABCMeta

    @abstractproperty
    def cidr_block(self):
        """
        A CIDR block for this subnet.

        :rtype: ``str``
        :return: A CIDR block string.
        """
        pass

    @abstractproperty