pnap_network_api 1.0.0 → 1.1.1

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -5
  3. data/VERSION +1 -1
  4. data/docs/NetworkMembership.md +22 -0
  5. data/docs/PrivateNetwork.md +7 -1
  6. data/docs/PublicNetwork.md +34 -0
  7. data/docs/PublicNetworkCreate.md +24 -0
  8. data/docs/PublicNetworkIpBlock.md +18 -0
  9. data/docs/PublicNetworkMembership.md +22 -0
  10. data/docs/PublicNetworkModify.md +20 -0
  11. data/docs/PublicNetworksApi.md +510 -0
  12. data/lib/pnap_network_api/api/private_networks_api.rb +2 -2
  13. data/lib/pnap_network_api/api/public_networks_api.rb +481 -0
  14. data/lib/pnap_network_api/api_client.rb +5 -3
  15. data/lib/pnap_network_api/api_error.rb +2 -2
  16. data/lib/pnap_network_api/configuration.rb +4 -3
  17. data/lib/pnap_network_api/models/error.rb +3 -2
  18. data/lib/pnap_network_api/models/network_membership.rb +258 -0
  19. data/lib/pnap_network_api/models/private_network.rb +97 -6
  20. data/lib/pnap_network_api/models/private_network_create.rb +46 -2
  21. data/lib/pnap_network_api/models/private_network_modify.rb +46 -2
  22. data/lib/pnap_network_api/models/private_network_server.rb +3 -2
  23. data/lib/pnap_network_api/models/public_network.rb +388 -0
  24. data/lib/pnap_network_api/models/public_network_create.rb +321 -0
  25. data/lib/pnap_network_api/models/public_network_ip_block.rb +226 -0
  26. data/lib/pnap_network_api/models/public_network_membership.rb +257 -0
  27. data/lib/pnap_network_api/models/public_network_modify.rb +270 -0
  28. data/lib/pnap_network_api/version.rb +2 -2
  29. data/lib/pnap_network_api.rb +8 -2
  30. data/pnap_network_api.gemspec +3 -3
  31. data/spec/api/public_networks_api_spec.rb +122 -0
  32. data/spec/api_client_spec.rb +2 -2
  33. data/spec/configuration_spec.rb +2 -2
  34. data/spec/models/network_membership_spec.rb +46 -0
  35. data/spec/models/public_network_create_spec.rb +52 -0
  36. data/spec/models/public_network_ip_block_spec.rb +34 -0
  37. data/spec/models/public_network_membership_spec.rb +46 -0
  38. data/spec/models/public_network_modify_spec.rb +40 -0
  39. data/spec/models/public_network_spec.rb +76 -0
  40. data/spec/spec_helper.rb +2 -2
  41. metadata +34 -6
@@ -0,0 +1,510 @@
1
+ # NetworkApi::PublicNetworksApi
2
+
3
+ All URIs are relative to *https://api.phoenixnap.com/networks/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**public_networks_get**](PublicNetworksApi.md#public_networks_get) | **GET** /public-networks | List Public Networks. |
8
+ | [**public_networks_network_id_delete**](PublicNetworksApi.md#public_networks_network_id_delete) | **DELETE** /public-networks/{publicNetworkId} | Delete a Public Network. |
9
+ | [**public_networks_network_id_get**](PublicNetworksApi.md#public_networks_network_id_get) | **GET** /public-networks/{publicNetworkId} | Get a Public Network. |
10
+ | [**public_networks_network_id_ip_blocks_ip_block_id_delete**](PublicNetworksApi.md#public_networks_network_id_ip_blocks_ip_block_id_delete) | **DELETE** /public-networks/{publicNetworkId}/ip-blocks/{ipBlockId} | Removes the IP Block from the Public Network. |
11
+ | [**public_networks_network_id_ip_blocks_post**](PublicNetworksApi.md#public_networks_network_id_ip_blocks_post) | **POST** /public-networks/{publicNetworkId}/ip-blocks | Adds an IP block to this public network. |
12
+ | [**public_networks_network_id_patch**](PublicNetworksApi.md#public_networks_network_id_patch) | **PATCH** /public-networks/{publicNetworkId} | Update Public Network's Details. |
13
+ | [**public_networks_post**](PublicNetworksApi.md#public_networks_post) | **POST** /public-networks | Create a public network. |
14
+
15
+
16
+ ## public_networks_get
17
+
18
+ > <Array<PublicNetwork>> public_networks_get(opts)
19
+
20
+ List Public Networks.
21
+
22
+ List all Public Networks owned by account.
23
+
24
+ ### Examples
25
+
26
+ ```ruby
27
+ require 'time'
28
+ require 'pnap_network_api'
29
+ # setup authorization
30
+ NetworkApi.configure do |config|
31
+ # Configure OAuth2 access token for authorization: OAuth2
32
+ config.access_token = 'YOUR ACCESS TOKEN'
33
+ end
34
+
35
+ api_instance = NetworkApi::PublicNetworksApi.new
36
+ opts = {
37
+ location: 'PHX' # String | If present will filter the result by the given location of the Public Networks.
38
+ }
39
+
40
+ begin
41
+ # List Public Networks.
42
+ result = api_instance.public_networks_get(opts)
43
+ p result
44
+ rescue NetworkApi::ApiError => e
45
+ puts "Error when calling PublicNetworksApi->public_networks_get: #{e}"
46
+ end
47
+ ```
48
+
49
+ #### Using the public_networks_get_with_http_info variant
50
+
51
+ This returns an Array which contains the response data, status code and headers.
52
+
53
+ > <Array(<Array<PublicNetwork>>, Integer, Hash)> public_networks_get_with_http_info(opts)
54
+
55
+ ```ruby
56
+ begin
57
+ # List Public Networks.
58
+ data, status_code, headers = api_instance.public_networks_get_with_http_info(opts)
59
+ p status_code # => 2xx
60
+ p headers # => { ... }
61
+ p data # => <Array<PublicNetwork>>
62
+ rescue NetworkApi::ApiError => e
63
+ puts "Error when calling PublicNetworksApi->public_networks_get_with_http_info: #{e}"
64
+ end
65
+ ```
66
+
67
+ ### Parameters
68
+
69
+ | Name | Type | Description | Notes |
70
+ | ---- | ---- | ----------- | ----- |
71
+ | **location** | **String** | If present will filter the result by the given location of the Public Networks. | [optional] |
72
+
73
+ ### Return type
74
+
75
+ [**Array&lt;PublicNetwork&gt;**](PublicNetwork.md)
76
+
77
+ ### Authorization
78
+
79
+ [OAuth2](../README.md#OAuth2)
80
+
81
+ ### HTTP request headers
82
+
83
+ - **Content-Type**: Not defined
84
+ - **Accept**: application/json
85
+
86
+
87
+ ## public_networks_network_id_delete
88
+
89
+ > public_networks_network_id_delete(public_network_id)
90
+
91
+ Delete a Public Network.
92
+
93
+ Delete Public Network. The request is accepted only if no resources are members of this network. The IP Block(s) will be freed and can be re-used in the future.
94
+
95
+ ### Examples
96
+
97
+ ```ruby
98
+ require 'time'
99
+ require 'pnap_network_api'
100
+ # setup authorization
101
+ NetworkApi.configure do |config|
102
+ # Configure OAuth2 access token for authorization: OAuth2
103
+ config.access_token = 'YOUR ACCESS TOKEN'
104
+ end
105
+
106
+ api_instance = NetworkApi::PublicNetworksApi.new
107
+ public_network_id = '603f3b2cfcaf050643b89a4b' # String | The Public Network identifier.
108
+
109
+ begin
110
+ # Delete a Public Network.
111
+ api_instance.public_networks_network_id_delete(public_network_id)
112
+ rescue NetworkApi::ApiError => e
113
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_delete: #{e}"
114
+ end
115
+ ```
116
+
117
+ #### Using the public_networks_network_id_delete_with_http_info variant
118
+
119
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
120
+
121
+ > <Array(nil, Integer, Hash)> public_networks_network_id_delete_with_http_info(public_network_id)
122
+
123
+ ```ruby
124
+ begin
125
+ # Delete a Public Network.
126
+ data, status_code, headers = api_instance.public_networks_network_id_delete_with_http_info(public_network_id)
127
+ p status_code # => 2xx
128
+ p headers # => { ... }
129
+ p data # => nil
130
+ rescue NetworkApi::ApiError => e
131
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_delete_with_http_info: #{e}"
132
+ end
133
+ ```
134
+
135
+ ### Parameters
136
+
137
+ | Name | Type | Description | Notes |
138
+ | ---- | ---- | ----------- | ----- |
139
+ | **public_network_id** | **String** | The Public Network identifier. | |
140
+
141
+ ### Return type
142
+
143
+ nil (empty response body)
144
+
145
+ ### Authorization
146
+
147
+ [OAuth2](../README.md#OAuth2)
148
+
149
+ ### HTTP request headers
150
+
151
+ - **Content-Type**: Not defined
152
+ - **Accept**: application/json
153
+
154
+
155
+ ## public_networks_network_id_get
156
+
157
+ > <PublicNetwork> public_networks_network_id_get(public_network_id)
158
+
159
+ Get a Public Network.
160
+
161
+ Retrieve Public Network Details.
162
+
163
+ ### Examples
164
+
165
+ ```ruby
166
+ require 'time'
167
+ require 'pnap_network_api'
168
+ # setup authorization
169
+ NetworkApi.configure do |config|
170
+ # Configure OAuth2 access token for authorization: OAuth2
171
+ config.access_token = 'YOUR ACCESS TOKEN'
172
+ end
173
+
174
+ api_instance = NetworkApi::PublicNetworksApi.new
175
+ public_network_id = '603f3b2cfcaf050643b89a4b' # String | The Public Network identifier.
176
+
177
+ begin
178
+ # Get a Public Network.
179
+ result = api_instance.public_networks_network_id_get(public_network_id)
180
+ p result
181
+ rescue NetworkApi::ApiError => e
182
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_get: #{e}"
183
+ end
184
+ ```
185
+
186
+ #### Using the public_networks_network_id_get_with_http_info variant
187
+
188
+ This returns an Array which contains the response data, status code and headers.
189
+
190
+ > <Array(<PublicNetwork>, Integer, Hash)> public_networks_network_id_get_with_http_info(public_network_id)
191
+
192
+ ```ruby
193
+ begin
194
+ # Get a Public Network.
195
+ data, status_code, headers = api_instance.public_networks_network_id_get_with_http_info(public_network_id)
196
+ p status_code # => 2xx
197
+ p headers # => { ... }
198
+ p data # => <PublicNetwork>
199
+ rescue NetworkApi::ApiError => e
200
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_get_with_http_info: #{e}"
201
+ end
202
+ ```
203
+
204
+ ### Parameters
205
+
206
+ | Name | Type | Description | Notes |
207
+ | ---- | ---- | ----------- | ----- |
208
+ | **public_network_id** | **String** | The Public Network identifier. | |
209
+
210
+ ### Return type
211
+
212
+ [**PublicNetwork**](PublicNetwork.md)
213
+
214
+ ### Authorization
215
+
216
+ [OAuth2](../README.md#OAuth2)
217
+
218
+ ### HTTP request headers
219
+
220
+ - **Content-Type**: Not defined
221
+ - **Accept**: application/json
222
+
223
+
224
+ ## public_networks_network_id_ip_blocks_ip_block_id_delete
225
+
226
+ > String public_networks_network_id_ip_blocks_ip_block_id_delete(public_network_id, ip_block_id)
227
+
228
+ Removes the IP Block from the Public Network.
229
+
230
+ Removes the IP Block from the Public Network. The result of this is that any traffic addressed to any IP within the block will not be routed to this network anymore. Please ensure that no resource members within this network have any IPs assigned from the IP Block being removed.
231
+
232
+ ### Examples
233
+
234
+ ```ruby
235
+ require 'time'
236
+ require 'pnap_network_api'
237
+ # setup authorization
238
+ NetworkApi.configure do |config|
239
+ # Configure OAuth2 access token for authorization: OAuth2
240
+ config.access_token = 'YOUR ACCESS TOKEN'
241
+ end
242
+
243
+ api_instance = NetworkApi::PublicNetworksApi.new
244
+ public_network_id = '603f3b2cfcaf050643b89a4b' # String | The Public Network identifier.
245
+ ip_block_id = '6047127fed34ecc3ba8402d2' # String | The IP Block identifier.
246
+
247
+ begin
248
+ # Removes the IP Block from the Public Network.
249
+ result = api_instance.public_networks_network_id_ip_blocks_ip_block_id_delete(public_network_id, ip_block_id)
250
+ p result
251
+ rescue NetworkApi::ApiError => e
252
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_ip_blocks_ip_block_id_delete: #{e}"
253
+ end
254
+ ```
255
+
256
+ #### Using the public_networks_network_id_ip_blocks_ip_block_id_delete_with_http_info variant
257
+
258
+ This returns an Array which contains the response data, status code and headers.
259
+
260
+ > <Array(String, Integer, Hash)> public_networks_network_id_ip_blocks_ip_block_id_delete_with_http_info(public_network_id, ip_block_id)
261
+
262
+ ```ruby
263
+ begin
264
+ # Removes the IP Block from the Public Network.
265
+ data, status_code, headers = api_instance.public_networks_network_id_ip_blocks_ip_block_id_delete_with_http_info(public_network_id, ip_block_id)
266
+ p status_code # => 2xx
267
+ p headers # => { ... }
268
+ p data # => String
269
+ rescue NetworkApi::ApiError => e
270
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_ip_blocks_ip_block_id_delete_with_http_info: #{e}"
271
+ end
272
+ ```
273
+
274
+ ### Parameters
275
+
276
+ | Name | Type | Description | Notes |
277
+ | ---- | ---- | ----------- | ----- |
278
+ | **public_network_id** | **String** | The Public Network identifier. | |
279
+ | **ip_block_id** | **String** | The IP Block identifier. | |
280
+
281
+ ### Return type
282
+
283
+ **String**
284
+
285
+ ### Authorization
286
+
287
+ [OAuth2](../README.md#OAuth2)
288
+
289
+ ### HTTP request headers
290
+
291
+ - **Content-Type**: Not defined
292
+ - **Accept**: application/json
293
+
294
+
295
+ ## public_networks_network_id_ip_blocks_post
296
+
297
+ > <PublicNetworkIpBlock> public_networks_network_id_ip_blocks_post(public_network_id, opts)
298
+
299
+ Adds an IP block to this public network.
300
+
301
+ Adds an IP block to this public 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::PublicNetworksApi.new
315
+ public_network_id = '603f3b2cfcaf050643b89a4b' # String | The Public Network identifier.
316
+ opts = {
317
+ public_network_ip_block: NetworkApi::PublicNetworkIpBlock.new({id: '60473a6115e34466c9f8f083'}) # PublicNetworkIpBlock |
318
+ }
319
+
320
+ begin
321
+ # Adds an IP block to this public network.
322
+ result = api_instance.public_networks_network_id_ip_blocks_post(public_network_id, opts)
323
+ p result
324
+ rescue NetworkApi::ApiError => e
325
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_ip_blocks_post: #{e}"
326
+ end
327
+ ```
328
+
329
+ #### Using the public_networks_network_id_ip_blocks_post_with_http_info variant
330
+
331
+ This returns an Array which contains the response data, status code and headers.
332
+
333
+ > <Array(<PublicNetworkIpBlock>, Integer, Hash)> public_networks_network_id_ip_blocks_post_with_http_info(public_network_id, opts)
334
+
335
+ ```ruby
336
+ begin
337
+ # Adds an IP block to this public network.
338
+ data, status_code, headers = api_instance.public_networks_network_id_ip_blocks_post_with_http_info(public_network_id, opts)
339
+ p status_code # => 2xx
340
+ p headers # => { ... }
341
+ p data # => <PublicNetworkIpBlock>
342
+ rescue NetworkApi::ApiError => e
343
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_ip_blocks_post_with_http_info: #{e}"
344
+ end
345
+ ```
346
+
347
+ ### Parameters
348
+
349
+ | Name | Type | Description | Notes |
350
+ | ---- | ---- | ----------- | ----- |
351
+ | **public_network_id** | **String** | The Public Network identifier. | |
352
+ | **public_network_ip_block** | [**PublicNetworkIpBlock**](PublicNetworkIpBlock.md) | | [optional] |
353
+
354
+ ### Return type
355
+
356
+ [**PublicNetworkIpBlock**](PublicNetworkIpBlock.md)
357
+
358
+ ### Authorization
359
+
360
+ [OAuth2](../README.md#OAuth2)
361
+
362
+ ### HTTP request headers
363
+
364
+ - **Content-Type**: application/json
365
+ - **Accept**: application/json
366
+
367
+
368
+ ## public_networks_network_id_patch
369
+
370
+ > <PublicNetwork> public_networks_network_id_patch(public_network_id, opts)
371
+
372
+ Update Public Network's Details.
373
+
374
+ Update Public Network's Details.
375
+
376
+ ### Examples
377
+
378
+ ```ruby
379
+ require 'time'
380
+ require 'pnap_network_api'
381
+ # setup authorization
382
+ NetworkApi.configure do |config|
383
+ # Configure OAuth2 access token for authorization: OAuth2
384
+ config.access_token = 'YOUR ACCESS TOKEN'
385
+ end
386
+
387
+ api_instance = NetworkApi::PublicNetworksApi.new
388
+ public_network_id = '603f3b2cfcaf050643b89a4b' # String | The Public Network identifier.
389
+ opts = {
390
+ public_network_modify: NetworkApi::PublicNetworkModify.new # PublicNetworkModify |
391
+ }
392
+
393
+ begin
394
+ # Update Public Network's Details.
395
+ result = api_instance.public_networks_network_id_patch(public_network_id, opts)
396
+ p result
397
+ rescue NetworkApi::ApiError => e
398
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_patch: #{e}"
399
+ end
400
+ ```
401
+
402
+ #### Using the public_networks_network_id_patch_with_http_info variant
403
+
404
+ This returns an Array which contains the response data, status code and headers.
405
+
406
+ > <Array(<PublicNetwork>, Integer, Hash)> public_networks_network_id_patch_with_http_info(public_network_id, opts)
407
+
408
+ ```ruby
409
+ begin
410
+ # Update Public Network's Details.
411
+ data, status_code, headers = api_instance.public_networks_network_id_patch_with_http_info(public_network_id, opts)
412
+ p status_code # => 2xx
413
+ p headers # => { ... }
414
+ p data # => <PublicNetwork>
415
+ rescue NetworkApi::ApiError => e
416
+ puts "Error when calling PublicNetworksApi->public_networks_network_id_patch_with_http_info: #{e}"
417
+ end
418
+ ```
419
+
420
+ ### Parameters
421
+
422
+ | Name | Type | Description | Notes |
423
+ | ---- | ---- | ----------- | ----- |
424
+ | **public_network_id** | **String** | The Public Network identifier. | |
425
+ | **public_network_modify** | [**PublicNetworkModify**](PublicNetworkModify.md) | | [optional] |
426
+
427
+ ### Return type
428
+
429
+ [**PublicNetwork**](PublicNetwork.md)
430
+
431
+ ### Authorization
432
+
433
+ [OAuth2](../README.md#OAuth2)
434
+
435
+ ### HTTP request headers
436
+
437
+ - **Content-Type**: application/json
438
+ - **Accept**: application/json
439
+
440
+
441
+ ## public_networks_post
442
+
443
+ > <PublicNetwork> public_networks_post(opts)
444
+
445
+ Create a public network.
446
+
447
+ Create a public network.
448
+
449
+ ### Examples
450
+
451
+ ```ruby
452
+ require 'time'
453
+ require 'pnap_network_api'
454
+ # setup authorization
455
+ NetworkApi.configure do |config|
456
+ # Configure OAuth2 access token for authorization: OAuth2
457
+ config.access_token = 'YOUR ACCESS TOKEN'
458
+ end
459
+
460
+ api_instance = NetworkApi::PublicNetworksApi.new
461
+ opts = {
462
+ public_network_create: NetworkApi::PublicNetworkCreate.new({name: 'Sample Network', location: 'PHX'}) # PublicNetworkCreate |
463
+ }
464
+
465
+ begin
466
+ # Create a public network.
467
+ result = api_instance.public_networks_post(opts)
468
+ p result
469
+ rescue NetworkApi::ApiError => e
470
+ puts "Error when calling PublicNetworksApi->public_networks_post: #{e}"
471
+ end
472
+ ```
473
+
474
+ #### Using the public_networks_post_with_http_info variant
475
+
476
+ This returns an Array which contains the response data, status code and headers.
477
+
478
+ > <Array(<PublicNetwork>, Integer, Hash)> public_networks_post_with_http_info(opts)
479
+
480
+ ```ruby
481
+ begin
482
+ # Create a public network.
483
+ data, status_code, headers = api_instance.public_networks_post_with_http_info(opts)
484
+ p status_code # => 2xx
485
+ p headers # => { ... }
486
+ p data # => <PublicNetwork>
487
+ rescue NetworkApi::ApiError => e
488
+ puts "Error when calling PublicNetworksApi->public_networks_post_with_http_info: #{e}"
489
+ end
490
+ ```
491
+
492
+ ### Parameters
493
+
494
+ | Name | Type | Description | Notes |
495
+ | ---- | ---- | ----------- | ----- |
496
+ | **public_network_create** | [**PublicNetworkCreate**](PublicNetworkCreate.md) | | [optional] |
497
+
498
+ ### Return type
499
+
500
+ [**PublicNetwork**](PublicNetwork.md)
501
+
502
+ ### Authorization
503
+
504
+ [OAuth2](../README.md#OAuth2)
505
+
506
+ ### HTTP request headers
507
+
508
+ - **Content-Type**: application/json
509
+ - **Accept**: application/json
510
+
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #Networks API
3
3
 
4
- #Use the Networks API to create, list, edit, and delete private networks to best fit your business needs. Private networks allow your servers to communicate without connecting to the public internet, avoiding unnecessary egress data charges.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
4
+ #Create, list, edit and delete public/private networks with the Network API. Use public networks to place multiple servers on the same network or VLAN. Assign new servers with IP addresses from the same CIDR range. Use private networks to avoid unnecessary egress data charges. Model your networks according to your business needs.<br> <br> <span class='pnap-api-knowledge-base-link'> Helpful knowledge base articles are available for <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#multi-private-backend-network-api' target='_blank'>multi-private backend networks</a> and <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/v1/)</b>
5
5
 
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
9
+ OpenAPI Generator version: 6.1.0
10
10
 
11
11
  =end
12
12