autosde_openapi_client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +207 -0
- data/Rakefile +10 -0
- data/autosde_openapi_client.gemspec +39 -0
- data/docs/AbstractCapability.md +19 -0
- data/docs/AbstractCapabilityApi.md +204 -0
- data/docs/Account.md +21 -0
- data/docs/AccountApi.md +256 -0
- data/docs/AccountPostRequest.md +19 -0
- data/docs/AccountPostResponse.md +23 -0
- data/docs/Address.md +31 -0
- data/docs/AddressApi.md +204 -0
- data/docs/AddressCreate.md +31 -0
- data/docs/AuthResponse.md +17 -0
- data/docs/Authentication.md +19 -0
- data/docs/AuthenticationApi.md +53 -0
- data/docs/AutoSDEProject.md +55 -0
- data/docs/AutoSDEProjectApi.md +204 -0
- data/docs/AutoSDERole.md +19 -0
- data/docs/AutoSDERoleApi.md +204 -0
- data/docs/CapabilityTranslation.md +35 -0
- data/docs/CapabilityTranslationApi.md +204 -0
- data/docs/CapabilityTranslationCreate.md +31 -0
- data/docs/Host.md +29 -0
- data/docs/HostApi.md +204 -0
- data/docs/HostCreate.md +39 -0
- data/docs/HostVolumeConnection.md +23 -0
- data/docs/HostVolumeConnectionApi.md +204 -0
- data/docs/HostVolumeConnectionCreate.md +21 -0
- data/docs/NativeCapability.md +23 -0
- data/docs/NativeCapabilityApi.md +204 -0
- data/docs/Profile.md +25 -0
- data/docs/ProfileApi.md +204 -0
- data/docs/ProvisioningStrategy.md +19 -0
- data/docs/ProvisioningStrategyApi.md +204 -0
- data/docs/Service.md +35 -0
- data/docs/ServiceAbstractCapabilityValue.md +21 -0
- data/docs/ServiceApi.md +256 -0
- data/docs/ServiceCreate.md +33 -0
- data/docs/ServiceResourceAttachment.md +23 -0
- data/docs/ServiceResourceAttachmentApi.md +204 -0
- data/docs/StorageResource.md +33 -0
- data/docs/StorageResourceApi.md +256 -0
- data/docs/StorageResourceCreate.md +31 -0
- data/docs/StorageResourceResponse.md +33 -0
- data/docs/StorageSystem.md +29 -0
- data/docs/StorageSystemApi.md +204 -0
- data/docs/StorageSystemCreate.md +49 -0
- data/docs/SystemType.md +25 -0
- data/docs/SystemTypeApi.md +204 -0
- data/docs/SystemTypeCreate.md +27 -0
- data/docs/Volume.md +31 -0
- data/docs/VolumeApi.md +256 -0
- data/docs/VolumeCreate.md +27 -0
- data/docs/VolumeResponse.md +31 -0
- data/docs/VolumeSafeDelete.md +21 -0
- data/docs/VolumeSafeDeleteApi.md +204 -0
- data/docs/VolumeSafeDeleteCreate.md +17 -0
- data/docs/VolumeUpdate.md +17 -0
- data/git_push.sh +58 -0
- data/lib/autosde_openapi_client.rb +94 -0
- data/lib/autosde_openapi_client/api/abstract_capability_api.rb +250 -0
- data/lib/autosde_openapi_client/api/account_api.rb +316 -0
- data/lib/autosde_openapi_client/api/address_api.rb +250 -0
- data/lib/autosde_openapi_client/api/authentication_api.rb +82 -0
- data/lib/autosde_openapi_client/api/auto_sde_project_api.rb +250 -0
- data/lib/autosde_openapi_client/api/auto_sde_role_api.rb +250 -0
- data/lib/autosde_openapi_client/api/capability_translation_api.rb +250 -0
- data/lib/autosde_openapi_client/api/host_api.rb +250 -0
- data/lib/autosde_openapi_client/api/host_volume_connection_api.rb +250 -0
- data/lib/autosde_openapi_client/api/native_capability_api.rb +250 -0
- data/lib/autosde_openapi_client/api/profile_api.rb +250 -0
- data/lib/autosde_openapi_client/api/provisioning_strategy_api.rb +250 -0
- data/lib/autosde_openapi_client/api/service_api.rb +316 -0
- data/lib/autosde_openapi_client/api/service_resource_attachment_api.rb +250 -0
- data/lib/autosde_openapi_client/api/storage_resource_api.rb +316 -0
- data/lib/autosde_openapi_client/api/storage_system_api.rb +250 -0
- data/lib/autosde_openapi_client/api/system_type_api.rb +250 -0
- data/lib/autosde_openapi_client/api/volume_api.rb +316 -0
- data/lib/autosde_openapi_client/api/volume_safe_delete_api.rb +250 -0
- data/lib/autosde_openapi_client/api_client.rb +388 -0
- data/lib/autosde_openapi_client/api_error.rb +57 -0
- data/lib/autosde_openapi_client/configuration.rb +266 -0
- data/lib/autosde_openapi_client/models/abstract_capability.rb +218 -0
- data/lib/autosde_openapi_client/models/account.rb +228 -0
- data/lib/autosde_openapi_client/models/account_post_request.rb +218 -0
- data/lib/autosde_openapi_client/models/account_post_response.rb +238 -0
- data/lib/autosde_openapi_client/models/address.rb +328 -0
- data/lib/autosde_openapi_client/models/address_create.rb +330 -0
- data/lib/autosde_openapi_client/models/auth_response.rb +208 -0
- data/lib/autosde_openapi_client/models/authentication.rb +218 -0
- data/lib/autosde_openapi_client/models/auto_sde_project.rb +398 -0
- data/lib/autosde_openapi_client/models/auto_sde_role.rb +218 -0
- data/lib/autosde_openapi_client/models/capability_translation.rb +328 -0
- data/lib/autosde_openapi_client/models/capability_translation_create.rb +310 -0
- data/lib/autosde_openapi_client/models/host.rb +321 -0
- data/lib/autosde_openapi_client/models/host_create.rb +382 -0
- data/lib/autosde_openapi_client/models/host_volume_connection.rb +275 -0
- data/lib/autosde_openapi_client/models/host_volume_connection_create.rb +265 -0
- data/lib/autosde_openapi_client/models/native_capability.rb +239 -0
- data/lib/autosde_openapi_client/models/profile.rb +283 -0
- data/lib/autosde_openapi_client/models/provisioning_strategy.rb +257 -0
- data/lib/autosde_openapi_client/models/service.rb +339 -0
- data/lib/autosde_openapi_client/models/service_abstract_capability_value.rb +227 -0
- data/lib/autosde_openapi_client/models/service_create.rb +327 -0
- data/lib/autosde_openapi_client/models/service_resource_attachment.rb +238 -0
- data/lib/autosde_openapi_client/models/storage_resource.rb +342 -0
- data/lib/autosde_openapi_client/models/storage_resource_create.rb +333 -0
- data/lib/autosde_openapi_client/models/storage_resource_response.rb +343 -0
- data/lib/autosde_openapi_client/models/storage_system.rb +333 -0
- data/lib/autosde_openapi_client/models/storage_system_create.rb +448 -0
- data/lib/autosde_openapi_client/models/system_type.rb +321 -0
- data/lib/autosde_openapi_client/models/system_type_create.rb +333 -0
- data/lib/autosde_openapi_client/models/volume.rb +316 -0
- data/lib/autosde_openapi_client/models/volume_create.rb +299 -0
- data/lib/autosde_openapi_client/models/volume_response.rb +318 -0
- data/lib/autosde_openapi_client/models/volume_safe_delete.rb +227 -0
- data/lib/autosde_openapi_client/models/volume_safe_delete_create.rb +207 -0
- data/lib/autosde_openapi_client/models/volume_update.rb +208 -0
- data/lib/autosde_openapi_client/version.rb +15 -0
- data/site_manager_oas.json +3992 -0
- data/spec/api/abstract_capability_api_spec.rb +74 -0
- data/spec/api/account_api_spec.rb +85 -0
- data/spec/api/address_api_spec.rb +74 -0
- data/spec/api/authentication_api_spec.rb +45 -0
- data/spec/api/auto_sde_project_api_spec.rb +74 -0
- data/spec/api/auto_sde_role_api_spec.rb +74 -0
- data/spec/api/capability_translation_api_spec.rb +74 -0
- data/spec/api/host_api_spec.rb +74 -0
- data/spec/api/host_volume_connection_api_spec.rb +74 -0
- data/spec/api/native_capability_api_spec.rb +74 -0
- data/spec/api/profile_api_spec.rb +74 -0
- data/spec/api/provisioning_strategy_api_spec.rb +74 -0
- data/spec/api/service_api_spec.rb +85 -0
- data/spec/api/service_resource_attachment_api_spec.rb +74 -0
- data/spec/api/storage_resource_api_spec.rb +85 -0
- data/spec/api/storage_system_api_spec.rb +74 -0
- data/spec/api/system_type_api_spec.rb +74 -0
- data/spec/api/volume_api_spec.rb +85 -0
- data/spec/api/volume_safe_delete_api_spec.rb +74 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/abstract_capability_spec.rb +47 -0
- data/spec/models/account_post_request_spec.rb +47 -0
- data/spec/models/account_post_response_spec.rb +59 -0
- data/spec/models/account_spec.rb +53 -0
- data/spec/models/address_create_spec.rb +91 -0
- data/spec/models/address_spec.rb +91 -0
- data/spec/models/auth_response_spec.rb +41 -0
- data/spec/models/authentication_spec.rb +47 -0
- data/spec/models/auto_sde_project_spec.rb +155 -0
- data/spec/models/auto_sde_role_spec.rb +47 -0
- data/spec/models/capability_translation_create_spec.rb +83 -0
- data/spec/models/capability_translation_spec.rb +95 -0
- data/spec/models/host_create_spec.rb +119 -0
- data/spec/models/host_spec.rb +85 -0
- data/spec/models/host_volume_connection_create_spec.rb +57 -0
- data/spec/models/host_volume_connection_spec.rb +63 -0
- data/spec/models/native_capability_spec.rb +59 -0
- data/spec/models/profile_spec.rb +69 -0
- data/spec/models/provisioning_strategy_spec.rb +51 -0
- data/spec/models/service_abstract_capability_value_spec.rb +53 -0
- data/spec/models/service_create_spec.rb +93 -0
- data/spec/models/service_resource_attachment_spec.rb +59 -0
- data/spec/models/service_spec.rb +99 -0
- data/spec/models/storage_resource_create_spec.rb +91 -0
- data/spec/models/storage_resource_response_spec.rb +97 -0
- data/spec/models/storage_resource_spec.rb +97 -0
- data/spec/models/storage_system_create_spec.rb +149 -0
- data/spec/models/storage_system_spec.rb +85 -0
- data/spec/models/system_type_create_spec.rb +79 -0
- data/spec/models/system_type_spec.rb +73 -0
- data/spec/models/volume_create_spec.rb +75 -0
- data/spec/models/volume_response_spec.rb +87 -0
- data/spec/models/volume_safe_delete_create_spec.rb +41 -0
- data/spec/models/volume_safe_delete_spec.rb +53 -0
- data/spec/models/volume_spec.rb +87 -0
- data/spec/models/volume_update_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +340 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Site Manager API
|
|
3
|
+
|
|
4
|
+
#Site Manager API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: autosde@il.ibm.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 4.3.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module OpenapiClient
|
|
16
|
+
# Authentication
|
|
17
|
+
class Authentication
|
|
18
|
+
# password
|
|
19
|
+
attr_accessor :password
|
|
20
|
+
|
|
21
|
+
# username
|
|
22
|
+
attr_accessor :username
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'password' => :'password',
|
|
28
|
+
:'username' => :'username'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.openapi_types
|
|
34
|
+
{
|
|
35
|
+
:'password' => :'String',
|
|
36
|
+
:'username' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Authentication` initialize method"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Authentication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'password')
|
|
62
|
+
self.password = attributes[:'password']
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
if attributes.key?(:'username')
|
|
66
|
+
self.username = attributes[:'username']
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
71
|
+
# @return Array for valid properties with the reasons
|
|
72
|
+
def list_invalid_properties
|
|
73
|
+
invalid_properties = Array.new
|
|
74
|
+
invalid_properties
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Check to see if the all the properties in the model are valid
|
|
78
|
+
# @return true if the model is valid
|
|
79
|
+
def valid?
|
|
80
|
+
true
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Checks equality by comparing each attribute.
|
|
84
|
+
# @param [Object] Object to be compared
|
|
85
|
+
def ==(o)
|
|
86
|
+
return true if self.equal?(o)
|
|
87
|
+
self.class == o.class &&
|
|
88
|
+
password == o.password &&
|
|
89
|
+
username == o.username
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# @see the `==` method
|
|
93
|
+
# @param [Object] Object to be compared
|
|
94
|
+
def eql?(o)
|
|
95
|
+
self == o
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Calculates hash code according to all attributes.
|
|
99
|
+
# @return [Integer] Hash code
|
|
100
|
+
def hash
|
|
101
|
+
[password, username].hash
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Builds the object from hash
|
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
|
+
# @return [Object] Returns the model itself
|
|
107
|
+
def self.build_from_hash(attributes)
|
|
108
|
+
new.build_from_hash(attributes)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Builds the object from hash
|
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
113
|
+
# @return [Object] Returns the model itself
|
|
114
|
+
def build_from_hash(attributes)
|
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
117
|
+
if type =~ /\AArray<(.*)>/i
|
|
118
|
+
# check to ensure the input is an array given that the attribute
|
|
119
|
+
# is documented as an array but the input is not
|
|
120
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
121
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
122
|
+
end
|
|
123
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
124
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
125
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
self
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Deserializes the data based on type
|
|
132
|
+
# @param string type Data type
|
|
133
|
+
# @param string value Value to be deserialized
|
|
134
|
+
# @return [Object] Deserialized data
|
|
135
|
+
def _deserialize(type, value)
|
|
136
|
+
case type.to_sym
|
|
137
|
+
when :DateTime
|
|
138
|
+
DateTime.parse(value)
|
|
139
|
+
when :Date
|
|
140
|
+
Date.parse(value)
|
|
141
|
+
when :String
|
|
142
|
+
value.to_s
|
|
143
|
+
when :Integer
|
|
144
|
+
value.to_i
|
|
145
|
+
when :Float
|
|
146
|
+
value.to_f
|
|
147
|
+
when :Boolean
|
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
+
true
|
|
150
|
+
else
|
|
151
|
+
false
|
|
152
|
+
end
|
|
153
|
+
when :Object
|
|
154
|
+
# generic object (usually a Hash), return directly
|
|
155
|
+
value
|
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
|
162
|
+
{}.tap do |hash|
|
|
163
|
+
value.each do |k, v|
|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
else # model
|
|
168
|
+
OpenapiClient.const_get(type).build_from_hash(value)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the string representation of the object
|
|
173
|
+
# @return [String] String presentation of the object
|
|
174
|
+
def to_s
|
|
175
|
+
to_hash.to_s
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
|
180
|
+
def to_body
|
|
181
|
+
to_hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Returns the object in the form of hash
|
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
|
186
|
+
def to_hash
|
|
187
|
+
hash = {}
|
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
189
|
+
value = self.send(attr)
|
|
190
|
+
if value.nil?
|
|
191
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
192
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
hash[param] = _to_hash(value)
|
|
196
|
+
end
|
|
197
|
+
hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Outputs non-array value in the form of hash
|
|
201
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
202
|
+
# @param [Object] value Any valid value
|
|
203
|
+
# @return [Hash] Returns the value in the form of hash
|
|
204
|
+
def _to_hash(value)
|
|
205
|
+
if value.is_a?(Array)
|
|
206
|
+
value.compact.map { |v| _to_hash(v) }
|
|
207
|
+
elsif value.is_a?(Hash)
|
|
208
|
+
{}.tap do |hash|
|
|
209
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
210
|
+
end
|
|
211
|
+
elsif value.respond_to? :to_hash
|
|
212
|
+
value.to_hash
|
|
213
|
+
else
|
|
214
|
+
value
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Site Manager API
|
|
3
|
+
|
|
4
|
+
#Site Manager API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: autosde@il.ibm.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 4.3.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module OpenapiClient
|
|
16
|
+
# Use this for AutoSDE project information.
|
|
17
|
+
class AutoSDEProject
|
|
18
|
+
# The number of instance cores that are allowed per project. doc-todo: what is a CORE?
|
|
19
|
+
attr_accessor :cores
|
|
20
|
+
|
|
21
|
+
# Project description.
|
|
22
|
+
attr_accessor :description
|
|
23
|
+
|
|
24
|
+
# The number of fixed IP addresses that are allowed per project. This number must be equal to or greater than the number of allowed instances.
|
|
25
|
+
attr_accessor :fixed_ips
|
|
26
|
+
|
|
27
|
+
# The number of floating IP addresses that are allowed per project.
|
|
28
|
+
attr_accessor :floating_ips
|
|
29
|
+
|
|
30
|
+
# The maximum number of groups.
|
|
31
|
+
attr_accessor :groups
|
|
32
|
+
|
|
33
|
+
# The number of bytes of content that are allowed for each injected file.
|
|
34
|
+
attr_accessor :injected_file_content_bytes
|
|
35
|
+
|
|
36
|
+
# The number of bytes that are allowed for each injected file path.
|
|
37
|
+
attr_accessor :injected_file_path_bytes
|
|
38
|
+
|
|
39
|
+
# The number of instances that are allowed per project. doc-todo: what is an instance? does it mean how many projects can exist at once?
|
|
40
|
+
attr_accessor :instances
|
|
41
|
+
|
|
42
|
+
# The number of key pairs that are allowed per user. doc-todo: what is a key pair?
|
|
43
|
+
attr_accessor :key_pairs
|
|
44
|
+
|
|
45
|
+
# Maximum capacity (GB) allocated to backups.
|
|
46
|
+
attr_accessor :max_total_backup_gigabytes
|
|
47
|
+
|
|
48
|
+
# Maximum number of backups. A backup is a full copy of a volume stored in an external service. The service can be configured. The only supported service is Object Storage. doc-todo:WHAT IS OBJECT STORAGE? A backup can subsequently be restored from the external service to either the same volume that the backup was originally taken from or to a new volume. Backup and restore operations can only be carried out on volumes that are in an unattached and available state.
|
|
49
|
+
attr_accessor :max_total_backups
|
|
50
|
+
|
|
51
|
+
# Maximum number of snapshots allowed per project.
|
|
52
|
+
attr_accessor :max_total_snapshots
|
|
53
|
+
|
|
54
|
+
# Maximum number of gigabytes allocated to volumes per project.
|
|
55
|
+
attr_accessor :max_total_volume_gigabytes
|
|
56
|
+
|
|
57
|
+
# Maximum number of provisioned volumes in the project.
|
|
58
|
+
attr_accessor :max_total_volumes
|
|
59
|
+
|
|
60
|
+
# The number of metadata items that are allowed for each instance.
|
|
61
|
+
attr_accessor :metadata_items
|
|
62
|
+
|
|
63
|
+
# Project name.
|
|
64
|
+
attr_accessor :name
|
|
65
|
+
|
|
66
|
+
# The size (GB) of volumes in request that are allowed per volume.
|
|
67
|
+
attr_accessor :per_volume_gigabytes
|
|
68
|
+
|
|
69
|
+
# The amount of instance RAM (MB) that are allowed per project. doc-todo: RAM per project, per specific project....?
|
|
70
|
+
attr_accessor :ram
|
|
71
|
+
|
|
72
|
+
# The number of security groups that are allowed per project.
|
|
73
|
+
attr_accessor :security_groups
|
|
74
|
+
|
|
75
|
+
# UUID
|
|
76
|
+
attr_accessor :uuid
|
|
77
|
+
|
|
78
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
79
|
+
def self.attribute_map
|
|
80
|
+
{
|
|
81
|
+
:'cores' => :'cores',
|
|
82
|
+
:'description' => :'description',
|
|
83
|
+
:'fixed_ips' => :'fixed_ips',
|
|
84
|
+
:'floating_ips' => :'floating_ips',
|
|
85
|
+
:'groups' => :'groups',
|
|
86
|
+
:'injected_file_content_bytes' => :'injected_file_content_bytes',
|
|
87
|
+
:'injected_file_path_bytes' => :'injected_file_path_bytes',
|
|
88
|
+
:'instances' => :'instances',
|
|
89
|
+
:'key_pairs' => :'key_pairs',
|
|
90
|
+
:'max_total_backup_gigabytes' => :'max_total_backup_gigabytes',
|
|
91
|
+
:'max_total_backups' => :'max_total_backups',
|
|
92
|
+
:'max_total_snapshots' => :'max_total_snapshots',
|
|
93
|
+
:'max_total_volume_gigabytes' => :'max_total_volume_gigabytes',
|
|
94
|
+
:'max_total_volumes' => :'max_total_volumes',
|
|
95
|
+
:'metadata_items' => :'metadata_items',
|
|
96
|
+
:'name' => :'name',
|
|
97
|
+
:'per_volume_gigabytes' => :'per_volume_gigabytes',
|
|
98
|
+
:'ram' => :'ram',
|
|
99
|
+
:'security_groups' => :'security_groups',
|
|
100
|
+
:'uuid' => :'uuid'
|
|
101
|
+
}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Attribute type mapping.
|
|
105
|
+
def self.openapi_types
|
|
106
|
+
{
|
|
107
|
+
:'cores' => :'Integer',
|
|
108
|
+
:'description' => :'String',
|
|
109
|
+
:'fixed_ips' => :'Integer',
|
|
110
|
+
:'floating_ips' => :'Integer',
|
|
111
|
+
:'groups' => :'Integer',
|
|
112
|
+
:'injected_file_content_bytes' => :'Float',
|
|
113
|
+
:'injected_file_path_bytes' => :'Integer',
|
|
114
|
+
:'instances' => :'Integer',
|
|
115
|
+
:'key_pairs' => :'Integer',
|
|
116
|
+
:'max_total_backup_gigabytes' => :'Float',
|
|
117
|
+
:'max_total_backups' => :'Integer',
|
|
118
|
+
:'max_total_snapshots' => :'Integer',
|
|
119
|
+
:'max_total_volume_gigabytes' => :'Float',
|
|
120
|
+
:'max_total_volumes' => :'Integer',
|
|
121
|
+
:'metadata_items' => :'Integer',
|
|
122
|
+
:'name' => :'String',
|
|
123
|
+
:'per_volume_gigabytes' => :'Float',
|
|
124
|
+
:'ram' => :'Float',
|
|
125
|
+
:'security_groups' => :'Integer',
|
|
126
|
+
:'uuid' => :'String'
|
|
127
|
+
}
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# List of attributes with nullable: true
|
|
131
|
+
def self.openapi_nullable
|
|
132
|
+
Set.new([
|
|
133
|
+
])
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Initializes the object
|
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
|
+
def initialize(attributes = {})
|
|
139
|
+
if (!attributes.is_a?(Hash))
|
|
140
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::AutoSDEProject` initialize method"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
144
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
145
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
146
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::AutoSDEProject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
147
|
+
end
|
|
148
|
+
h[k.to_sym] = v
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'cores')
|
|
152
|
+
self.cores = attributes[:'cores']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'description')
|
|
156
|
+
self.description = attributes[:'description']
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'fixed_ips')
|
|
160
|
+
self.fixed_ips = attributes[:'fixed_ips']
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'floating_ips')
|
|
164
|
+
self.floating_ips = attributes[:'floating_ips']
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'groups')
|
|
168
|
+
self.groups = attributes[:'groups']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'injected_file_content_bytes')
|
|
172
|
+
self.injected_file_content_bytes = attributes[:'injected_file_content_bytes']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'injected_file_path_bytes')
|
|
176
|
+
self.injected_file_path_bytes = attributes[:'injected_file_path_bytes']
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'instances')
|
|
180
|
+
self.instances = attributes[:'instances']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'key_pairs')
|
|
184
|
+
self.key_pairs = attributes[:'key_pairs']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'max_total_backup_gigabytes')
|
|
188
|
+
self.max_total_backup_gigabytes = attributes[:'max_total_backup_gigabytes']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'max_total_backups')
|
|
192
|
+
self.max_total_backups = attributes[:'max_total_backups']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'max_total_snapshots')
|
|
196
|
+
self.max_total_snapshots = attributes[:'max_total_snapshots']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'max_total_volume_gigabytes')
|
|
200
|
+
self.max_total_volume_gigabytes = attributes[:'max_total_volume_gigabytes']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'max_total_volumes')
|
|
204
|
+
self.max_total_volumes = attributes[:'max_total_volumes']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'metadata_items')
|
|
208
|
+
self.metadata_items = attributes[:'metadata_items']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'name')
|
|
212
|
+
self.name = attributes[:'name']
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'per_volume_gigabytes')
|
|
216
|
+
self.per_volume_gigabytes = attributes[:'per_volume_gigabytes']
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if attributes.key?(:'ram')
|
|
220
|
+
self.ram = attributes[:'ram']
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if attributes.key?(:'security_groups')
|
|
224
|
+
self.security_groups = attributes[:'security_groups']
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if attributes.key?(:'uuid')
|
|
228
|
+
self.uuid = attributes[:'uuid']
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
233
|
+
# @return Array for valid properties with the reasons
|
|
234
|
+
def list_invalid_properties
|
|
235
|
+
invalid_properties = Array.new
|
|
236
|
+
invalid_properties
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Check to see if the all the properties in the model are valid
|
|
240
|
+
# @return true if the model is valid
|
|
241
|
+
def valid?
|
|
242
|
+
true
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Checks equality by comparing each attribute.
|
|
246
|
+
# @param [Object] Object to be compared
|
|
247
|
+
def ==(o)
|
|
248
|
+
return true if self.equal?(o)
|
|
249
|
+
self.class == o.class &&
|
|
250
|
+
cores == o.cores &&
|
|
251
|
+
description == o.description &&
|
|
252
|
+
fixed_ips == o.fixed_ips &&
|
|
253
|
+
floating_ips == o.floating_ips &&
|
|
254
|
+
groups == o.groups &&
|
|
255
|
+
injected_file_content_bytes == o.injected_file_content_bytes &&
|
|
256
|
+
injected_file_path_bytes == o.injected_file_path_bytes &&
|
|
257
|
+
instances == o.instances &&
|
|
258
|
+
key_pairs == o.key_pairs &&
|
|
259
|
+
max_total_backup_gigabytes == o.max_total_backup_gigabytes &&
|
|
260
|
+
max_total_backups == o.max_total_backups &&
|
|
261
|
+
max_total_snapshots == o.max_total_snapshots &&
|
|
262
|
+
max_total_volume_gigabytes == o.max_total_volume_gigabytes &&
|
|
263
|
+
max_total_volumes == o.max_total_volumes &&
|
|
264
|
+
metadata_items == o.metadata_items &&
|
|
265
|
+
name == o.name &&
|
|
266
|
+
per_volume_gigabytes == o.per_volume_gigabytes &&
|
|
267
|
+
ram == o.ram &&
|
|
268
|
+
security_groups == o.security_groups &&
|
|
269
|
+
uuid == o.uuid
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# @see the `==` method
|
|
273
|
+
# @param [Object] Object to be compared
|
|
274
|
+
def eql?(o)
|
|
275
|
+
self == o
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Calculates hash code according to all attributes.
|
|
279
|
+
# @return [Integer] Hash code
|
|
280
|
+
def hash
|
|
281
|
+
[cores, description, fixed_ips, floating_ips, groups, injected_file_content_bytes, injected_file_path_bytes, instances, key_pairs, max_total_backup_gigabytes, max_total_backups, max_total_snapshots, max_total_volume_gigabytes, max_total_volumes, metadata_items, name, per_volume_gigabytes, ram, security_groups, uuid].hash
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Builds the object from hash
|
|
285
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
286
|
+
# @return [Object] Returns the model itself
|
|
287
|
+
def self.build_from_hash(attributes)
|
|
288
|
+
new.build_from_hash(attributes)
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Builds the object from hash
|
|
292
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
293
|
+
# @return [Object] Returns the model itself
|
|
294
|
+
def build_from_hash(attributes)
|
|
295
|
+
return nil unless attributes.is_a?(Hash)
|
|
296
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
297
|
+
if type =~ /\AArray<(.*)>/i
|
|
298
|
+
# check to ensure the input is an array given that the attribute
|
|
299
|
+
# is documented as an array but the input is not
|
|
300
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
301
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
302
|
+
end
|
|
303
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
304
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
305
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
self
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Deserializes the data based on type
|
|
312
|
+
# @param string type Data type
|
|
313
|
+
# @param string value Value to be deserialized
|
|
314
|
+
# @return [Object] Deserialized data
|
|
315
|
+
def _deserialize(type, value)
|
|
316
|
+
case type.to_sym
|
|
317
|
+
when :DateTime
|
|
318
|
+
DateTime.parse(value)
|
|
319
|
+
when :Date
|
|
320
|
+
Date.parse(value)
|
|
321
|
+
when :String
|
|
322
|
+
value.to_s
|
|
323
|
+
when :Integer
|
|
324
|
+
value.to_i
|
|
325
|
+
when :Float
|
|
326
|
+
value.to_f
|
|
327
|
+
when :Boolean
|
|
328
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
329
|
+
true
|
|
330
|
+
else
|
|
331
|
+
false
|
|
332
|
+
end
|
|
333
|
+
when :Object
|
|
334
|
+
# generic object (usually a Hash), return directly
|
|
335
|
+
value
|
|
336
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
337
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
338
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
339
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
340
|
+
k_type = Regexp.last_match[:k_type]
|
|
341
|
+
v_type = Regexp.last_match[:v_type]
|
|
342
|
+
{}.tap do |hash|
|
|
343
|
+
value.each do |k, v|
|
|
344
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
else # model
|
|
348
|
+
OpenapiClient.const_get(type).build_from_hash(value)
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Returns the string representation of the object
|
|
353
|
+
# @return [String] String presentation of the object
|
|
354
|
+
def to_s
|
|
355
|
+
to_hash.to_s
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
359
|
+
# @return [Hash] Returns the object in the form of hash
|
|
360
|
+
def to_body
|
|
361
|
+
to_hash
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Returns the object in the form of hash
|
|
365
|
+
# @return [Hash] Returns the object in the form of hash
|
|
366
|
+
def to_hash
|
|
367
|
+
hash = {}
|
|
368
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
369
|
+
value = self.send(attr)
|
|
370
|
+
if value.nil?
|
|
371
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
372
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
hash[param] = _to_hash(value)
|
|
376
|
+
end
|
|
377
|
+
hash
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
# Outputs non-array value in the form of hash
|
|
381
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
382
|
+
# @param [Object] value Any valid value
|
|
383
|
+
# @return [Hash] Returns the value in the form of hash
|
|
384
|
+
def _to_hash(value)
|
|
385
|
+
if value.is_a?(Array)
|
|
386
|
+
value.compact.map { |v| _to_hash(v) }
|
|
387
|
+
elsif value.is_a?(Hash)
|
|
388
|
+
{}.tap do |hash|
|
|
389
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
390
|
+
end
|
|
391
|
+
elsif value.respond_to? :to_hash
|
|
392
|
+
value.to_hash
|
|
393
|
+
else
|
|
394
|
+
value
|
|
395
|
+
end
|
|
396
|
+
end
|
|
397
|
+
end
|
|
398
|
+
end
|