pnap_network_storage_api 1.1.0 → 1.3.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 +6 -0
- data/VERSION +1 -1
- data/docs/NfsPermissionsCreate.md +26 -0
- data/docs/NfsPermissionsUpdate.md +26 -0
- data/docs/PermissionsCreate.md +18 -0
- data/docs/PermissionsUpdate.md +18 -0
- data/docs/StorageNetworkCreate.md +2 -2
- data/docs/StorageNetworkVolumeCreate.md +24 -0
- data/docs/StorageNetworksApi.md +75 -1
- data/docs/VolumeCreate.md +3 -1
- data/docs/VolumeUpdate.md +9 -1
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +70 -0
- data/lib/pnap_network_storage_api/models/nfs_permissions_create.rb +271 -0
- data/lib/pnap_network_storage_api/models/nfs_permissions_update.rb +271 -0
- data/lib/pnap_network_storage_api/models/permissions_create.rb +220 -0
- data/lib/pnap_network_storage_api/models/permissions_update.rb +220 -0
- data/lib/pnap_network_storage_api/models/storage_network_create.rb +2 -2
- data/lib/pnap_network_storage_api/models/storage_network_volume_create.rb +358 -0
- data/lib/pnap_network_storage_api/models/volume_create.rb +26 -17
- data/lib/pnap_network_storage_api/models/volume_update.rb +117 -4
- data/lib/pnap_network_storage_api.rb +5 -0
- data/spec/models/nfs_permissions_create_spec.rb +58 -0
- data/spec/models/nfs_permissions_update_spec.rb +58 -0
- data/spec/models/permissions_create_spec.rb +34 -0
- data/spec/models/permissions_update_spec.rb +34 -0
- data/spec/models/storage_network_volume_create_spec.rb +52 -0
- metadata +27 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d120bcac5267b846f83dbc1ea051aee392e9b82300931c585dfdcac8cadb63a
|
4
|
+
data.tar.gz: bcd0e1bbb133621426684eaf5e2458e577b929abb6c7178e82e1bb036b79f47d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 239ff1a8f22703984c1ff835bd980a0327182efbdeab62e9d47abfd850faa52bd832e95138890ef732cacfbe2ff7ed74cff5235e40b834fc513ffbe5a2944c61
|
7
|
+
data.tar.gz: ccc43adb4c49d25efd01379afbd3b60ab0b67817814b68a4a0b5b0345c21ec570f715f845c6c32eb36012c3e2e9ee587e10f446bda2a94c2d825bc95b56cac12
|
data/README.md
CHANGED
@@ -127,6 +127,7 @@ 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_post**](docs/StorageNetworksApi.md#storage_networks_storage_network_id_volumes_post) | **POST** /storage-networks/{storageNetworkId}/volumes | Create a volume belonging to a storage network.
|
130
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
|
131
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.
|
132
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.
|
@@ -136,11 +137,16 @@ Class | Method | HTTP request | Description
|
|
136
137
|
|
137
138
|
- [NetworkStorageApi::Error](docs/Error.md)
|
138
139
|
- [NetworkStorageApi::NfsPermissions](docs/NfsPermissions.md)
|
140
|
+
- [NetworkStorageApi::NfsPermissionsCreate](docs/NfsPermissionsCreate.md)
|
141
|
+
- [NetworkStorageApi::NfsPermissionsUpdate](docs/NfsPermissionsUpdate.md)
|
139
142
|
- [NetworkStorageApi::Permissions](docs/Permissions.md)
|
143
|
+
- [NetworkStorageApi::PermissionsCreate](docs/PermissionsCreate.md)
|
144
|
+
- [NetworkStorageApi::PermissionsUpdate](docs/PermissionsUpdate.md)
|
140
145
|
- [NetworkStorageApi::Status](docs/Status.md)
|
141
146
|
- [NetworkStorageApi::StorageNetwork](docs/StorageNetwork.md)
|
142
147
|
- [NetworkStorageApi::StorageNetworkCreate](docs/StorageNetworkCreate.md)
|
143
148
|
- [NetworkStorageApi::StorageNetworkUpdate](docs/StorageNetworkUpdate.md)
|
149
|
+
- [NetworkStorageApi::StorageNetworkVolumeCreate](docs/StorageNetworkVolumeCreate.md)
|
144
150
|
- [NetworkStorageApi::Volume](docs/Volume.md)
|
145
151
|
- [NetworkStorageApi::VolumeCreate](docs/VolumeCreate.md)
|
146
152
|
- [NetworkStorageApi::VolumeUpdate](docs/VolumeUpdate.md)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.0
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# NetworkStorageApi::NfsPermissionsCreate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **read_write** | **Array<String>** | Read/Write access. | [optional] |
|
8
|
+
| **read_only** | **Array<String>** | Read only access. | [optional] |
|
9
|
+
| **root_squash** | **Array<String>** | Root squash permission. | [optional] |
|
10
|
+
| **no_squash** | **Array<String>** | No squash permission. | [optional] |
|
11
|
+
| **all_squash** | **Array<String>** | All squash permission. | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'pnap_network_storage_api'
|
17
|
+
|
18
|
+
instance = NetworkStorageApi::NfsPermissionsCreate.new(
|
19
|
+
read_write: ["100.80.0.5","100.80.0.6"],
|
20
|
+
read_only: ["100.80.0.5"],
|
21
|
+
root_squash: ["100.80.0.5","100.80.0.4/24"],
|
22
|
+
no_squash: ["100.80.0.7","100.80.0.*"],
|
23
|
+
all_squash: ["100.80.0.5","100.80.0.6"]
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# NetworkStorageApi::NfsPermissionsUpdate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **read_write** | **Array<String>** | Read/Write access. | [optional] |
|
8
|
+
| **read_only** | **Array<String>** | Read only access. | [optional] |
|
9
|
+
| **root_squash** | **Array<String>** | Root squash permission. | [optional] |
|
10
|
+
| **no_squash** | **Array<String>** | No squash permission. | [optional] |
|
11
|
+
| **all_squash** | **Array<String>** | All squash permission. | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'pnap_network_storage_api'
|
17
|
+
|
18
|
+
instance = NetworkStorageApi::NfsPermissionsUpdate.new(
|
19
|
+
read_write: ["100.80.0.5","100.80.0.6"],
|
20
|
+
read_only: ["100.80.0.5"],
|
21
|
+
root_squash: ["100.80.0.5","100.80.0.4/24"],
|
22
|
+
no_squash: ["100.80.0.7","100.80.0.*"],
|
23
|
+
all_squash: ["100.80.0.5","100.80.0.6"]
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# NetworkStorageApi::PermissionsCreate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **nfs** | [**NfsPermissionsCreate**](NfsPermissionsCreate.md) | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_network_storage_api'
|
13
|
+
|
14
|
+
instance = NetworkStorageApi::PermissionsCreate.new(
|
15
|
+
nfs: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# NetworkStorageApi::PermissionsUpdate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **nfs** | [**NfsPermissionsUpdate**](NfsPermissionsUpdate.md) | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_network_storage_api'
|
13
|
+
|
14
|
+
instance = NetworkStorageApi::PermissionsUpdate.new(
|
15
|
+
nfs: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -6,8 +6,8 @@
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **name** | **String** | Storage network friendly name. | |
|
8
8
|
| **description** | **String** | Storage network description. | [optional] |
|
9
|
-
| **location** | **String** | Location of storage network. Currently this field should be set to `PHX`. | |
|
10
|
-
| **volumes** | [**Array<
|
9
|
+
| **location** | **String** | Location of storage network. Currently this field should be set to `PHX` or `ASH`. | |
|
10
|
+
| **volumes** | [**Array<StorageNetworkVolumeCreate>**](StorageNetworkVolumeCreate.md) | Volume to be created alongside storage. Currently only 1 volume is supported. | |
|
11
11
|
|
12
12
|
## Example
|
13
13
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# NetworkStorageApi::StorageNetworkVolumeCreate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | Volume friendly name. | |
|
8
|
+
| **description** | **String** | Volume description. | [optional] |
|
9
|
+
| **path_suffix** | **String** | Last part of volume's path. | [optional] |
|
10
|
+
| **capacity_in_gb** | **Integer** | Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported. | |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'pnap_network_storage_api'
|
16
|
+
|
17
|
+
instance = NetworkStorageApi::StorageNetworkVolumeCreate.new(
|
18
|
+
name: My volume name,
|
19
|
+
description: My volume description,
|
20
|
+
path_suffix: /shared-docs,
|
21
|
+
capacity_in_gb: 2000
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
data/docs/StorageNetworksApi.md
CHANGED
@@ -10,6 +10,7 @@ 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_post**](StorageNetworksApi.md#storage_networks_storage_network_id_volumes_post) | **POST** /storage-networks/{storageNetworkId}/volumes | Create a volume belonging to a storage network. |
|
13
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 |
|
14
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. |
|
15
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. |
|
@@ -317,7 +318,7 @@ end
|
|
317
318
|
|
318
319
|
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
319
320
|
opts = {
|
320
|
-
storage_network_create: NetworkStorageApi::StorageNetworkCreate.new({name: 'My storage network', location: 'PHX', volumes: [NetworkStorageApi::
|
321
|
+
storage_network_create: NetworkStorageApi::StorageNetworkCreate.new({name: 'My storage network', location: 'PHX', volumes: [NetworkStorageApi::StorageNetworkVolumeCreate.new({name: 'My volume name', capacity_in_gb: 2000})]}) # StorageNetworkCreate |
|
321
322
|
}
|
322
323
|
|
323
324
|
begin
|
@@ -436,6 +437,79 @@ end
|
|
436
437
|
- **Accept**: application/json
|
437
438
|
|
438
439
|
|
440
|
+
## storage_networks_storage_network_id_volumes_post
|
441
|
+
|
442
|
+
> <Volume> storage_networks_storage_network_id_volumes_post(storage_network_id, opts)
|
443
|
+
|
444
|
+
Create a volume belonging to a storage network.
|
445
|
+
|
446
|
+
Create a volume belonging to a storage network.
|
447
|
+
|
448
|
+
### Examples
|
449
|
+
|
450
|
+
```ruby
|
451
|
+
require 'time'
|
452
|
+
require 'pnap_network_storage_api'
|
453
|
+
# setup authorization
|
454
|
+
NetworkStorageApi.configure do |config|
|
455
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
456
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
457
|
+
end
|
458
|
+
|
459
|
+
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
460
|
+
storage_network_id = '50dc434c-9bba-427b-bcd6-0bdba45c4dd2' # String | ID of storage network.
|
461
|
+
opts = {
|
462
|
+
volume_create: NetworkStorageApi::VolumeCreate.new({name: 'My volume name', capacity_in_gb: 2000}) # VolumeCreate |
|
463
|
+
}
|
464
|
+
|
465
|
+
begin
|
466
|
+
# Create a volume belonging to a storage network.
|
467
|
+
result = api_instance.storage_networks_storage_network_id_volumes_post(storage_network_id, opts)
|
468
|
+
p result
|
469
|
+
rescue NetworkStorageApi::ApiError => e
|
470
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_post: #{e}"
|
471
|
+
end
|
472
|
+
```
|
473
|
+
|
474
|
+
#### Using the storage_networks_storage_network_id_volumes_post_with_http_info variant
|
475
|
+
|
476
|
+
This returns an Array which contains the response data, status code and headers.
|
477
|
+
|
478
|
+
> <Array(<Volume>, Integer, Hash)> storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts)
|
479
|
+
|
480
|
+
```ruby
|
481
|
+
begin
|
482
|
+
# Create a volume belonging to a storage network.
|
483
|
+
data, status_code, headers = api_instance.storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts)
|
484
|
+
p status_code # => 2xx
|
485
|
+
p headers # => { ... }
|
486
|
+
p data # => <Volume>
|
487
|
+
rescue NetworkStorageApi::ApiError => e
|
488
|
+
puts "Error when calling StorageNetworksApi->storage_networks_storage_network_id_volumes_post_with_http_info: #{e}"
|
489
|
+
end
|
490
|
+
```
|
491
|
+
|
492
|
+
### Parameters
|
493
|
+
|
494
|
+
| Name | Type | Description | Notes |
|
495
|
+
| ---- | ---- | ----------- | ----- |
|
496
|
+
| **storage_network_id** | **String** | ID of storage network. | |
|
497
|
+
| **volume_create** | [**VolumeCreate**](VolumeCreate.md) | | [optional] |
|
498
|
+
|
499
|
+
### Return type
|
500
|
+
|
501
|
+
[**Volume**](Volume.md)
|
502
|
+
|
503
|
+
### Authorization
|
504
|
+
|
505
|
+
[OAuth2](../README.md#OAuth2)
|
506
|
+
|
507
|
+
### HTTP request headers
|
508
|
+
|
509
|
+
- **Content-Type**: application/json
|
510
|
+
- **Accept**: application/json
|
511
|
+
|
512
|
+
|
439
513
|
## storage_networks_storage_network_id_volumes_volume_id_delete
|
440
514
|
|
441
515
|
> storage_networks_storage_network_id_volumes_volume_id_delete(storage_network_id, volume_id)
|
data/docs/VolumeCreate.md
CHANGED
@@ -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
|
+
| **permissions** | [**PermissionsCreate**](PermissionsCreate.md) | | [optional] |
|
11
12
|
|
12
13
|
## Example
|
13
14
|
|
@@ -18,7 +19,8 @@ instance = NetworkStorageApi::VolumeCreate.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
|
+
permissions: null
|
22
24
|
)
|
23
25
|
```
|
24
26
|
|
data/docs/VolumeUpdate.md
CHANGED
@@ -4,7 +4,11 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | Volume friendly name. | [optional] |
|
8
|
+
| **description** | **String** | Volume description. | [optional] |
|
7
9
|
| **capacity_in_gb** | **Integer** | Capacity of Volume in GB. Currently only whole numbers and multiples of 1000GB are supported. | [optional] |
|
10
|
+
| **path_suffix** | **String** | Last part of volume's path. | [optional] |
|
11
|
+
| **permissions** | [**PermissionsUpdate**](PermissionsUpdate.md) | | [optional] |
|
8
12
|
|
9
13
|
## Example
|
10
14
|
|
@@ -12,7 +16,11 @@
|
|
12
16
|
require 'pnap_network_storage_api'
|
13
17
|
|
14
18
|
instance = NetworkStorageApi::VolumeUpdate.new(
|
15
|
-
|
19
|
+
name: New Volume name,
|
20
|
+
description: New Volume description,
|
21
|
+
capacity_in_gb: 2000,
|
22
|
+
path_suffix: null,
|
23
|
+
permissions: null
|
16
24
|
)
|
17
25
|
```
|
18
26
|
|
@@ -402,6 +402,76 @@ module NetworkStorageApi
|
|
402
402
|
return data, status_code, headers
|
403
403
|
end
|
404
404
|
|
405
|
+
# Create a volume belonging to a storage network.
|
406
|
+
# Create a volume belonging to a storage network.
|
407
|
+
# @param storage_network_id [String] ID of storage network.
|
408
|
+
# @param [Hash] opts the optional parameters
|
409
|
+
# @option opts [VolumeCreate] :volume_create
|
410
|
+
# @return [Volume]
|
411
|
+
def storage_networks_storage_network_id_volumes_post(storage_network_id, opts = {})
|
412
|
+
data, _status_code, _headers = storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts)
|
413
|
+
data
|
414
|
+
end
|
415
|
+
|
416
|
+
# Create a volume belonging to a storage network.
|
417
|
+
# Create a volume belonging to a storage network.
|
418
|
+
# @param storage_network_id [String] ID of storage network.
|
419
|
+
# @param [Hash] opts the optional parameters
|
420
|
+
# @option opts [VolumeCreate] :volume_create
|
421
|
+
# @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
|
422
|
+
def storage_networks_storage_network_id_volumes_post_with_http_info(storage_network_id, opts = {})
|
423
|
+
if @api_client.config.debugging
|
424
|
+
@api_client.config.logger.debug 'Calling API: StorageNetworksApi.storage_networks_storage_network_id_volumes_post ...'
|
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_post"
|
429
|
+
end
|
430
|
+
# resource path
|
431
|
+
local_var_path = '/storage-networks/{storageNetworkId}/volumes'.sub('{' + 'storageNetworkId' + '}', CGI.escape(storage_network_id.to_s))
|
432
|
+
|
433
|
+
# query parameters
|
434
|
+
query_params = opts[:query_params] || {}
|
435
|
+
|
436
|
+
# header parameters
|
437
|
+
header_params = opts[:header_params] || {}
|
438
|
+
# HTTP header 'Accept' (if needed)
|
439
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
440
|
+
# HTTP header 'Content-Type'
|
441
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
442
|
+
if !content_type.nil?
|
443
|
+
header_params['Content-Type'] = content_type
|
444
|
+
end
|
445
|
+
|
446
|
+
# form parameters
|
447
|
+
form_params = opts[:form_params] || {}
|
448
|
+
|
449
|
+
# http body (model)
|
450
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'volume_create'])
|
451
|
+
|
452
|
+
# return_type
|
453
|
+
return_type = opts[:debug_return_type] || 'Volume'
|
454
|
+
|
455
|
+
# auth_names
|
456
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
457
|
+
|
458
|
+
new_options = opts.merge(
|
459
|
+
:operation => :"StorageNetworksApi.storage_networks_storage_network_id_volumes_post",
|
460
|
+
:header_params => header_params,
|
461
|
+
:query_params => query_params,
|
462
|
+
:form_params => form_params,
|
463
|
+
:body => post_body,
|
464
|
+
:auth_names => auth_names,
|
465
|
+
:return_type => return_type
|
466
|
+
)
|
467
|
+
|
468
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
469
|
+
if @api_client.config.debugging
|
470
|
+
@api_client.config.logger.debug "API called: StorageNetworksApi#storage_networks_storage_network_id_volumes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
471
|
+
end
|
472
|
+
return data, status_code, headers
|
473
|
+
end
|
474
|
+
|
405
475
|
# Delete a Storage Network's Volume
|
406
476
|
# Delete a Storage Network's Volume
|
407
477
|
# @param storage_network_id [String] ID of storage network.
|
@@ -0,0 +1,271 @@
|
|
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
|
+
# NFS specific permissions on a volume.
|
18
|
+
class NfsPermissionsCreate
|
19
|
+
# Read/Write access.
|
20
|
+
attr_accessor :read_write
|
21
|
+
|
22
|
+
# Read only access.
|
23
|
+
attr_accessor :read_only
|
24
|
+
|
25
|
+
# Root squash permission.
|
26
|
+
attr_accessor :root_squash
|
27
|
+
|
28
|
+
# No squash permission.
|
29
|
+
attr_accessor :no_squash
|
30
|
+
|
31
|
+
# All squash permission.
|
32
|
+
attr_accessor :all_squash
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'read_write' => :'readWrite',
|
38
|
+
:'read_only' => :'readOnly',
|
39
|
+
:'root_squash' => :'rootSquash',
|
40
|
+
:'no_squash' => :'noSquash',
|
41
|
+
:'all_squash' => :'allSquash'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns all the JSON keys this model knows about
|
46
|
+
def self.acceptable_attributes
|
47
|
+
attribute_map.values
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attribute type mapping.
|
51
|
+
def self.openapi_types
|
52
|
+
{
|
53
|
+
:'read_write' => :'Array<String>',
|
54
|
+
:'read_only' => :'Array<String>',
|
55
|
+
:'root_squash' => :'Array<String>',
|
56
|
+
:'no_squash' => :'Array<String>',
|
57
|
+
:'all_squash' => :'Array<String>'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
])
|
65
|
+
end
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
if (!attributes.is_a?(Hash))
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `NetworkStorageApi::NfsPermissionsCreate` initialize method"
|
72
|
+
end
|
73
|
+
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
76
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkStorageApi::NfsPermissionsCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
78
|
+
end
|
79
|
+
h[k.to_sym] = v
|
80
|
+
}
|
81
|
+
|
82
|
+
if attributes.key?(:'read_write')
|
83
|
+
if (value = attributes[:'read_write']).is_a?(Array)
|
84
|
+
self.read_write = value
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'read_only')
|
89
|
+
if (value = attributes[:'read_only']).is_a?(Array)
|
90
|
+
self.read_only = value
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'root_squash')
|
95
|
+
if (value = attributes[:'root_squash']).is_a?(Array)
|
96
|
+
self.root_squash = value
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'no_squash')
|
101
|
+
if (value = attributes[:'no_squash']).is_a?(Array)
|
102
|
+
self.no_squash = value
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'all_squash')
|
107
|
+
if (value = attributes[:'all_squash']).is_a?(Array)
|
108
|
+
self.all_squash = value
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
114
|
+
# @return Array for valid properties with the reasons
|
115
|
+
def list_invalid_properties
|
116
|
+
invalid_properties = Array.new
|
117
|
+
invalid_properties
|
118
|
+
end
|
119
|
+
|
120
|
+
# Check to see if the all the properties in the model are valid
|
121
|
+
# @return true if the model is valid
|
122
|
+
def valid?
|
123
|
+
true
|
124
|
+
end
|
125
|
+
|
126
|
+
# Checks equality by comparing each attribute.
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def ==(o)
|
129
|
+
return true if self.equal?(o)
|
130
|
+
self.class == o.class &&
|
131
|
+
read_write == o.read_write &&
|
132
|
+
read_only == o.read_only &&
|
133
|
+
root_squash == o.root_squash &&
|
134
|
+
no_squash == o.no_squash &&
|
135
|
+
all_squash == o.all_squash
|
136
|
+
end
|
137
|
+
|
138
|
+
# @see the `==` method
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def eql?(o)
|
141
|
+
self == o
|
142
|
+
end
|
143
|
+
|
144
|
+
# Calculates hash code according to all attributes.
|
145
|
+
# @return [Integer] Hash code
|
146
|
+
def hash
|
147
|
+
[read_write, read_only, root_squash, no_squash, all_squash].hash
|
148
|
+
end
|
149
|
+
|
150
|
+
# Builds the object from hash
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
152
|
+
# @return [Object] Returns the model itself
|
153
|
+
def self.build_from_hash(attributes)
|
154
|
+
new.build_from_hash(attributes)
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def build_from_hash(attributes)
|
161
|
+
return nil unless attributes.is_a?(Hash)
|
162
|
+
attributes = attributes.transform_keys(&:to_sym)
|
163
|
+
self.class.openapi_types.each_pair do |key, type|
|
164
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
165
|
+
self.send("#{key}=", nil)
|
166
|
+
elsif type =~ /\AArray<(.*)>/i
|
167
|
+
# check to ensure the input is an array given that the attribute
|
168
|
+
# is documented as an array but the input is not
|
169
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
170
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
171
|
+
end
|
172
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
173
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
self
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param string type Data type
|
182
|
+
# @param string value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def _deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :Time
|
187
|
+
Time.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :Boolean
|
197
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
# models (e.g. Pet) or oneOf
|
218
|
+
klass = NetworkStorageApi.const_get(type)
|
219
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Returns the string representation of the object
|
224
|
+
# @return [String] String presentation of the object
|
225
|
+
def to_s
|
226
|
+
to_hash.to_s
|
227
|
+
end
|
228
|
+
|
229
|
+
# to_body is an alias to to_hash (backward compatibility)
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
231
|
+
def to_body
|
232
|
+
to_hash
|
233
|
+
end
|
234
|
+
|
235
|
+
# Returns the object in the form of hash
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
237
|
+
def to_hash
|
238
|
+
hash = {}
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
240
|
+
value = self.send(attr)
|
241
|
+
if value.nil?
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
244
|
+
end
|
245
|
+
|
246
|
+
hash[param] = _to_hash(value)
|
247
|
+
end
|
248
|
+
hash
|
249
|
+
end
|
250
|
+
|
251
|
+
# Outputs non-array value in the form of hash
|
252
|
+
# For object, use to_hash. Otherwise, just return the value
|
253
|
+
# @param [Object] value Any valid value
|
254
|
+
# @return [Hash] Returns the value in the form of hash
|
255
|
+
def _to_hash(value)
|
256
|
+
if value.is_a?(Array)
|
257
|
+
value.compact.map { |v| _to_hash(v) }
|
258
|
+
elsif value.is_a?(Hash)
|
259
|
+
{}.tap do |hash|
|
260
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
261
|
+
end
|
262
|
+
elsif value.respond_to? :to_hash
|
263
|
+
value.to_hash
|
264
|
+
else
|
265
|
+
value
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|