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.
- checksums.yaml +4 -4
- data/README.md +18 -5
- data/VERSION +1 -1
- data/docs/NetworkMembership.md +22 -0
- data/docs/PrivateNetwork.md +7 -1
- data/docs/PublicNetwork.md +34 -0
- data/docs/PublicNetworkCreate.md +24 -0
- data/docs/PublicNetworkIpBlock.md +18 -0
- data/docs/PublicNetworkMembership.md +22 -0
- data/docs/PublicNetworkModify.md +20 -0
- data/docs/PublicNetworksApi.md +510 -0
- data/lib/pnap_network_api/api/private_networks_api.rb +2 -2
- data/lib/pnap_network_api/api/public_networks_api.rb +481 -0
- data/lib/pnap_network_api/api_client.rb +5 -3
- data/lib/pnap_network_api/api_error.rb +2 -2
- data/lib/pnap_network_api/configuration.rb +4 -3
- data/lib/pnap_network_api/models/error.rb +3 -2
- data/lib/pnap_network_api/models/network_membership.rb +258 -0
- data/lib/pnap_network_api/models/private_network.rb +97 -6
- data/lib/pnap_network_api/models/private_network_create.rb +46 -2
- data/lib/pnap_network_api/models/private_network_modify.rb +46 -2
- data/lib/pnap_network_api/models/private_network_server.rb +3 -2
- data/lib/pnap_network_api/models/public_network.rb +388 -0
- data/lib/pnap_network_api/models/public_network_create.rb +321 -0
- data/lib/pnap_network_api/models/public_network_ip_block.rb +226 -0
- data/lib/pnap_network_api/models/public_network_membership.rb +257 -0
- data/lib/pnap_network_api/models/public_network_modify.rb +270 -0
- data/lib/pnap_network_api/version.rb +2 -2
- data/lib/pnap_network_api.rb +8 -2
- data/pnap_network_api.gemspec +3 -3
- data/spec/api/public_networks_api_spec.rb +122 -0
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/network_membership_spec.rb +46 -0
- data/spec/models/public_network_create_spec.rb +52 -0
- data/spec/models/public_network_ip_block_spec.rb +34 -0
- data/spec/models/public_network_membership_spec.rb +46 -0
- data/spec/models/public_network_modify_spec.rb +40 -0
- data/spec/models/public_network_spec.rb +76 -0
- data/spec/spec_helper.rb +2 -2
- metadata +34 -6
@@ -0,0 +1,481 @@
|
|
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> 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
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: support@phoenixnap.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module NetworkApi
|
16
|
+
class PublicNetworksApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List Public Networks.
|
23
|
+
# List all Public Networks owned by account.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :location If present will filter the result by the given location of the Public Networks.
|
26
|
+
# @return [Array<PublicNetwork>]
|
27
|
+
def public_networks_get(opts = {})
|
28
|
+
data, _status_code, _headers = public_networks_get_with_http_info(opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# List Public Networks.
|
33
|
+
# List all Public Networks owned by account.
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @option opts [String] :location If present will filter the result by the given location of the Public Networks.
|
36
|
+
# @return [Array<(Array<PublicNetwork>, Integer, Hash)>] Array<PublicNetwork> data, response status code and response headers
|
37
|
+
def public_networks_get_with_http_info(opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_get ...'
|
40
|
+
end
|
41
|
+
# resource path
|
42
|
+
local_var_path = '/public-networks'
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = opts[:query_params] || {}
|
46
|
+
query_params[:'location'] = opts[:'location'] if !opts[:'location'].nil?
|
47
|
+
|
48
|
+
# header parameters
|
49
|
+
header_params = opts[:header_params] || {}
|
50
|
+
# HTTP header 'Accept' (if needed)
|
51
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
52
|
+
|
53
|
+
# form parameters
|
54
|
+
form_params = opts[:form_params] || {}
|
55
|
+
|
56
|
+
# http body (model)
|
57
|
+
post_body = opts[:debug_body]
|
58
|
+
|
59
|
+
# return_type
|
60
|
+
return_type = opts[:debug_return_type] || 'Array<PublicNetwork>'
|
61
|
+
|
62
|
+
# auth_names
|
63
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
64
|
+
|
65
|
+
new_options = opts.merge(
|
66
|
+
:operation => :"PublicNetworksApi.public_networks_get",
|
67
|
+
:header_params => header_params,
|
68
|
+
:query_params => query_params,
|
69
|
+
:form_params => form_params,
|
70
|
+
:body => post_body,
|
71
|
+
:auth_names => auth_names,
|
72
|
+
:return_type => return_type
|
73
|
+
)
|
74
|
+
|
75
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
76
|
+
if @api_client.config.debugging
|
77
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
78
|
+
end
|
79
|
+
return data, status_code, headers
|
80
|
+
end
|
81
|
+
|
82
|
+
# Delete a Public Network.
|
83
|
+
# 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.
|
84
|
+
# @param public_network_id [String] The Public Network identifier.
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [nil]
|
87
|
+
def public_networks_network_id_delete(public_network_id, opts = {})
|
88
|
+
public_networks_network_id_delete_with_http_info(public_network_id, opts)
|
89
|
+
nil
|
90
|
+
end
|
91
|
+
|
92
|
+
# Delete a Public Network.
|
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
|
+
# @param public_network_id [String] The Public Network identifier.
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
97
|
+
def public_networks_network_id_delete_with_http_info(public_network_id, opts = {})
|
98
|
+
if @api_client.config.debugging
|
99
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_network_id_delete ...'
|
100
|
+
end
|
101
|
+
# verify the required parameter 'public_network_id' is set
|
102
|
+
if @api_client.config.client_side_validation && public_network_id.nil?
|
103
|
+
fail ArgumentError, "Missing the required parameter 'public_network_id' when calling PublicNetworksApi.public_networks_network_id_delete"
|
104
|
+
end
|
105
|
+
# resource path
|
106
|
+
local_var_path = '/public-networks/{publicNetworkId}'.sub('{' + 'publicNetworkId' + '}', CGI.escape(public_network_id.to_s))
|
107
|
+
|
108
|
+
# query parameters
|
109
|
+
query_params = opts[:query_params] || {}
|
110
|
+
|
111
|
+
# header parameters
|
112
|
+
header_params = opts[:header_params] || {}
|
113
|
+
# HTTP header 'Accept' (if needed)
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
115
|
+
|
116
|
+
# form parameters
|
117
|
+
form_params = opts[:form_params] || {}
|
118
|
+
|
119
|
+
# http body (model)
|
120
|
+
post_body = opts[:debug_body]
|
121
|
+
|
122
|
+
# return_type
|
123
|
+
return_type = opts[:debug_return_type]
|
124
|
+
|
125
|
+
# auth_names
|
126
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
127
|
+
|
128
|
+
new_options = opts.merge(
|
129
|
+
:operation => :"PublicNetworksApi.public_networks_network_id_delete",
|
130
|
+
:header_params => header_params,
|
131
|
+
:query_params => query_params,
|
132
|
+
:form_params => form_params,
|
133
|
+
:body => post_body,
|
134
|
+
:auth_names => auth_names,
|
135
|
+
:return_type => return_type
|
136
|
+
)
|
137
|
+
|
138
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
139
|
+
if @api_client.config.debugging
|
140
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_network_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
141
|
+
end
|
142
|
+
return data, status_code, headers
|
143
|
+
end
|
144
|
+
|
145
|
+
# Get a Public Network.
|
146
|
+
# Retrieve Public Network Details.
|
147
|
+
# @param public_network_id [String] The Public Network identifier.
|
148
|
+
# @param [Hash] opts the optional parameters
|
149
|
+
# @return [PublicNetwork]
|
150
|
+
def public_networks_network_id_get(public_network_id, opts = {})
|
151
|
+
data, _status_code, _headers = public_networks_network_id_get_with_http_info(public_network_id, opts)
|
152
|
+
data
|
153
|
+
end
|
154
|
+
|
155
|
+
# Get a Public Network.
|
156
|
+
# Retrieve Public Network Details.
|
157
|
+
# @param public_network_id [String] The Public Network identifier.
|
158
|
+
# @param [Hash] opts the optional parameters
|
159
|
+
# @return [Array<(PublicNetwork, Integer, Hash)>] PublicNetwork data, response status code and response headers
|
160
|
+
def public_networks_network_id_get_with_http_info(public_network_id, opts = {})
|
161
|
+
if @api_client.config.debugging
|
162
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_network_id_get ...'
|
163
|
+
end
|
164
|
+
# verify the required parameter 'public_network_id' is set
|
165
|
+
if @api_client.config.client_side_validation && public_network_id.nil?
|
166
|
+
fail ArgumentError, "Missing the required parameter 'public_network_id' when calling PublicNetworksApi.public_networks_network_id_get"
|
167
|
+
end
|
168
|
+
# resource path
|
169
|
+
local_var_path = '/public-networks/{publicNetworkId}'.sub('{' + 'publicNetworkId' + '}', CGI.escape(public_network_id.to_s))
|
170
|
+
|
171
|
+
# query parameters
|
172
|
+
query_params = opts[:query_params] || {}
|
173
|
+
|
174
|
+
# header parameters
|
175
|
+
header_params = opts[:header_params] || {}
|
176
|
+
# HTTP header 'Accept' (if needed)
|
177
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
178
|
+
|
179
|
+
# form parameters
|
180
|
+
form_params = opts[:form_params] || {}
|
181
|
+
|
182
|
+
# http body (model)
|
183
|
+
post_body = opts[:debug_body]
|
184
|
+
|
185
|
+
# return_type
|
186
|
+
return_type = opts[:debug_return_type] || 'PublicNetwork'
|
187
|
+
|
188
|
+
# auth_names
|
189
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
190
|
+
|
191
|
+
new_options = opts.merge(
|
192
|
+
:operation => :"PublicNetworksApi.public_networks_network_id_get",
|
193
|
+
:header_params => header_params,
|
194
|
+
:query_params => query_params,
|
195
|
+
:form_params => form_params,
|
196
|
+
:body => post_body,
|
197
|
+
:auth_names => auth_names,
|
198
|
+
:return_type => return_type
|
199
|
+
)
|
200
|
+
|
201
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
202
|
+
if @api_client.config.debugging
|
203
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_network_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
204
|
+
end
|
205
|
+
return data, status_code, headers
|
206
|
+
end
|
207
|
+
|
208
|
+
# Removes the IP Block from the Public Network.
|
209
|
+
# 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.
|
210
|
+
# @param public_network_id [String] The Public Network identifier.
|
211
|
+
# @param ip_block_id [String] The IP Block identifier.
|
212
|
+
# @param [Hash] opts the optional parameters
|
213
|
+
# @return [String]
|
214
|
+
def public_networks_network_id_ip_blocks_ip_block_id_delete(public_network_id, ip_block_id, opts = {})
|
215
|
+
data, _status_code, _headers = public_networks_network_id_ip_blocks_ip_block_id_delete_with_http_info(public_network_id, ip_block_id, opts)
|
216
|
+
data
|
217
|
+
end
|
218
|
+
|
219
|
+
# Removes the IP Block from the Public Network.
|
220
|
+
# 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.
|
221
|
+
# @param public_network_id [String] The Public Network identifier.
|
222
|
+
# @param ip_block_id [String] The IP Block identifier.
|
223
|
+
# @param [Hash] opts the optional parameters
|
224
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
225
|
+
def public_networks_network_id_ip_blocks_ip_block_id_delete_with_http_info(public_network_id, ip_block_id, opts = {})
|
226
|
+
if @api_client.config.debugging
|
227
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_network_id_ip_blocks_ip_block_id_delete ...'
|
228
|
+
end
|
229
|
+
# verify the required parameter 'public_network_id' is set
|
230
|
+
if @api_client.config.client_side_validation && public_network_id.nil?
|
231
|
+
fail ArgumentError, "Missing the required parameter 'public_network_id' when calling PublicNetworksApi.public_networks_network_id_ip_blocks_ip_block_id_delete"
|
232
|
+
end
|
233
|
+
# verify the required parameter 'ip_block_id' is set
|
234
|
+
if @api_client.config.client_side_validation && ip_block_id.nil?
|
235
|
+
fail ArgumentError, "Missing the required parameter 'ip_block_id' when calling PublicNetworksApi.public_networks_network_id_ip_blocks_ip_block_id_delete"
|
236
|
+
end
|
237
|
+
# resource path
|
238
|
+
local_var_path = '/public-networks/{publicNetworkId}/ip-blocks/{ipBlockId}'.sub('{' + 'publicNetworkId' + '}', CGI.escape(public_network_id.to_s)).sub('{' + 'ipBlockId' + '}', CGI.escape(ip_block_id.to_s))
|
239
|
+
|
240
|
+
# query parameters
|
241
|
+
query_params = opts[:query_params] || {}
|
242
|
+
|
243
|
+
# header parameters
|
244
|
+
header_params = opts[:header_params] || {}
|
245
|
+
# HTTP header 'Accept' (if needed)
|
246
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
247
|
+
|
248
|
+
# form parameters
|
249
|
+
form_params = opts[:form_params] || {}
|
250
|
+
|
251
|
+
# http body (model)
|
252
|
+
post_body = opts[:debug_body]
|
253
|
+
|
254
|
+
# return_type
|
255
|
+
return_type = opts[:debug_return_type] || 'String'
|
256
|
+
|
257
|
+
# auth_names
|
258
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
259
|
+
|
260
|
+
new_options = opts.merge(
|
261
|
+
:operation => :"PublicNetworksApi.public_networks_network_id_ip_blocks_ip_block_id_delete",
|
262
|
+
:header_params => header_params,
|
263
|
+
:query_params => query_params,
|
264
|
+
:form_params => form_params,
|
265
|
+
:body => post_body,
|
266
|
+
:auth_names => auth_names,
|
267
|
+
:return_type => return_type
|
268
|
+
)
|
269
|
+
|
270
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
271
|
+
if @api_client.config.debugging
|
272
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_network_id_ip_blocks_ip_block_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
273
|
+
end
|
274
|
+
return data, status_code, headers
|
275
|
+
end
|
276
|
+
|
277
|
+
# Adds an IP block to this public network.
|
278
|
+
# Adds an IP block to this public network.
|
279
|
+
# @param public_network_id [String] The Public Network identifier.
|
280
|
+
# @param [Hash] opts the optional parameters
|
281
|
+
# @option opts [PublicNetworkIpBlock] :public_network_ip_block
|
282
|
+
# @return [PublicNetworkIpBlock]
|
283
|
+
def public_networks_network_id_ip_blocks_post(public_network_id, opts = {})
|
284
|
+
data, _status_code, _headers = public_networks_network_id_ip_blocks_post_with_http_info(public_network_id, opts)
|
285
|
+
data
|
286
|
+
end
|
287
|
+
|
288
|
+
# Adds an IP block to this public network.
|
289
|
+
# Adds an IP block to this public network.
|
290
|
+
# @param public_network_id [String] The Public Network identifier.
|
291
|
+
# @param [Hash] opts the optional parameters
|
292
|
+
# @option opts [PublicNetworkIpBlock] :public_network_ip_block
|
293
|
+
# @return [Array<(PublicNetworkIpBlock, Integer, Hash)>] PublicNetworkIpBlock data, response status code and response headers
|
294
|
+
def public_networks_network_id_ip_blocks_post_with_http_info(public_network_id, opts = {})
|
295
|
+
if @api_client.config.debugging
|
296
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_network_id_ip_blocks_post ...'
|
297
|
+
end
|
298
|
+
# verify the required parameter 'public_network_id' is set
|
299
|
+
if @api_client.config.client_side_validation && public_network_id.nil?
|
300
|
+
fail ArgumentError, "Missing the required parameter 'public_network_id' when calling PublicNetworksApi.public_networks_network_id_ip_blocks_post"
|
301
|
+
end
|
302
|
+
# resource path
|
303
|
+
local_var_path = '/public-networks/{publicNetworkId}/ip-blocks'.sub('{' + 'publicNetworkId' + '}', CGI.escape(public_network_id.to_s))
|
304
|
+
|
305
|
+
# query parameters
|
306
|
+
query_params = opts[:query_params] || {}
|
307
|
+
|
308
|
+
# header parameters
|
309
|
+
header_params = opts[:header_params] || {}
|
310
|
+
# HTTP header 'Accept' (if needed)
|
311
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
312
|
+
# HTTP header 'Content-Type'
|
313
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
314
|
+
if !content_type.nil?
|
315
|
+
header_params['Content-Type'] = content_type
|
316
|
+
end
|
317
|
+
|
318
|
+
# form parameters
|
319
|
+
form_params = opts[:form_params] || {}
|
320
|
+
|
321
|
+
# http body (model)
|
322
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'public_network_ip_block'])
|
323
|
+
|
324
|
+
# return_type
|
325
|
+
return_type = opts[:debug_return_type] || 'PublicNetworkIpBlock'
|
326
|
+
|
327
|
+
# auth_names
|
328
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
329
|
+
|
330
|
+
new_options = opts.merge(
|
331
|
+
:operation => :"PublicNetworksApi.public_networks_network_id_ip_blocks_post",
|
332
|
+
:header_params => header_params,
|
333
|
+
:query_params => query_params,
|
334
|
+
:form_params => form_params,
|
335
|
+
:body => post_body,
|
336
|
+
:auth_names => auth_names,
|
337
|
+
:return_type => return_type
|
338
|
+
)
|
339
|
+
|
340
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
341
|
+
if @api_client.config.debugging
|
342
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_network_id_ip_blocks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
343
|
+
end
|
344
|
+
return data, status_code, headers
|
345
|
+
end
|
346
|
+
|
347
|
+
# Update Public Network's Details.
|
348
|
+
# Update Public Network's Details.
|
349
|
+
# @param public_network_id [String] The Public Network identifier.
|
350
|
+
# @param [Hash] opts the optional parameters
|
351
|
+
# @option opts [PublicNetworkModify] :public_network_modify
|
352
|
+
# @return [PublicNetwork]
|
353
|
+
def public_networks_network_id_patch(public_network_id, opts = {})
|
354
|
+
data, _status_code, _headers = public_networks_network_id_patch_with_http_info(public_network_id, opts)
|
355
|
+
data
|
356
|
+
end
|
357
|
+
|
358
|
+
# Update Public Network's Details.
|
359
|
+
# Update Public Network's Details.
|
360
|
+
# @param public_network_id [String] The Public Network identifier.
|
361
|
+
# @param [Hash] opts the optional parameters
|
362
|
+
# @option opts [PublicNetworkModify] :public_network_modify
|
363
|
+
# @return [Array<(PublicNetwork, Integer, Hash)>] PublicNetwork data, response status code and response headers
|
364
|
+
def public_networks_network_id_patch_with_http_info(public_network_id, opts = {})
|
365
|
+
if @api_client.config.debugging
|
366
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_network_id_patch ...'
|
367
|
+
end
|
368
|
+
# verify the required parameter 'public_network_id' is set
|
369
|
+
if @api_client.config.client_side_validation && public_network_id.nil?
|
370
|
+
fail ArgumentError, "Missing the required parameter 'public_network_id' when calling PublicNetworksApi.public_networks_network_id_patch"
|
371
|
+
end
|
372
|
+
# resource path
|
373
|
+
local_var_path = '/public-networks/{publicNetworkId}'.sub('{' + 'publicNetworkId' + '}', CGI.escape(public_network_id.to_s))
|
374
|
+
|
375
|
+
# query parameters
|
376
|
+
query_params = opts[:query_params] || {}
|
377
|
+
|
378
|
+
# header parameters
|
379
|
+
header_params = opts[:header_params] || {}
|
380
|
+
# HTTP header 'Accept' (if needed)
|
381
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
382
|
+
# HTTP header 'Content-Type'
|
383
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
384
|
+
if !content_type.nil?
|
385
|
+
header_params['Content-Type'] = content_type
|
386
|
+
end
|
387
|
+
|
388
|
+
# form parameters
|
389
|
+
form_params = opts[:form_params] || {}
|
390
|
+
|
391
|
+
# http body (model)
|
392
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'public_network_modify'])
|
393
|
+
|
394
|
+
# return_type
|
395
|
+
return_type = opts[:debug_return_type] || 'PublicNetwork'
|
396
|
+
|
397
|
+
# auth_names
|
398
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
399
|
+
|
400
|
+
new_options = opts.merge(
|
401
|
+
:operation => :"PublicNetworksApi.public_networks_network_id_patch",
|
402
|
+
:header_params => header_params,
|
403
|
+
:query_params => query_params,
|
404
|
+
:form_params => form_params,
|
405
|
+
:body => post_body,
|
406
|
+
:auth_names => auth_names,
|
407
|
+
:return_type => return_type
|
408
|
+
)
|
409
|
+
|
410
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
411
|
+
if @api_client.config.debugging
|
412
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_network_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
413
|
+
end
|
414
|
+
return data, status_code, headers
|
415
|
+
end
|
416
|
+
|
417
|
+
# Create a public network.
|
418
|
+
# Create a public network.
|
419
|
+
# @param [Hash] opts the optional parameters
|
420
|
+
# @option opts [PublicNetworkCreate] :public_network_create
|
421
|
+
# @return [PublicNetwork]
|
422
|
+
def public_networks_post(opts = {})
|
423
|
+
data, _status_code, _headers = public_networks_post_with_http_info(opts)
|
424
|
+
data
|
425
|
+
end
|
426
|
+
|
427
|
+
# Create a public network.
|
428
|
+
# Create a public network.
|
429
|
+
# @param [Hash] opts the optional parameters
|
430
|
+
# @option opts [PublicNetworkCreate] :public_network_create
|
431
|
+
# @return [Array<(PublicNetwork, Integer, Hash)>] PublicNetwork data, response status code and response headers
|
432
|
+
def public_networks_post_with_http_info(opts = {})
|
433
|
+
if @api_client.config.debugging
|
434
|
+
@api_client.config.logger.debug 'Calling API: PublicNetworksApi.public_networks_post ...'
|
435
|
+
end
|
436
|
+
# resource path
|
437
|
+
local_var_path = '/public-networks'
|
438
|
+
|
439
|
+
# query parameters
|
440
|
+
query_params = opts[:query_params] || {}
|
441
|
+
|
442
|
+
# header parameters
|
443
|
+
header_params = opts[:header_params] || {}
|
444
|
+
# HTTP header 'Accept' (if needed)
|
445
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
446
|
+
# HTTP header 'Content-Type'
|
447
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
448
|
+
if !content_type.nil?
|
449
|
+
header_params['Content-Type'] = content_type
|
450
|
+
end
|
451
|
+
|
452
|
+
# form parameters
|
453
|
+
form_params = opts[:form_params] || {}
|
454
|
+
|
455
|
+
# http body (model)
|
456
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'public_network_create'])
|
457
|
+
|
458
|
+
# return_type
|
459
|
+
return_type = opts[:debug_return_type] || 'PublicNetwork'
|
460
|
+
|
461
|
+
# auth_names
|
462
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
463
|
+
|
464
|
+
new_options = opts.merge(
|
465
|
+
:operation => :"PublicNetworksApi.public_networks_post",
|
466
|
+
:header_params => header_params,
|
467
|
+
:query_params => query_params,
|
468
|
+
:form_params => form_params,
|
469
|
+
:body => post_body,
|
470
|
+
:auth_names => auth_names,
|
471
|
+
:return_type => return_type
|
472
|
+
)
|
473
|
+
|
474
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
475
|
+
if @api_client.config.debugging
|
476
|
+
@api_client.config.logger.debug "API called: PublicNetworksApi#public_networks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
477
|
+
end
|
478
|
+
return data, status_code, headers
|
479
|
+
end
|
480
|
+
end
|
481
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -95,6 +95,7 @@ module NetworkApi
|
|
95
95
|
header_params = @default_headers.merge(opts[:header_params] || {})
|
96
96
|
query_params = opts[:query_params] || {}
|
97
97
|
form_params = opts[:form_params] || {}
|
98
|
+
follow_location = opts[:follow_location] || true
|
98
99
|
|
99
100
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
100
101
|
|
@@ -111,7 +112,8 @@ module NetworkApi
|
|
111
112
|
:ssl_verifyhost => _verify_ssl_host,
|
112
113
|
:sslcert => @config.cert_file,
|
113
114
|
:sslkey => @config.key_file,
|
114
|
-
:verbose => @config.debugging
|
115
|
+
:verbose => @config.debugging,
|
116
|
+
:followlocation => follow_location
|
115
117
|
}
|
116
118
|
|
117
119
|
# set custom cert, if provided
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -133,6 +133,7 @@ module NetworkApi
|
|
133
133
|
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
134
134
|
attr_accessor :params_encoding
|
135
135
|
|
136
|
+
|
136
137
|
attr_accessor :inject_format
|
137
138
|
|
138
139
|
attr_accessor :force_ending_format
|
@@ -150,10 +151,10 @@ module NetworkApi
|
|
150
151
|
@client_side_validation = true
|
151
152
|
@verify_ssl = true
|
152
153
|
@verify_ssl_host = true
|
153
|
-
@params_encoding = nil
|
154
154
|
@cert_file = nil
|
155
155
|
@key_file = nil
|
156
156
|
@timeout = 0
|
157
|
+
@params_encoding = nil
|
157
158
|
@debugging = false
|
158
159
|
@inject_format = false
|
159
160
|
@force_ending_format = false
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Networks API
|
3
3
|
|
4
|
-
#
|
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:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -125,6 +125,7 @@ module NetworkApi
|
|
125
125
|
# @return [Object] Returns the model itself
|
126
126
|
def build_from_hash(attributes)
|
127
127
|
return nil unless attributes.is_a?(Hash)
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
128
129
|
self.class.openapi_types.each_pair do |key, type|
|
129
130
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
130
131
|
self.send("#{key}=", nil)
|