1 # Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
2 # and others. All rights reserved.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 SNAPS domain object for Volume Types. Should contain attributes that
20 are shared amongst cloud providers
22 def __init__(self, name, volume_type_id, public, encryption, qos_spec):
25 :param name: the volume's name
26 :param volume_type_id: the volume type's id
27 :param public: True if public
28 :param encryption: instance of a VolumeTypeEncryption domain object
29 :param qos_spec: instance of a QoSSpec domain object
32 self.id = volume_type_id
34 self.encryption = encryption
35 self.qos_spec = qos_spec
37 def __eq__(self, other):
38 return (self.name == other.name and self.id == other.id
39 and self.public == other.public
40 and self.encryption == other.encryption
41 and self.qos_spec == other.qos_spec)
44 class VolumeTypeEncryption:
46 SNAPS domain object for Volume Types. Should contain attributes that
47 are shared amongst cloud providers
49 def __init__(self, volume_encryption_id, volume_type_id,
50 control_location, provider, cipher, key_size):
53 :param volume_encryption_id: the encryption id
54 :param volume_type_id: the associated volume type's id
55 :param control_location: front-end | back-end
56 :param provider: the encryption provider class
57 :param cipher: the encryption cipher
58 :param key_size: the encryption key size
60 self.id = volume_encryption_id
61 self.volume_type_id = volume_type_id
62 self.control_location = control_location
63 self.provider = provider
65 self.key_size = key_size
67 def __eq__(self, other):
68 return (self.id == other.id
69 and self.volume_type_id == other.volume_type_id
70 and self.control_location == other.control_location
71 and self.provider == other.provider
72 and self.cipher == other.cipher
73 and self.key_size == other.key_size)
78 SNAPS domain object for Volume Types. Should contain attributes that
79 are shared amongst cloud providers
81 def __init__(self, name, spec_id, consumer):
84 :param name: the volume's name
85 :param spec_id: the QoS Spec's id
89 self.consumer = consumer
91 def __eq__(self, other):
92 return (self.name == other.name and self.id == other.id
93 and self.consumer == other.consumer)