-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathconstants.py
More file actions
109 lines (80 loc) · 2.38 KB
/
constants.py
File metadata and controls
109 lines (80 loc) · 2.38 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
class Actions:
START = 'start'
SHUTDOWN = 'shutdown'
DELETE = 'delete'
HIBERNATE = 'hibernate'
RESTORE = 'restore'
def __init__(self):
return
class VolumeActions:
ATTACH = 'attach'
DETACH = 'detach'
RENAME = 'rename'
INCREASE_SIZE = 'resize'
DELETE = 'delete'
CLONE = 'clone'
def __init__(self):
return
class InstanceStatus:
ORDERED = 'ordered'
RUNNING = 'running'
PROVISIONING = 'provisioning'
OFFLINE = 'offline'
STARTING_HIBERNATION = 'starting_hibernation'
HIBERNATING = 'hibernating'
RESTORING = 'restoring'
ERROR = 'error'
def __init__(self):
return
class VolumeStatus:
ORDERED = 'ordered'
CREATING = 'creating'
ATTACHED = 'attached'
DETACHED = 'detached'
DELETING = 'deleting'
DELETED = 'deleted'
CLONING = 'cloning'
def __init__(self):
return
class VolumeTypes:
NVMe = 'NVMe'
HDD = 'HDD'
def __init__(self):
return
class Locations:
FIN_01: str = 'FIN-01'
FIN_02: str = 'FIN-02'
FIN_03: str = 'FIN-03'
ICE_01: str = 'ICE-01'
def __init__(self):
return
class ErrorCodes:
INVALID_REQUEST = 'invalid_request'
UNAUTHORIZED_REQUEST = 'unauthorized_request'
INSUFFICIENT_FUNDS = 'insufficient_funds'
FORBIDDEN_ACTION = 'forbidden_action'
NOT_FOUND = 'not_found'
SERVER_ERROR = 'server_error'
SERVICE_UNAVAILABLE = 'service_unavailable'
def __init__(self):
return
class Constants:
def __init__(self, base_url, version):
self.instance_actions: Actions = Actions()
"""Available actions to perform on an instance"""
self.volume_actions: VolumeActions = VolumeActions()
"""Available actions to perform on a volume"""
self.instance_status: InstanceStatus = InstanceStatus()
"""Possible instance statuses"""
self.volume_status: VolumeStatus = VolumeStatus()
"""Possible volume statuses"""
self.volume_types: VolumeTypes = VolumeTypes()
"""Available volume types"""
self.locations: Locations = Locations()
"""Available locations"""
self.error_codes: ErrorCodes = ErrorCodes()
"""Available error codes"""
self.base_url: str = base_url
"""DataCrunch's Public API URL"""
self.version: str = version
"""Current SDK Version"""