pnap_network_storage_api 1.3.0 → 2.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 +4 -4
- data/README.md +14 -8
- data/VERSION +1 -1
- data/docs/StorageNetwork.md +2 -0
- data/docs/StorageNetworkCreate.md +3 -1
- data/docs/StorageNetworkVolumeCreate.md +3 -1
- data/docs/StorageNetworksApi.md +146 -76
- data/docs/TagAssignment.md +26 -0
- data/docs/TagAssignmentRequest.md +20 -0
- data/docs/Volume.md +5 -1
- data/docs/VolumeCreate.md +3 -1
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +187 -88
- data/lib/pnap_network_storage_api/api_client.rb +24 -21
- data/lib/pnap_network_storage_api/api_error.rb +2 -1
- data/lib/pnap_network_storage_api/configuration.rb +28 -9
- data/lib/pnap_network_storage_api/models/error.rb +16 -19
- data/lib/pnap_network_storage_api/models/nfs_permissions.rb +14 -19
- data/lib/pnap_network_storage_api/models/nfs_permissions_create.rb +14 -19
- data/lib/pnap_network_storage_api/models/nfs_permissions_update.rb +14 -19
- data/lib/pnap_network_storage_api/models/permissions.rb +14 -19
- data/lib/pnap_network_storage_api/models/permissions_create.rb +14 -19
- data/lib/pnap_network_storage_api/models/permissions_update.rb +14 -19
- data/lib/pnap_network_storage_api/models/status.rb +8 -4
- data/lib/pnap_network_storage_api/models/storage_network.rb +47 -20
- data/lib/pnap_network_storage_api/models/storage_network_create.rb +78 -24
- data/lib/pnap_network_storage_api/models/storage_network_update.rb +36 -22
- data/lib/pnap_network_storage_api/models/storage_network_volume_create.rb +57 -27
- data/lib/pnap_network_storage_api/models/tag_assignment.rb +311 -0
- data/lib/pnap_network_storage_api/models/tag_assignment_request.rb +233 -0
- data/lib/pnap_network_storage_api/models/volume.rb +62 -23
- data/lib/pnap_network_storage_api/models/volume_create.rb +57 -27
- data/lib/pnap_network_storage_api/models/volume_update.rb +48 -26
- data/lib/pnap_network_storage_api/version.rb +1 -1
- data/lib/pnap_network_storage_api.rb +3 -1
- data/pnap_network_storage_api.gemspec +2 -2
- data/spec/api/storage_networks_api_spec.rb +70 -15
- data/spec/models/error_spec.rb +6 -4
- data/spec/models/nfs_permissions_create_spec.rb +9 -7
- data/spec/models/nfs_permissions_spec.rb +9 -7
- data/spec/models/nfs_permissions_update_spec.rb +9 -7
- data/spec/models/permissions_create_spec.rb +5 -3
- data/spec/models/permissions_spec.rb +5 -3
- data/spec/models/permissions_update_spec.rb +5 -3
- data/spec/models/status_spec.rb +4 -2
- data/spec/models/storage_network_create_spec.rb +14 -6
- data/spec/models/storage_network_spec.rb +19 -11
- data/spec/models/storage_network_update_spec.rb +6 -4
- data/spec/models/storage_network_volume_create_spec.rb +14 -6
- data/spec/models/tag_assignment_request_spec.rb +42 -0
- data/spec/models/tag_assignment_spec.rb +64 -0
- data/spec/models/volume_create_spec.rb +20 -6
- data/spec/models/volume_spec.rb +32 -12
- data/spec/models/volume_update_spec.rb +29 -3
- data/spec/spec_helper.rb +1 -1
- metadata +20 -16
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -81,29 +81,29 @@ module NetworkStorageApi
|
|
81
81
|
|
82
82
|
# Delete a storage network and its volume.
|
83
83
|
# Delete a storage network and its volume. A storage network can only be removed if it's not in 'BUSY' state. Billing stops on storage network deletion.
|
84
|
-
# @param
|
84
|
+
# @param storage_id [String] ID of the storage.
|
85
85
|
# @param [Hash] opts the optional parameters
|
86
86
|
# @return [nil]
|
87
|
-
def storage_networks_id_delete(
|
88
|
-
storage_networks_id_delete_with_http_info(
|
87
|
+
def storage_networks_id_delete(storage_id, opts = {})
|
88
|
+
storage_networks_id_delete_with_http_info(storage_id, opts)
|
89
89
|
nil
|
90
90
|
end
|
91
91
|
|
92
92
|
# Delete a storage network and its volume.
|
93
93
|
# Delete a storage network and its volume. A storage network can only be removed if it's not in 'BUSY' state. Billing stops on storage network deletion.
|
94
|
-
# @param
|
94
|
+
# @param storage_id [String] ID of the storage.
|
95
95
|
# @param [Hash] opts the optional parameters
|
96
96
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
97
|
-
def storage_networks_id_delete_with_http_info(
|
97
|
+
def storage_networks_id_delete_with_http_info(storage_id, opts = {})
|
98
98
|
if @api_client.config.debugging
|
99
99
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_id_delete ...'
|
100
100
|
end
|
101
|
-
# verify the required parameter '
|
102
|
-
if @api_client.config.client_side_validation &&
|
103
|
-
fail ArgumentError, "Missing the required parameter '
|
101
|
+
# verify the required parameter 'storage_id' is set
|
102
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
103
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_id_delete"
|
104
104
|
end
|
105
105
|
# resource path
|
106
|
-
local_var_path = '/storage-networks/{
|
106
|
+
local_var_path = '/storage-networks/{storageId}'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
107
107
|
|
108
108
|
# query parameters
|
109
109
|
query_params = opts[:query_params] || {}
|
@@ -144,29 +144,29 @@ module NetworkStorageApi
|
|
144
144
|
|
145
145
|
# Get storage network details.
|
146
146
|
# Get storage network details.
|
147
|
-
# @param
|
147
|
+
# @param storage_id [String] ID of the storage.
|
148
148
|
# @param [Hash] opts the optional parameters
|
149
149
|
# @return [StorageNetwork]
|
150
|
-
def storage_networks_id_get(
|
151
|
-
data, _status_code, _headers = storage_networks_id_get_with_http_info(
|
150
|
+
def storage_networks_id_get(storage_id, opts = {})
|
151
|
+
data, _status_code, _headers = storage_networks_id_get_with_http_info(storage_id, opts)
|
152
152
|
data
|
153
153
|
end
|
154
154
|
|
155
155
|
# Get storage network details.
|
156
156
|
# Get storage network details.
|
157
|
-
# @param
|
157
|
+
# @param storage_id [String] ID of the storage.
|
158
158
|
# @param [Hash] opts the optional parameters
|
159
159
|
# @return [Array<(StorageNetwork, Integer, Hash)>] StorageNetwork data, response status code and response headers
|
160
|
-
def storage_networks_id_get_with_http_info(
|
160
|
+
def storage_networks_id_get_with_http_info(storage_id, opts = {})
|
161
161
|
if @api_client.config.debugging
|
162
162
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_id_get ...'
|
163
163
|
end
|
164
|
-
# verify the required parameter '
|
165
|
-
if @api_client.config.client_side_validation &&
|
166
|
-
fail ArgumentError, "Missing the required parameter '
|
164
|
+
# verify the required parameter 'storage_id' is set
|
165
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
166
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_id_get"
|
167
167
|
end
|
168
168
|
# resource path
|
169
|
-
local_var_path = '/storage-networks/{
|
169
|
+
local_var_path = '/storage-networks/{storageId}'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
170
170
|
|
171
171
|
# query parameters
|
172
172
|
query_params = opts[:query_params] || {}
|
@@ -207,31 +207,35 @@ module NetworkStorageApi
|
|
207
207
|
|
208
208
|
# Update storage network details.
|
209
209
|
# Update storage network details.
|
210
|
-
# @param
|
210
|
+
# @param storage_id [String] ID of the storage.
|
211
|
+
# @param storage_network_update [StorageNetworkUpdate] Storage network to be updated.
|
211
212
|
# @param [Hash] opts the optional parameters
|
212
|
-
# @option opts [StorageNetworkUpdate] :storage_network_update Storage network to be updated.
|
213
213
|
# @return [StorageNetwork]
|
214
|
-
def storage_networks_id_patch(
|
215
|
-
data, _status_code, _headers = storage_networks_id_patch_with_http_info(
|
214
|
+
def storage_networks_id_patch(storage_id, storage_network_update, opts = {})
|
215
|
+
data, _status_code, _headers = storage_networks_id_patch_with_http_info(storage_id, storage_network_update, opts)
|
216
216
|
data
|
217
217
|
end
|
218
218
|
|
219
219
|
# Update storage network details.
|
220
220
|
# Update storage network details.
|
221
|
-
# @param
|
221
|
+
# @param storage_id [String] ID of the storage.
|
222
|
+
# @param storage_network_update [StorageNetworkUpdate] Storage network to be updated.
|
222
223
|
# @param [Hash] opts the optional parameters
|
223
|
-
# @option opts [StorageNetworkUpdate] :storage_network_update Storage network to be updated.
|
224
224
|
# @return [Array<(StorageNetwork, Integer, Hash)>] StorageNetwork data, response status code and response headers
|
225
|
-
def storage_networks_id_patch_with_http_info(
|
225
|
+
def storage_networks_id_patch_with_http_info(storage_id, storage_network_update, opts = {})
|
226
226
|
if @api_client.config.debugging
|
227
227
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_id_patch ...'
|
228
228
|
end
|
229
|
-
# verify the required parameter '
|
230
|
-
if @api_client.config.client_side_validation &&
|
231
|
-
fail ArgumentError, "Missing the required parameter '
|
229
|
+
# verify the required parameter 'storage_id' is set
|
230
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
231
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_id_patch"
|
232
|
+
end
|
233
|
+
# verify the required parameter 'storage_network_update' is set
|
234
|
+
if @api_client.config.client_side_validation && storage_network_update.nil?
|
235
|
+
fail ArgumentError, "Missing the required parameter 'storage_network_update' when calling StorageNetworksApi.storage_networks_id_patch"
|
232
236
|
end
|
233
237
|
# resource path
|
234
|
-
local_var_path = '/storage-networks/{
|
238
|
+
local_var_path = '/storage-networks/{storageId}'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
235
239
|
|
236
240
|
# query parameters
|
237
241
|
query_params = opts[:query_params] || {}
|
@@ -250,7 +254,7 @@ module NetworkStorageApi
|
|
250
254
|
form_params = opts[:form_params] || {}
|
251
255
|
|
252
256
|
# http body (model)
|
253
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
257
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(storage_network_update)
|
254
258
|
|
255
259
|
# return_type
|
256
260
|
return_type = opts[:debug_return_type] || 'StorageNetwork'
|
@@ -277,23 +281,27 @@ module NetworkStorageApi
|
|
277
281
|
|
278
282
|
# Create a storage network and volume.
|
279
283
|
# Create a storage network and volume.
|
284
|
+
# @param storage_network_create [StorageNetworkCreate]
|
280
285
|
# @param [Hash] opts the optional parameters
|
281
|
-
# @option opts [StorageNetworkCreate] :storage_network_create
|
282
286
|
# @return [StorageNetwork]
|
283
|
-
def storage_networks_post(opts = {})
|
284
|
-
data, _status_code, _headers = storage_networks_post_with_http_info(opts)
|
287
|
+
def storage_networks_post(storage_network_create, opts = {})
|
288
|
+
data, _status_code, _headers = storage_networks_post_with_http_info(storage_network_create, opts)
|
285
289
|
data
|
286
290
|
end
|
287
291
|
|
288
292
|
# Create a storage network and volume.
|
289
293
|
# Create a storage network and volume.
|
294
|
+
# @param storage_network_create [StorageNetworkCreate]
|
290
295
|
# @param [Hash] opts the optional parameters
|
291
|
-
# @option opts [StorageNetworkCreate] :storage_network_create
|
292
296
|
# @return [Array<(StorageNetwork, Integer, Hash)>] StorageNetwork data, response status code and response headers
|
293
|
-
def storage_networks_post_with_http_info(opts = {})
|
297
|
+
def storage_networks_post_with_http_info(storage_network_create, opts = {})
|
294
298
|
if @api_client.config.debugging
|
295
299
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_post ...'
|
296
300
|
end
|
301
|
+
# verify the required parameter 'storage_network_create' is set
|
302
|
+
if @api_client.config.client_side_validation && storage_network_create.nil?
|
303
|
+
fail ArgumentError, "Missing the required parameter 'storage_network_create' when calling StorageNetworksApi.storage_networks_post"
|
304
|
+
end
|
297
305
|
# resource path
|
298
306
|
local_var_path = '/storage-networks'
|
299
307
|
|
@@ -314,7 +322,7 @@ module NetworkStorageApi
|
|
314
322
|
form_params = opts[:form_params] || {}
|
315
323
|
|
316
324
|
# http body (model)
|
317
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
325
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(storage_network_create)
|
318
326
|
|
319
327
|
# return_type
|
320
328
|
return_type = opts[:debug_return_type] || 'StorageNetwork'
|
@@ -341,32 +349,35 @@ module NetworkStorageApi
|
|
341
349
|
|
342
350
|
# Display one or more volumes belonging to a storage network.
|
343
351
|
# Display one or more volumes belonging to a storage network.
|
344
|
-
# @param
|
352
|
+
# @param storage_id [String] ID of the storage.
|
345
353
|
# @param [Hash] opts the optional parameters
|
354
|
+
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
346
355
|
# @return [Array<Volume>]
|
347
|
-
def storage_networks_storage_network_id_volumes_get(
|
348
|
-
data, _status_code, _headers = storage_networks_storage_network_id_volumes_get_with_http_info(
|
356
|
+
def storage_networks_storage_network_id_volumes_get(storage_id, opts = {})
|
357
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_get_with_http_info(storage_id, opts)
|
349
358
|
data
|
350
359
|
end
|
351
360
|
|
352
361
|
# Display one or more volumes belonging to a storage network.
|
353
362
|
# Display one or more volumes belonging to a storage network.
|
354
|
-
# @param
|
363
|
+
# @param storage_id [String] ID of the storage.
|
355
364
|
# @param [Hash] opts the optional parameters
|
365
|
+
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
356
366
|
# @return [Array<(Array<Volume>, Integer, Hash)>] Array<Volume> data, response status code and response headers
|
357
|
-
def storage_networks_storage_network_id_volumes_get_with_http_info(
|
367
|
+
def storage_networks_storage_network_id_volumes_get_with_http_info(storage_id, opts = {})
|
358
368
|
if @api_client.config.debugging
|
359
369
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_get ...'
|
360
370
|
end
|
361
|
-
# verify the required parameter '
|
362
|
-
if @api_client.config.client_side_validation &&
|
363
|
-
fail ArgumentError, "Missing the required parameter '
|
371
|
+
# verify the required parameter 'storage_id' is set
|
372
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
373
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_get"
|
364
374
|
end
|
365
375
|
# resource path
|
366
|
-
local_var_path = '/storage-networks/{
|
376
|
+
local_var_path = '/storage-networks/{storageId}/volumes'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
367
377
|
|
368
378
|
# query parameters
|
369
379
|
query_params = opts[:query_params] || {}
|
380
|
+
query_params[:'tag'] = @api_client.build_collection_param(opts[:'tag'], :multi) if !opts[:'tag'].nil?
|
370
381
|
|
371
382
|
# header parameters
|
372
383
|
header_params = opts[:header_params] || {}
|
@@ -404,31 +415,35 @@ module NetworkStorageApi
|
|
404
415
|
|
405
416
|
# Create a volume belonging to a storage network.
|
406
417
|
# Create a volume belonging to a storage network.
|
407
|
-
# @param
|
418
|
+
# @param storage_id [String] ID of the storage.
|
419
|
+
# @param volume_create [VolumeCreate]
|
408
420
|
# @param [Hash] opts the optional parameters
|
409
|
-
# @option opts [VolumeCreate] :volume_create
|
410
421
|
# @return [Volume]
|
411
|
-
def storage_networks_storage_network_id_volumes_post(
|
412
|
-
data, _status_code, _headers = storage_networks_storage_network_id_volumes_post_with_http_info(
|
422
|
+
def storage_networks_storage_network_id_volumes_post(storage_id, volume_create, opts = {})
|
423
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_post_with_http_info(storage_id, volume_create, opts)
|
413
424
|
data
|
414
425
|
end
|
415
426
|
|
416
427
|
# Create a volume belonging to a storage network.
|
417
428
|
# Create a volume belonging to a storage network.
|
418
|
-
# @param
|
429
|
+
# @param storage_id [String] ID of the storage.
|
430
|
+
# @param volume_create [VolumeCreate]
|
419
431
|
# @param [Hash] opts the optional parameters
|
420
|
-
# @option opts [VolumeCreate] :volume_create
|
421
432
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
422
|
-
def storage_networks_storage_network_id_volumes_post_with_http_info(
|
433
|
+
def storage_networks_storage_network_id_volumes_post_with_http_info(storage_id, volume_create, opts = {})
|
423
434
|
if @api_client.config.debugging
|
424
435
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_post ...'
|
425
436
|
end
|
426
|
-
# verify the required parameter '
|
427
|
-
if @api_client.config.client_side_validation &&
|
428
|
-
fail ArgumentError, "Missing the required parameter '
|
437
|
+
# verify the required parameter 'storage_id' is set
|
438
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
439
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_post"
|
440
|
+
end
|
441
|
+
# verify the required parameter 'volume_create' is set
|
442
|
+
if @api_client.config.client_side_validation && volume_create.nil?
|
443
|
+
fail ArgumentError, "Missing the required parameter 'volume_create' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_post"
|
429
444
|
end
|
430
445
|
# resource path
|
431
|
-
local_var_path = '/storage-networks/{
|
446
|
+
local_var_path = '/storage-networks/{storageId}/volumes'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
432
447
|
|
433
448
|
# query parameters
|
434
449
|
query_params = opts[:query_params] || {}
|
@@ -447,7 +462,7 @@ module NetworkStorageApi
|
|
447
462
|
form_params = opts[:form_params] || {}
|
448
463
|
|
449
464
|
# http body (model)
|
450
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
465
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(volume_create)
|
451
466
|
|
452
467
|
# return_type
|
453
468
|
return_type = opts[:debug_return_type] || 'Volume'
|
@@ -474,35 +489,35 @@ module NetworkStorageApi
|
|
474
489
|
|
475
490
|
# Delete a Storage Network's Volume
|
476
491
|
# Delete a Storage Network's Volume
|
477
|
-
# @param
|
492
|
+
# @param storage_id [String] ID of the storage.
|
478
493
|
# @param volume_id [String] ID of volume.
|
479
494
|
# @param [Hash] opts the optional parameters
|
480
495
|
# @return [nil]
|
481
|
-
def storage_networks_storage_network_id_volumes_volume_id_delete(
|
482
|
-
storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(
|
496
|
+
def storage_networks_storage_network_id_volumes_volume_id_delete(storage_id, volume_id, opts = {})
|
497
|
+
storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_id, volume_id, opts)
|
483
498
|
nil
|
484
499
|
end
|
485
500
|
|
486
501
|
# Delete a Storage Network's Volume
|
487
502
|
# Delete a Storage Network's Volume
|
488
|
-
# @param
|
503
|
+
# @param storage_id [String] ID of the storage.
|
489
504
|
# @param volume_id [String] ID of volume.
|
490
505
|
# @param [Hash] opts the optional parameters
|
491
506
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
492
|
-
def storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(
|
507
|
+
def storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_id, volume_id, opts = {})
|
493
508
|
if @api_client.config.debugging
|
494
509
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete ...'
|
495
510
|
end
|
496
|
-
# verify the required parameter '
|
497
|
-
if @api_client.config.client_side_validation &&
|
498
|
-
fail ArgumentError, "Missing the required parameter '
|
511
|
+
# verify the required parameter 'storage_id' is set
|
512
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
513
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
|
499
514
|
end
|
500
515
|
# verify the required parameter 'volume_id' is set
|
501
516
|
if @api_client.config.client_side_validation && volume_id.nil?
|
502
517
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
|
503
518
|
end
|
504
519
|
# resource path
|
505
|
-
local_var_path = '/storage-networks/{
|
520
|
+
local_var_path = '/storage-networks/{storageId}/volumes/{volumeId}'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
506
521
|
|
507
522
|
# query parameters
|
508
523
|
query_params = opts[:query_params] || {}
|
@@ -543,35 +558,35 @@ module NetworkStorageApi
|
|
543
558
|
|
544
559
|
# Get a storage network's volume details.
|
545
560
|
# Get a storage network's volume details.
|
546
|
-
# @param
|
561
|
+
# @param storage_id [String] ID of the storage.
|
547
562
|
# @param volume_id [String] ID of volume.
|
548
563
|
# @param [Hash] opts the optional parameters
|
549
564
|
# @return [Volume]
|
550
|
-
def storage_networks_storage_network_id_volumes_volume_id_get(
|
551
|
-
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_get_with_http_info(
|
565
|
+
def storage_networks_storage_network_id_volumes_volume_id_get(storage_id, volume_id, opts = {})
|
566
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_get_with_http_info(storage_id, volume_id, opts)
|
552
567
|
data
|
553
568
|
end
|
554
569
|
|
555
570
|
# Get a storage network's volume details.
|
556
571
|
# Get a storage network's volume details.
|
557
|
-
# @param
|
572
|
+
# @param storage_id [String] ID of the storage.
|
558
573
|
# @param volume_id [String] ID of volume.
|
559
574
|
# @param [Hash] opts the optional parameters
|
560
575
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
561
|
-
def storage_networks_storage_network_id_volumes_volume_id_get_with_http_info(
|
576
|
+
def storage_networks_storage_network_id_volumes_volume_id_get_with_http_info(storage_id, volume_id, opts = {})
|
562
577
|
if @api_client.config.debugging
|
563
578
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_get ...'
|
564
579
|
end
|
565
|
-
# verify the required parameter '
|
566
|
-
if @api_client.config.client_side_validation &&
|
567
|
-
fail ArgumentError, "Missing the required parameter '
|
580
|
+
# verify the required parameter 'storage_id' is set
|
581
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
582
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_get"
|
568
583
|
end
|
569
584
|
# verify the required parameter 'volume_id' is set
|
570
585
|
if @api_client.config.client_side_validation && volume_id.nil?
|
571
586
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_get"
|
572
587
|
end
|
573
588
|
# resource path
|
574
|
-
local_var_path = '/storage-networks/{
|
589
|
+
local_var_path = '/storage-networks/{storageId}/volumes/{volumeId}'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
575
590
|
|
576
591
|
# query parameters
|
577
592
|
query_params = opts[:query_params] || {}
|
@@ -612,37 +627,41 @@ module NetworkStorageApi
|
|
612
627
|
|
613
628
|
# Update a storage network's volume details.
|
614
629
|
# Update a storage network's volume details.
|
615
|
-
# @param
|
630
|
+
# @param storage_id [String] ID of the storage.
|
616
631
|
# @param volume_id [String] ID of volume.
|
632
|
+
# @param volume_update [VolumeUpdate] Storage network volume to be updated.
|
617
633
|
# @param [Hash] opts the optional parameters
|
618
|
-
# @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
|
619
634
|
# @return [Volume]
|
620
|
-
def storage_networks_storage_network_id_volumes_volume_id_patch(
|
621
|
-
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(
|
635
|
+
def storage_networks_storage_network_id_volumes_volume_id_patch(storage_id, volume_id, volume_update, opts = {})
|
636
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_id, volume_id, volume_update, opts)
|
622
637
|
data
|
623
638
|
end
|
624
639
|
|
625
640
|
# Update a storage network's volume details.
|
626
641
|
# Update a storage network's volume details.
|
627
|
-
# @param
|
642
|
+
# @param storage_id [String] ID of the storage.
|
628
643
|
# @param volume_id [String] ID of volume.
|
644
|
+
# @param volume_update [VolumeUpdate] Storage network volume to be updated.
|
629
645
|
# @param [Hash] opts the optional parameters
|
630
|
-
# @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
|
631
646
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
632
|
-
def storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(
|
647
|
+
def storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_id, volume_id, volume_update, opts = {})
|
633
648
|
if @api_client.config.debugging
|
634
649
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch ...'
|
635
650
|
end
|
636
|
-
# verify the required parameter '
|
637
|
-
if @api_client.config.client_side_validation &&
|
638
|
-
fail ArgumentError, "Missing the required parameter '
|
651
|
+
# verify the required parameter 'storage_id' is set
|
652
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
653
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
|
639
654
|
end
|
640
655
|
# verify the required parameter 'volume_id' is set
|
641
656
|
if @api_client.config.client_side_validation && volume_id.nil?
|
642
657
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
|
643
658
|
end
|
659
|
+
# verify the required parameter 'volume_update' is set
|
660
|
+
if @api_client.config.client_side_validation && volume_update.nil?
|
661
|
+
fail ArgumentError, "Missing the required parameter 'volume_update' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
|
662
|
+
end
|
644
663
|
# resource path
|
645
|
-
local_var_path = '/storage-networks/{
|
664
|
+
local_var_path = '/storage-networks/{storageId}/volumes/{volumeId}'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
646
665
|
|
647
666
|
# query parameters
|
648
667
|
query_params = opts[:query_params] || {}
|
@@ -661,7 +680,7 @@ module NetworkStorageApi
|
|
661
680
|
form_params = opts[:form_params] || {}
|
662
681
|
|
663
682
|
# http body (model)
|
664
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
683
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(volume_update)
|
665
684
|
|
666
685
|
# return_type
|
667
686
|
return_type = opts[:debug_return_type] || 'Volume'
|
@@ -685,5 +704,85 @@ module NetworkStorageApi
|
|
685
704
|
end
|
686
705
|
return data, status_code, headers
|
687
706
|
end
|
707
|
+
|
708
|
+
# Overwrites tags assigned for the volume.
|
709
|
+
# Overwrites tags assigned for the volume.
|
710
|
+
# @param storage_id [String] ID of the storage.
|
711
|
+
# @param volume_id [String] ID of volume.
|
712
|
+
# @param tag_assignment_request [Array<TagAssignmentRequest>] Tags to assign to the volume.
|
713
|
+
# @param [Hash] opts the optional parameters
|
714
|
+
# @return [Volume]
|
715
|
+
def storage_networks_storage_network_id_volumes_volume_id_tags_put(storage_id, volume_id, tag_assignment_request, opts = {})
|
716
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(storage_id, volume_id, tag_assignment_request, opts)
|
717
|
+
data
|
718
|
+
end
|
719
|
+
|
720
|
+
# Overwrites tags assigned for the volume.
|
721
|
+
# Overwrites tags assigned for the volume.
|
722
|
+
# @param storage_id [String] ID of the storage.
|
723
|
+
# @param volume_id [String] ID of volume.
|
724
|
+
# @param tag_assignment_request [Array<TagAssignmentRequest>] Tags to assign to the volume.
|
725
|
+
# @param [Hash] opts the optional parameters
|
726
|
+
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
727
|
+
def storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(storage_id, volume_id, tag_assignment_request, opts = {})
|
728
|
+
if @api_client.config.debugging
|
729
|
+
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put ...'
|
730
|
+
end
|
731
|
+
# verify the required parameter 'storage_id' is set
|
732
|
+
if @api_client.config.client_side_validation && storage_id.nil?
|
733
|
+
fail ArgumentError, "Missing the required parameter 'storage_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put"
|
734
|
+
end
|
735
|
+
# verify the required parameter 'volume_id' is set
|
736
|
+
if @api_client.config.client_side_validation && volume_id.nil?
|
737
|
+
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put"
|
738
|
+
end
|
739
|
+
# verify the required parameter 'tag_assignment_request' is set
|
740
|
+
if @api_client.config.client_side_validation && tag_assignment_request.nil?
|
741
|
+
fail ArgumentError, "Missing the required parameter 'tag_assignment_request' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put"
|
742
|
+
end
|
743
|
+
# resource path
|
744
|
+
local_var_path = '/storage-networks/{storageId}/volumes/{volumeId}/tags'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
745
|
+
|
746
|
+
# query parameters
|
747
|
+
query_params = opts[:query_params] || {}
|
748
|
+
|
749
|
+
# header parameters
|
750
|
+
header_params = opts[:header_params] || {}
|
751
|
+
# HTTP header 'Accept' (if needed)
|
752
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
753
|
+
# HTTP header 'Content-Type'
|
754
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
755
|
+
if !content_type.nil?
|
756
|
+
header_params['Content-Type'] = content_type
|
757
|
+
end
|
758
|
+
|
759
|
+
# form parameters
|
760
|
+
form_params = opts[:form_params] || {}
|
761
|
+
|
762
|
+
# http body (model)
|
763
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_assignment_request)
|
764
|
+
|
765
|
+
# return_type
|
766
|
+
return_type = opts[:debug_return_type] || 'Volume'
|
767
|
+
|
768
|
+
# auth_names
|
769
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
770
|
+
|
771
|
+
new_options = opts.merge(
|
772
|
+
:operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put",
|
773
|
+
:header_params => header_params,
|
774
|
+
:query_params => query_params,
|
775
|
+
:form_params => form_params,
|
776
|
+
:body => post_body,
|
777
|
+
:auth_names => auth_names,
|
778
|
+
:return_type => return_type
|
779
|
+
)
|
780
|
+
|
781
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
782
|
+
if @api_client.config.debugging
|
783
|
+
@api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_volume_id_tags_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
784
|
+
end
|
785
|
+
return data, status_code, headers
|
786
|
+
end
|
688
787
|
end
|
689
788
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 1.0
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -17,6 +17,7 @@ require 'tempfile'
|
|
17
17
|
require 'time'
|
18
18
|
require 'typhoeus'
|
19
19
|
|
20
|
+
|
20
21
|
module NetworkStorageApi
|
21
22
|
class ApiClient
|
22
23
|
# The Configuration object holding settings to be used in the API client.
|
@@ -31,6 +32,7 @@ module NetworkStorageApi
|
|
31
32
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
32
33
|
def initialize(config = Configuration.default)
|
33
34
|
@config = config
|
35
|
+
@config.params_encoding = :multi
|
34
36
|
@user_agent = "PNAP-ruby-sdk-bmc/#{ NetworkStorageApi::VERSION }"
|
35
37
|
@powered_by = "PNAP-ruby-sdk-bmc/#{ NetworkStorageApi::VERSION }"
|
36
38
|
@default_headers = {
|
@@ -47,9 +49,10 @@ module NetworkStorageApi
|
|
47
49
|
# Call an API with given options.
|
48
50
|
#
|
49
51
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
50
|
-
# the data deserialized from response body (
|
52
|
+
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
51
53
|
def call_api(http_method, path, opts = {})
|
52
54
|
request = build_request(http_method, path, opts)
|
55
|
+
tempfile = download_file(request) if opts[:return_type] == 'File'
|
53
56
|
response = request.run
|
54
57
|
|
55
58
|
if @config.debugging
|
@@ -71,7 +74,9 @@ module NetworkStorageApi
|
|
71
74
|
end
|
72
75
|
end
|
73
76
|
|
74
|
-
if opts[:return_type]
|
77
|
+
if opts[:return_type] == 'File'
|
78
|
+
data = tempfile
|
79
|
+
elsif opts[:return_type]
|
75
80
|
data = deserialize(response, opts[:return_type])
|
76
81
|
else
|
77
82
|
data = nil
|
@@ -127,9 +132,7 @@ module NetworkStorageApi
|
|
127
132
|
end
|
128
133
|
end
|
129
134
|
|
130
|
-
|
131
|
-
download_file(request) if opts[:return_type] == 'File'
|
132
|
-
request
|
135
|
+
Typhoeus::Request.new(url, req_opts)
|
133
136
|
end
|
134
137
|
|
135
138
|
# Builds the HTTP request body
|
@@ -167,6 +170,8 @@ module NetworkStorageApi
|
|
167
170
|
# process can use.
|
168
171
|
#
|
169
172
|
# @see Configuration#temp_folder_path
|
173
|
+
#
|
174
|
+
# @return [Tempfile] the tempfile generated
|
170
175
|
def download_file(request)
|
171
176
|
tempfile = nil
|
172
177
|
encoding = nil
|
@@ -181,21 +186,24 @@ module NetworkStorageApi
|
|
181
186
|
prefix = prefix + '-' unless prefix.end_with?('-')
|
182
187
|
encoding = response.body.encoding
|
183
188
|
tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
|
184
|
-
@tempfile = tempfile
|
185
189
|
end
|
186
190
|
request.on_body do |chunk|
|
187
191
|
chunk.force_encoding(encoding)
|
188
192
|
tempfile.write(chunk)
|
189
193
|
end
|
190
|
-
request
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
194
|
+
# run the request to ensure the tempfile is created successfully before returning it
|
195
|
+
request.run
|
196
|
+
if tempfile
|
197
|
+
tempfile.close
|
198
|
+
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
199
|
+
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
200
|
+
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
201
|
+
"explicitly with `tempfile.delete`"
|
202
|
+
else
|
203
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
198
204
|
end
|
205
|
+
|
206
|
+
tempfile
|
199
207
|
end
|
200
208
|
|
201
209
|
# Check if the given MIME is a JSON MIME.
|
@@ -216,15 +224,10 @@ module NetworkStorageApi
|
|
216
224
|
# @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
|
217
225
|
def deserialize(response, return_type)
|
218
226
|
body = response.body
|
219
|
-
|
220
|
-
# handle file downloading - return the File instance processed in request callbacks
|
221
|
-
# note that response body is empty when the file is written in chunks in request on_body callback
|
222
|
-
return @tempfile if return_type == 'File'
|
223
|
-
|
224
227
|
return nil if body.nil? || body.empty?
|
225
228
|
|
226
229
|
# return response body directly for String return type
|
227
|
-
return body if return_type == 'String'
|
230
|
+
return body.to_s if return_type == 'String'
|
228
231
|
|
229
232
|
# ensuring a default content type
|
230
233
|
content_type = response.headers['Content-Type'] || 'application/json'
|