Пример #1
0
    class Schema(model.Schema):
        object_id = model.PrimaryKey('id')
        name = model.String(required=True)
        security_groups = model.Nested(SecurityGroup, many=True, missing=list)
        status = model.String(required=True)
        tenant = model.Dependency(keystone.Tenant)
        image = model.Dependency(glance.Image, allow_none=True)
        image_membership = model.Dependency(glance.ImageMember,
                                            allow_none=True)
        user_id = model.String(required=True)  # TODO: user reference
        key_name = model.String(required=True, allow_none=True)
        flavor = model.Dependency(Flavor)
        config_drive = model.String(required=True)
        availability_zone = model.String(required=True, allow_none=True)
        host = model.String(required=True)
        hypervisor_hostname = model.String(required=True)
        instance_name = model.String(required=True)
        metadata = model.Dict(missing=dict)
        ephemeral_disks = model.Nested(EphemeralDisk, many=True, missing=list)
        attached_volumes = model.Dependency(cinder.Volume,
                                            many=True,
                                            missing=list)
        # TODO: ports

        FIELD_MAPPING = {
            'host': HOST,
            'hypervisor_hostname': 'OS-EXT-SRV-ATTR:hypervisor_hostname',
            'instance_name': 'OS-EXT-SRV-ATTR:instance_name',
            'availability_zone': 'OS-EXT-AZ:availability_zone',
            'attached_volumes': VOLUMES_ATTACHED,
            'tenant': 'tenant_id',
        }
        FIELD_VALUE_TRANSFORMERS = {'image': lambda x: x or None}
Пример #2
0
 class Schema(model.Schema):
     object_id = model.PrimaryKey('id')
     name = model.String(required=True)
     tenant = model.Dependency(keystone.Tenant, required=True,
                               load_from='owner', dump_to='owner')
     checksum = model.String(required=True, allow_none=True)
     size = model.Integer(required=True)
     virtual_size = model.Integer(required=True, allow_none=True,
                                  missing=None)
     is_public = model.Boolean(required=True)
     protected = model.Boolean(required=True)
     container_format = model.String(required=True)
     disk_format = model.String(required=True)
     min_disk = model.Integer(required=True)
     min_ram = model.Integer(required=True)
     properties = model.Dict()
     members = model.Reference(ImageMember, many=True, missing=list)
Пример #3
0
    class Schema(model.Schema):
        object_id = model.PrimaryKey('id')
        name = model.String(required=True, allow_none=True)
        description = model.String(required=True, allow_none=True)
        availability_zone = model.String(required=True)
        encrypted = model.Boolean(missing=False)
        host = model.String(required=True)
        size = model.Integer(required=True)
        tenant = model.Dependency(keystone.Tenant, required=True)
        metadata = model.Dict(missing=dict)
        volume_type = model.String(required=True)
        attachments = model.Nested(Attachment, many=True, missing=list)

        FIELD_MAPPING = {
            'name': 'display_name',
            'description': 'display_description',
            'host': 'os-vol-host-attr:host',
            'tenant': 'os-vol-tenant-attr:tenant_id',
        }
Пример #4
0
 class Schema(model.Schema):
     foo = model.String(required=True)
     ref = model.Dependency(ExampleReferenced, required=True)
     refs = model.Dependency(ExampleReferenced, required=True, many=True)
     ref_none = model.Dependency(ExampleReferenced,
                                 missing=None,
                                 allow_none=True)
     refs_none = model.Dependency(ExampleReferenced,
                                  missing=None,
                                  many=True,
                                  allow_none=True)
Пример #5
0
 class Schema(model.Schema):
     object_id = model.PrimaryKey()
     bar = model.String(required=True)
     baz = model.Nested(ExampleNested)
     ref = model.Dependency(ExampleReferenced, required=True)
     refs = model.Dependency(ExampleReferenced, required=True, many=True)
     ref_none = model.Dependency(ExampleReferenced,
                                 missing=None,
                                 allow_none=True)
     refs_none = model.Dependency(ExampleReferenced,
                                  missing=None,
                                  many=True,
                                  allow_none=True)
Пример #6
0
 class Schema(model.Schema):
     path = model.String(required=True)
     size = model.Integer(required=True)
Пример #7
0
 class Schema(model.Schema):
     name = model.String(required=True)
Пример #8
0
 class Schema(model.Schema):
     object_id = model.PrimaryKey('id')
     field1 = model.String()
     field2 = model.String()
Пример #9
0
 class Schema(model.Schema):
     object_id = model.PrimaryKey('id')
     name = model.String(required=True)
     enabled = model.Boolean(required=True)
     description = model.String(allow_none=True)
Пример #10
0
 class Schema(model.Schema):
     server = model.Reference('cloudferry.lib.os.discovery.nova.Server')
     device = model.String(required=True)
Пример #11
0
 class Schema(model.Schema):
     foo = model.String(required=True)