pnap_network_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 +154 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/Error.md +20 -0
- data/docs/PrivateNetwork.md +34 -0
- data/docs/PrivateNetworkCreate.md +26 -0
- data/docs/PrivateNetworkModify.md +22 -0
- data/docs/PrivateNetworkServer.md +20 -0
- data/docs/PrivateNetworksApi.md +364 -0
- data/lib/pnap_network_api/api/private_networks_api.rb +342 -0
- data/lib/pnap_network_api/api_client.rb +392 -0
- data/lib/pnap_network_api/api_error.rb +57 -0
- data/lib/pnap_network_api/configuration.rb +278 -0
- data/lib/pnap_network_api/models/error.rb +236 -0
- data/lib/pnap_network_api/models/private_network.rb +341 -0
- data/lib/pnap_network_api/models/private_network_create.rb +277 -0
- data/lib/pnap_network_api/models/private_network_modify.rb +250 -0
- data/lib/pnap_network_api/models/private_network_server.rb +242 -0
- data/lib/pnap_network_api/version.rb +19 -0
- data/lib/pnap_network_api.rb +45 -0
- data/pnap_network_api.gemspec +39 -0
- data/spec/api/private_networks_api_spec.rb +96 -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/private_network_create_spec.rb +58 -0
- data/spec/models/private_network_modify_spec.rb +46 -0
- data/spec/models/private_network_server_spec.rb +40 -0
- data/spec/models/private_network_spec.rb +82 -0
- data/spec/spec_helper.rb +111 -0
- metadata +124 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c32455cd457e2d564fd3df4eaf12df1d5ec05dfcd27c8529a83561fc43f1f7ea
|
4
|
+
data.tar.gz: e85981c47c3c0956c62e21ba9635f37e53963601464dd8a698dc4f21915986d3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 199f1064336c7b4a9da8659797e6abdc12c97851159bf0cb5d0d951558526c8daba21180cdd35dcb812580ef081eff3c68b533289133ae47c76ea2a2c097767f
|
7
|
+
data.tar.gz: f8597618363bbd2743f032ee80bd1a55afbfc118418004a5e083e14c328d1d5f8e73b1af92962c4e215e8ea27eeb15089cc36041b2b2ce7142c80f0564791c1e
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
# pnap_network_api
|
2
|
+
|
3
|
+
NetworkApi - the Ruby gem for the Networks API
|
4
|
+
|
5
|
+
Use the Networks API to create, list, edit, and delete private networks to best fit your business needs.
|
6
|
+
Private networks allow your servers to communicate without connecting to the public internet, avoiding unnecessary
|
7
|
+
egress data charges.<br>
|
8
|
+
<br>
|
9
|
+
<span class='pnap-api-knowledge-base-link'>
|
10
|
+
Knowledge base articles to help you can be found
|
11
|
+
<a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>here</a>
|
12
|
+
</span><br>
|
13
|
+
<br>
|
14
|
+
<b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
|
15
|
+
|
16
|
+
|
17
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
18
|
+
|
19
|
+
- API version: 1.0
|
20
|
+
For more information, please visit [https://phoenixnap.com/](https://phoenixnap.com/)
|
21
|
+
|
22
|
+
## Installation
|
23
|
+
|
24
|
+
### Build a gem
|
25
|
+
|
26
|
+
To build the Ruby code into a gem:
|
27
|
+
|
28
|
+
```shell
|
29
|
+
gem build pnap_network_api.gemspec
|
30
|
+
```
|
31
|
+
|
32
|
+
Then either install the gem locally, replacing `<VERSION>` with the actual version:
|
33
|
+
|
34
|
+
```shell
|
35
|
+
gem install ./pnap_network_api-<VERSION>.gem
|
36
|
+
```
|
37
|
+
|
38
|
+
(for development, run `gem install --dev ./pnap_network_api-<VERSION>.gem` to install the development dependencies)
|
39
|
+
|
40
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
41
|
+
|
42
|
+
Finally add this to the Gemfile:
|
43
|
+
|
44
|
+
gem 'pnap_network_api', '~> <VERSION>'
|
45
|
+
|
46
|
+
### Install from Git
|
47
|
+
|
48
|
+
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:
|
49
|
+
|
50
|
+
gem 'pnap_network_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'NetworkApi/*.gemspec'
|
51
|
+
|
52
|
+
If you'd like the development version:
|
53
|
+
|
54
|
+
gem 'pnap_network_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'NetworkApi/*.gemspec', branch: 'develop'
|
55
|
+
|
56
|
+
Then run `bundle install`.
|
57
|
+
|
58
|
+
### Include the Ruby code directly
|
59
|
+
|
60
|
+
Include the Ruby code directly using `-I` as follows:
|
61
|
+
|
62
|
+
```shell
|
63
|
+
ruby -Ilib script.rb
|
64
|
+
```
|
65
|
+
|
66
|
+
## Getting Started
|
67
|
+
|
68
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
# Load the gem
|
72
|
+
require 'pnap_network_api'
|
73
|
+
|
74
|
+
# Setup authorization
|
75
|
+
NetworkApi.configure do |config|
|
76
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
77
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
78
|
+
end
|
79
|
+
|
80
|
+
api_instance = NetworkApi::PrivateNetworksApi.new
|
81
|
+
opts = {
|
82
|
+
location: 'PHX' # String | If present will filter the result by the given location of the Private Networks.
|
83
|
+
}
|
84
|
+
|
85
|
+
begin
|
86
|
+
#List Private Networks.
|
87
|
+
result = api_instance.private_networks_get(opts)
|
88
|
+
p result
|
89
|
+
rescue NetworkApi::ApiError => e
|
90
|
+
puts "Exception when calling PrivateNetworksApi->private_networks_get: #{e}"
|
91
|
+
end
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
Authorization can also be setup by using the [`oauth`](https://github.com/oauth-xx/oauth2) library:
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
# Load the gem
|
99
|
+
require 'pnap_network_api'
|
100
|
+
require 'oauth2'
|
101
|
+
|
102
|
+
# Setup variables for getting a token.
|
103
|
+
client_id = 'YOUR_CLIENT_ID'
|
104
|
+
client_secret = 'YOUR_CLIENT_SECRET'
|
105
|
+
auth_url = 'https://auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token'
|
106
|
+
|
107
|
+
|
108
|
+
# Setup authorization
|
109
|
+
NetworkApi.configure do |config|
|
110
|
+
# Retrieve the token using OAuth2.
|
111
|
+
client = OAuth2::Client.new(client_id, client_secret, token_url: auth_url)
|
112
|
+
token = client.client_credentials.get_token
|
113
|
+
|
114
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
115
|
+
config.access_token = token.token
|
116
|
+
end
|
117
|
+
|
118
|
+
```
|
119
|
+
|
120
|
+
## Documentation for API Endpoints
|
121
|
+
|
122
|
+
All URIs are relative to *https://api.phoenixnap.com/networks/v1*
|
123
|
+
|
124
|
+
Class | Method | HTTP request | Description
|
125
|
+
------------ | ------------- | ------------- | -------------
|
126
|
+
*NetworkApi::PrivateNetworksApi* | [**private_networks_get**](docs/PrivateNetworksApi.md#private_networks_get) | **GET** /private-networks | List Private Networks.
|
127
|
+
*NetworkApi::PrivateNetworksApi* | [**private_networks_network_id_delete**](docs/PrivateNetworksApi.md#private_networks_network_id_delete) | **DELETE** /private-networks/{privateNetworkId} | Delete a Private Network.
|
128
|
+
*NetworkApi::PrivateNetworksApi* | [**private_networks_network_id_get**](docs/PrivateNetworksApi.md#private_networks_network_id_get) | **GET** /private-networks/{privateNetworkId} | Get a Private Network.
|
129
|
+
*NetworkApi::PrivateNetworksApi* | [**private_networks_network_id_put**](docs/PrivateNetworksApi.md#private_networks_network_id_put) | **PUT** /private-networks/{privateNetworkId} | Update a Private Network.
|
130
|
+
*NetworkApi::PrivateNetworksApi* | [**private_networks_post**](docs/PrivateNetworksApi.md#private_networks_post) | **POST** /private-networks | Create a Private Network.
|
131
|
+
|
132
|
+
|
133
|
+
## Documentation for Models
|
134
|
+
|
135
|
+
- [NetworkApi::Error](docs/Error.md)
|
136
|
+
- [NetworkApi::PrivateNetwork](docs/PrivateNetwork.md)
|
137
|
+
- [NetworkApi::PrivateNetworkCreate](docs/PrivateNetworkCreate.md)
|
138
|
+
- [NetworkApi::PrivateNetworkModify](docs/PrivateNetworkModify.md)
|
139
|
+
- [NetworkApi::PrivateNetworkServer](docs/PrivateNetworkServer.md)
|
140
|
+
|
141
|
+
|
142
|
+
## Documentation for Authorization
|
143
|
+
|
144
|
+
|
145
|
+
### OAuth2
|
146
|
+
|
147
|
+
|
148
|
+
- **Type**: OAuth
|
149
|
+
- **Flow**: application
|
150
|
+
- **Authorization URL**:
|
151
|
+
- **Scopes**:
|
152
|
+
- bmc: Grants full access to bmc-api.
|
153
|
+
- bmc.read: Grants read only access to bmc-api.
|
154
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/docs/Error.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# NetworkApi::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_api'
|
14
|
+
|
15
|
+
instance = NetworkApi::Error.new(
|
16
|
+
message: null,
|
17
|
+
validation_errors: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# NetworkApi::PrivateNetwork
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | The private network identifier. | |
|
8
|
+
| **name** | **String** | The friendly name of this private network. | |
|
9
|
+
| **description** | **String** | The description of this private network. | [optional] |
|
10
|
+
| **vlan_id** | **Integer** | The VLAN of this private network. | |
|
11
|
+
| **type** | **String** | The type of the private network. | |
|
12
|
+
| **location** | **String** | The location of this private network. | |
|
13
|
+
| **location_default** | **Boolean** | Identifies network as the default private network for the specified location. | |
|
14
|
+
| **cidr** | **String** | IP range associated with this private network in CIDR notation. | |
|
15
|
+
| **servers** | [**Array<PrivateNetworkServer>**](PrivateNetworkServer.md) | | |
|
16
|
+
|
17
|
+
## Example
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'pnap_network_api'
|
21
|
+
|
22
|
+
instance = NetworkApi::PrivateNetwork.new(
|
23
|
+
id: 604721852cf65253d151528b,
|
24
|
+
name: Sample Network,
|
25
|
+
description: Further details on the network,
|
26
|
+
vlan_id: 10,
|
27
|
+
type: PRIVATE,
|
28
|
+
location: PHX,
|
29
|
+
location_default: true,
|
30
|
+
cidr: 10.0.0.0/24,
|
31
|
+
servers: null
|
32
|
+
)
|
33
|
+
```
|
34
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# NetworkApi::PrivateNetworkCreate
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | The friendly name of this private network. This name should be unique. | |
|
8
|
+
| **description** | **String** | The description of this private network. | [optional] |
|
9
|
+
| **location** | **String** | The location of this private network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`. | |
|
10
|
+
| **location_default** | **Boolean** | Identifies network as the default private network for the specified location. | [optional][default to false] |
|
11
|
+
| **cidr** | **String** | IP range associated with this private network in CIDR notation. | |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'pnap_network_api'
|
17
|
+
|
18
|
+
instance = NetworkApi::PrivateNetworkCreate.new(
|
19
|
+
name: Sample Network,
|
20
|
+
description: Further details on the network,
|
21
|
+
location: PHX,
|
22
|
+
location_default: true,
|
23
|
+
cidr: 10.0.0.0/24
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# NetworkApi::PrivateNetworkModify
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **name** | **String** | A friendly name given to the private network. This name should be unique. | |
|
8
|
+
| **description** | **String** | A description of this private network | [optional] |
|
9
|
+
| **location_default** | **Boolean** | Identifies network as the default private network for the specified location. | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_network_api'
|
15
|
+
|
16
|
+
instance = NetworkApi::PrivateNetworkModify.new(
|
17
|
+
name: Sample network,
|
18
|
+
description: Further details on the network.,
|
19
|
+
location_default: true
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# NetworkApi::PrivateNetworkServer
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | The server identifier. | |
|
8
|
+
| **ips** | **Array<String>** | List of private IPs associated to the server. | |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_network_api'
|
14
|
+
|
15
|
+
instance = NetworkApi::PrivateNetworkServer.new(
|
16
|
+
id: 603f3e995c18d515cda9c4f8,
|
17
|
+
ips: ["10.0.0.2","10.0.0.3"]
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,364 @@
|
|
1
|
+
# NetworkApi::PrivateNetworksApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phoenixnap.com/networks/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**private_networks_get**](PrivateNetworksApi.md#private_networks_get) | **GET** /private-networks | List Private Networks. |
|
8
|
+
| [**private_networks_network_id_delete**](PrivateNetworksApi.md#private_networks_network_id_delete) | **DELETE** /private-networks/{privateNetworkId} | Delete a Private Network. |
|
9
|
+
| [**private_networks_network_id_get**](PrivateNetworksApi.md#private_networks_network_id_get) | **GET** /private-networks/{privateNetworkId} | Get a Private Network. |
|
10
|
+
| [**private_networks_network_id_put**](PrivateNetworksApi.md#private_networks_network_id_put) | **PUT** /private-networks/{privateNetworkId} | Update a Private Network. |
|
11
|
+
| [**private_networks_post**](PrivateNetworksApi.md#private_networks_post) | **POST** /private-networks | Create a Private Network. |
|
12
|
+
|
13
|
+
|
14
|
+
## private_networks_get
|
15
|
+
|
16
|
+
> <Array<PrivateNetwork>> private_networks_get(opts)
|
17
|
+
|
18
|
+
List Private Networks.
|
19
|
+
|
20
|
+
List all Private Networks owned by account.
|
21
|
+
|
22
|
+
### Examples
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
require 'time'
|
26
|
+
require 'pnap_network_api'
|
27
|
+
# setup authorization
|
28
|
+
NetworkApi.configure do |config|
|
29
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
30
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
31
|
+
end
|
32
|
+
|
33
|
+
api_instance = NetworkApi::PrivateNetworksApi.new
|
34
|
+
opts = {
|
35
|
+
location: 'PHX' # String | If present will filter the result by the given location of the Private Networks.
|
36
|
+
}
|
37
|
+
|
38
|
+
begin
|
39
|
+
# List Private Networks.
|
40
|
+
result = api_instance.private_networks_get(opts)
|
41
|
+
p result
|
42
|
+
rescue NetworkApi::ApiError => e
|
43
|
+
puts "Error when calling PrivateNetworksApi->private_networks_get: #{e}"
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
#### Using the private_networks_get_with_http_info variant
|
48
|
+
|
49
|
+
This returns an Array which contains the response data, status code and headers.
|
50
|
+
|
51
|
+
> <Array(<Array<PrivateNetwork>>, Integer, Hash)> private_networks_get_with_http_info(opts)
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
begin
|
55
|
+
# List Private Networks.
|
56
|
+
data, status_code, headers = api_instance.private_networks_get_with_http_info(opts)
|
57
|
+
p status_code # => 2xx
|
58
|
+
p headers # => { ... }
|
59
|
+
p data # => <Array<PrivateNetwork>>
|
60
|
+
rescue NetworkApi::ApiError => e
|
61
|
+
puts "Error when calling PrivateNetworksApi->private_networks_get_with_http_info: #{e}"
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
### Parameters
|
66
|
+
|
67
|
+
| Name | Type | Description | Notes |
|
68
|
+
| ---- | ---- | ----------- | ----- |
|
69
|
+
| **location** | **String** | If present will filter the result by the given location of the Private Networks. | [optional] |
|
70
|
+
|
71
|
+
### Return type
|
72
|
+
|
73
|
+
[**Array<PrivateNetwork>**](PrivateNetwork.md)
|
74
|
+
|
75
|
+
### Authorization
|
76
|
+
|
77
|
+
[OAuth2](../README.md#OAuth2)
|
78
|
+
|
79
|
+
### HTTP request headers
|
80
|
+
|
81
|
+
- **Content-Type**: Not defined
|
82
|
+
- **Accept**: application/json
|
83
|
+
|
84
|
+
|
85
|
+
## private_networks_network_id_delete
|
86
|
+
|
87
|
+
> private_networks_network_id_delete(private_network_id)
|
88
|
+
|
89
|
+
Delete a Private Network.
|
90
|
+
|
91
|
+
Delete Private Network.
|
92
|
+
|
93
|
+
### Examples
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
require 'time'
|
97
|
+
require 'pnap_network_api'
|
98
|
+
# setup authorization
|
99
|
+
NetworkApi.configure do |config|
|
100
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
101
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
102
|
+
end
|
103
|
+
|
104
|
+
api_instance = NetworkApi::PrivateNetworksApi.new
|
105
|
+
private_network_id = '603f3b2cfcaf050643b89a4b' # String | The private network identifier.
|
106
|
+
|
107
|
+
begin
|
108
|
+
# Delete a Private Network.
|
109
|
+
api_instance.private_networks_network_id_delete(private_network_id)
|
110
|
+
rescue NetworkApi::ApiError => e
|
111
|
+
puts "Error when calling PrivateNetworksApi->private_networks_network_id_delete: #{e}"
|
112
|
+
end
|
113
|
+
```
|
114
|
+
|
115
|
+
#### Using the private_networks_network_id_delete_with_http_info variant
|
116
|
+
|
117
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
118
|
+
|
119
|
+
> <Array(nil, Integer, Hash)> private_networks_network_id_delete_with_http_info(private_network_id)
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
begin
|
123
|
+
# Delete a Private Network.
|
124
|
+
data, status_code, headers = api_instance.private_networks_network_id_delete_with_http_info(private_network_id)
|
125
|
+
p status_code # => 2xx
|
126
|
+
p headers # => { ... }
|
127
|
+
p data # => nil
|
128
|
+
rescue NetworkApi::ApiError => e
|
129
|
+
puts "Error when calling PrivateNetworksApi->private_networks_network_id_delete_with_http_info: #{e}"
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Parameters
|
134
|
+
|
135
|
+
| Name | Type | Description | Notes |
|
136
|
+
| ---- | ---- | ----------- | ----- |
|
137
|
+
| **private_network_id** | **String** | The private network identifier. | |
|
138
|
+
|
139
|
+
### Return type
|
140
|
+
|
141
|
+
nil (empty response body)
|
142
|
+
|
143
|
+
### Authorization
|
144
|
+
|
145
|
+
[OAuth2](../README.md#OAuth2)
|
146
|
+
|
147
|
+
### HTTP request headers
|
148
|
+
|
149
|
+
- **Content-Type**: Not defined
|
150
|
+
- **Accept**: application/json
|
151
|
+
|
152
|
+
|
153
|
+
## private_networks_network_id_get
|
154
|
+
|
155
|
+
> <PrivateNetwork> private_networks_network_id_get(private_network_id)
|
156
|
+
|
157
|
+
Get a Private Network.
|
158
|
+
|
159
|
+
Retrieve Private Network Details.
|
160
|
+
|
161
|
+
### Examples
|
162
|
+
|
163
|
+
```ruby
|
164
|
+
require 'time'
|
165
|
+
require 'pnap_network_api'
|
166
|
+
# setup authorization
|
167
|
+
NetworkApi.configure do |config|
|
168
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
169
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
170
|
+
end
|
171
|
+
|
172
|
+
api_instance = NetworkApi::PrivateNetworksApi.new
|
173
|
+
private_network_id = '603f3b2cfcaf050643b89a4b' # String | The private network identifier.
|
174
|
+
|
175
|
+
begin
|
176
|
+
# Get a Private Network.
|
177
|
+
result = api_instance.private_networks_network_id_get(private_network_id)
|
178
|
+
p result
|
179
|
+
rescue NetworkApi::ApiError => e
|
180
|
+
puts "Error when calling PrivateNetworksApi->private_networks_network_id_get: #{e}"
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
#### Using the private_networks_network_id_get_with_http_info variant
|
185
|
+
|
186
|
+
This returns an Array which contains the response data, status code and headers.
|
187
|
+
|
188
|
+
> <Array(<PrivateNetwork>, Integer, Hash)> private_networks_network_id_get_with_http_info(private_network_id)
|
189
|
+
|
190
|
+
```ruby
|
191
|
+
begin
|
192
|
+
# Get a Private Network.
|
193
|
+
data, status_code, headers = api_instance.private_networks_network_id_get_with_http_info(private_network_id)
|
194
|
+
p status_code # => 2xx
|
195
|
+
p headers # => { ... }
|
196
|
+
p data # => <PrivateNetwork>
|
197
|
+
rescue NetworkApi::ApiError => e
|
198
|
+
puts "Error when calling PrivateNetworksApi->private_networks_network_id_get_with_http_info: #{e}"
|
199
|
+
end
|
200
|
+
```
|
201
|
+
|
202
|
+
### Parameters
|
203
|
+
|
204
|
+
| Name | Type | Description | Notes |
|
205
|
+
| ---- | ---- | ----------- | ----- |
|
206
|
+
| **private_network_id** | **String** | The private network identifier. | |
|
207
|
+
|
208
|
+
### Return type
|
209
|
+
|
210
|
+
[**PrivateNetwork**](PrivateNetwork.md)
|
211
|
+
|
212
|
+
### Authorization
|
213
|
+
|
214
|
+
[OAuth2](../README.md#OAuth2)
|
215
|
+
|
216
|
+
### HTTP request headers
|
217
|
+
|
218
|
+
- **Content-Type**: Not defined
|
219
|
+
- **Accept**: application/json
|
220
|
+
|
221
|
+
|
222
|
+
## private_networks_network_id_put
|
223
|
+
|
224
|
+
> <PrivateNetwork> private_networks_network_id_put(private_network_id, opts)
|
225
|
+
|
226
|
+
Update a Private Network.
|
227
|
+
|
228
|
+
Update Private Network Details.
|
229
|
+
|
230
|
+
### Examples
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
require 'time'
|
234
|
+
require 'pnap_network_api'
|
235
|
+
# setup authorization
|
236
|
+
NetworkApi.configure do |config|
|
237
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
238
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
239
|
+
end
|
240
|
+
|
241
|
+
api_instance = NetworkApi::PrivateNetworksApi.new
|
242
|
+
private_network_id = '603f3b2cfcaf050643b89a4b' # String | The private network identifier.
|
243
|
+
opts = {
|
244
|
+
private_network_modify: NetworkApi::PrivateNetworkModify.new({name: 'Sample network', location_default: true}) # PrivateNetworkModify |
|
245
|
+
}
|
246
|
+
|
247
|
+
begin
|
248
|
+
# Update a Private Network.
|
249
|
+
result = api_instance.private_networks_network_id_put(private_network_id, opts)
|
250
|
+
p result
|
251
|
+
rescue NetworkApi::ApiError => e
|
252
|
+
puts "Error when calling PrivateNetworksApi->private_networks_network_id_put: #{e}"
|
253
|
+
end
|
254
|
+
```
|
255
|
+
|
256
|
+
#### Using the private_networks_network_id_put_with_http_info variant
|
257
|
+
|
258
|
+
This returns an Array which contains the response data, status code and headers.
|
259
|
+
|
260
|
+
> <Array(<PrivateNetwork>, Integer, Hash)> private_networks_network_id_put_with_http_info(private_network_id, opts)
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
begin
|
264
|
+
# Update a Private Network.
|
265
|
+
data, status_code, headers = api_instance.private_networks_network_id_put_with_http_info(private_network_id, opts)
|
266
|
+
p status_code # => 2xx
|
267
|
+
p headers # => { ... }
|
268
|
+
p data # => <PrivateNetwork>
|
269
|
+
rescue NetworkApi::ApiError => e
|
270
|
+
puts "Error when calling PrivateNetworksApi->private_networks_network_id_put_with_http_info: #{e}"
|
271
|
+
end
|
272
|
+
```
|
273
|
+
|
274
|
+
### Parameters
|
275
|
+
|
276
|
+
| Name | Type | Description | Notes |
|
277
|
+
| ---- | ---- | ----------- | ----- |
|
278
|
+
| **private_network_id** | **String** | The private network identifier. | |
|
279
|
+
| **private_network_modify** | [**PrivateNetworkModify**](PrivateNetworkModify.md) | | [optional] |
|
280
|
+
|
281
|
+
### Return type
|
282
|
+
|
283
|
+
[**PrivateNetwork**](PrivateNetwork.md)
|
284
|
+
|
285
|
+
### Authorization
|
286
|
+
|
287
|
+
[OAuth2](../README.md#OAuth2)
|
288
|
+
|
289
|
+
### HTTP request headers
|
290
|
+
|
291
|
+
- **Content-Type**: application/json
|
292
|
+
- **Accept**: application/json
|
293
|
+
|
294
|
+
|
295
|
+
## private_networks_post
|
296
|
+
|
297
|
+
> <PrivateNetwork> private_networks_post(opts)
|
298
|
+
|
299
|
+
Create a Private Network.
|
300
|
+
|
301
|
+
Create a Private Network.
|
302
|
+
|
303
|
+
### Examples
|
304
|
+
|
305
|
+
```ruby
|
306
|
+
require 'time'
|
307
|
+
require 'pnap_network_api'
|
308
|
+
# setup authorization
|
309
|
+
NetworkApi.configure do |config|
|
310
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
311
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
312
|
+
end
|
313
|
+
|
314
|
+
api_instance = NetworkApi::PrivateNetworksApi.new
|
315
|
+
opts = {
|
316
|
+
private_network_create: NetworkApi::PrivateNetworkCreate.new({name: 'Sample Network', location: 'PHX', cidr: '10.0.0.0/24'}) # PrivateNetworkCreate |
|
317
|
+
}
|
318
|
+
|
319
|
+
begin
|
320
|
+
# Create a Private Network.
|
321
|
+
result = api_instance.private_networks_post(opts)
|
322
|
+
p result
|
323
|
+
rescue NetworkApi::ApiError => e
|
324
|
+
puts "Error when calling PrivateNetworksApi->private_networks_post: #{e}"
|
325
|
+
end
|
326
|
+
```
|
327
|
+
|
328
|
+
#### Using the private_networks_post_with_http_info variant
|
329
|
+
|
330
|
+
This returns an Array which contains the response data, status code and headers.
|
331
|
+
|
332
|
+
> <Array(<PrivateNetwork>, Integer, Hash)> private_networks_post_with_http_info(opts)
|
333
|
+
|
334
|
+
```ruby
|
335
|
+
begin
|
336
|
+
# Create a Private Network.
|
337
|
+
data, status_code, headers = api_instance.private_networks_post_with_http_info(opts)
|
338
|
+
p status_code # => 2xx
|
339
|
+
p headers # => { ... }
|
340
|
+
p data # => <PrivateNetwork>
|
341
|
+
rescue NetworkApi::ApiError => e
|
342
|
+
puts "Error when calling PrivateNetworksApi->private_networks_post_with_http_info: #{e}"
|
343
|
+
end
|
344
|
+
```
|
345
|
+
|
346
|
+
### Parameters
|
347
|
+
|
348
|
+
| Name | Type | Description | Notes |
|
349
|
+
| ---- | ---- | ----------- | ----- |
|
350
|
+
| **private_network_create** | [**PrivateNetworkCreate**](PrivateNetworkCreate.md) | | [optional] |
|
351
|
+
|
352
|
+
### Return type
|
353
|
+
|
354
|
+
[**PrivateNetwork**](PrivateNetwork.md)
|
355
|
+
|
356
|
+
### Authorization
|
357
|
+
|
358
|
+
[OAuth2](../README.md#OAuth2)
|
359
|
+
|
360
|
+
### HTTP request headers
|
361
|
+
|
362
|
+
- **Content-Type**: application/json
|
363
|
+
- **Accept**: application/json
|
364
|
+
|