pnap_network_storage_api 1.0.0 → 1.1.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 +3 -0
- data/VERSION +1 -1
- data/docs/StorageNetworksApi.md +147 -0
- data/docs/Volume.md +2 -0
- data/docs/VolumeUpdate.md +18 -0
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +146 -1
- data/lib/pnap_network_storage_api/api_client.rb +4 -2
- data/lib/pnap_network_storage_api/api_error.rb +1 -1
- data/lib/pnap_network_storage_api/configuration.rb +3 -2
- data/lib/pnap_network_storage_api/models/error.rb +2 -1
- data/lib/pnap_network_storage_api/models/nfs_permissions.rb +2 -1
- data/lib/pnap_network_storage_api/models/permissions.rb +2 -1
- data/lib/pnap_network_storage_api/models/status.rb +1 -1
- data/lib/pnap_network_storage_api/models/storage_network.rb +2 -1
- data/lib/pnap_network_storage_api/models/storage_network_create.rb +2 -1
- data/lib/pnap_network_storage_api/models/storage_network_update.rb +2 -1
- data/lib/pnap_network_storage_api/models/volume.rb +13 -2
- data/lib/pnap_network_storage_api/models/volume_create.rb +2 -1
- data/lib/pnap_network_storage_api/models/volume_update.rb +236 -0
- data/lib/pnap_network_storage_api/version.rb +1 -1
- data/lib/pnap_network_storage_api.rb +2 -1
- data/pnap_network_storage_api.gemspec +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/volume_update_spec.rb +34 -0
- data/spec/spec_helper.rb +1 -1
- metadata +12 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98790b752c44df0148ad5371bd2044d5dff91b569b25c8b7c38e2bc016dd1e5a
|
4
|
+
data.tar.gz: '089913181ec8d92e0560bf0d13991d9dacc5ed2839bc48e92564bbfe3577fd54'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d619f8343b73ad20a8e9bdd40b7efe43ea8c1f2833f3a408af32477a097b70cd0155f8888d0434709d2ee49216ce4f8427074363bf41c2cbd8def0b6f7b616b
|
7
|
+
data.tar.gz: 94b4b770f57606f873a1da64360e4c1faba2737cf2ba6a7ec792f981feb418a4687fb9292793f4d9e8b8a366205da8e37770d5630496280fa1512e217faeba91
|
data/README.md
CHANGED
@@ -127,7 +127,9 @@ Class | Method | HTTP request | Description
|
|
127
127
|
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_id_patch**](docs/StorageNetworksApi.md#storage_networks_id_patch) | **PATCH** /storage-networks/{storageNetworkId} | Update storage network details.
|
128
128
|
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_post**](docs/StorageNetworksApi.md#storage_networks_post) | **POST** /storage-networks | Create a storage network and volume.
|
129
129
|
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_get**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_get) | **GET** /storage-networks/{storageNetworkId}/volumes | Display one or more volumes belonging to a storage network.
|
130
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_delete**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_delete) | **DELETE** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Delete a Storage Network's Volume
|
130
131
|
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_get**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_get) | **GET** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Get a storage network's volume details.
|
132
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_patch**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_patch) | **PATCH** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Update a storage network's volume details.
|
131
133
|
|
132
134
|
|
133
135
|
## Documentation for Models
|
@@ -141,6 +143,7 @@ Class | Method | HTTP request | Description
|
|
141
143
|
- [NetworkStorageApi::StorageNetworkUpdate](docs/StorageNetworkUpdate.md)
|
142
144
|
- [NetworkStorageApi::Volume](docs/Volume.md)
|
143
145
|
- [NetworkStorageApi::VolumeCreate](docs/VolumeCreate.md)
|
146
|
+
- [NetworkStorageApi::VolumeUpdate](docs/VolumeUpdate.md)
|
144
147
|
|
145
148
|
|
146
149
|
## Documentation for Authorization
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/docs/StorageNetworksApi.md
CHANGED
@@ -10,7 +10,9 @@ All URIs are relative to *https://api.phoenixnap.com/network-storage/v1*
|
|
10
10
|
| [**storage_networks_id_patch**](StorageNetworksApi.md#storage_networks_id_patch) | **PATCH** /storage-networks/{storageNetworkId} | Update storage network details. |
|
11
11
|
| [**storage_networks_post**](StorageNetworksApi.md#storage_networks_post) | **POST** /storage-networks | Create a storage network and volume. |
|
12
12
|
| [**storage_networks_storage_network_id_volumes_get**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_get) | **GET** /storage-networks/{storageNetworkId}/volumes | Display one or more volumes belonging to a storage network. |
|
13
|
+
| [**storage_networks_storage_network_id_volumes_volume_id_delete**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_delete) | **DELETE** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Delete a Storage Network's Volume |
|
13
14
|
| [**storage_networks_storage_network_id_volumes_volume_id_get**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_get) | **GET** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Get a storage network's volume details. |
|
15
|
+
| [**storage_networks_storage_network_id_volumes_volume_id_patch**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_patch) | **PATCH** /storage-networks/{storageNetworkId}/volumes/{volumeId} | Update a storage network's volume details. |
|
14
16
|
|
15
17
|
|
16
18
|
## storage_networks_get
|
@@ -434,6 +436,76 @@ end
|
|
434
436
|
- **Accept**: application/json
|
435
437
|
|
436
438
|
|
439
|
+
## storage_networks_storage_network_id_volumes_volume_id_delete
|
440
|
+
|
441
|
+
> storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id)
|
442
|
+
|
443
|
+
Delete a Storage Network's Volume
|
444
|
+
|
445
|
+
Delete a Storage Network's Volume
|
446
|
+
|
447
|
+
### Examples
|
448
|
+
|
449
|
+
```ruby
|
450
|
+
require 'time'
|
451
|
+
require 'pnap_network_storage_api'
|
452
|
+
# setup authorization
|
453
|
+
NetworkStorageApi.configure do |config|
|
454
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
455
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
456
|
+
end
|
457
|
+
|
458
|
+
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
459
|
+
storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
|
460
|
+
volume_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of volume.
|
461
|
+
|
462
|
+
begin
|
463
|
+
# Delete a Storage Network's Volume
|
464
|
+
api_instance.storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id)
|
465
|
+
rescue NetworkStorageApi::ApiError => e
|
466
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_delete: #{e}"
|
467
|
+
end
|
468
|
+
```
|
469
|
+
|
470
|
+
#### Using the storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info variant
|
471
|
+
|
472
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
473
|
+
|
474
|
+
> <Array(nil, Integer, Hash)> storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id)
|
475
|
+
|
476
|
+
```ruby
|
477
|
+
begin
|
478
|
+
# Delete a Storage Network's Volume
|
479
|
+
data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id)
|
480
|
+
p status_code # => 2xx
|
481
|
+
p headers # => { ... }
|
482
|
+
p data # => nil
|
483
|
+
rescue NetworkStorageApi::ApiError => e
|
484
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info: #{e}"
|
485
|
+
end
|
486
|
+
```
|
487
|
+
|
488
|
+
### Parameters
|
489
|
+
|
490
|
+
| Name | Type | Description | Notes |
|
491
|
+
| ---- | ---- | ----------- | ----- |
|
492
|
+
| **storage_network_id** | **String** | ID of storage network. | |
|
493
|
+
| **volume_id** | **String** | ID of volume. | |
|
494
|
+
|
495
|
+
### Return type
|
496
|
+
|
497
|
+
nil (empty response body)
|
498
|
+
|
499
|
+
### Authorization
|
500
|
+
|
501
|
+
[OAuth2](../README.md#OAuth2)
|
502
|
+
|
503
|
+
### HTTP request headers
|
504
|
+
|
505
|
+
- **Content-Type**: Not defined
|
506
|
+
- **Accept**: application/json
|
507
|
+
|
508
|
+
|
437
509
|
## storage_networks_storage_network_id_volumes_volume_id_get
|
438
510
|
|
439
511
|
> <Volume> storage_networks_storage_network_id_volumes_volume_id_get(storage_network_id, volume_id)
|
@@ -504,3 +576,78 @@ end
|
|
504
576
|
- **Content-Type**: Not defined
|
505
577
|
- **Accept**: application/json
|
506
578
|
|
579
|
+
|
580
|
+
## storage_networks_storage_network_id_volumes_volume_id_patch
|
581
|
+
|
582
|
+
> <Volume> storage_networks_storage_network_id_volumes_volume_id_patch(storage_network_id, volume_id, opts)
|
583
|
+
|
584
|
+
Update a storage network's volume details.
|
585
|
+
|
586
|
+
Update a storage network's volume details.
|
587
|
+
|
588
|
+
### Examples
|
589
|
+
|
590
|
+
```ruby
|
591
|
+
require 'time'
|
592
|
+
require 'pnap_network_storage_api'
|
593
|
+
# setup authorization
|
594
|
+
NetworkStorageApi.configure do |config|
|
595
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
596
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
597
|
+
end
|
598
|
+
|
599
|
+
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
600
|
+
storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
|
601
|
+
volume_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of volume.
|
602
|
+
opts = {
|
603
|
+
volume_update: NetworkStorageApi::VolumeUpdate.new # VolumeUpdate | Storage network volume to be updated.
|
604
|
+
}
|
605
|
+
|
606
|
+
begin
|
607
|
+
# Update a storage network's volume details.
|
608
|
+
result = api_instance.storage_networks_storage_network_id_volumes_volume_id_patch(storage_network_id, volume_id, opts)
|
609
|
+
p result
|
610
|
+
rescue NetworkStorageApi::ApiError => e
|
611
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_patch: #{e}"
|
612
|
+
end
|
613
|
+
```
|
614
|
+
|
615
|
+
#### Using the storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info variant
|
616
|
+
|
617
|
+
This returns an Array which contains the response data, status code and headers.
|
618
|
+
|
619
|
+
> <Array(<Volume>, Integer, Hash)> storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts)
|
620
|
+
|
621
|
+
```ruby
|
622
|
+
begin
|
623
|
+
# Update a storage network's volume details.
|
624
|
+
data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts)
|
625
|
+
p status_code # => 2xx
|
626
|
+
p headers # => { ... }
|
627
|
+
p data # => <Volume>
|
628
|
+
rescue NetworkStorageApi::ApiError => e
|
629
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info: #{e}"
|
630
|
+
end
|
631
|
+
```
|
632
|
+
|
633
|
+
### Parameters
|
634
|
+
|
635
|
+
| Name | Type | Description | Notes |
|
636
|
+
| ---- | ---- | ----------- | ----- |
|
637
|
+
| **storage_network_id** | **String** | ID of storage network. | |
|
638
|
+
| **volume_id** | **String** | ID of volume. | |
|
639
|
+
| **volume_update** | [**VolumeUpdate**](VolumeUpdate.md) | Storage network volume to be updated. | [optional] |
|
640
|
+
|
641
|
+
### Return type
|
642
|
+
|
643
|
+
[**Volume**](Volume.md)
|
644
|
+
|
645
|
+
### Authorization
|
646
|
+
|
647
|
+
[OAuth2](../README.md#OAuth2)
|
648
|
+
|
649
|
+
### HTTP request headers
|
650
|
+
|
651
|
+
- **Content-Type**: application/json
|
652
|
+
- **Accept**: application/json
|
653
|
+
|
data/docs/Volume.md
CHANGED
@@ -10,6 +10,7 @@
|
|
10
10
|
| **path** | **String** | Volume's full path. It is in form of `/{volumeId}/pathSuffix`'. | [optional] |
|
11
11
|
| **path_suffix** | **String** | Last part of volume's path. | [optional] |
|
12
12
|
| **capacity_in_gb** | **Integer** | Maximum capacity in GB. | [optional] |
|
13
|
+
| **used_capacity_in_gb** | **Integer** | Used capacity in GB, updated periodically. | [optional] |
|
13
14
|
| **protocol** | **String** | File system protocol. Currently this field should be set to `NFS`. | [optional] |
|
14
15
|
| **status** | [**Status**](Status.md) | | [optional] |
|
15
16
|
| **created_on** | **Time** | | [optional] |
|
@@ -27,6 +28,7 @@ instance = NetworkStorageApi::Volume.new(
|
|
27
28
|
path: /qjul77ahf5fplr2ba484/shared-docs,
|
28
29
|
path_suffix: /shared-docs,
|
29
30
|
capacity_in_gb: 2000,
|
31
|
+
used_capacity_in_gb: 1000,
|
30
32
|
protocol: NFS,
|
31
33
|
status: null,
|
32
34
|
created_on: 2021-03-13T20:24:32.491Z,
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# NetworkStorageApi::VolumeUpdate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **capacity_in_gb** | **Integer** | Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported. | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_network_storage_api'
|
13
|
+
|
14
|
+
instance = NetworkStorageApi::VolumeUpdate.new(
|
15
|
+
capacity_in_gb: 2000
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -402,6 +402,75 @@ module NetworkStorageApi
|
|
402
402
|
return data, status_code, headers
|
403
403
|
end
|
404
404
|
|
405
|
+
# Delete a Storage Network's Volume
|
406
|
+
# Delete a Storage Network's Volume
|
407
|
+
# @param storage_network_id [String] ID of storage network.
|
408
|
+
# @param volume_id [String] ID of volume.
|
409
|
+
# @param [Hash] opts the optional parameters
|
410
|
+
# @return [nil]
|
411
|
+
def storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id, opts = {})
|
412
|
+
storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id, opts)
|
413
|
+
nil
|
414
|
+
end
|
415
|
+
|
416
|
+
# Delete a Storage Network's Volume
|
417
|
+
# Delete a Storage Network's Volume
|
418
|
+
# @param storage_network_id [String] ID of storage network.
|
419
|
+
# @param volume_id [String] ID of volume.
|
420
|
+
# @param [Hash] opts the optional parameters
|
421
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
422
|
+
def storage_networks_storage_network_id_volumes_volume_id_delete_with_http_info(storage_network_id, volume_id, opts = {})
|
423
|
+
if @api_client.config.debugging
|
424
|
+
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete ...'
|
425
|
+
end
|
426
|
+
# verify the required parameter 'storage_network_id' is set
|
427
|
+
if @api_client.config.client_side_validation && storage_network_id.nil?
|
428
|
+
fail ArgumentError, "Missing the required parameter 'storage_network_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
|
429
|
+
end
|
430
|
+
# verify the required parameter 'volume_id' is set
|
431
|
+
if @api_client.config.client_side_validation && volume_id.nil?
|
432
|
+
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete"
|
433
|
+
end
|
434
|
+
# resource path
|
435
|
+
local_var_path = '/storage-networks/{storageNetworkId}/volumes/{volumeId}'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
436
|
+
|
437
|
+
# query parameters
|
438
|
+
query_params = opts[:query_params] || {}
|
439
|
+
|
440
|
+
# header parameters
|
441
|
+
header_params = opts[:header_params] || {}
|
442
|
+
# HTTP header 'Accept' (if needed)
|
443
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
444
|
+
|
445
|
+
# form parameters
|
446
|
+
form_params = opts[:form_params] || {}
|
447
|
+
|
448
|
+
# http body (model)
|
449
|
+
post_body = opts[:debug_body]
|
450
|
+
|
451
|
+
# return_type
|
452
|
+
return_type = opts[:debug_return_type]
|
453
|
+
|
454
|
+
# auth_names
|
455
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
456
|
+
|
457
|
+
new_options = opts.merge(
|
458
|
+
:operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_delete",
|
459
|
+
:header_params => header_params,
|
460
|
+
:query_params => query_params,
|
461
|
+
:form_params => form_params,
|
462
|
+
:body => post_body,
|
463
|
+
:auth_names => auth_names,
|
464
|
+
:return_type => return_type
|
465
|
+
)
|
466
|
+
|
467
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
468
|
+
if @api_client.config.debugging
|
469
|
+
@api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_volume_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
470
|
+
end
|
471
|
+
return data, status_code, headers
|
472
|
+
end
|
473
|
+
|
405
474
|
# Get a storage network's volume details.
|
406
475
|
# Get a storage network's volume details.
|
407
476
|
# @param storage_network_id [String] ID of storage network.
|
@@ -470,5 +539,81 @@ module NetworkStorageApi
|
|
470
539
|
end
|
471
540
|
return data, status_code, headers
|
472
541
|
end
|
542
|
+
|
543
|
+
# Update a storage network's volume details.
|
544
|
+
# Update a storage network's volume details.
|
545
|
+
# @param storage_network_id [String] ID of storage network.
|
546
|
+
# @param volume_id [String] ID of volume.
|
547
|
+
# @param [Hash] opts the optional parameters
|
548
|
+
# @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
|
549
|
+
# @return [Volume]
|
550
|
+
def storage_networks_storage_network_id_volumes_volume_id_patch(storage_network_id, volume_id, opts = {})
|
551
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts)
|
552
|
+
data
|
553
|
+
end
|
554
|
+
|
555
|
+
# Update a storage network's volume details.
|
556
|
+
# Update a storage network's volume details.
|
557
|
+
# @param storage_network_id [String] ID of storage network.
|
558
|
+
# @param volume_id [String] ID of volume.
|
559
|
+
# @param [Hash] opts the optional parameters
|
560
|
+
# @option opts [VolumeUpdate] :volume_update Storage network volume to be updated.
|
561
|
+
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
562
|
+
def storage_networks_storage_network_id_volumes_volume_id_patch_with_http_info(storage_network_id, volume_id, opts = {})
|
563
|
+
if @api_client.config.debugging
|
564
|
+
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch ...'
|
565
|
+
end
|
566
|
+
# verify the required parameter 'storage_network_id' is set
|
567
|
+
if @api_client.config.client_side_validation && storage_network_id.nil?
|
568
|
+
fail ArgumentError, "Missing the required parameter 'storage_network_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
|
569
|
+
end
|
570
|
+
# verify the required parameter 'volume_id' is set
|
571
|
+
if @api_client.config.client_side_validation && volume_id.nil?
|
572
|
+
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch"
|
573
|
+
end
|
574
|
+
# resource path
|
575
|
+
local_var_path = '/storage-networks/{storageNetworkId}/volumes/{volumeId}'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
576
|
+
|
577
|
+
# query parameters
|
578
|
+
query_params = opts[:query_params] || {}
|
579
|
+
|
580
|
+
# header parameters
|
581
|
+
header_params = opts[:header_params] || {}
|
582
|
+
# HTTP header 'Accept' (if needed)
|
583
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
584
|
+
# HTTP header 'Content-Type'
|
585
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
586
|
+
if !content_type.nil?
|
587
|
+
header_params['Content-Type'] = content_type
|
588
|
+
end
|
589
|
+
|
590
|
+
# form parameters
|
591
|
+
form_params = opts[:form_params] || {}
|
592
|
+
|
593
|
+
# http body (model)
|
594
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'volume_update'])
|
595
|
+
|
596
|
+
# return_type
|
597
|
+
return_type = opts[:debug_return_type] || 'Volume'
|
598
|
+
|
599
|
+
# auth_names
|
600
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
601
|
+
|
602
|
+
new_options = opts.merge(
|
603
|
+
:operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_patch",
|
604
|
+
:header_params => header_params,
|
605
|
+
:query_params => query_params,
|
606
|
+
:form_params => form_params,
|
607
|
+
:body => post_body,
|
608
|
+
:auth_names => auth_names,
|
609
|
+
:return_type => return_type
|
610
|
+
)
|
611
|
+
|
612
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
613
|
+
if @api_client.config.debugging
|
614
|
+
@api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_volume_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
615
|
+
end
|
616
|
+
return data, status_code, headers
|
617
|
+
end
|
473
618
|
end
|
474
619
|
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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -95,6 +95,7 @@ module NetworkStorageApi
|
|
95
95
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
96
96
|
query_params = opts[:query_params] || {}
|
97
97
|
form_params = opts[:form_params] || {}
|
98
|
+
follow_location = opts[:follow_location] || true
|
98
99
|
|
99
100
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
100
101
|
|
@@ -111,7 +112,8 @@ module NetworkStorageApi
|
|
111
112
|
:ssl_verifyhost => _verify_ssl_host,
|
112
113
|
:sslcert => @config.cert_file,
|
113
114
|
:sslkey => @config.key_file,
|
114
|
-
:verbose => @config.debugging
|
115
|
+
:verbose => @config.debugging,
|
116
|
+
:followlocation => follow_location
|
115
117
|
}
|
116
118
|
|
117
119
|
# set custom cert, if provided
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -133,6 +133,7 @@ module NetworkStorageApi
|
|
133
133
|
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
134
134
|
attr_accessor :params_encoding
|
135
135
|
|
136
|
+
|
136
137
|
attr_accessor :inject_format
|
137
138
|
|
138
139
|
attr_accessor :force_ending_format
|
@@ -150,10 +151,10 @@ module NetworkStorageApi
|
|
150
151
|
@client_side_validation = true
|
151
152
|
@verify_ssl = true
|
152
153
|
@verify_ssl_host = true
|
153
|
-
@params_encoding = nil
|
154
154
|
@cert_file = nil
|
155
155
|
@key_file = nil
|
156
156
|
@timeout = 0
|
157
|
+
@params_encoding = nil
|
157
158
|
@debugging = false
|
158
159
|
@inject_format = false
|
159
160
|
@force_ending_format = false
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -125,6 +125,7 @@ module NetworkStorageApi
|
|
125
125
|
# @return [Object] Returns the model itself
|
126
126
|
def build_from_hash(attributes)
|
127
127
|
return nil unless attributes.is_a?(Hash)
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
128
129
|
self.class.openapi_types.each_pair do |key, type|
|
129
130
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
130
131
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -159,6 +159,7 @@ module NetworkStorageApi
|
|
159
159
|
# @return [Object] Returns the model itself
|
160
160
|
def build_from_hash(attributes)
|
161
161
|
return nil unless attributes.is_a?(Hash)
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
162
163
|
self.class.openapi_types.each_pair do |key, type|
|
163
164
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
164
165
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -108,6 +108,7 @@ module NetworkStorageApi
|
|
108
108
|
# @return [Object] Returns the model itself
|
109
109
|
def build_from_hash(attributes)
|
110
110
|
return nil unless attributes.is_a?(Hash)
|
111
|
+
attributes = attributes.transform_keys(&:to_sym)
|
111
112
|
self.class.openapi_types.each_pair do |key, type|
|
112
113
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
113
114
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -192,6 +192,7 @@ module NetworkStorageApi
|
|
192
192
|
# @return [Object] Returns the model itself
|
193
193
|
def build_from_hash(attributes)
|
194
194
|
return nil unless attributes.is_a?(Hash)
|
195
|
+
attributes = attributes.transform_keys(&:to_sym)
|
195
196
|
self.class.openapi_types.each_pair do |key, type|
|
196
197
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
197
198
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -227,6 +227,7 @@ module NetworkStorageApi
|
|
227
227
|
# @return [Object] Returns the model itself
|
228
228
|
def build_from_hash(attributes)
|
229
229
|
return nil unless attributes.is_a?(Hash)
|
230
|
+
attributes = attributes.transform_keys(&:to_sym)
|
230
231
|
self.class.openapi_types.each_pair do |key, type|
|
231
232
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
232
233
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -158,6 +158,7 @@ module NetworkStorageApi
|
|
158
158
|
# @return [Object] Returns the model itself
|
159
159
|
def build_from_hash(attributes)
|
160
160
|
return nil unless attributes.is_a?(Hash)
|
161
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
162
|
self.class.openapi_types.each_pair do |key, type|
|
162
163
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
163
164
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -34,6 +34,9 @@ module NetworkStorageApi
|
|
34
34
|
# Maximum capacity in GB.
|
35
35
|
attr_accessor :capacity_in_gb
|
36
36
|
|
37
|
+
# Used capacity in GB, updated periodically.
|
38
|
+
attr_accessor :used_capacity_in_gb
|
39
|
+
|
37
40
|
# File system protocol. Currently this field should be set to `NFS`.
|
38
41
|
attr_accessor :protocol
|
39
42
|
|
@@ -52,6 +55,7 @@ module NetworkStorageApi
|
|
52
55
|
:'path' => :'path',
|
53
56
|
:'path_suffix' => :'pathSuffix',
|
54
57
|
:'capacity_in_gb' => :'capacityInGb',
|
58
|
+
:'used_capacity_in_gb' => :'usedCapacityInGb',
|
55
59
|
:'protocol' => :'protocol',
|
56
60
|
:'status' => :'status',
|
57
61
|
:'created_on' => :'createdOn',
|
@@ -73,6 +77,7 @@ module NetworkStorageApi
|
|
73
77
|
:'path' => :'String',
|
74
78
|
:'path_suffix' => :'String',
|
75
79
|
:'capacity_in_gb' => :'Integer',
|
80
|
+
:'used_capacity_in_gb' => :'Integer',
|
76
81
|
:'protocol' => :'String',
|
77
82
|
:'status' => :'Status',
|
78
83
|
:'created_on' => :'Time',
|
@@ -125,6 +130,10 @@ module NetworkStorageApi
|
|
125
130
|
self.capacity_in_gb = attributes[:'capacity_in_gb']
|
126
131
|
end
|
127
132
|
|
133
|
+
if attributes.key?(:'used_capacity_in_gb')
|
134
|
+
self.used_capacity_in_gb = attributes[:'used_capacity_in_gb']
|
135
|
+
end
|
136
|
+
|
128
137
|
if attributes.key?(:'protocol')
|
129
138
|
self.protocol = attributes[:'protocol']
|
130
139
|
end
|
@@ -166,6 +175,7 @@ module NetworkStorageApi
|
|
166
175
|
path == o.path &&
|
167
176
|
path_suffix == o.path_suffix &&
|
168
177
|
capacity_in_gb == o.capacity_in_gb &&
|
178
|
+
used_capacity_in_gb == o.used_capacity_in_gb &&
|
169
179
|
protocol == o.protocol &&
|
170
180
|
status == o.status &&
|
171
181
|
created_on == o.created_on &&
|
@@ -181,7 +191,7 @@ module NetworkStorageApi
|
|
181
191
|
# Calculates hash code according to all attributes.
|
182
192
|
# @return [Integer] Hash code
|
183
193
|
def hash
|
184
|
-
[id, name, description, path, path_suffix, capacity_in_gb, protocol, status, created_on, permissions].hash
|
194
|
+
[id, name, description, path, path_suffix, capacity_in_gb, used_capacity_in_gb, protocol, status, created_on, permissions].hash
|
185
195
|
end
|
186
196
|
|
187
197
|
# Builds the object from hash
|
@@ -196,6 +206,7 @@ module NetworkStorageApi
|
|
196
206
|
# @return [Object] Returns the model itself
|
197
207
|
def build_from_hash(attributes)
|
198
208
|
return nil unless attributes.is_a?(Hash)
|
209
|
+
attributes = attributes.transform_keys(&:to_sym)
|
199
210
|
self.class.openapi_types.each_pair do |key, type|
|
200
211
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
201
212
|
self.send("#{key}=", nil)
|
@@ -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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -246,6 +246,7 @@ module NetworkStorageApi
|
|
246
246
|
# @return [Object] Returns the model itself
|
247
247
|
def build_from_hash(attributes)
|
248
248
|
return nil unless attributes.is_a?(Hash)
|
249
|
+
attributes = attributes.transform_keys(&:to_sym)
|
249
250
|
self.class.openapi_types.each_pair do |key, type|
|
250
251
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
251
252
|
self.send("#{key}=", nil)
|
@@ -0,0 +1,236 @@
|
|
1
|
+
=begin
|
2
|
+
#Network Storage API
|
3
|
+
|
4
|
+
#Create, list, edit, and delete storage networks with the Network Storage API. Use storage networks to expand storage capacity on a private network. <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bare-metal-cloud-storage' target='_blank'>here</a> </span> <br> <b>All URLs are relative to (https://api.phoenixnap.com/network-storage/v1/)</b>
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@phoenixnap.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module NetworkStorageApi
|
17
|
+
# Update storage network volume.
|
18
|
+
class VolumeUpdate
|
19
|
+
# Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported.
|
20
|
+
attr_accessor :capacity_in_gb
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'capacity_in_gb' => :'capacityInGb'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.openapi_types
|
36
|
+
{
|
37
|
+
:'capacity_in_gb' => :'Integer'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of attributes with nullable: true
|
42
|
+
def self.openapi_nullable
|
43
|
+
Set.new([
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
if (!attributes.is_a?(Hash))
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `NetworkStorageApi::VolumeUpdate` initialize method"
|
52
|
+
end
|
53
|
+
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::VolumeUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
+
end
|
59
|
+
h[k.to_sym] = v
|
60
|
+
}
|
61
|
+
|
62
|
+
if attributes.key?(:'capacity_in_gb')
|
63
|
+
self.capacity_in_gb = attributes[:'capacity_in_gb']
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
+
# @return Array for valid properties with the reasons
|
69
|
+
def list_invalid_properties
|
70
|
+
invalid_properties = Array.new
|
71
|
+
if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
|
72
|
+
invalid_properties.push('invalid value for "capacity_in_gb", must be greater than or equal to 2000.')
|
73
|
+
end
|
74
|
+
|
75
|
+
invalid_properties
|
76
|
+
end
|
77
|
+
|
78
|
+
# Check to see if the all the properties in the model are valid
|
79
|
+
# @return true if the model is valid
|
80
|
+
def valid?
|
81
|
+
return false if !@capacity_in_gb.nil? && @capacity_in_gb < 2000
|
82
|
+
true
|
83
|
+
end
|
84
|
+
|
85
|
+
# Custom attribute writer method with validation
|
86
|
+
# @param [Object] capacity_in_gb Value to be assigned
|
87
|
+
def capacity_in_gb=(capacity_in_gb)
|
88
|
+
if !capacity_in_gb.nil? && capacity_in_gb < 2000
|
89
|
+
fail ArgumentError, 'invalid value for "capacity_in_gb", must be greater than or equal to 2000.'
|
90
|
+
end
|
91
|
+
|
92
|
+
@capacity_in_gb = capacity_in_gb
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks equality by comparing each attribute.
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def ==(o)
|
98
|
+
return true if self.equal?(o)
|
99
|
+
self.class == o.class &&
|
100
|
+
capacity_in_gb == o.capacity_in_gb
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Integer] Hash code
|
111
|
+
def hash
|
112
|
+
[capacity_in_gb].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def self.build_from_hash(attributes)
|
119
|
+
new.build_from_hash(attributes)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def build_from_hash(attributes)
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
127
|
+
attributes = attributes.transform_keys(&:to_sym)
|
128
|
+
self.class.openapi_types.each_pair do |key, type|
|
129
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
130
|
+
self.send("#{key}=", nil)
|
131
|
+
elsif type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def _deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :Time
|
152
|
+
Time.parse(value)
|
153
|
+
when :Date
|
154
|
+
Date.parse(value)
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :Boolean
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
# models (e.g. Pet) or oneOf
|
183
|
+
klass = NetworkStorageApi.const_get(type)
|
184
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the string representation of the object
|
189
|
+
# @return [String] String presentation of the object
|
190
|
+
def to_s
|
191
|
+
to_hash.to_s
|
192
|
+
end
|
193
|
+
|
194
|
+
# to_body is an alias to to_hash (backward compatibility)
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_body
|
197
|
+
to_hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the object in the form of hash
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = self.send(attr)
|
206
|
+
if value.nil?
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
|
+
end
|
210
|
+
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
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: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -26,6 +26,7 @@ require 'pnap_network_storage_api/models/storage_network_create'
|
|
26
26
|
require 'pnap_network_storage_api/models/storage_network_update'
|
27
27
|
require 'pnap_network_storage_api/models/volume'
|
28
28
|
require 'pnap_network_storage_api/models/volume_create'
|
29
|
+
require 'pnap_network_storage_api/models/volume_update'
|
29
30
|
|
30
31
|
# APIs
|
31
32
|
require 'pnap_network_storage_api/api/storage_networks_api'
|
data/spec/api_client_spec.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
=begin
|
2
|
+
#Network Storage API
|
3
|
+
|
4
|
+
#Create, list, edit, and delete storage networks with the Network Storage API. Use storage networks to expand storage capacity on a private network. <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bare-metal-cloud-storage' target='_blank'>here</a> </span> <br> <b>All URLs are relative to (https://api.phoenixnap.com/network-storage/v1/)</b>
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@phoenixnap.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for NetworkStorageApi::VolumeUpdate
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe NetworkStorageApi::VolumeUpdate do
|
21
|
+
let(:instance) { NetworkStorageApi::VolumeUpdate.new }
|
22
|
+
|
23
|
+
describe 'test an instance of VolumeUpdate' do
|
24
|
+
it 'should create an instance of VolumeUpdate' do
|
25
|
+
expect(instance).to be_instance_of(NetworkStorageApi::VolumeUpdate)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "capacity_in_gb"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pnap_network_storage_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PhoenixNAP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- docs/StorageNetworksApi.md
|
72
72
|
- docs/Volume.md
|
73
73
|
- docs/VolumeCreate.md
|
74
|
+
- docs/VolumeUpdate.md
|
74
75
|
- lib/pnap_network_storage_api.rb
|
75
76
|
- lib/pnap_network_storage_api/api/storage_networks_api.rb
|
76
77
|
- lib/pnap_network_storage_api/api_client.rb
|
@@ -85,6 +86,7 @@ files:
|
|
85
86
|
- lib/pnap_network_storage_api/models/storage_network_update.rb
|
86
87
|
- lib/pnap_network_storage_api/models/volume.rb
|
87
88
|
- lib/pnap_network_storage_api/models/volume_create.rb
|
89
|
+
- lib/pnap_network_storage_api/models/volume_update.rb
|
88
90
|
- lib/pnap_network_storage_api/version.rb
|
89
91
|
- pnap_network_storage_api.gemspec
|
90
92
|
- spec/api/storage_networks_api_spec.rb
|
@@ -99,6 +101,7 @@ files:
|
|
99
101
|
- spec/models/storage_network_update_spec.rb
|
100
102
|
- spec/models/volume_create_spec.rb
|
101
103
|
- spec/models/volume_spec.rb
|
104
|
+
- spec/models/volume_update_spec.rb
|
102
105
|
- spec/spec_helper.rb
|
103
106
|
homepage: https://phoenixnap.com/bare-metal-cloud
|
104
107
|
licenses:
|
@@ -120,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
123
|
- !ruby/object:Gem::Version
|
121
124
|
version: '0'
|
122
125
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
126
|
+
rubygems_version: 3.3.5
|
124
127
|
signing_key:
|
125
128
|
specification_version: 4
|
126
129
|
summary: Network Storage API Ruby Gem
|
@@ -128,13 +131,14 @@ test_files:
|
|
128
131
|
- spec/api/storage_networks_api_spec.rb
|
129
132
|
- spec/api_client_spec.rb
|
130
133
|
- spec/configuration_spec.rb
|
131
|
-
- spec/models/
|
132
|
-
- spec/models/
|
134
|
+
- spec/models/permissions_spec.rb
|
135
|
+
- spec/models/storage_network_create_spec.rb
|
136
|
+
- spec/models/volume_create_spec.rb
|
133
137
|
- spec/models/error_spec.rb
|
138
|
+
- spec/models/storage_network_spec.rb
|
134
139
|
- spec/models/nfs_permissions_spec.rb
|
135
140
|
- spec/models/status_spec.rb
|
136
|
-
- spec/models/
|
137
|
-
- spec/models/
|
138
|
-
- spec/models/volume_create_spec.rb
|
141
|
+
- spec/models/volume_spec.rb
|
142
|
+
- spec/models/volume_update_spec.rb
|
139
143
|
- spec/models/storage_network_update_spec.rb
|
140
144
|
- spec/spec_helper.rb
|