pnap_network_api 2.1.2 → 2.2.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 +1 -0
- data/VERSION +1 -1
- data/docs/BgpIpPrefix.md +24 -0
- data/docs/BgpPeerGroup.md +6 -2
- data/docs/BgpPeerGroupCreate.md +1 -1
- data/docs/PrivateNetworkCreate.md +1 -1
- data/docs/PublicNetwork.md +1 -1
- data/docs/PublicNetworkCreate.md +1 -1
- data/lib/pnap_network_api/api/bgp_peer_groups_api.rb +6 -6
- data/lib/pnap_network_api/api/private_networks_api.rb +6 -6
- data/lib/pnap_network_api/api/public_networks_api.rb +8 -8
- data/lib/pnap_network_api/api_client.rb +17 -14
- data/lib/pnap_network_api/api_error.rb +1 -1
- data/lib/pnap_network_api/api_model_base.rb +88 -0
- data/lib/pnap_network_api/configuration.rb +11 -1
- data/lib/pnap_network_api/models/asn_details.rb +41 -78
- data/lib/pnap_network_api/models/bgp_ip_prefix.rb +247 -0
- data/lib/pnap_network_api/models/bgp_ipv4_prefix.rb +52 -79
- data/lib/pnap_network_api/models/bgp_peer_group.rb +184 -83
- data/lib/pnap_network_api/models/bgp_peer_group_create.rb +44 -81
- data/lib/pnap_network_api/models/bgp_peer_group_patch.rb +13 -80
- data/lib/pnap_network_api/models/error.rb +21 -78
- data/lib/pnap_network_api/models/network_membership.rb +41 -78
- data/lib/pnap_network_api/models/private_network.rb +103 -80
- data/lib/pnap_network_api/models/private_network_create.rb +24 -81
- data/lib/pnap_network_api/models/private_network_modify.rb +23 -80
- data/lib/pnap_network_api/models/private_network_server.rb +31 -78
- data/lib/pnap_network_api/models/public_network.rb +84 -81
- data/lib/pnap_network_api/models/public_network_create.rb +24 -81
- data/lib/pnap_network_api/models/public_network_ip_block.rb +41 -78
- data/lib/pnap_network_api/models/public_network_ip_block_create.rb +21 -78
- data/lib/pnap_network_api/models/public_network_modify.rb +13 -80
- data/lib/pnap_network_api/version.rb +1 -2
- data/lib/pnap_network_api.rb +3 -1
- data/pnap_network_api.gemspec +6 -6
- data/spec/api/bgp_peer_groups_api_spec.rb +1 -1
- data/spec/api/private_networks_api_spec.rb +1 -1
- data/spec/api/public_networks_api_spec.rb +1 -1
- data/spec/models/asn_details_spec.rb +2 -2
- data/spec/models/bgp_ip_prefix_spec.rb +54 -0
- data/spec/models/bgp_ipv4_prefix_spec.rb +2 -2
- data/spec/models/bgp_peer_group_create_spec.rb +2 -2
- data/spec/models/bgp_peer_group_patch_spec.rb +2 -2
- data/spec/models/bgp_peer_group_spec.rb +14 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/network_membership_spec.rb +2 -2
- data/spec/models/private_network_create_spec.rb +2 -2
- data/spec/models/private_network_modify_spec.rb +2 -2
- data/spec/models/private_network_server_spec.rb +2 -2
- data/spec/models/private_network_spec.rb +2 -2
- data/spec/models/public_network_create_spec.rb +2 -2
- data/spec/models/public_network_ip_block_create_spec.rb +2 -2
- data/spec/models/public_network_ip_block_spec.rb +2 -2
- data/spec/models/public_network_modify_spec.rb +2 -2
- data/spec/models/public_network_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +31 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0cf22f778135248e895ff34299f5547140025073e0b4ff4da8d80b6299f5348b
|
|
4
|
+
data.tar.gz: 54e014aa8d044a043dfd929aa7e74424292f7d35d1b4e4fab8d0bf458a236f6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9c32bc806c0969d642ff3567c9e99a764ea88a48fe7ba1ea9a9597a42a569b413a6d01e445f11121f8e1d5bc0e85cc8187784c91fafc9072ceb17ce66562740d
|
|
7
|
+
data.tar.gz: 53b9921bbf5fd977e7f442dd41ba9295018c661357084c6dd3704030be1598b9b08f1799097a70cca62e9459f2fe35787ce22e074e38c001a50408d8ac61a343
|
data/README.md
CHANGED
|
@@ -150,6 +150,7 @@ Class | Method | HTTP request | Description
|
|
|
150
150
|
|
|
151
151
|
- [NetworkApi::AsnDetails](docs/AsnDetails.md)
|
|
152
152
|
- [NetworkApi::BgpIPv4Prefix](docs/BgpIPv4Prefix.md)
|
|
153
|
+
- [NetworkApi::BgpIpPrefix](docs/BgpIpPrefix.md)
|
|
153
154
|
- [NetworkApi::BgpPeerGroup](docs/BgpPeerGroup.md)
|
|
154
155
|
- [NetworkApi::BgpPeerGroupCreate](docs/BgpPeerGroupCreate.md)
|
|
155
156
|
- [NetworkApi::BgpPeerGroupPatch](docs/BgpPeerGroupPatch.md)
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.2.0
|
data/docs/BgpIpPrefix.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# NetworkApi::BgpIpPrefix
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **ip_allocation_id** | **String** | IP allocation ID. | |
|
|
8
|
+
| **cidr** | **String** | The IP block in CIDR format, dependent on IP version. | |
|
|
9
|
+
| **ip_version** | **String** | The IP block version. | |
|
|
10
|
+
| **status** | **String** | The BGP IP Prefix status. Can have one of the following values: `PENDING`, `BUSY`, `READY`, `ERROR` and `DELETING`. | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'pnap_network_api'
|
|
16
|
+
|
|
17
|
+
instance = NetworkApi::BgpIpPrefix.new(
|
|
18
|
+
ip_allocation_id: 6047127fed34ecc3ba8402d2,
|
|
19
|
+
cidr: 10.111.14.40/29,
|
|
20
|
+
ip_version: V4,
|
|
21
|
+
status: READY
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
data/docs/BgpPeerGroup.md
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **id** | **String** | The unique identifier of the BGP Peer Group. | |
|
|
8
8
|
| **status** | **String** | The BGP Peer Group status. Can have one of the following values: `PENDING`, `ON_HOLD`, `BUSY`, `READY`, `ERROR`, `PENDING_DELETION` and `DELETING`. | |
|
|
9
|
-
| **location** | **String** | The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI`
|
|
10
|
-
| **ipv4_prefixes** | [**Array<BgpIPv4Prefix>**](BgpIPv4Prefix.md) | The List of the BGP Peer Group IPv4 prefixes. | |
|
|
9
|
+
| **location** | **String** | The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`. | |
|
|
10
|
+
| **ipv4_prefixes** | [**Array<BgpIPv4Prefix>**](BgpIPv4Prefix.md) | The List of the BGP Peer Group IPv4 prefixes. Deprecated in favour of generic ipPrefixes. | |
|
|
11
|
+
| **ip_prefixes** | [**Array<BgpIpPrefix>**](BgpIpPrefix.md) | The List of the BGP Peer Group IP prefixes. | |
|
|
11
12
|
| **target_asn_details** | [**AsnDetails**](AsnDetails.md) | | |
|
|
12
13
|
| **active_asn_details** | [**AsnDetails**](AsnDetails.md) | | [optional] |
|
|
13
14
|
| **password** | **String** | The BGP Peer Group password. | |
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
| **rpki_roa_origin_asn** | **Integer** | The RPKI ROA Origin ASN of the BGP Peer Group based on location. | |
|
|
16
17
|
| **e_bgp_multi_hop** | **Integer** | The eBGP Multi-hop of the BGP Peer Group. | |
|
|
17
18
|
| **peering_loopbacks_v4** | **Array<String>** | The IPv4 Peering Loopback addresses of the BGP Peer Group. Valid IP formats are IPv4 addresses. | |
|
|
19
|
+
| **peering_loopbacks_v6** | **Array<String>** | The IPv6 Peering Loopback addresses of the BGP Peer Group. Valid IP formats are IPv6 addresses. | |
|
|
18
20
|
| **keep_alive_timer_seconds** | **Integer** | The Keep Alive Timer in seconds of the BGP Peer Group. | |
|
|
19
21
|
| **hold_timer_seconds** | **Integer** | The Hold Timer in seconds of the BGP Peer Group. | |
|
|
20
22
|
| **created_on** | **String** | Date and time of creation. | [optional] |
|
|
@@ -30,6 +32,7 @@ instance = NetworkApi::BgpPeerGroup.new(
|
|
|
30
32
|
status: READY,
|
|
31
33
|
location: ASH,
|
|
32
34
|
ipv4_prefixes: null,
|
|
35
|
+
ip_prefixes: null,
|
|
33
36
|
target_asn_details: null,
|
|
34
37
|
active_asn_details: null,
|
|
35
38
|
password: E!73423ghhjfge45,
|
|
@@ -37,6 +40,7 @@ instance = NetworkApi::BgpPeerGroup.new(
|
|
|
37
40
|
rpki_roa_origin_asn: 20454,
|
|
38
41
|
e_bgp_multi_hop: 7,
|
|
39
42
|
peering_loopbacks_v4: ["169.254.247.0","169.254.247.1"],
|
|
43
|
+
peering_loopbacks_v6: ["fd00:0:0:1005::1","fd00:0:0:1005::2"],
|
|
40
44
|
keep_alive_timer_seconds: 10,
|
|
41
45
|
hold_timer_seconds: 30,
|
|
42
46
|
created_on: 2024-03-01T10:30:00Z,
|
data/docs/BgpPeerGroupCreate.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **location** | **String** | The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI`
|
|
7
|
+
| **location** | **String** | The BGP Peer Group location. Can have one of the following values: `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`. | |
|
|
8
8
|
| **asn** | **Integer** | The BGP Peer Group ASN. | [default to 65401] |
|
|
9
9
|
| **password** | **String** | The BGP Peer Group password. | [optional] |
|
|
10
10
|
| **advertised_routes** | **String** | The Advertised routes for the BGP Peer Group. Can have one of the following values: `DEFAULT` and `NONE`. | [default to 'NONE'] |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **name** | **String** | The friendly name of this private network. This name should be unique. | |
|
|
8
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`
|
|
9
|
+
| **location** | **String** | The location of this private network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`. | |
|
|
10
10
|
| **location_default** | **Boolean** | Identifies network as the default private network for the specified location. | [optional][default to false] |
|
|
11
11
|
| **vlan_id** | **Integer** | The VLAN that will be assigned to this network. | [optional] |
|
|
12
12
|
| **cidr** | **String** | IP range associated with this private network in CIDR notation.<br> Setting the `force` query parameter to `true` allows you to skip assigning a specific IP range to network. | [optional] |
|
data/docs/PublicNetwork.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
| **vlan_id** | **Integer** | The VLAN of this public network. | |
|
|
9
9
|
| **memberships** | [**Array<NetworkMembership>**](NetworkMembership.md) | A list of resources that are members of this public network. | |
|
|
10
10
|
| **name** | **String** | The friendly name of this public network. | |
|
|
11
|
-
| **location** | **String** | The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`
|
|
11
|
+
| **location** | **String** | The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`. | |
|
|
12
12
|
| **description** | **String** | The description of this public network. | [optional] |
|
|
13
13
|
| **status** | **String** | The status of the public network. Can have one of the following values: `BUSY`, `READY`, `DELETING` or `ERROR`. | |
|
|
14
14
|
| **created_on** | **Time** | Date and time when this public network was created. | |
|
data/docs/PublicNetworkCreate.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **name** | **String** | The friendly name of this public network. This name should be unique. | |
|
|
8
8
|
| **description** | **String** | The description of this public network. | [optional] |
|
|
9
|
-
| **location** | **String** | The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`
|
|
9
|
+
| **location** | **String** | The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`. | |
|
|
10
10
|
| **vlan_id** | **Integer** | The VLAN that will be assigned to this network. | [optional] |
|
|
11
11
|
| **ip_blocks** | [**Array<PublicNetworkIpBlockCreate>**](PublicNetworkIpBlockCreate.md) | A list of IP Blocks that will be associated with this public network. Supported maximum of 10 IPv4 Blocks and 1 IPv6 Block. | [optional] |
|
|
12
12
|
| **ra_enabled** | **Boolean** | Boolean indicating whether Router Advertisement is enabled. Only applicable for Network with IPv6 Blocks. | [optional] |
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -48,7 +48,7 @@ module NetworkApi
|
|
|
48
48
|
# header parameters
|
|
49
49
|
header_params = opts[:header_params] || {}
|
|
50
50
|
# HTTP header 'Accept' (if needed)
|
|
51
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
52
52
|
|
|
53
53
|
# form parameters
|
|
54
54
|
form_params = opts[:form_params] || {}
|
|
@@ -111,7 +111,7 @@ module NetworkApi
|
|
|
111
111
|
# header parameters
|
|
112
112
|
header_params = opts[:header_params] || {}
|
|
113
113
|
# HTTP header 'Accept' (if needed)
|
|
114
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
115
115
|
|
|
116
116
|
# form parameters
|
|
117
117
|
form_params = opts[:form_params] || {}
|
|
@@ -174,7 +174,7 @@ module NetworkApi
|
|
|
174
174
|
# header parameters
|
|
175
175
|
header_params = opts[:header_params] || {}
|
|
176
176
|
# HTTP header 'Accept' (if needed)
|
|
177
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
178
178
|
|
|
179
179
|
# form parameters
|
|
180
180
|
form_params = opts[:form_params] || {}
|
|
@@ -243,7 +243,7 @@ module NetworkApi
|
|
|
243
243
|
# header parameters
|
|
244
244
|
header_params = opts[:header_params] || {}
|
|
245
245
|
# HTTP header 'Accept' (if needed)
|
|
246
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
246
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
247
247
|
# HTTP header 'Content-Type'
|
|
248
248
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
249
249
|
if !content_type.nil?
|
|
@@ -311,7 +311,7 @@ module NetworkApi
|
|
|
311
311
|
# header parameters
|
|
312
312
|
header_params = opts[:header_params] || {}
|
|
313
313
|
# HTTP header 'Accept' (if needed)
|
|
314
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
314
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
315
315
|
# HTTP header 'Content-Type'
|
|
316
316
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
317
317
|
if !content_type.nil?
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -48,7 +48,7 @@ module NetworkApi
|
|
|
48
48
|
# header parameters
|
|
49
49
|
header_params = opts[:header_params] || {}
|
|
50
50
|
# HTTP header 'Accept' (if needed)
|
|
51
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
52
52
|
|
|
53
53
|
# form parameters
|
|
54
54
|
form_params = opts[:form_params] || {}
|
|
@@ -111,7 +111,7 @@ module NetworkApi
|
|
|
111
111
|
# header parameters
|
|
112
112
|
header_params = opts[:header_params] || {}
|
|
113
113
|
# HTTP header 'Accept' (if needed)
|
|
114
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
115
115
|
|
|
116
116
|
# form parameters
|
|
117
117
|
form_params = opts[:form_params] || {}
|
|
@@ -174,7 +174,7 @@ module NetworkApi
|
|
|
174
174
|
# header parameters
|
|
175
175
|
header_params = opts[:header_params] || {}
|
|
176
176
|
# HTTP header 'Accept' (if needed)
|
|
177
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
178
178
|
|
|
179
179
|
# form parameters
|
|
180
180
|
form_params = opts[:form_params] || {}
|
|
@@ -243,7 +243,7 @@ module NetworkApi
|
|
|
243
243
|
# header parameters
|
|
244
244
|
header_params = opts[:header_params] || {}
|
|
245
245
|
# HTTP header 'Accept' (if needed)
|
|
246
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
246
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
247
247
|
# HTTP header 'Content-Type'
|
|
248
248
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
249
249
|
if !content_type.nil?
|
|
@@ -314,7 +314,7 @@ module NetworkApi
|
|
|
314
314
|
# header parameters
|
|
315
315
|
header_params = opts[:header_params] || {}
|
|
316
316
|
# HTTP header 'Accept' (if needed)
|
|
317
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
317
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
318
318
|
# HTTP header 'Content-Type'
|
|
319
319
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
320
320
|
if !content_type.nil?
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -48,7 +48,7 @@ module NetworkApi
|
|
|
48
48
|
# header parameters
|
|
49
49
|
header_params = opts[:header_params] || {}
|
|
50
50
|
# HTTP header 'Accept' (if needed)
|
|
51
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
52
52
|
|
|
53
53
|
# form parameters
|
|
54
54
|
form_params = opts[:form_params] || {}
|
|
@@ -111,7 +111,7 @@ module NetworkApi
|
|
|
111
111
|
# header parameters
|
|
112
112
|
header_params = opts[:header_params] || {}
|
|
113
113
|
# HTTP header 'Accept' (if needed)
|
|
114
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
115
115
|
|
|
116
116
|
# form parameters
|
|
117
117
|
form_params = opts[:form_params] || {}
|
|
@@ -174,7 +174,7 @@ module NetworkApi
|
|
|
174
174
|
# header parameters
|
|
175
175
|
header_params = opts[:header_params] || {}
|
|
176
176
|
# HTTP header 'Accept' (if needed)
|
|
177
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
178
178
|
|
|
179
179
|
# form parameters
|
|
180
180
|
form_params = opts[:form_params] || {}
|
|
@@ -246,7 +246,7 @@ module NetworkApi
|
|
|
246
246
|
# header parameters
|
|
247
247
|
header_params = opts[:header_params] || {}
|
|
248
248
|
# HTTP header 'Accept' (if needed)
|
|
249
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
249
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
250
250
|
|
|
251
251
|
# form parameters
|
|
252
252
|
form_params = opts[:form_params] || {}
|
|
@@ -315,7 +315,7 @@ module NetworkApi
|
|
|
315
315
|
# header parameters
|
|
316
316
|
header_params = opts[:header_params] || {}
|
|
317
317
|
# HTTP header 'Accept' (if needed)
|
|
318
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
318
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
319
319
|
# HTTP header 'Content-Type'
|
|
320
320
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
321
321
|
if !content_type.nil?
|
|
@@ -389,7 +389,7 @@ module NetworkApi
|
|
|
389
389
|
# header parameters
|
|
390
390
|
header_params = opts[:header_params] || {}
|
|
391
391
|
# HTTP header 'Accept' (if needed)
|
|
392
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
393
393
|
# HTTP header 'Content-Type'
|
|
394
394
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
395
395
|
if !content_type.nil?
|
|
@@ -457,7 +457,7 @@ module NetworkApi
|
|
|
457
457
|
# header parameters
|
|
458
458
|
header_params = opts[:header_params] || {}
|
|
459
459
|
# HTTP header 'Accept' (if needed)
|
|
460
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
460
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
461
461
|
# HTTP header 'Content-Type'
|
|
462
462
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
463
463
|
if !content_type.nil?
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -52,7 +52,8 @@ module NetworkApi
|
|
|
52
52
|
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
|
53
53
|
def call_api(http_method, path, opts = {})
|
|
54
54
|
request = build_request(http_method, path, opts)
|
|
55
|
-
tempfile =
|
|
55
|
+
tempfile = nil
|
|
56
|
+
(download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
|
|
56
57
|
response = request.run
|
|
57
58
|
|
|
58
59
|
if @config.debugging
|
|
@@ -191,19 +192,17 @@ module NetworkApi
|
|
|
191
192
|
chunk.force_encoding(encoding)
|
|
192
193
|
tempfile.write(chunk)
|
|
193
194
|
end
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
request.on_complete do
|
|
196
|
+
if !tempfile
|
|
197
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
198
|
+
end
|
|
197
199
|
tempfile.close
|
|
198
200
|
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
|
199
201
|
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
|
200
202
|
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
|
201
203
|
"explicitly with `tempfile.delete`"
|
|
202
|
-
|
|
203
|
-
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
204
|
+
yield tempfile if block_given?
|
|
204
205
|
end
|
|
205
|
-
|
|
206
|
-
tempfile
|
|
207
206
|
end
|
|
208
207
|
|
|
209
208
|
# Check if the given MIME is a JSON MIME.
|
|
@@ -215,7 +214,7 @@ module NetworkApi
|
|
|
215
214
|
# @param [String] mime MIME
|
|
216
215
|
# @return [Boolean] True if the MIME is application/json
|
|
217
216
|
def json_mime?(mime)
|
|
218
|
-
(mime == '*/*') || !(mime =~
|
|
217
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
|
219
218
|
end
|
|
220
219
|
|
|
221
220
|
# Deserialize the response to the given return type.
|
|
@@ -282,9 +281,13 @@ module NetworkApi
|
|
|
282
281
|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
|
283
282
|
end
|
|
284
283
|
else
|
|
285
|
-
# models (e.g. Pet) or oneOf
|
|
284
|
+
# models (e.g. Pet) or oneOf/anyOf
|
|
286
285
|
klass = NetworkApi.const_get(return_type)
|
|
287
|
-
klass.respond_to?(:openapi_one_of)
|
|
286
|
+
if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
|
|
287
|
+
klass.build(data)
|
|
288
|
+
else
|
|
289
|
+
klass.build_from_hash(data)
|
|
290
|
+
end
|
|
288
291
|
end
|
|
289
292
|
end
|
|
290
293
|
|
|
@@ -294,7 +297,7 @@ module NetworkApi
|
|
|
294
297
|
# @param [String] filename the filename to be sanitized
|
|
295
298
|
# @return [String] the sanitized filename
|
|
296
299
|
def sanitize_filename(filename)
|
|
297
|
-
filename.
|
|
300
|
+
filename.split(/[\/\\]/).last
|
|
298
301
|
end
|
|
299
302
|
|
|
300
303
|
def build_request_url(path, opts = {})
|
|
@@ -394,4 +397,4 @@ module NetworkApi
|
|
|
394
397
|
end
|
|
395
398
|
end
|
|
396
399
|
end
|
|
397
|
-
end
|
|
400
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Networks API
|
|
3
|
+
|
|
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>, <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-15' target='_blank'>public networks</a> and <a href='https://phoenixnap.com/kb/border-gateway-protocol-bmc' target='_blank'>border gateway protocol peer groups</a>. </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/networks/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
|
+
Generator version: 7.20.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module NetworkApi
|
|
14
|
+
class ApiModelBase
|
|
15
|
+
# Deserializes the data based on type
|
|
16
|
+
# @param string type Data type
|
|
17
|
+
# @param string value Value to be deserialized
|
|
18
|
+
# @return [Object] Deserialized data
|
|
19
|
+
def self._deserialize(type, value)
|
|
20
|
+
case type.to_sym
|
|
21
|
+
when :Time
|
|
22
|
+
Time.parse(value)
|
|
23
|
+
when :Date
|
|
24
|
+
Date.parse(value)
|
|
25
|
+
when :String
|
|
26
|
+
value.to_s
|
|
27
|
+
when :Integer
|
|
28
|
+
value.to_i
|
|
29
|
+
when :Float
|
|
30
|
+
value.to_f
|
|
31
|
+
when :Boolean
|
|
32
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
33
|
+
true
|
|
34
|
+
else
|
|
35
|
+
false
|
|
36
|
+
end
|
|
37
|
+
when :Object
|
|
38
|
+
# generic object (usually a Hash), return directly
|
|
39
|
+
value
|
|
40
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
41
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
42
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
43
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
44
|
+
k_type = Regexp.last_match[:k_type]
|
|
45
|
+
v_type = Regexp.last_match[:v_type]
|
|
46
|
+
{}.tap do |hash|
|
|
47
|
+
value.each do |k, v|
|
|
48
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
else # model
|
|
52
|
+
# models (e.g. Pet) or oneOf
|
|
53
|
+
klass = NetworkApi.const_get(type)
|
|
54
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns the string representation of the object
|
|
59
|
+
# @return [String] String presentation of the object
|
|
60
|
+
def to_s
|
|
61
|
+
to_hash.to_s
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
65
|
+
# @return [Hash] Returns the object in the form of hash
|
|
66
|
+
def to_body
|
|
67
|
+
to_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Outputs non-array value in the form of hash
|
|
71
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
72
|
+
# @param [Object] value Any valid value
|
|
73
|
+
# @return [Hash] Returns the value in the form of hash
|
|
74
|
+
def _to_hash(value)
|
|
75
|
+
if value.is_a?(Array)
|
|
76
|
+
value.compact.map { |v| _to_hash(v) }
|
|
77
|
+
elsif value.is_a?(Hash)
|
|
78
|
+
{}.tap do |hash|
|
|
79
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
80
|
+
end
|
|
81
|
+
elsif value.respond_to? :to_hash
|
|
82
|
+
value.to_hash
|
|
83
|
+
else
|
|
84
|
+
value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -6,7 +6,7 @@
|
|
|
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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -79,6 +79,14 @@ module NetworkApi
|
|
|
79
79
|
# @return [true, false]
|
|
80
80
|
attr_accessor :debugging
|
|
81
81
|
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
|
86
|
+
# Default to false.
|
|
87
|
+
# @return [true, false]
|
|
88
|
+
attr_accessor :ignore_operation_servers
|
|
89
|
+
|
|
82
90
|
# Defines the logger used for debugging.
|
|
83
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
|
84
92
|
#
|
|
@@ -166,6 +174,7 @@ module NetworkApi
|
|
|
166
174
|
@timeout = 0
|
|
167
175
|
@params_encoding = nil
|
|
168
176
|
@debugging = false
|
|
177
|
+
@ignore_operation_servers = false
|
|
169
178
|
@inject_format = false
|
|
170
179
|
@force_ending_format = false
|
|
171
180
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
|
@@ -200,6 +209,7 @@ module NetworkApi
|
|
|
200
209
|
|
|
201
210
|
# Returns base URL for specified operation based on server settings
|
|
202
211
|
def base_url(operation = nil)
|
|
212
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
|
203
213
|
if operation_server_settings.key?(operation) then
|
|
204
214
|
index = server_operation_index.fetch(operation, server_index)
|
|
205
215
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|