pnap_network_storage_api 1.4.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 +12 -9
- data/VERSION +1 -1
- data/docs/StorageNetwork.md +2 -0
- data/docs/StorageNetworksApi.md +77 -87
- data/docs/Volume.md +2 -0
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +120 -100
- 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 +42 -22
- 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 +41 -23
- data/lib/pnap_network_storage_api/models/tag_assignment.rb +20 -19
- data/lib/pnap_network_storage_api/models/tag_assignment_request.rb +16 -19
- data/lib/pnap_network_storage_api/models/volume.rb +47 -20
- data/lib/pnap_network_storage_api/models/volume_create.rb +41 -23
- 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 +1 -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 +6 -4
- data/spec/models/tag_assignment_spec.rb +9 -7
- 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 +13 -17
- 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,31 +349,31 @@ 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
|
346
354
|
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
347
355
|
# @return [Array<Volume>]
|
348
|
-
def storage_networks_storage_network_id_volumes_get(
|
349
|
-
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)
|
350
358
|
data
|
351
359
|
end
|
352
360
|
|
353
361
|
# Display one or more volumes belonging to a storage network.
|
354
362
|
# Display one or more volumes belonging to a storage network.
|
355
|
-
# @param
|
363
|
+
# @param storage_id [String] ID of the storage.
|
356
364
|
# @param [Hash] opts the optional parameters
|
357
365
|
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
358
366
|
# @return [Array<(Array<Volume>, Integer, Hash)>] Array<Volume> data, response status code and response headers
|
359
|
-
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 = {})
|
360
368
|
if @api_client.config.debugging
|
361
369
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_get ...'
|
362
370
|
end
|
363
|
-
# verify the required parameter '
|
364
|
-
if @api_client.config.client_side_validation &&
|
365
|
-
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"
|
366
374
|
end
|
367
375
|
# resource path
|
368
|
-
local_var_path = '/storage-networks/{
|
376
|
+
local_var_path = '/storage-networks/{storageId}/volumes'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
369
377
|
|
370
378
|
# query parameters
|
371
379
|
query_params = opts[:query_params] || {}
|
@@ -407,31 +415,35 @@ module NetworkStorageApi
|
|
407
415
|
|
408
416
|
# Create a volume belonging to a storage network.
|
409
417
|
# Create a volume belonging to a storage network.
|
410
|
-
# @param
|
418
|
+
# @param storage_id [String] ID of the storage.
|
419
|
+
# @param volume_create [VolumeCreate]
|
411
420
|
# @param [Hash] opts the optional parameters
|
412
|
-
# @option opts [VolumeCreate] :volume_create
|
413
421
|
# @return [Volume]
|
414
|
-
def storage_networks_storage_network_id_volumes_post(
|
415
|
-
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)
|
416
424
|
data
|
417
425
|
end
|
418
426
|
|
419
427
|
# Create a volume belonging to a storage network.
|
420
428
|
# Create a volume belonging to a storage network.
|
421
|
-
# @param
|
429
|
+
# @param storage_id [String] ID of the storage.
|
430
|
+
# @param volume_create [VolumeCreate]
|
422
431
|
# @param [Hash] opts the optional parameters
|
423
|
-
# @option opts [VolumeCreate] :volume_create
|
424
432
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
425
|
-
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 = {})
|
426
434
|
if @api_client.config.debugging
|
427
435
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_post ...'
|
428
436
|
end
|
429
|
-
# verify the required parameter '
|
430
|
-
if @api_client.config.client_side_validation &&
|
431
|
-
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"
|
432
444
|
end
|
433
445
|
# resource path
|
434
|
-
local_var_path = '/storage-networks/{
|
446
|
+
local_var_path = '/storage-networks/{storageId}/volumes'.sub('{' + 'storageId' + '}', CGI.escape(storage_id.to_s))
|
435
447
|
|
436
448
|
# query parameters
|
437
449
|
query_params = opts[:query_params] || {}
|
@@ -450,7 +462,7 @@ module NetworkStorageApi
|
|
450
462
|
form_params = opts[:form_params] || {}
|
451
463
|
|
452
464
|
# http body (model)
|
453
|
-
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)
|
454
466
|
|
455
467
|
# return_type
|
456
468
|
return_type = opts[:debug_return_type] || 'Volume'
|
@@ -477,35 +489,35 @@ module NetworkStorageApi
|
|
477
489
|
|
478
490
|
# Delete a Storage Network's Volume
|
479
491
|
# Delete a Storage Network's Volume
|
480
|
-
# @param
|
492
|
+
# @param storage_id [String] ID of the storage.
|
481
493
|
# @param volume_id [String] ID of volume.
|
482
494
|
# @param [Hash] opts the optional parameters
|
483
495
|
# @return [nil]
|
484
|
-
def storage_networks_storage_network_id_volumes_volume_id_delete(
|
485
|
-
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)
|
486
498
|
nil
|
487
499
|
end
|
488
500
|
|
489
501
|
# Delete a Storage Network's Volume
|
490
502
|
# Delete a Storage Network's Volume
|
491
|
-
# @param
|
503
|
+
# @param storage_id [String] ID of the storage.
|
492
504
|
# @param volume_id [String] ID of volume.
|
493
505
|
# @param [Hash] opts the optional parameters
|
494
506
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
495
|
-
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 = {})
|
496
508
|
if @api_client.config.debugging
|
497
509
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete ...'
|
498
510
|
end
|
499
|
-
# verify the required parameter '
|
500
|
-
if @api_client.config.client_side_validation &&
|
501
|
-
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"
|
502
514
|
end
|
503
515
|
# verify the required parameter 'volume_id' is set
|
504
516
|
if @api_client.config.client_side_validation && volume_id.nil?
|
505
517
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
|
506
518
|
end
|
507
519
|
# resource path
|
508
|
-
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))
|
509
521
|
|
510
522
|
# query parameters
|
511
523
|
query_params = opts[:query_params] || {}
|
@@ -546,35 +558,35 @@ module NetworkStorageApi
|
|
546
558
|
|
547
559
|
# Get a storage network's volume details.
|
548
560
|
# Get a storage network's volume details.
|
549
|
-
# @param
|
561
|
+
# @param storage_id [String] ID of the storage.
|
550
562
|
# @param volume_id [String] ID of volume.
|
551
563
|
# @param [Hash] opts the optional parameters
|
552
564
|
# @return [Volume]
|
553
|
-
def storage_networks_storage_network_id_volumes_volume_id_get(
|
554
|
-
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)
|
555
567
|
data
|
556
568
|
end
|
557
569
|
|
558
570
|
# Get a storage network's volume details.
|
559
571
|
# Get a storage network's volume details.
|
560
|
-
# @param
|
572
|
+
# @param storage_id [String] ID of the storage.
|
561
573
|
# @param volume_id [String] ID of volume.
|
562
574
|
# @param [Hash] opts the optional parameters
|
563
575
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
564
|
-
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 = {})
|
565
577
|
if @api_client.config.debugging
|
566
578
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_get ...'
|
567
579
|
end
|
568
|
-
# verify the required parameter '
|
569
|
-
if @api_client.config.client_side_validation &&
|
570
|
-
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"
|
571
583
|
end
|
572
584
|
# verify the required parameter 'volume_id' is set
|
573
585
|
if @api_client.config.client_side_validation && volume_id.nil?
|
574
586
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_get"
|
575
587
|
end
|
576
588
|
# resource path
|
577
|
-
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))
|
578
590
|
|
579
591
|
# query parameters
|
580
592
|
query_params = opts[:query_params] || {}
|
@@ -615,37 +627,41 @@ module NetworkStorageApi
|
|
615
627
|
|
616
628
|
# Update a storage network's volume details.
|
617
629
|
# Update a storage network's volume details.
|
618
|
-
# @param
|
630
|
+
# @param storage_id [String] ID of the storage.
|
619
631
|
# @param volume_id [String] ID of volume.
|
632
|
+
# @param volume_update [VolumeUpdate] Storage network volume to be updated.
|
620
633
|
# @param [Hash] opts the optional parameters
|
621
|
-
# @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
|
622
634
|
# @return [Volume]
|
623
|
-
def storage_networks_storage_network_id_volumes_volume_id_patch(
|
624
|
-
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)
|
625
637
|
data
|
626
638
|
end
|
627
639
|
|
628
640
|
# Update a storage network's volume details.
|
629
641
|
# Update a storage network's volume details.
|
630
|
-
# @param
|
642
|
+
# @param storage_id [String] ID of the storage.
|
631
643
|
# @param volume_id [String] ID of volume.
|
644
|
+
# @param volume_update [VolumeUpdate] Storage network volume to be updated.
|
632
645
|
# @param [Hash] opts the optional parameters
|
633
|
-
# @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
|
634
646
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
635
|
-
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 = {})
|
636
648
|
if @api_client.config.debugging
|
637
649
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch ...'
|
638
650
|
end
|
639
|
-
# verify the required parameter '
|
640
|
-
if @api_client.config.client_side_validation &&
|
641
|
-
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"
|
642
654
|
end
|
643
655
|
# verify the required parameter 'volume_id' is set
|
644
656
|
if @api_client.config.client_side_validation && volume_id.nil?
|
645
657
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
|
646
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
|
647
663
|
# resource path
|
648
|
-
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))
|
649
665
|
|
650
666
|
# query parameters
|
651
667
|
query_params = opts[:query_params] || {}
|
@@ -664,7 +680,7 @@ module NetworkStorageApi
|
|
664
680
|
form_params = opts[:form_params] || {}
|
665
681
|
|
666
682
|
# http body (model)
|
667
|
-
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)
|
668
684
|
|
669
685
|
# return_type
|
670
686
|
return_type = opts[:debug_return_type] || 'Volume'
|
@@ -691,37 +707,41 @@ module NetworkStorageApi
|
|
691
707
|
|
692
708
|
# Overwrites tags assigned for the volume.
|
693
709
|
# Overwrites tags assigned for the volume.
|
694
|
-
# @param
|
710
|
+
# @param storage_id [String] ID of the storage.
|
695
711
|
# @param volume_id [String] ID of volume.
|
712
|
+
# @param tag_assignment_request [Array<TagAssignmentRequest>] Tags to assign to the volume.
|
696
713
|
# @param [Hash] opts the optional parameters
|
697
|
-
# @option opts [Array<TagAssignmentRequest>] :tag_assignment_request Tags to assign to the volume.
|
698
714
|
# @return [Volume]
|
699
|
-
def storage_networks_storage_network_id_volumes_volume_id_tags_put(
|
700
|
-
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(
|
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)
|
701
717
|
data
|
702
718
|
end
|
703
719
|
|
704
720
|
# Overwrites tags assigned for the volume.
|
705
721
|
# Overwrites tags assigned for the volume.
|
706
|
-
# @param
|
722
|
+
# @param storage_id [String] ID of the storage.
|
707
723
|
# @param volume_id [String] ID of volume.
|
724
|
+
# @param tag_assignment_request [Array<TagAssignmentRequest>] Tags to assign to the volume.
|
708
725
|
# @param [Hash] opts the optional parameters
|
709
|
-
# @option opts [Array<TagAssignmentRequest>] :tag_assignment_request Tags to assign to the volume.
|
710
726
|
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
711
|
-
def storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(
|
727
|
+
def storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(storage_id, volume_id, tag_assignment_request, opts = {})
|
712
728
|
if @api_client.config.debugging
|
713
729
|
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put ...'
|
714
730
|
end
|
715
|
-
# verify the required parameter '
|
716
|
-
if @api_client.config.client_side_validation &&
|
717
|
-
fail ArgumentError, "Missing the required parameter '
|
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"
|
718
734
|
end
|
719
735
|
# verify the required parameter 'volume_id' is set
|
720
736
|
if @api_client.config.client_side_validation && volume_id.nil?
|
721
737
|
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put"
|
722
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
|
723
743
|
# resource path
|
724
|
-
local_var_path = '/storage-networks/{
|
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))
|
725
745
|
|
726
746
|
# query parameters
|
727
747
|
query_params = opts[:query_params] || {}
|
@@ -740,7 +760,7 @@ module NetworkStorageApi
|
|
740
760
|
form_params = opts[:form_params] || {}
|
741
761
|
|
742
762
|
# http body (model)
|
743
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
763
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_assignment_request)
|
744
764
|
|
745
765
|
# return_type
|
746
766
|
return_type = opts[:debug_return_type] || 'Volume'
|
@@ -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'
|
@@ -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
|
|
@@ -32,6 +32,7 @@ module NetworkStorageApi
|
|
32
32
|
end
|
33
33
|
else
|
34
34
|
super arg
|
35
|
+
@message = arg
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|