class HostNetworkInterface(resources.NetworkInterface):
    """Used for marking devices which are already in use, so that
    we don't offer them for use as Lustre targets."""

    class Meta:
        identifier = ScopedId("host_id", "name")

    name = attributes.String()
    inet4_address = attributes.String()
    inet4_prefix = attributes.Integer(default=0)
    type = attributes.String()
    up = attributes.Boolean()
class HostNetworkInterface(resources.NetworkInterface):
    """Used for marking devices which are already in use, so that
    we don't offer them for use as Lustre targets."""
    class Meta:
        identifier = ScopedId('host_id', 'name')

    name = attributes.String()
    inet4_address = attributes.String()
    inet4_prefix = attributes.Integer(default=0)
    type = attributes.String()
    up = attributes.Boolean()

    rx_bytes = statistics.Counter(units="Bytes/s")
    tx_bytes = statistics.Counter(units="Bytes/s")
class LogicalDrive(BaseStorageResource):
    """A storage device with a fixed size that could be used for installing the Lustre software"""
    class Meta:
        icon = "virtual_disk"

    size = attributes.Bytes()
    filesystem_type = attributes.Boolean(optional=True)

    usable_for_lustre = True
    """ This has to be a class method today because at the point we call it we only has the type not the object"""

    @classmethod
    def device_type(cls):
        """ By default devices are linux block devices """
        return "linux"