ibm_cloud_power 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +68 -0
- data/LICENSE.txt +202 -0
- data/README.md +56 -10
- data/docs/CloudConnection.md +41 -0
- data/docs/CloudConnectionCreate.md +23 -0
- data/docs/CloudConnectionEndpointClassic.md +19 -0
- data/docs/CloudConnectionEndpointGRE.md +19 -0
- data/docs/CloudConnectionEndpointVPC.md +19 -0
- data/docs/CloudConnectionGRETunnel.md +21 -0
- data/docs/CloudConnectionSpeed.md +16 -0
- data/docs/CloudConnectionUpdate.md +27 -0
- data/docs/CloudConnectionVPC.md +19 -0
- data/docs/CloudConnectionVirtualPrivateClouds.md +17 -0
- data/docs/CloudConnectionVirtualPrivateCloudsVirtualPrivateClouds.md +23 -0
- data/docs/CloudConnections.md +17 -0
- data/docs/CreateDataVolume.md +6 -6
- data/docs/CreateImage.md +3 -3
- data/docs/Image.md +2 -0
- data/docs/ImageReference.md +2 -0
- data/docs/MaximumStorageAllocation.md +21 -0
- data/docs/MultiVolumesCreate.md +6 -4
- data/docs/Network.md +1 -1
- data/docs/NetworkPort.md +2 -0
- data/docs/NetworkReference.md +1 -1
- data/docs/PCloudCloudConnectionsApi.md +394 -0
- data/docs/PCloudEventsApi.md +2 -2
- data/docs/PCloudImagesApi.md +104 -6
- data/docs/PCloudPVMInstancesApi.md +60 -5
- data/docs/PCloudPlacementGroupsApi.md +298 -0
- data/docs/PCloudStorageCapacityApi.md +196 -0
- data/docs/PCloudVolumesApi.md +344 -0
- data/docs/PVMInstance.md +3 -1
- data/docs/PVMInstanceCreate.md +5 -3
- data/docs/PlacementGroup.md +23 -0
- data/docs/PlacementGroupCreate.md +19 -0
- data/docs/PlacementGroupServer.md +17 -0
- data/docs/PlacementGroups.md +17 -0
- data/docs/SAPCreate.md +1 -1
- data/docs/StoragePoolCapacity.md +23 -0
- data/docs/StoragePoolsCapacity.md +19 -0
- data/docs/StorageTypeCapacity.md +21 -0
- data/docs/StorageTypesCapacity.md +19 -0
- data/docs/Volume.md +2 -0
- data/docs/VolumeReference.md +2 -0
- data/docs/VolumesCloneAsyncRequest.md +1 -1
- data/docs/VolumesCloneCancel.md +1 -1
- data/docs/VolumesCloneDetail.md +1 -1
- data/docs/VolumesCloneExecute.md +1 -1
- data/lib/ibm_cloud_power.rb +24 -0
- data/lib/ibm_cloud_power/api/p_cloud_cloud_connections_api.rb +560 -0
- data/lib/ibm_cloud_power/api/p_cloud_events_api.rb +2 -2
- data/lib/ibm_cloud_power/api/p_cloud_images_api.rb +133 -4
- data/lib/ibm_cloud_power/api/p_cloud_placement_groups_api.rb +430 -0
- data/lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb +82 -5
- data/lib/ibm_cloud_power/api/p_cloud_storage_capacity_api.rb +274 -0
- data/lib/ibm_cloud_power/api/p_cloud_volumes_api.rb +477 -0
- data/lib/ibm_cloud_power/models/cloud_connection.rb +379 -0
- data/lib/ibm_cloud_power/models/cloud_connection_create.rb +249 -0
- data/lib/ibm_cloud_power/models/cloud_connection_endpoint_classic.rb +218 -0
- data/lib/ibm_cloud_power/models/cloud_connection_endpoint_gre.rb +221 -0
- data/lib/ibm_cloud_power/models/cloud_connection_endpoint_vpc.rb +221 -0
- data/lib/ibm_cloud_power/models/cloud_connection_gre_tunnel.rb +239 -0
- data/lib/ibm_cloud_power/models/cloud_connection_speed.rb +42 -0
- data/lib/ibm_cloud_power/models/cloud_connection_update.rb +257 -0
- data/lib/ibm_cloud_power/models/cloud_connection_virtual_private_clouds.rb +216 -0
- data/lib/ibm_cloud_power/models/cloud_connection_virtual_private_clouds_virtual_private_clouds.rb +259 -0
- data/lib/ibm_cloud_power/models/cloud_connection_vpc.rb +224 -0
- data/lib/ibm_cloud_power/models/cloud_connections.rb +216 -0
- data/lib/ibm_cloud_power/models/create_data_volume.rb +17 -17
- data/lib/ibm_cloud_power/models/create_image.rb +3 -3
- data/lib/ibm_cloud_power/models/image.rb +16 -1
- data/lib/ibm_cloud_power/models/image_reference.rb +16 -1
- data/lib/ibm_cloud_power/models/maximum_storage_allocation.rb +245 -0
- data/lib/ibm_cloud_power/models/multi_volumes_create.rb +17 -7
- data/lib/ibm_cloud_power/models/network.rb +1 -1
- data/lib/ibm_cloud_power/models/network_port.rb +11 -1
- data/lib/ibm_cloud_power/models/network_reference.rb +1 -1
- data/lib/ibm_cloud_power/models/placement_group.rb +295 -0
- data/lib/ibm_cloud_power/models/placement_group_create.rb +263 -0
- data/lib/ibm_cloud_power/models/placement_group_server.rb +214 -0
- data/lib/ibm_cloud_power/models/placement_groups.rb +216 -0
- data/lib/ibm_cloud_power/models/pvm_instance.rb +17 -5
- data/lib/ibm_cloud_power/models/pvm_instance_create.rb +16 -6
- data/lib/ibm_cloud_power/models/pvm_instance_reference.rb +2 -2
- data/lib/ibm_cloud_power/models/sap_create.rb +1 -1
- data/lib/ibm_cloud_power/models/storage_pool_capacity.rb +245 -0
- data/lib/ibm_cloud_power/models/storage_pools_capacity.rb +220 -0
- data/lib/ibm_cloud_power/models/storage_type_capacity.rb +231 -0
- data/lib/ibm_cloud_power/models/storage_types_capacity.rb +220 -0
- data/lib/ibm_cloud_power/models/volume.rb +11 -1
- data/lib/ibm_cloud_power/models/volume_reference.rb +11 -1
- data/lib/ibm_cloud_power/models/volumes_clone_async_request.rb +1 -1
- data/lib/ibm_cloud_power/models/volumes_clone_cancel.rb +1 -1
- data/lib/ibm_cloud_power/models/volumes_clone_detail.rb +1 -1
- data/lib/ibm_cloud_power/models/volumes_clone_execute.rb +1 -1
- data/lib/ibm_cloud_power/version.rb +1 -1
- data/spec/api/p_cloud_cloud_connections_api_spec.rb +132 -0
- data/spec/api/p_cloud_placement_groups_api_spec.rb +108 -0
- data/spec/api/p_cloud_storage_capacity_api_spec.rb +81 -0
- data/spec/models/cloud_connection_create_spec.rb +59 -0
- data/spec/models/cloud_connection_endpoint_classic_spec.rb +47 -0
- data/spec/models/cloud_connection_endpoint_gre_spec.rb +47 -0
- data/spec/models/cloud_connection_endpoint_vpc_spec.rb +47 -0
- data/spec/models/cloud_connection_gre_tunnel_spec.rb +53 -0
- data/spec/models/cloud_connection_spec.rb +113 -0
- data/spec/models/cloud_connection_speed_spec.rb +35 -0
- data/spec/models/cloud_connection_update_spec.rb +71 -0
- data/spec/models/cloud_connection_virtual_private_clouds_spec.rb +41 -0
- data/spec/models/cloud_connection_virtual_private_clouds_virtual_private_clouds_spec.rb +59 -0
- data/spec/models/cloud_connection_vpc_spec.rb +47 -0
- data/spec/models/cloud_connections_spec.rb +41 -0
- data/spec/models/maximum_storage_allocation_spec.rb +53 -0
- data/spec/models/placement_group_create_spec.rb +51 -0
- data/spec/models/placement_group_server_spec.rb +41 -0
- data/spec/models/placement_group_spec.rb +63 -0
- data/spec/models/placement_groups_spec.rb +41 -0
- data/spec/models/storage_pool_capacity_spec.rb +59 -0
- data/spec/models/storage_pools_capacity_spec.rb +47 -0
- data/spec/models/storage_type_capacity_spec.rb +53 -0
- data/spec/models/storage_types_capacity_spec.rb +47 -0
- metadata +130 -32
@@ -14,13 +14,13 @@ require 'date'
|
|
14
14
|
|
15
15
|
module IbmCloudPower
|
16
16
|
class CreateImage
|
17
|
-
# Source of the image
|
17
|
+
# Source of the image. The root-project value is used to import an available stock image into a PCloud instance image catalog. The url value is used to import a custom image from a Cloud storage account into a PCloud instance image catalog.
|
18
18
|
attr_accessor :source
|
19
19
|
|
20
|
-
# Image ID of existing
|
20
|
+
# Image ID of existing stock image; required for copy image
|
21
21
|
attr_accessor :image_id
|
22
22
|
|
23
|
-
# Name to
|
23
|
+
# Name to specify a custom image that is imported from Cloud Object Storage. You must not use this property when you import an available stock image. Stock image names cannot be changed.
|
24
24
|
attr_accessor :image_name
|
25
25
|
|
26
26
|
# (deprecated - replaced by region, imageFilename and bucketName) Path to image starting with service endpoint and ending with image filename
|
@@ -32,6 +32,9 @@ module IbmCloudPower
|
|
32
32
|
# Storage type for image
|
33
33
|
attr_accessor :storage_type
|
34
34
|
|
35
|
+
# Storage pool where the image is located
|
36
|
+
attr_accessor :storage_pool
|
37
|
+
|
35
38
|
# Creation Date
|
36
39
|
attr_accessor :creation_date
|
37
40
|
|
@@ -57,6 +60,7 @@ module IbmCloudPower
|
|
57
60
|
:'description' => :'description',
|
58
61
|
:'size' => :'size',
|
59
62
|
:'storage_type' => :'storageType',
|
63
|
+
:'storage_pool' => :'storagePool',
|
60
64
|
:'creation_date' => :'creationDate',
|
61
65
|
:'last_update_date' => :'lastUpdateDate',
|
62
66
|
:'specifications' => :'specifications',
|
@@ -75,6 +79,7 @@ module IbmCloudPower
|
|
75
79
|
:'description' => :'String',
|
76
80
|
:'size' => :'Float',
|
77
81
|
:'storage_type' => :'String',
|
82
|
+
:'storage_pool' => :'String',
|
78
83
|
:'creation_date' => :'DateTime',
|
79
84
|
:'last_update_date' => :'DateTime',
|
80
85
|
:'specifications' => :'ImageSpecifications',
|
@@ -129,6 +134,10 @@ module IbmCloudPower
|
|
129
134
|
self.storage_type = attributes[:'storage_type']
|
130
135
|
end
|
131
136
|
|
137
|
+
if attributes.key?(:'storage_pool')
|
138
|
+
self.storage_pool = attributes[:'storage_pool']
|
139
|
+
end
|
140
|
+
|
132
141
|
if attributes.key?(:'creation_date')
|
133
142
|
self.creation_date = attributes[:'creation_date']
|
134
143
|
end
|
@@ -178,6 +187,10 @@ module IbmCloudPower
|
|
178
187
|
invalid_properties.push('invalid value for "storage_type", storage_type cannot be nil.')
|
179
188
|
end
|
180
189
|
|
190
|
+
if @storage_pool.nil?
|
191
|
+
invalid_properties.push('invalid value for "storage_pool", storage_pool cannot be nil.')
|
192
|
+
end
|
193
|
+
|
181
194
|
if @creation_date.nil?
|
182
195
|
invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.')
|
183
196
|
end
|
@@ -196,6 +209,7 @@ module IbmCloudPower
|
|
196
209
|
return false if @name.nil?
|
197
210
|
return false if @size.nil?
|
198
211
|
return false if @storage_type.nil?
|
212
|
+
return false if @storage_pool.nil?
|
199
213
|
return false if @creation_date.nil?
|
200
214
|
return false if @last_update_date.nil?
|
201
215
|
true
|
@@ -212,6 +226,7 @@ module IbmCloudPower
|
|
212
226
|
description == o.description &&
|
213
227
|
size == o.size &&
|
214
228
|
storage_type == o.storage_type &&
|
229
|
+
storage_pool == o.storage_pool &&
|
215
230
|
creation_date == o.creation_date &&
|
216
231
|
last_update_date == o.last_update_date &&
|
217
232
|
specifications == o.specifications &&
|
@@ -229,7 +244,7 @@ module IbmCloudPower
|
|
229
244
|
# Calculates hash code according to all attributes.
|
230
245
|
# @return [Integer] Hash code
|
231
246
|
def hash
|
232
|
-
[image_id, name, state, description, size, storage_type, creation_date, last_update_date, specifications, volumes, servers, taskref].hash
|
247
|
+
[image_id, name, state, description, size, storage_type, storage_pool, creation_date, last_update_date, specifications, volumes, servers, taskref].hash
|
233
248
|
end
|
234
249
|
|
235
250
|
# Builds the object from hash
|
@@ -29,6 +29,9 @@ module IbmCloudPower
|
|
29
29
|
# Storage type for image
|
30
30
|
attr_accessor :storage_type
|
31
31
|
|
32
|
+
# Storage pool where the image is located
|
33
|
+
attr_accessor :storage_pool
|
34
|
+
|
32
35
|
# Creation Date
|
33
36
|
attr_accessor :creation_date
|
34
37
|
|
@@ -48,6 +51,7 @@ module IbmCloudPower
|
|
48
51
|
:'state' => :'state',
|
49
52
|
:'description' => :'description',
|
50
53
|
:'storage_type' => :'storageType',
|
54
|
+
:'storage_pool' => :'storagePool',
|
51
55
|
:'creation_date' => :'creationDate',
|
52
56
|
:'last_update_date' => :'lastUpdateDate',
|
53
57
|
:'specifications' => :'specifications',
|
@@ -63,6 +67,7 @@ module IbmCloudPower
|
|
63
67
|
:'state' => :'String',
|
64
68
|
:'description' => :'String',
|
65
69
|
:'storage_type' => :'String',
|
70
|
+
:'storage_pool' => :'String',
|
66
71
|
:'creation_date' => :'DateTime',
|
67
72
|
:'last_update_date' => :'DateTime',
|
68
73
|
:'specifications' => :'ImageSpecifications',
|
@@ -111,6 +116,10 @@ module IbmCloudPower
|
|
111
116
|
self.storage_type = attributes[:'storage_type']
|
112
117
|
end
|
113
118
|
|
119
|
+
if attributes.key?(:'storage_pool')
|
120
|
+
self.storage_pool = attributes[:'storage_pool']
|
121
|
+
end
|
122
|
+
|
114
123
|
if attributes.key?(:'creation_date')
|
115
124
|
self.creation_date = attributes[:'creation_date']
|
116
125
|
end
|
@@ -152,6 +161,10 @@ module IbmCloudPower
|
|
152
161
|
invalid_properties.push('invalid value for "storage_type", storage_type cannot be nil.')
|
153
162
|
end
|
154
163
|
|
164
|
+
if @storage_pool.nil?
|
165
|
+
invalid_properties.push('invalid value for "storage_pool", storage_pool cannot be nil.')
|
166
|
+
end
|
167
|
+
|
155
168
|
if @creation_date.nil?
|
156
169
|
invalid_properties.push('invalid value for "creation_date", creation_date cannot be nil.')
|
157
170
|
end
|
@@ -179,6 +192,7 @@ module IbmCloudPower
|
|
179
192
|
return false if @state.nil?
|
180
193
|
return false if @description.nil?
|
181
194
|
return false if @storage_type.nil?
|
195
|
+
return false if @storage_pool.nil?
|
182
196
|
return false if @creation_date.nil?
|
183
197
|
return false if @last_update_date.nil?
|
184
198
|
return false if @specifications.nil?
|
@@ -196,6 +210,7 @@ module IbmCloudPower
|
|
196
210
|
state == o.state &&
|
197
211
|
description == o.description &&
|
198
212
|
storage_type == o.storage_type &&
|
213
|
+
storage_pool == o.storage_pool &&
|
199
214
|
creation_date == o.creation_date &&
|
200
215
|
last_update_date == o.last_update_date &&
|
201
216
|
specifications == o.specifications &&
|
@@ -211,7 +226,7 @@ module IbmCloudPower
|
|
211
226
|
# Calculates hash code according to all attributes.
|
212
227
|
# @return [Integer] Hash code
|
213
228
|
def hash
|
214
|
-
[image_id, name, state, description, storage_type, creation_date, last_update_date, specifications, href].hash
|
229
|
+
[image_id, name, state, description, storage_type, storage_pool, creation_date, last_update_date, specifications, href].hash
|
215
230
|
end
|
216
231
|
|
217
232
|
# Builds the object from hash
|
@@ -0,0 +1,245 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module IbmCloudPower
|
16
|
+
# Maximum storage allocation
|
17
|
+
class MaximumStorageAllocation
|
18
|
+
# Storage type
|
19
|
+
attr_accessor :storage_type
|
20
|
+
|
21
|
+
# Storage pool
|
22
|
+
attr_accessor :storage_pool
|
23
|
+
|
24
|
+
# Maximum allocation storage size (GB)
|
25
|
+
attr_accessor :max_allocation_size
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'storage_type' => :'storageType',
|
31
|
+
:'storage_pool' => :'storagePool',
|
32
|
+
:'max_allocation_size' => :'maxAllocationSize'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'storage_type' => :'String',
|
40
|
+
:'storage_pool' => :'String',
|
41
|
+
:'max_allocation_size' => :'Integer'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::MaximumStorageAllocation` initialize method"
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::MaximumStorageAllocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'storage_type')
|
67
|
+
self.storage_type = attributes[:'storage_type']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'storage_pool')
|
71
|
+
self.storage_pool = attributes[:'storage_pool']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:'max_allocation_size')
|
75
|
+
self.max_allocation_size = attributes[:'max_allocation_size']
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properties with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
if @storage_type.nil?
|
84
|
+
invalid_properties.push('invalid value for "storage_type", storage_type cannot be nil.')
|
85
|
+
end
|
86
|
+
|
87
|
+
if @storage_pool.nil?
|
88
|
+
invalid_properties.push('invalid value for "storage_pool", storage_pool cannot be nil.')
|
89
|
+
end
|
90
|
+
|
91
|
+
if @max_allocation_size.nil?
|
92
|
+
invalid_properties.push('invalid value for "max_allocation_size", max_allocation_size cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
return false if @storage_type.nil?
|
102
|
+
return false if @storage_pool.nil?
|
103
|
+
return false if @max_allocation_size.nil?
|
104
|
+
true
|
105
|
+
end
|
106
|
+
|
107
|
+
# Checks equality by comparing each attribute.
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def ==(o)
|
110
|
+
return true if self.equal?(o)
|
111
|
+
self.class == o.class &&
|
112
|
+
storage_type == o.storage_type &&
|
113
|
+
storage_pool == o.storage_pool &&
|
114
|
+
max_allocation_size == o.max_allocation_size
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Integer] Hash code
|
125
|
+
def hash
|
126
|
+
[storage_type, storage_pool, max_allocation_size].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def self.build_from_hash(attributes)
|
133
|
+
new.build_from_hash(attributes)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
151
|
+
self.send("#{key}=", nil)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
self
|
156
|
+
end
|
157
|
+
|
158
|
+
# Deserializes the data based on type
|
159
|
+
# @param string type Data type
|
160
|
+
# @param string value Value to be deserialized
|
161
|
+
# @return [Object] Deserialized data
|
162
|
+
def _deserialize(type, value)
|
163
|
+
case type.to_sym
|
164
|
+
when :DateTime
|
165
|
+
DateTime.parse(value)
|
166
|
+
when :Date
|
167
|
+
Date.parse(value)
|
168
|
+
when :String
|
169
|
+
value.to_s
|
170
|
+
when :Integer
|
171
|
+
value.to_i
|
172
|
+
when :Float
|
173
|
+
value.to_f
|
174
|
+
when :Boolean
|
175
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
176
|
+
true
|
177
|
+
else
|
178
|
+
false
|
179
|
+
end
|
180
|
+
when :Object
|
181
|
+
# generic object (usually a Hash), return directly
|
182
|
+
value
|
183
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
184
|
+
inner_type = Regexp.last_match[:inner_type]
|
185
|
+
value.map { |v| _deserialize(inner_type, v) }
|
186
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
187
|
+
k_type = Regexp.last_match[:k_type]
|
188
|
+
v_type = Regexp.last_match[:v_type]
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each do |k, v|
|
191
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
else # model
|
195
|
+
IbmCloudPower.const_get(type).build_from_hash(value)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns the string representation of the object
|
200
|
+
# @return [String] String presentation of the object
|
201
|
+
def to_s
|
202
|
+
to_hash.to_s
|
203
|
+
end
|
204
|
+
|
205
|
+
# to_body is an alias to to_hash (backward compatibility)
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_body
|
208
|
+
to_hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Returns the object in the form of hash
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
213
|
+
def to_hash
|
214
|
+
hash = {}
|
215
|
+
self.class.attribute_map.each_pair do |attr, param|
|
216
|
+
value = self.send(attr)
|
217
|
+
if value.nil?
|
218
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
219
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
220
|
+
end
|
221
|
+
|
222
|
+
hash[param] = _to_hash(value)
|
223
|
+
end
|
224
|
+
hash
|
225
|
+
end
|
226
|
+
|
227
|
+
# Outputs non-array value in the form of hash
|
228
|
+
# For object, use to_hash. Otherwise, just return the value
|
229
|
+
# @param [Object] value Any valid value
|
230
|
+
# @return [Hash] Returns the value in the form of hash
|
231
|
+
def _to_hash(value)
|
232
|
+
if value.is_a?(Array)
|
233
|
+
value.compact.map { |v| _to_hash(v) }
|
234
|
+
elsif value.is_a?(Hash)
|
235
|
+
{}.tap do |hash|
|
236
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
237
|
+
end
|
238
|
+
elsif value.respond_to? :to_hash
|
239
|
+
value.to_hash
|
240
|
+
else
|
241
|
+
value
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -26,15 +26,18 @@ module IbmCloudPower
|
|
26
26
|
# Indicates if the volume is shareable between VMs
|
27
27
|
attr_accessor :shareable
|
28
28
|
|
29
|
-
# Type of Disk
|
29
|
+
# Type of Disk; required if affinityPolicy is not provided, otherwise ignored
|
30
30
|
attr_accessor :disk_type
|
31
31
|
|
32
|
-
# Affinity policy for data volume being created; requires affinityVolume to be specified
|
32
|
+
# Affinity policy for data volume being created; requires affinityPVMInstance or affinityVolume to be specified;
|
33
33
|
attr_accessor :affinity_policy
|
34
34
|
|
35
|
-
# Volume (ID or Name)to base volume affinity policy against; required if affinityPolicy provided
|
35
|
+
# Volume (ID or Name) to base volume affinity policy against; required if affinityPolicy is provided and affinityPVMInstance is not provided
|
36
36
|
attr_accessor :affinity_volume
|
37
37
|
|
38
|
+
# PVM Instance (ID or Name)to base volume affinity policy against; required if affinityPolicy is provided and affinityVolume is not provided
|
39
|
+
attr_accessor :affinity_pvm_instance
|
40
|
+
|
38
41
|
class EnumAttributeValidator
|
39
42
|
attr_reader :datatype
|
40
43
|
attr_reader :allowable_values
|
@@ -66,7 +69,8 @@ module IbmCloudPower
|
|
66
69
|
:'shareable' => :'shareable',
|
67
70
|
:'disk_type' => :'diskType',
|
68
71
|
:'affinity_policy' => :'affinityPolicy',
|
69
|
-
:'affinity_volume' => :'affinityVolume'
|
72
|
+
:'affinity_volume' => :'affinityVolume',
|
73
|
+
:'affinity_pvm_instance' => :'affinityPVMInstance'
|
70
74
|
}
|
71
75
|
end
|
72
76
|
|
@@ -79,7 +83,8 @@ module IbmCloudPower
|
|
79
83
|
:'shareable' => :'Boolean',
|
80
84
|
:'disk_type' => :'String',
|
81
85
|
:'affinity_policy' => :'String',
|
82
|
-
:'affinity_volume' => :'String'
|
86
|
+
:'affinity_volume' => :'String',
|
87
|
+
:'affinity_pvm_instance' => :'String'
|
83
88
|
}
|
84
89
|
end
|
85
90
|
|
@@ -131,6 +136,10 @@ module IbmCloudPower
|
|
131
136
|
if attributes.key?(:'affinity_volume')
|
132
137
|
self.affinity_volume = attributes[:'affinity_volume']
|
133
138
|
end
|
139
|
+
|
140
|
+
if attributes.key?(:'affinity_pvm_instance')
|
141
|
+
self.affinity_pvm_instance = attributes[:'affinity_pvm_instance']
|
142
|
+
end
|
134
143
|
end
|
135
144
|
|
136
145
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -179,7 +188,8 @@ module IbmCloudPower
|
|
179
188
|
shareable == o.shareable &&
|
180
189
|
disk_type == o.disk_type &&
|
181
190
|
affinity_policy == o.affinity_policy &&
|
182
|
-
affinity_volume == o.affinity_volume
|
191
|
+
affinity_volume == o.affinity_volume &&
|
192
|
+
affinity_pvm_instance == o.affinity_pvm_instance
|
183
193
|
end
|
184
194
|
|
185
195
|
# @see the `==` method
|
@@ -191,7 +201,7 @@ module IbmCloudPower
|
|
191
201
|
# Calculates hash code according to all attributes.
|
192
202
|
# @return [Integer] Hash code
|
193
203
|
def hash
|
194
|
-
[name, size, count, shareable, disk_type, affinity_policy, affinity_volume].hash
|
204
|
+
[name, size, count, shareable, disk_type, affinity_policy, affinity_volume, affinity_pvm_instance].hash
|
195
205
|
end
|
196
206
|
|
197
207
|
# Builds the object from hash
|