-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.py
59 lines (36 loc) · 1.61 KB
/
schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from marshmallow import Schema, fields, validate
from openstack_resources import connection_types
"""Set of all marshmallow schemes used in this project"""
class StartServerSchema(Schema):
flavor = fields.String(required=True)
image = fields.String(required=True)
key_name = fields.String(required=True)
# public_key = fields.String(required=True)
servername = fields.String(required=True)
network_id = fields.String(required=True)
diskspace = fields.Int(required=False, default=0)
volume_name = fields.String(required=False, default="new_volume")
metadata = fields.Dict(required=True)
class CreateMetadataSchema(Schema):
metadata = fields.Dict(required=True)
class DeleteMetadataSchema(Schema):
keys = fields.List(fields.String(), required=True)
class CreateKeypairSchema(Schema):
public_key = fields.String(required=False)
keyname = fields.String(missing="default_key")
class NetworkSchema(Schema):
external_network = fields.String(required=True)
class FloatingIpSchema(Schema):
network_id = fields.String(required=True)
instance_id = fields.String(required=True)
class ProjectSchema(Schema):
unscoped_token = fields.String(required=True)
user_id = fields.String(required=True)
class SecurityGroupSchema(Schema):
name = fields.String(required=False, default="default_security_group")
class SecurityGroupRuleSchema(Schema):
type = fields.String(required=True, validate=validate.OneOf(connection_types))
class LoginSchema(Schema):
token = fields.String(required=True)
class ScopeSchema(Schema):
project_id = fields.String(required=True)