pnap_network_storage_api 1.3.0 → 1.4.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/StorageNetworkCreate.md +3 -1
- data/docs/StorageNetworkVolumeCreate.md +3 -1
- data/docs/StorageNetworksApi.md +84 -4
- data/docs/TagAssignment.md +26 -0
- data/docs/TagAssignmentRequest.md +20 -0
- data/docs/Volume.md +3 -1
- data/docs/VolumeCreate.md +3 -1
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +79 -0
- data/lib/pnap_network_storage_api/models/storage_network_create.rb +38 -4
- data/lib/pnap_network_storage_api/models/storage_network_volume_create.rb +16 -4
- data/lib/pnap_network_storage_api/models/tag_assignment.rb +310 -0
- data/lib/pnap_network_storage_api/models/tag_assignment_request.rb +236 -0
- data/lib/pnap_network_storage_api/models/volume.rb +16 -4
- data/lib/pnap_network_storage_api/models/volume_create.rb +16 -4
- data/lib/pnap_network_storage_api.rb +2 -0
- data/spec/models/tag_assignment_request_spec.rb +40 -0
- data/spec/models/tag_assignment_spec.rb +62 -0
- metadata +18 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5668cd5b72b5d4d17579c59d465487d9797605a11be10e84fe34baab3b80e20
|
4
|
+
data.tar.gz: a8008f4c3b394379243e953dfc3cbc574fc39e1f6db99a3d44c4651655849981
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76bce7930c96de9ef060590d9e12827a6886c9d48b8f90985505fb2db1c34cb6975789dd0765d2d7ff24a6dd8ab2c5ab9303b95bb8374231cf43caa062ed7b22
|
7
|
+
data.tar.gz: fbc2196d6a5bd40b9f85b9b8e837ec642b2a16c9c569197c80cfa93d92fa10aea11ade6802a79707858972260dd5e565b052e8c3d98c0ffc0182442aa82cffb8
|
data/README.md
CHANGED
@@ -131,6 +131,7 @@ Class | Method | HTTP request | Description
|
|
131
131
|
*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
|
132
132
|
*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.
|
133
133
|
*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.
|
134
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_storage_network_id_volumes_volume_id_tags_put**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_tags_put) | **PUT** /storage-networks/{storageNetworkId}/volumes/{volumeId}/tags | Overwrites tags assigned for the volume.
|
134
135
|
|
135
136
|
|
136
137
|
## Documentation for Models
|
@@ -147,6 +148,8 @@ Class | Method | HTTP request | Description
|
|
147
148
|
- [NetworkStorageApi::StorageNetworkCreate](docs/StorageNetworkCreate.md)
|
148
149
|
- [NetworkStorageApi::StorageNetworkUpdate](docs/StorageNetworkUpdate.md)
|
149
150
|
- [NetworkStorageApi::StorageNetworkVolumeCreate](docs/StorageNetworkVolumeCreate.md)
|
151
|
+
- [NetworkStorageApi::TagAssignment](docs/TagAssignment.md)
|
152
|
+
- [NetworkStorageApi::TagAssignmentRequest](docs/TagAssignmentRequest.md)
|
150
153
|
- [NetworkStorageApi::Volume](docs/Volume.md)
|
151
154
|
- [NetworkStorageApi::VolumeCreate](docs/VolumeCreate.md)
|
152
155
|
- [NetworkStorageApi::VolumeUpdate](docs/VolumeUpdate.md)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
@@ -8,6 +8,7 @@
|
|
8
8
|
| **description** | **String** | Storage network description. | [optional] |
|
9
9
|
| **location** | **String** | Location of storage network. Currently this field should be set to `PHX` or `ASH`. | |
|
10
10
|
| **volumes** | [**Array<StorageNetworkVolumeCreate>**](StorageNetworkVolumeCreate.md) | Volume to be created alongside storage. Currently only 1 volume is supported. | |
|
11
|
+
| **client_vlan** | **Integer** | Custom Client VLAN that the Storage Network will be set to. | [optional] |
|
11
12
|
|
12
13
|
## Example
|
13
14
|
|
@@ -18,7 +19,8 @@ instance = NetworkStorageApi::StorageNetworkCreate.new(
|
|
18
19
|
name: My storage network,
|
19
20
|
description: My storage network description,
|
20
21
|
location: PHX,
|
21
|
-
volumes: null
|
22
|
+
volumes: null,
|
23
|
+
client_vlan: null
|
22
24
|
)
|
23
25
|
```
|
24
26
|
|
@@ -8,6 +8,7 @@
|
|
8
8
|
| **description** | **String** | Volume description. | [optional] |
|
9
9
|
| **path_suffix** | **String** | Last part of volume's path. | [optional] |
|
10
10
|
| **capacity_in_gb** | **Integer** | Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported. | |
|
11
|
+
| **tags** | [**Array<TagAssignmentRequest>**](TagAssignmentRequest.md) | Tags to set to the resource. To create a new tag or list all the existing tags that you can use, refer to [Tags API](https://developers.phoenixnap.com/docs/tags/1/overview). | [optional] |
|
11
12
|
|
12
13
|
## Example
|
13
14
|
|
@@ -18,7 +19,8 @@ instance = NetworkStorageApi::StorageNetworkVolumeCreate.new(
|
|
18
19
|
name: My volume name,
|
19
20
|
description: My volume description,
|
20
21
|
path_suffix: /shared-docs,
|
21
|
-
capacity_in_gb: 2000
|
22
|
+
capacity_in_gb: 2000,
|
23
|
+
tags: [{"name":"stage","value":"beta"},{"name":"group","value":"discounted"}]
|
22
24
|
)
|
23
25
|
```
|
24
26
|
|
data/docs/StorageNetworksApi.md
CHANGED
@@ -14,6 +14,7 @@ All URIs are relative to *https://api.phoenixnap.com/network-storage/v1*
|
|
14
14
|
| [**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 |
|
15
15
|
| [**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. |
|
16
16
|
| [**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. |
|
17
|
+
| [**storage_networks_storage_network_id_volumes_volume_id_tags_put**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_volume_id_tags_put) | **PUT** /storage-networks/{storageNetworkId}/volumes/{volumeId}/tags | Overwrites tags assigned for the volume. |
|
17
18
|
|
18
19
|
|
19
20
|
## storage_networks_get
|
@@ -370,7 +371,7 @@ end
|
|
370
371
|
|
371
372
|
## storage_networks_storage_network_id_volumes_get
|
372
373
|
|
373
|
-
> <Array<Volume>> storage_networks_storage_network_id_volumes_get(storage_network_id)
|
374
|
+
> <Array<Volume>> storage_networks_storage_network_id_volumes_get(storage_network_id, opts)
|
374
375
|
|
375
376
|
Display one or more volumes belonging to a storage network.
|
376
377
|
|
@@ -389,10 +390,13 @@ end
|
|
389
390
|
|
390
391
|
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
391
392
|
storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
|
393
|
+
opts = {
|
394
|
+
tag: ['inner_example'] # Array<String> | A list of query parameters related to tags in the form of tagName.tagValue
|
395
|
+
}
|
392
396
|
|
393
397
|
begin
|
394
398
|
# Display one or more volumes belonging to a storage network.
|
395
|
-
result = api_instance.storage_networks_storage_network_id_volumes_get(storage_network_id)
|
399
|
+
result = api_instance.storage_networks_storage_network_id_volumes_get(storage_network_id, opts)
|
396
400
|
p result
|
397
401
|
rescue NetworkStorageApi::ApiError => e
|
398
402
|
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_get: #{e}"
|
@@ -403,12 +407,12 @@ end
|
|
403
407
|
|
404
408
|
This returns an Array which contains the response data, status code and headers.
|
405
409
|
|
406
|
-
> <Array(<Array<Volume>>, Integer, Hash)> storage_networks_storage_network_id_volumes_get_with_http_info(storage_network_id)
|
410
|
+
> <Array(<Array<Volume>>, Integer, Hash)> storage_networks_storage_network_id_volumes_get_with_http_info(storage_network_id, opts)
|
407
411
|
|
408
412
|
```ruby
|
409
413
|
begin
|
410
414
|
# Display one or more volumes belonging to a storage network.
|
411
|
-
data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_get_with_http_info(storage_network_id)
|
415
|
+
data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_get_with_http_info(storage_network_id, opts)
|
412
416
|
p status_code # => 2xx
|
413
417
|
p headers # => { ... }
|
414
418
|
p data # => <Array<Volume>>
|
@@ -422,6 +426,7 @@ end
|
|
422
426
|
| Name | Type | Description | Notes |
|
423
427
|
| ---- | ---- | ----------- | ----- |
|
424
428
|
| **storage_network_id** | **String** | ID of storage network. | |
|
429
|
+
| **tag** | [**Array<String>**](String.md) | A list of query parameters related to tags in the form of tagName.tagValue | [optional] |
|
425
430
|
|
426
431
|
### Return type
|
427
432
|
|
@@ -725,3 +730,78 @@ end
|
|
725
730
|
- **Content-Type**: application/json
|
726
731
|
- **Accept**: application/json
|
727
732
|
|
733
|
+
|
734
|
+
## storage_networks_storage_network_id_volumes_volume_id_tags_put
|
735
|
+
|
736
|
+
> <Volume> storage_networks_storage_network_id_volumes_volume_id_tags_put(storage_network_id, volume_id, opts)
|
737
|
+
|
738
|
+
Overwrites tags assigned for the volume.
|
739
|
+
|
740
|
+
Overwrites tags assigned for the volume.
|
741
|
+
|
742
|
+
### Examples
|
743
|
+
|
744
|
+
```ruby
|
745
|
+
require 'time'
|
746
|
+
require 'pnap_network_storage_api'
|
747
|
+
# setup authorization
|
748
|
+
NetworkStorageApi.configure do |config|
|
749
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
750
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
751
|
+
end
|
752
|
+
|
753
|
+
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
754
|
+
storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
|
755
|
+
volume_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of volume.
|
756
|
+
opts = {
|
757
|
+
tag_assignment_request: [NetworkStorageApi::TagAssignmentRequest.new({name: 'Environment'})] # Array<TagAssignmentRequest> | Tags to assign to the volume.
|
758
|
+
}
|
759
|
+
|
760
|
+
begin
|
761
|
+
# Overwrites tags assigned for the volume.
|
762
|
+
result = api_instance.storage_networks_storage_network_id_volumes_volume_id_tags_put(storage_network_id, volume_id, opts)
|
763
|
+
p result
|
764
|
+
rescue NetworkStorageApi::ApiError => e
|
765
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_tags_put: #{e}"
|
766
|
+
end
|
767
|
+
```
|
768
|
+
|
769
|
+
#### Using the storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info variant
|
770
|
+
|
771
|
+
This returns an Array which contains the response data, status code and headers.
|
772
|
+
|
773
|
+
> <Array(<Volume>, Integer, Hash)> storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(storage_network_id, volume_id, opts)
|
774
|
+
|
775
|
+
```ruby
|
776
|
+
begin
|
777
|
+
# Overwrites tags assigned for the volume.
|
778
|
+
data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(storage_network_id, volume_id, opts)
|
779
|
+
p status_code # => 2xx
|
780
|
+
p headers # => { ... }
|
781
|
+
p data # => <Volume>
|
782
|
+
rescue NetworkStorageApi::ApiError => e
|
783
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info: #{e}"
|
784
|
+
end
|
785
|
+
```
|
786
|
+
|
787
|
+
### Parameters
|
788
|
+
|
789
|
+
| Name | Type | Description | Notes |
|
790
|
+
| ---- | ---- | ----------- | ----- |
|
791
|
+
| **storage_network_id** | **String** | ID of storage network. | |
|
792
|
+
| **volume_id** | **String** | ID of volume. | |
|
793
|
+
| **tag_assignment_request** | [**Array<TagAssignmentRequest>**](TagAssignmentRequest.md) | Tags to assign to the volume. | [optional] |
|
794
|
+
|
795
|
+
### Return type
|
796
|
+
|
797
|
+
[**Volume**](Volume.md)
|
798
|
+
|
799
|
+
### Authorization
|
800
|
+
|
801
|
+
[OAuth2](../README.md#OAuth2)
|
802
|
+
|
803
|
+
### HTTP request headers
|
804
|
+
|
805
|
+
- **Content-Type**: application/json
|
806
|
+
- **Accept**: application/json
|
807
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# NetworkStorageApi::TagAssignment
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | The unique id of the tag. | |
|
8
|
+
| **name** | **String** | The name of the tag. | |
|
9
|
+
| **value** | **String** | The value of the tag assigned to the resource. | [optional] |
|
10
|
+
| **is_billing_tag** | **Boolean** | Whether or not to show the tag as part of billing and invoices | |
|
11
|
+
| **created_by** | **String** | Who the tag was created by. | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'pnap_network_storage_api'
|
17
|
+
|
18
|
+
instance = NetworkStorageApi::TagAssignment.new(
|
19
|
+
id: 60ffafcdffb8b074c7968dad,
|
20
|
+
name: Environment,
|
21
|
+
value: PROD,
|
22
|
+
is_billing_tag: true,
|
23
|
+
created_by: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# NetworkStorageApi::TagAssignmentRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | The name of the tag. Tag names are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}. | |
|
8
|
+
| **value** | **String** | The value of the tag assigned to the resource. Tag values are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_network_storage_api'
|
14
|
+
|
15
|
+
instance = NetworkStorageApi::TagAssignmentRequest.new(
|
16
|
+
name: Environment,
|
17
|
+
value: PROD
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/Volume.md
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
| **status** | [**Status**](Status.md) | | [optional] |
|
16
16
|
| **created_on** | **Time** | | [optional] |
|
17
17
|
| **permissions** | [**Permissions**](Permissions.md) | | [optional] |
|
18
|
+
| **tags** | [**Array<TagAssignment>**](TagAssignment.md) | The tags assigned if any. | [optional] |
|
18
19
|
|
19
20
|
## Example
|
20
21
|
|
@@ -32,7 +33,8 @@ instance = NetworkStorageApi::Volume.new(
|
|
32
33
|
protocol: NFS,
|
33
34
|
status: null,
|
34
35
|
created_on: 2021-03-13T20:24:32.491Z,
|
35
|
-
permissions: null
|
36
|
+
permissions: null,
|
37
|
+
tags: [{"name":"stage","value":"beta"},{"name":"group","value":"discounted"}]
|
36
38
|
)
|
37
39
|
```
|
38
40
|
|
data/docs/VolumeCreate.md
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
| **path_suffix** | **String** | Last part of volume's path. | [optional] |
|
10
10
|
| **capacity_in_gb** | **Integer** | Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported. | |
|
11
11
|
| **permissions** | [**PermissionsCreate**](PermissionsCreate.md) | | [optional] |
|
12
|
+
| **tags** | [**Array<TagAssignmentRequest>**](TagAssignmentRequest.md) | Tags to set to the resource. To create a new tag or list all the existing tags that you can use, refer to [Tags API](https://developers.phoenixnap.com/docs/tags/1/overview). | [optional] |
|
12
13
|
|
13
14
|
## Example
|
14
15
|
|
@@ -20,7 +21,8 @@ instance = NetworkStorageApi::VolumeCreate.new(
|
|
20
21
|
description: My volume description,
|
21
22
|
path_suffix: /shared-docs,
|
22
23
|
capacity_in_gb: 2000,
|
23
|
-
permissions: null
|
24
|
+
permissions: null,
|
25
|
+
tags: [{"name":"stage","value":"beta"},{"name":"group","value":"discounted"}]
|
24
26
|
)
|
25
27
|
```
|
26
28
|
|
@@ -343,6 +343,7 @@ module NetworkStorageApi
|
|
343
343
|
# Display one or more volumes belonging to a storage network.
|
344
344
|
# @param storage_network_id [String] ID of storage network.
|
345
345
|
# @param [Hash] opts the optional parameters
|
346
|
+
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
346
347
|
# @return [Array<Volume>]
|
347
348
|
def storage_networks_storage_network_id_volumes_get(storage_network_id, opts = {})
|
348
349
|
data, _status_code, _headers = storage_networks_storage_network_id_volumes_get_with_http_info(storage_network_id, opts)
|
@@ -353,6 +354,7 @@ module NetworkStorageApi
|
|
353
354
|
# Display one or more volumes belonging to a storage network.
|
354
355
|
# @param storage_network_id [String] ID of storage network.
|
355
356
|
# @param [Hash] opts the optional parameters
|
357
|
+
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
356
358
|
# @return [Array<(Array<Volume>, Integer, Hash)>] Array<Volume> data, response status code and response headers
|
357
359
|
def storage_networks_storage_network_id_volumes_get_with_http_info(storage_network_id, opts = {})
|
358
360
|
if @api_client.config.debugging
|
@@ -367,6 +369,7 @@ module NetworkStorageApi
|
|
367
369
|
|
368
370
|
# query parameters
|
369
371
|
query_params = opts[:query_params] || {}
|
372
|
+
query_params[:'tag'] = @api_client.build_collection_param(opts[:'tag'], :multi) if !opts[:'tag'].nil?
|
370
373
|
|
371
374
|
# header parameters
|
372
375
|
header_params = opts[:header_params] || {}
|
@@ -685,5 +688,81 @@ module NetworkStorageApi
|
|
685
688
|
end
|
686
689
|
return data, status_code, headers
|
687
690
|
end
|
691
|
+
|
692
|
+
# Overwrites tags assigned for the volume.
|
693
|
+
# Overwrites tags assigned for the volume.
|
694
|
+
# @param storage_network_id [String] ID of storage network.
|
695
|
+
# @param volume_id [String] ID of volume.
|
696
|
+
# @param [Hash] opts the optional parameters
|
697
|
+
# @option opts [Array<TagAssignmentRequest>] :tag_assignment_request Tags to assign to the volume.
|
698
|
+
# @return [Volume]
|
699
|
+
def storage_networks_storage_network_id_volumes_volume_id_tags_put(storage_network_id, volume_id, opts = {})
|
700
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_volume_id_tags_put_with_http_info(storage_network_id, volume_id, opts)
|
701
|
+
data
|
702
|
+
end
|
703
|
+
|
704
|
+
# Overwrites tags assigned for the volume.
|
705
|
+
# Overwrites tags assigned for the volume.
|
706
|
+
# @param storage_network_id [String] ID of storage network.
|
707
|
+
# @param volume_id [String] ID of volume.
|
708
|
+
# @param [Hash] opts the optional parameters
|
709
|
+
# @option opts [Array<TagAssignmentRequest>] :tag_assignment_request Tags to assign to the volume.
|
710
|
+
# @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(storage_network_id, volume_id, opts = {})
|
712
|
+
if @api_client.config.debugging
|
713
|
+
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put ...'
|
714
|
+
end
|
715
|
+
# verify the required parameter 'storage_network_id' is set
|
716
|
+
if @api_client.config.client_side_validation && storage_network_id.nil?
|
717
|
+
fail ArgumentError, "Missing the required parameter 'storage_network_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put"
|
718
|
+
end
|
719
|
+
# verify the required parameter 'volume_id' is set
|
720
|
+
if @api_client.config.client_side_validation && volume_id.nil?
|
721
|
+
fail ArgumentError, "Missing the required parameter 'volume_id' when calling StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put"
|
722
|
+
end
|
723
|
+
# resource path
|
724
|
+
local_var_path = '/storage-networks/{storageNetworkId}/volumes/{volumeId}/tags'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
|
725
|
+
|
726
|
+
# query parameters
|
727
|
+
query_params = opts[:query_params] || {}
|
728
|
+
|
729
|
+
# header parameters
|
730
|
+
header_params = opts[:header_params] || {}
|
731
|
+
# HTTP header 'Accept' (if needed)
|
732
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
733
|
+
# HTTP header 'Content-Type'
|
734
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
735
|
+
if !content_type.nil?
|
736
|
+
header_params['Content-Type'] = content_type
|
737
|
+
end
|
738
|
+
|
739
|
+
# form parameters
|
740
|
+
form_params = opts[:form_params] || {}
|
741
|
+
|
742
|
+
# http body (model)
|
743
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'tag_assignment_request'])
|
744
|
+
|
745
|
+
# return_type
|
746
|
+
return_type = opts[:debug_return_type] || 'Volume'
|
747
|
+
|
748
|
+
# auth_names
|
749
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
750
|
+
|
751
|
+
new_options = opts.merge(
|
752
|
+
:operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_volume_id_tags_put",
|
753
|
+
:header_params => header_params,
|
754
|
+
:query_params => query_params,
|
755
|
+
:form_params => form_params,
|
756
|
+
:body => post_body,
|
757
|
+
:auth_names => auth_names,
|
758
|
+
:return_type => return_type
|
759
|
+
)
|
760
|
+
|
761
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
762
|
+
if @api_client.config.debugging
|
763
|
+
@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}"
|
764
|
+
end
|
765
|
+
return data, status_code, headers
|
766
|
+
end
|
688
767
|
end
|
689
768
|
end
|
@@ -28,13 +28,17 @@ module NetworkStorageApi
|
|
28
28
|
# Volume to be created alongside storage. Currently only 1 volume is supported.
|
29
29
|
attr_accessor :volumes
|
30
30
|
|
31
|
+
# Custom Client VLAN that the Storage Network will be set to.
|
32
|
+
attr_accessor :client_vlan
|
33
|
+
|
31
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
35
|
def self.attribute_map
|
33
36
|
{
|
34
37
|
:'name' => :'name',
|
35
38
|
:'description' => :'description',
|
36
39
|
:'location' => :'location',
|
37
|
-
:'volumes' => :'volumes'
|
40
|
+
:'volumes' => :'volumes',
|
41
|
+
:'client_vlan' => :'clientVlan'
|
38
42
|
}
|
39
43
|
end
|
40
44
|
|
@@ -49,7 +53,8 @@ module NetworkStorageApi
|
|
49
53
|
:'name' => :'String',
|
50
54
|
:'description' => :'String',
|
51
55
|
:'location' => :'String',
|
52
|
-
:'volumes' => :'Array<StorageNetworkVolumeCreate>'
|
56
|
+
:'volumes' => :'Array<StorageNetworkVolumeCreate>',
|
57
|
+
:'client_vlan' => :'Integer'
|
53
58
|
}
|
54
59
|
end
|
55
60
|
|
@@ -91,6 +96,10 @@ module NetworkStorageApi
|
|
91
96
|
self.volumes = value
|
92
97
|
end
|
93
98
|
end
|
99
|
+
|
100
|
+
if attributes.key?(:'client_vlan')
|
101
|
+
self.client_vlan = attributes[:'client_vlan']
|
102
|
+
end
|
94
103
|
end
|
95
104
|
|
96
105
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -129,6 +138,14 @@ module NetworkStorageApi
|
|
129
138
|
invalid_properties.push('invalid value for "volumes", number of items must be greater than or equal to 1.')
|
130
139
|
end
|
131
140
|
|
141
|
+
if !@client_vlan.nil? && @client_vlan > 4094
|
142
|
+
invalid_properties.push('invalid value for "client_vlan", must be smaller than or equal to 4094.')
|
143
|
+
end
|
144
|
+
|
145
|
+
if !@client_vlan.nil? && @client_vlan < 2
|
146
|
+
invalid_properties.push('invalid value for "client_vlan", must be greater than or equal to 2.')
|
147
|
+
end
|
148
|
+
|
132
149
|
invalid_properties
|
133
150
|
end
|
134
151
|
|
@@ -143,6 +160,8 @@ module NetworkStorageApi
|
|
143
160
|
return false if @volumes.nil?
|
144
161
|
return false if @volumes.length > 1
|
145
162
|
return false if @volumes.length < 1
|
163
|
+
return false if !@client_vlan.nil? && @client_vlan > 4094
|
164
|
+
return false if !@client_vlan.nil? && @client_vlan < 2
|
146
165
|
true
|
147
166
|
end
|
148
167
|
|
@@ -192,6 +211,20 @@ module NetworkStorageApi
|
|
192
211
|
@volumes = volumes
|
193
212
|
end
|
194
213
|
|
214
|
+
# Custom attribute writer method with validation
|
215
|
+
# @param [Object] client_vlan Value to be assigned
|
216
|
+
def client_vlan=(client_vlan)
|
217
|
+
if !client_vlan.nil? && client_vlan > 4094
|
218
|
+
fail ArgumentError, 'invalid value for "client_vlan", must be smaller than or equal to 4094.'
|
219
|
+
end
|
220
|
+
|
221
|
+
if !client_vlan.nil? && client_vlan < 2
|
222
|
+
fail ArgumentError, 'invalid value for "client_vlan", must be greater than or equal to 2.'
|
223
|
+
end
|
224
|
+
|
225
|
+
@client_vlan = client_vlan
|
226
|
+
end
|
227
|
+
|
195
228
|
# Checks equality by comparing each attribute.
|
196
229
|
# @param [Object] Object to be compared
|
197
230
|
def ==(o)
|
@@ -200,7 +233,8 @@ module NetworkStorageApi
|
|
200
233
|
name == o.name &&
|
201
234
|
description == o.description &&
|
202
235
|
location == o.location &&
|
203
|
-
volumes == o.volumes
|
236
|
+
volumes == o.volumes &&
|
237
|
+
client_vlan == o.client_vlan
|
204
238
|
end
|
205
239
|
|
206
240
|
# @see the `==` method
|
@@ -212,7 +246,7 @@ module NetworkStorageApi
|
|
212
246
|
# Calculates hash code according to all attributes.
|
213
247
|
# @return [Integer] Hash code
|
214
248
|
def hash
|
215
|
-
[name, description, location, volumes].hash
|
249
|
+
[name, description, location, volumes, client_vlan].hash
|
216
250
|
end
|
217
251
|
|
218
252
|
# Builds the object from hash
|
@@ -28,13 +28,17 @@ module NetworkStorageApi
|
|
28
28
|
# Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported.
|
29
29
|
attr_accessor :capacity_in_gb
|
30
30
|
|
31
|
+
# Tags to set to the resource. To create a new tag or list all the existing tags that you can use, refer to [Tags API](https://developers.phoenixnap.com/docs/tags/1/overview).
|
32
|
+
attr_accessor :tags
|
33
|
+
|
31
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
35
|
def self.attribute_map
|
33
36
|
{
|
34
37
|
:'name' => :'name',
|
35
38
|
:'description' => :'description',
|
36
39
|
:'path_suffix' => :'pathSuffix',
|
37
|
-
:'capacity_in_gb' => :'capacityInGb'
|
40
|
+
:'capacity_in_gb' => :'capacityInGb',
|
41
|
+
:'tags' => :'tags'
|
38
42
|
}
|
39
43
|
end
|
40
44
|
|
@@ -49,7 +53,8 @@ module NetworkStorageApi
|
|
49
53
|
:'name' => :'String',
|
50
54
|
:'description' => :'String',
|
51
55
|
:'path_suffix' => :'String',
|
52
|
-
:'capacity_in_gb' => :'Integer'
|
56
|
+
:'capacity_in_gb' => :'Integer',
|
57
|
+
:'tags' => :'Array<TagAssignmentRequest>'
|
53
58
|
}
|
54
59
|
end
|
55
60
|
|
@@ -89,6 +94,12 @@ module NetworkStorageApi
|
|
89
94
|
if attributes.key?(:'capacity_in_gb')
|
90
95
|
self.capacity_in_gb = attributes[:'capacity_in_gb']
|
91
96
|
end
|
97
|
+
|
98
|
+
if attributes.key?(:'tags')
|
99
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
100
|
+
self.tags = value
|
101
|
+
end
|
102
|
+
end
|
92
103
|
end
|
93
104
|
|
94
105
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -219,7 +230,8 @@ module NetworkStorageApi
|
|
219
230
|
name == o.name &&
|
220
231
|
description == o.description &&
|
221
232
|
path_suffix == o.path_suffix &&
|
222
|
-
capacity_in_gb == o.capacity_in_gb
|
233
|
+
capacity_in_gb == o.capacity_in_gb &&
|
234
|
+
tags == o.tags
|
223
235
|
end
|
224
236
|
|
225
237
|
# @see the `==` method
|
@@ -231,7 +243,7 @@ module NetworkStorageApi
|
|
231
243
|
# Calculates hash code according to all attributes.
|
232
244
|
# @return [Integer] Hash code
|
233
245
|
def hash
|
234
|
-
[name, description, path_suffix, capacity_in_gb].hash
|
246
|
+
[name, description, path_suffix, capacity_in_gb, tags].hash
|
235
247
|
end
|
236
248
|
|
237
249
|
# Builds the object from hash
|