pnap_network_storage_api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +158 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/Error.md +20 -0
- data/docs/NfsPermissions.md +26 -0
- data/docs/Permissions.md +18 -0
- data/docs/Status.md +15 -0
- data/docs/StorageNetwork.md +34 -0
- data/docs/StorageNetworkCreate.md +24 -0
- data/docs/StorageNetworkUpdate.md +20 -0
- data/docs/StorageNetworksApi.md +506 -0
- data/docs/Volume.md +36 -0
- data/docs/VolumeCreate.md +24 -0
- data/lib/pnap_network_storage_api/api/storage_networks_api.rb +474 -0
- data/lib/pnap_network_storage_api/api_client.rb +392 -0
- data/lib/pnap_network_storage_api/api_error.rb +57 -0
- data/lib/pnap_network_storage_api/configuration.rb +278 -0
- data/lib/pnap_network_storage_api/models/error.rb +236 -0
- data/lib/pnap_network_storage_api/models/nfs_permissions.rb +270 -0
- data/lib/pnap_network_storage_api/models/permissions.rb +219 -0
- data/lib/pnap_network_storage_api/models/status.rb +38 -0
- data/lib/pnap_network_storage_api/models/storage_network.rb +303 -0
- data/lib/pnap_network_storage_api/models/storage_network_create.rb +338 -0
- data/lib/pnap_network_storage_api/models/storage_network_update.rb +269 -0
- data/lib/pnap_network_storage_api/models/volume.rb +307 -0
- data/lib/pnap_network_storage_api/models/volume_create.rb +357 -0
- data/lib/pnap_network_storage_api/version.rb +19 -0
- data/lib/pnap_network_storage_api.rb +49 -0
- data/pnap_network_storage_api.gemspec +39 -0
- data/spec/api/storage_networks_api_spec.rb +121 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/nfs_permissions_spec.rb +58 -0
- data/spec/models/permissions_spec.rb +34 -0
- data/spec/models/status_spec.rb +28 -0
- data/spec/models/storage_network_create_spec.rb +52 -0
- data/spec/models/storage_network_spec.rb +82 -0
- data/spec/models/storage_network_update_spec.rb +40 -0
- data/spec/models/volume_create_spec.rb +52 -0
- data/spec/models/volume_spec.rb +88 -0
- data/spec/spec_helper.rb +111 -0
- metadata +140 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1dbf60ff5d211a65d2bf9a7fde2c7f425653919524fd8f6b2c5b5279c0716e53
|
4
|
+
data.tar.gz: 60133f7d3deb4919e0a81f81520fdc2d69875a716786ecc762d3a8677fe62179
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d83a67049fa097656a2577744a0a26c01d469a5b762766c3eaa5dd66748b061fbf3b10c6fbfa372700e38a7e8ce242bf8c1bbfb15b99c3601e4a520b53d9a137
|
7
|
+
data.tar.gz: 1f84c9b0a8e4c70643066743d6bd469d0439b750eacb5c44b59ef432c28ed8a1c318b6813804ef3533ff9d7ea9a8efba738fe0a333462d95af4e8ee9098f1630
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
# pnap_network_storage_api
|
2
|
+
|
3
|
+
NetworkStorageApi - the Ruby gem for the Network Storage API
|
4
|
+
|
5
|
+
Create, list, edit, and delete storage networks with the Network Storage API. Use storage networks to expand storage capacity on a private network.
|
6
|
+
<br>
|
7
|
+
<span class='pnap-api-knowledge-base-link'>
|
8
|
+
Knowledge base articles to help you can be found
|
9
|
+
<a href='https://phoenixnap.com/kb/bare-metal-cloud-storage' target='_blank'>here</a>
|
10
|
+
</span>
|
11
|
+
<br>
|
12
|
+
<b>All URLs are relative to (https://api.phoenixnap.com/network-storage/v1/)</b>
|
13
|
+
|
14
|
+
|
15
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
16
|
+
|
17
|
+
- API version: 1.0
|
18
|
+
For more information, please visit [https://phoenixnap.com/](https://phoenixnap.com/)
|
19
|
+
|
20
|
+
## Installation
|
21
|
+
|
22
|
+
### Build a gem
|
23
|
+
|
24
|
+
To build the Ruby code into a gem:
|
25
|
+
|
26
|
+
```shell
|
27
|
+
gem build pnap_network_storage_api.gemspec
|
28
|
+
```
|
29
|
+
|
30
|
+
Then either install the gem locally, replacing `<VERSION>` with the actual version:
|
31
|
+
|
32
|
+
```shell
|
33
|
+
gem install ./pnap_network_storage_api-<VERSION>.gem
|
34
|
+
```
|
35
|
+
|
36
|
+
(for development, run `gem install --dev ./pnap_network_storage_api-<VERSION>.gem` to install the development dependencies)
|
37
|
+
|
38
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
39
|
+
|
40
|
+
Finally add this to the Gemfile:
|
41
|
+
|
42
|
+
gem 'pnap_network_storage_api', '~> <VERSION>'
|
43
|
+
|
44
|
+
### Install from Git
|
45
|
+
|
46
|
+
To install this Gem from this repository, you'll need to get Bundler by doing `gem install bundler`. Add the following line in your Gemfile:
|
47
|
+
|
48
|
+
gem 'pnap_network_storage_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'NetworkStorageApi/*.gemspec'
|
49
|
+
|
50
|
+
If you'd like the development version:
|
51
|
+
|
52
|
+
gem 'pnap_network_storage_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'NetworkStorageApi/*.gemspec', branch: 'develop'
|
53
|
+
|
54
|
+
Then run `bundle install`.
|
55
|
+
|
56
|
+
### Include the Ruby code directly
|
57
|
+
|
58
|
+
Include the Ruby code directly using `-I` as follows:
|
59
|
+
|
60
|
+
```shell
|
61
|
+
ruby -Ilib script.rb
|
62
|
+
```
|
63
|
+
|
64
|
+
## Getting Started
|
65
|
+
|
66
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
# Load the gem
|
70
|
+
require 'pnap_network_storage_api'
|
71
|
+
|
72
|
+
# Setup authorization
|
73
|
+
NetworkStorageApi.configure do |config|
|
74
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
75
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
76
|
+
end
|
77
|
+
|
78
|
+
api_instance = NetworkStorageApi::StorageNetworksApi.new
|
79
|
+
opts = {
|
80
|
+
location: 'PHX' # String | If present will filter the result by the given location.
|
81
|
+
}
|
82
|
+
|
83
|
+
begin
|
84
|
+
#List all storage networks.
|
85
|
+
result = api_instance.storage_networks_get(opts)
|
86
|
+
p result
|
87
|
+
rescue NetworkStorageApi::ApiError => e
|
88
|
+
puts "Exception when calling StorageNetworksApi->storage_networks_get: #{e}"
|
89
|
+
end
|
90
|
+
|
91
|
+
```
|
92
|
+
|
93
|
+
Authorization can also be setup by using the [`oauth`](https://github.com/oauth-xx/oauth2) library:
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
# Load the gem
|
97
|
+
require 'pnap_network_storage_api'
|
98
|
+
require 'oauth2'
|
99
|
+
|
100
|
+
# Setup variables for getting a token.
|
101
|
+
client_id = 'YOUR_CLIENT_ID'
|
102
|
+
client_secret = 'YOUR_CLIENT_SECRET'
|
103
|
+
auth_url = 'https://auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token'
|
104
|
+
|
105
|
+
|
106
|
+
# Setup authorization
|
107
|
+
NetworkStorageApi.configure do |config|
|
108
|
+
# Retrieve the token using OAuth2.
|
109
|
+
client = OAuth2::Client.new(client_id, client_secret, token_url: auth_url)
|
110
|
+
token = client.client_credentials.get_token
|
111
|
+
|
112
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
113
|
+
config.access_token = token.token
|
114
|
+
end
|
115
|
+
|
116
|
+
```
|
117
|
+
|
118
|
+
## Documentation for API Endpoints
|
119
|
+
|
120
|
+
All URIs are relative to *https://api.phoenixnap.com/network-storage/v1*
|
121
|
+
|
122
|
+
Class | Method | HTTP request | Description
|
123
|
+
------------ | ------------- | ------------- | -------------
|
124
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_get**](docs/StorageNetworksApi.md#storage_networks_get) | **GET** /storage-networks | List all storage networks.
|
125
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_id_delete**](docs/StorageNetworksApi.md#storage_networks_id_delete) | **DELETE** /storage-networks/{storageNetworkId} | Delete a storage network and its volume.
|
126
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_id_get**](docs/StorageNetworksApi.md#storage_networks_id_get) | **GET** /storage-networks/{storageNetworkId} | Get storage network details.
|
127
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_id_patch**](docs/StorageNetworksApi.md#storage_networks_id_patch) | **PATCH** /storage-networks/{storageNetworkId} | Update storage network details.
|
128
|
+
*NetworkStorageApi::StorageNetworksApi* | [**storage_networks_post**](docs/StorageNetworksApi.md#storage_networks_post) | **POST** /storage-networks | Create a storage network and volume.
|
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_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.
|
131
|
+
|
132
|
+
|
133
|
+
## Documentation for Models
|
134
|
+
|
135
|
+
- [NetworkStorageApi::Error](docs/Error.md)
|
136
|
+
- [NetworkStorageApi::NfsPermissions](docs/NfsPermissions.md)
|
137
|
+
- [NetworkStorageApi::Permissions](docs/Permissions.md)
|
138
|
+
- [NetworkStorageApi::Status](docs/Status.md)
|
139
|
+
- [NetworkStorageApi::StorageNetwork](docs/StorageNetwork.md)
|
140
|
+
- [NetworkStorageApi::StorageNetworkCreate](docs/StorageNetworkCreate.md)
|
141
|
+
- [NetworkStorageApi::StorageNetworkUpdate](docs/StorageNetworkUpdate.md)
|
142
|
+
- [NetworkStorageApi::Volume](docs/Volume.md)
|
143
|
+
- [NetworkStorageApi::VolumeCreate](docs/VolumeCreate.md)
|
144
|
+
|
145
|
+
|
146
|
+
## Documentation for Authorization
|
147
|
+
|
148
|
+
|
149
|
+
### OAuth2
|
150
|
+
|
151
|
+
|
152
|
+
- **Type**: OAuth
|
153
|
+
- **Flow**: application
|
154
|
+
- **Authorization URL**:
|
155
|
+
- **Scopes**:
|
156
|
+
- networkstorage: Grants full access to Network Storage API.
|
157
|
+
- networkstorage.read: Grants read only access to Network Storage API.
|
158
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/docs/Error.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# NetworkStorageApi::Error
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **message** | **String** | The description detailing the cause of the error code. | [readonly] |
|
8
|
+
| **validation_errors** | **Array<String>** | Validation errors, if any. | [optional][readonly] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_network_storage_api'
|
14
|
+
|
15
|
+
instance = NetworkStorageApi::Error.new(
|
16
|
+
message: null,
|
17
|
+
validation_errors: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# NetworkStorageApi::NfsPermissions
|
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::NfsPermissions.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
|
+
|
data/docs/Permissions.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# NetworkStorageApi::Permissions
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **nfs** | [**NfsPermissions**](NfsPermissions.md) | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'pnap_network_storage_api'
|
13
|
+
|
14
|
+
instance = NetworkStorageApi::Permissions.new(
|
15
|
+
nfs: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
data/docs/Status.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# NetworkStorageApi::Status
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'pnap_network_storage_api'
|
12
|
+
|
13
|
+
instance = NetworkStorageApi::Status.new()
|
14
|
+
```
|
15
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# NetworkStorageApi::StorageNetwork
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | Storage network ID. | [optional] |
|
8
|
+
| **name** | **String** | Storage network friendly name. | [optional] |
|
9
|
+
| **description** | **String** | Storage network description. | [optional] |
|
10
|
+
| **status** | [**Status**](Status.md) | | [optional] |
|
11
|
+
| **location** | **String** | Location of storage network. Currently this field should be set to `PHX` or `ASH`. | [optional] |
|
12
|
+
| **network_id** | **String** | Id of network the storage belongs to. | [optional] |
|
13
|
+
| **ips** | **Array<String>** | IP of the storage network. | [optional] |
|
14
|
+
| **created_on** | **Time** | Date and time when this storage network was created. | [optional] |
|
15
|
+
| **volumes** | [**Array<Volume>**](Volume.md) | Volume for a storage network. | [optional] |
|
16
|
+
|
17
|
+
## Example
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'pnap_network_storage_api'
|
21
|
+
|
22
|
+
instance = NetworkStorageApi::StorageNetwork.new(
|
23
|
+
id: 603f3b2cfcaf050643b89a4b,
|
24
|
+
name: My storage network,
|
25
|
+
description: My storage network description,
|
26
|
+
status: null,
|
27
|
+
location: PHX,
|
28
|
+
network_id: 603f3b2cfcaf050643b89a4b,
|
29
|
+
ips: ["100.64.0.1","100.64.0.2"],
|
30
|
+
created_on: 2021-03-13T20:24:32.491Z,
|
31
|
+
volumes: null
|
32
|
+
)
|
33
|
+
```
|
34
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# NetworkStorageApi::StorageNetworkCreate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | Storage network friendly name. | |
|
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<VolumeCreate>**](VolumeCreate.md) | Volume to be created alongside storage. Currently only 1 volume is supported. | |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'pnap_network_storage_api'
|
16
|
+
|
17
|
+
instance = NetworkStorageApi::StorageNetworkCreate.new(
|
18
|
+
name: My storage network,
|
19
|
+
description: My storage network description,
|
20
|
+
location: PHX,
|
21
|
+
volumes: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# NetworkStorageApi::StorageNetworkUpdate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | Storage network friendly name. | [optional] |
|
8
|
+
| **description** | **String** | Storage network description. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_network_storage_api'
|
14
|
+
|
15
|
+
instance = NetworkStorageApi::StorageNetworkUpdate.new(
|
16
|
+
name: My storage network,
|
17
|
+
description: My storage network description
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|