Exemplo n.º 1
0
Arquivo: models.py Projeto: oksbsb/lcm
class VMImport(Model):
    name = StringType(serialized_name='NAME', required=True)
    os = StringType(serialized_name='OS', required=True)
    launch_server = StringType(serialized_name='LAUNCH_SERVER', required=True)
    userid = IntType(serialized_name='USERID', required=True)
    product_specification_lcuuid = UUIDType(
        serialized_name='PRODUCT_SPECIFICATION_LCUUID', required=True)
    domain = UUIDType(required=True, serialized_name='DOMAIN')
Exemplo n.º 2
0
Arquivo: models.py Projeto: oksbsb/lcm
class VmPlanRequest(Model):
    """VM plan price request structure
    """
    cpu = IntType(required=True, serialized_name='CPU')
    memory = IntType(required=True, serialized_name='MEMORY')
    disk = IntType(required=True, serialized_name='DISK')
    domain = UUIDType(serialized_name='DOMAIN')
Exemplo n.º 3
0
Arquivo: models.py Projeto: oksbsb/lcm
class BackupChargeAdd(Model):
    """Backup Charge add structure
    """
    name = StringType(required=True, serialized_name='NAME')
    userid = IntType(required=True, serialized_name='USERID')
    start_time = StringType(required=True, serialized_name='START_TIME')
    size = IntType(required=True, serialized_name='SIZE')
    domain = UUIDType(serialized_name='DOMAIN', required=True)
    charge_mode = IntType(required=True, serialized_name='CHARGE_MODE')
    price = IntType(required=True, serialized_name='PRICE')
Exemplo n.º 4
0
Arquivo: models.py Projeto: oksbsb/lcm
class PyagexecStorage(Model):
    pool_name = StringType(required=True, serialized_name='POOL_NAME')
    uuid = UUIDType(serialized_name='UUID')
    total_size = IntType(required=True, serialized_name='TOTAL_SIZE')
    used_size = IntType(required=True, serialized_name='USED_SIZE')

    def validate_used_size(self, data, value):
        if data['total_size'] < value or value < 0:
            raise ValidationError('0 <= used_size <= total_size')
        return value
Exemplo n.º 5
0
Arquivo: models.py Projeto: oksbsb/lcm
class StorageAdd(Model):
    """Storage add model structure
    """
    _backends = ['CEPH_RBD']
    backends = string_enum(*_backends)
    backends_dict = dict(zip(_backends, [1]))

    _types = ['CAPACITY', 'PERFORMANCE']
    types = string_enum(*_types)

    name = StringType(required=True, serialized_name='NAME')
    uuid = UUIDType(serialized_name='UUID')
    disk_total = IntType(required=True, serialized_name='DISK_TOTAL')
    disk_used = IntType(required=True, serialized_name='DISK_USED')
    backend = StringType(required=True,
                         serialized_name='BACKEND',
                         choices=_backends)
    hosts = ListType(IPv4Type, serialized_name='HOSTS', default=[])
    type = StringType(required=True, serialized_name='TYPE', choices=_types)
    domain = UUIDType(serialized_name='DOMAIN', required=True)
Exemplo n.º 6
0
class OwnedModelMixin(Model):
    """This class standardizes the approach to expressing ownership of data
    """
    owner_id = UUIDType(required=True)
    owner_username = StringType(max_length=30, required=True)
Exemplo n.º 7
0
Arquivo: models.py Projeto: oksbsb/lcm
class PriceRequest(Model):
    """Price request structure
    """
    name = StringType(serialized_name='NAME', required=True)
    quantity = StringType(serialized_name='QUANTITY', required=True)
    domain = UUIDType(serialized_name='DOMAIN', required=True)
Exemplo n.º 8
0
Arquivo: models.py Projeto: oksbsb/lcm
class VolImport(Model):
    name = StringType(serialized_name='NAME', required=True)
    storage_lcuuid = UUIDType(serialized_name='STORAGE_LCUUID', required=True)
    user_lcuuid = StringType(serialized_name='USER_LCUUID', required=True)
    product_specification_lcuuid = UUIDType(
        serialized_name='PRODUCT_SPECIFICATION_LCUUID', required=True)