pnap_bmc_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.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +196 -0
  4. data/Rakefile +10 -0
  5. data/VERSION +1 -0
  6. data/docs/ActionResult.md +18 -0
  7. data/docs/DeleteResult.md +20 -0
  8. data/docs/DeleteSshKeyResult.md +20 -0
  9. data/docs/Error.md +20 -0
  10. data/docs/IpBlocksConfiguration.md +20 -0
  11. data/docs/NetworkConfiguration.md +20 -0
  12. data/docs/OsConfiguration.md +24 -0
  13. data/docs/OsConfigurationMap.md +22 -0
  14. data/docs/OsConfigurationMapEsxi.md +22 -0
  15. data/docs/OsConfigurationMapProxmox.md +22 -0
  16. data/docs/OsConfigurationWindows.md +18 -0
  17. data/docs/PrivateNetworkConfiguration.md +22 -0
  18. data/docs/Quota.md +32 -0
  19. data/docs/QuotaEditLimitRequest.md +20 -0
  20. data/docs/QuotaEditLimitRequestDetails.md +22 -0
  21. data/docs/QuotaEditLimitRequestDetailsAllOf.md +18 -0
  22. data/docs/QuotasApi.md +217 -0
  23. data/docs/RelinquishIpBlock.md +18 -0
  24. data/docs/ResetResult.md +22 -0
  25. data/docs/SSHKeysApi.md +360 -0
  26. data/docs/Server.md +64 -0
  27. data/docs/ServerCreate.md +44 -0
  28. data/docs/ServerIpBlock.md +20 -0
  29. data/docs/ServerPatch.md +20 -0
  30. data/docs/ServerPrivateNetwork.md +24 -0
  31. data/docs/ServerReserve.md +18 -0
  32. data/docs/ServerReset.md +24 -0
  33. data/docs/ServersApi.md +1237 -0
  34. data/docs/SshKey.md +30 -0
  35. data/docs/SshKeyCreate.md +22 -0
  36. data/docs/SshKeyUpdate.md +20 -0
  37. data/docs/TagAssignment.md +26 -0
  38. data/docs/TagAssignmentRequest.md +20 -0
  39. data/lib/pnap_bmc_api/api/quotas_api.rb +212 -0
  40. data/lib/pnap_bmc_api/api/servers_api.rb +1159 -0
  41. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +339 -0
  42. data/lib/pnap_bmc_api/api_client.rb +392 -0
  43. data/lib/pnap_bmc_api/api_error.rb +57 -0
  44. data/lib/pnap_bmc_api/configuration.rb +278 -0
  45. data/lib/pnap_bmc_api/models/action_result.rb +225 -0
  46. data/lib/pnap_bmc_api/models/delete_result.rb +240 -0
  47. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +240 -0
  48. data/lib/pnap_bmc_api/models/error.rb +236 -0
  49. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +283 -0
  50. data/lib/pnap_bmc_api/models/network_configuration.rb +228 -0
  51. data/lib/pnap_bmc_api/models/os_configuration.rb +266 -0
  52. data/lib/pnap_bmc_api/models/os_configuration_map.rb +237 -0
  53. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +257 -0
  54. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +257 -0
  55. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +237 -0
  56. data/lib/pnap_bmc_api/models/private_network_configuration.rb +244 -0
  57. data/lib/pnap_bmc_api/models/quota.rb +415 -0
  58. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +259 -0
  59. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +281 -0
  60. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb +225 -0
  61. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +222 -0
  62. data/lib/pnap_bmc_api/models/reset_result.rb +244 -0
  63. data/lib/pnap_bmc_api/models/server.rb +687 -0
  64. data/lib/pnap_bmc_api/models/server_create.rb +434 -0
  65. data/lib/pnap_bmc_api/models/server_ip_block.rb +235 -0
  66. data/lib/pnap_bmc_api/models/server_patch.rb +280 -0
  67. data/lib/pnap_bmc_api/models/server_private_network.rb +274 -0
  68. data/lib/pnap_bmc_api/models/server_reserve.rb +225 -0
  69. data/lib/pnap_bmc_api/models/server_reset.rb +255 -0
  70. data/lib/pnap_bmc_api/models/ssh_key.rb +315 -0
  71. data/lib/pnap_bmc_api/models/ssh_key_create.rb +283 -0
  72. data/lib/pnap_bmc_api/models/ssh_key_update.rb +268 -0
  73. data/lib/pnap_bmc_api/models/tag_assignment.rb +309 -0
  74. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +235 -0
  75. data/lib/pnap_bmc_api/version.rb +19 -0
  76. data/lib/pnap_bmc_api.rb +72 -0
  77. data/pnap_bmc_api.gemspec +39 -0
  78. data/spec/api/quotas_api_spec.rb +71 -0
  79. data/spec/api/servers_api_spec.rb +249 -0
  80. data/spec/api/ssh_keys_api_spec.rb +95 -0
  81. data/spec/api_client_spec.rb +226 -0
  82. data/spec/configuration_spec.rb +42 -0
  83. data/spec/models/action_result_spec.rb +34 -0
  84. data/spec/models/delete_result_spec.rb +40 -0
  85. data/spec/models/delete_ssh_key_result_spec.rb +40 -0
  86. data/spec/models/error_spec.rb +40 -0
  87. data/spec/models/ip_blocks_configuration_spec.rb +44 -0
  88. data/spec/models/network_configuration_spec.rb +40 -0
  89. data/spec/models/os_configuration_map_esxi_spec.rb +46 -0
  90. data/spec/models/os_configuration_map_proxmox_spec.rb +46 -0
  91. data/spec/models/os_configuration_map_spec.rb +46 -0
  92. data/spec/models/os_configuration_spec.rb +52 -0
  93. data/spec/models/os_configuration_windows_spec.rb +34 -0
  94. data/spec/models/private_network_configuration_spec.rb +46 -0
  95. data/spec/models/quota_edit_limit_request_details_all_of_spec.rb +34 -0
  96. data/spec/models/quota_edit_limit_request_details_spec.rb +46 -0
  97. data/spec/models/quota_edit_limit_request_spec.rb +40 -0
  98. data/spec/models/quota_spec.rb +84 -0
  99. data/spec/models/relinquish_ip_block_spec.rb +34 -0
  100. data/spec/models/reset_result_spec.rb +46 -0
  101. data/spec/models/server_create_spec.rb +112 -0
  102. data/spec/models/server_ip_block_spec.rb +40 -0
  103. data/spec/models/server_patch_spec.rb +40 -0
  104. data/spec/models/server_private_network_spec.rb +52 -0
  105. data/spec/models/server_reserve_spec.rb +34 -0
  106. data/spec/models/server_reset_spec.rb +52 -0
  107. data/spec/models/server_spec.rb +172 -0
  108. data/spec/models/ssh_key_create_spec.rb +46 -0
  109. data/spec/models/ssh_key_spec.rb +70 -0
  110. data/spec/models/ssh_key_update_spec.rb +40 -0
  111. data/spec/models/tag_assignment_request_spec.rb +40 -0
  112. data/spec/models/tag_assignment_spec.rb +62 -0
  113. data/spec/spec_helper.rb +111 -0
  114. metadata +232 -0
@@ -0,0 +1,339 @@
1
+ =begin
2
+ #Bare Metal Cloud API
3
+
4
+ #Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API. Deprovision servers, get or edit SSH key details, and a lot more. Manage your infrastructure more efficiently using just a few simple api calls.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/how-to-deploy-bare-metal-cloud-server' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/bmc/v1/)</b>
5
+
6
+ The version of the OpenAPI document: 0.1
7
+ Contact: support@phoenixnap.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module BmcApi
16
+ class SSHKeysApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List SSH Keys.
23
+ # List all SSH Keys.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Array<SshKey>]
26
+ def ssh_keys_get(opts = {})
27
+ data, _status_code, _headers = ssh_keys_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # List SSH Keys.
32
+ # List all SSH Keys.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Array<SshKey>, Integer, Hash)>] Array<SshKey> data, response status code and response headers
35
+ def ssh_keys_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: SSHKeysApi.ssh_keys_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/ssh-keys'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'Array<SshKey>'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"SSHKeysApi.ssh_keys_get",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: SSHKeysApi#ssh_keys_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Create SSH Key.
80
+ # Create an SSH Key. SSH Keys created can be used for server creation and reset functionality.
81
+ # @param [Hash] opts the optional parameters
82
+ # @option opts [SshKeyCreate] :ssh_key_create
83
+ # @return [SshKey]
84
+ def ssh_keys_post(opts = {})
85
+ data, _status_code, _headers = ssh_keys_post_with_http_info(opts)
86
+ data
87
+ end
88
+
89
+ # Create SSH Key.
90
+ # Create an SSH Key. SSH Keys created can be used for server creation and reset functionality.
91
+ # @param [Hash] opts the optional parameters
92
+ # @option opts [SshKeyCreate] :ssh_key_create
93
+ # @return [Array<(SshKey, Integer, Hash)>] SshKey data, response status code and response headers
94
+ def ssh_keys_post_with_http_info(opts = {})
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug 'Calling API: SSHKeysApi.ssh_keys_post ...'
97
+ end
98
+ # resource path
99
+ local_var_path = '/ssh-keys'
100
+
101
+ # query parameters
102
+ query_params = opts[:query_params] || {}
103
+
104
+ # header parameters
105
+ header_params = opts[:header_params] || {}
106
+ # HTTP header 'Accept' (if needed)
107
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
108
+ # HTTP header 'Content-Type'
109
+ content_type = @api_client.select_header_content_type(['application/json'])
110
+ if !content_type.nil?
111
+ header_params['Content-Type'] = content_type
112
+ end
113
+
114
+ # form parameters
115
+ form_params = opts[:form_params] || {}
116
+
117
+ # http body (model)
118
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ssh_key_create'])
119
+
120
+ # return_type
121
+ return_type = opts[:debug_return_type] || 'SshKey'
122
+
123
+ # auth_names
124
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
125
+
126
+ new_options = opts.merge(
127
+ :operation => :"SSHKeysApi.ssh_keys_post",
128
+ :header_params => header_params,
129
+ :query_params => query_params,
130
+ :form_params => form_params,
131
+ :body => post_body,
132
+ :auth_names => auth_names,
133
+ :return_type => return_type
134
+ )
135
+
136
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug "API called: SSHKeysApi#ssh_keys_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ end
140
+ return data, status_code, headers
141
+ end
142
+
143
+ # Delete SSH Key.
144
+ # Delete an SSH Key.
145
+ # @param ssh_key_id [String] The SSH Key&#39;s ID.
146
+ # @param [Hash] opts the optional parameters
147
+ # @return [DeleteSshKeyResult]
148
+ def ssh_keys_ssh_key_id_delete(ssh_key_id, opts = {})
149
+ data, _status_code, _headers = ssh_keys_ssh_key_id_delete_with_http_info(ssh_key_id, opts)
150
+ data
151
+ end
152
+
153
+ # Delete SSH Key.
154
+ # Delete an SSH Key.
155
+ # @param ssh_key_id [String] The SSH Key&#39;s ID.
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [Array<(DeleteSshKeyResult, Integer, Hash)>] DeleteSshKeyResult data, response status code and response headers
158
+ def ssh_keys_ssh_key_id_delete_with_http_info(ssh_key_id, opts = {})
159
+ if @api_client.config.debugging
160
+ @api_client.config.logger.debug 'Calling API: SSHKeysApi.ssh_keys_ssh_key_id_delete ...'
161
+ end
162
+ # verify the required parameter 'ssh_key_id' is set
163
+ if @api_client.config.client_side_validation && ssh_key_id.nil?
164
+ fail ArgumentError, "Missing the required parameter 'ssh_key_id' when calling SSHKeysApi.ssh_keys_ssh_key_id_delete"
165
+ end
166
+ # resource path
167
+ local_var_path = '/ssh-keys/{sshKeyId}'.sub('{' + 'sshKeyId' + '}', CGI.escape(ssh_key_id.to_s))
168
+
169
+ # query parameters
170
+ query_params = opts[:query_params] || {}
171
+
172
+ # header parameters
173
+ header_params = opts[:header_params] || {}
174
+ # HTTP header 'Accept' (if needed)
175
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
176
+
177
+ # form parameters
178
+ form_params = opts[:form_params] || {}
179
+
180
+ # http body (model)
181
+ post_body = opts[:debug_body]
182
+
183
+ # return_type
184
+ return_type = opts[:debug_return_type] || 'DeleteSshKeyResult'
185
+
186
+ # auth_names
187
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
188
+
189
+ new_options = opts.merge(
190
+ :operation => :"SSHKeysApi.ssh_keys_ssh_key_id_delete",
191
+ :header_params => header_params,
192
+ :query_params => query_params,
193
+ :form_params => form_params,
194
+ :body => post_body,
195
+ :auth_names => auth_names,
196
+ :return_type => return_type
197
+ )
198
+
199
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug "API called: SSHKeysApi#ssh_keys_ssh_key_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ end
203
+ return data, status_code, headers
204
+ end
205
+
206
+ # Get SSH Key.
207
+ # Get SSH Key details.
208
+ # @param ssh_key_id [String] The SSH Key&#39;s ID.
209
+ # @param [Hash] opts the optional parameters
210
+ # @return [SshKey]
211
+ def ssh_keys_ssh_key_id_get(ssh_key_id, opts = {})
212
+ data, _status_code, _headers = ssh_keys_ssh_key_id_get_with_http_info(ssh_key_id, opts)
213
+ data
214
+ end
215
+
216
+ # Get SSH Key.
217
+ # Get SSH Key details.
218
+ # @param ssh_key_id [String] The SSH Key&#39;s ID.
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [Array<(SshKey, Integer, Hash)>] SshKey data, response status code and response headers
221
+ def ssh_keys_ssh_key_id_get_with_http_info(ssh_key_id, opts = {})
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug 'Calling API: SSHKeysApi.ssh_keys_ssh_key_id_get ...'
224
+ end
225
+ # verify the required parameter 'ssh_key_id' is set
226
+ if @api_client.config.client_side_validation && ssh_key_id.nil?
227
+ fail ArgumentError, "Missing the required parameter 'ssh_key_id' when calling SSHKeysApi.ssh_keys_ssh_key_id_get"
228
+ end
229
+ # resource path
230
+ local_var_path = '/ssh-keys/{sshKeyId}'.sub('{' + 'sshKeyId' + '}', CGI.escape(ssh_key_id.to_s))
231
+
232
+ # query parameters
233
+ query_params = opts[:query_params] || {}
234
+
235
+ # header parameters
236
+ header_params = opts[:header_params] || {}
237
+ # HTTP header 'Accept' (if needed)
238
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
239
+
240
+ # form parameters
241
+ form_params = opts[:form_params] || {}
242
+
243
+ # http body (model)
244
+ post_body = opts[:debug_body]
245
+
246
+ # return_type
247
+ return_type = opts[:debug_return_type] || 'SshKey'
248
+
249
+ # auth_names
250
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
251
+
252
+ new_options = opts.merge(
253
+ :operation => :"SSHKeysApi.ssh_keys_ssh_key_id_get",
254
+ :header_params => header_params,
255
+ :query_params => query_params,
256
+ :form_params => form_params,
257
+ :body => post_body,
258
+ :auth_names => auth_names,
259
+ :return_type => return_type
260
+ )
261
+
262
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug "API called: SSHKeysApi#ssh_keys_ssh_key_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
265
+ end
266
+ return data, status_code, headers
267
+ end
268
+
269
+ # Edit SSH Key.
270
+ # Edit SSH Key details.
271
+ # @param ssh_key_id [String] The SSH Key&#39;s ID.
272
+ # @param [Hash] opts the optional parameters
273
+ # @option opts [SshKeyUpdate] :ssh_key_update
274
+ # @return [SshKey]
275
+ def ssh_keys_ssh_key_id_put(ssh_key_id, opts = {})
276
+ data, _status_code, _headers = ssh_keys_ssh_key_id_put_with_http_info(ssh_key_id, opts)
277
+ data
278
+ end
279
+
280
+ # Edit SSH Key.
281
+ # Edit SSH Key details.
282
+ # @param ssh_key_id [String] The SSH Key&#39;s ID.
283
+ # @param [Hash] opts the optional parameters
284
+ # @option opts [SshKeyUpdate] :ssh_key_update
285
+ # @return [Array<(SshKey, Integer, Hash)>] SshKey data, response status code and response headers
286
+ def ssh_keys_ssh_key_id_put_with_http_info(ssh_key_id, opts = {})
287
+ if @api_client.config.debugging
288
+ @api_client.config.logger.debug 'Calling API: SSHKeysApi.ssh_keys_ssh_key_id_put ...'
289
+ end
290
+ # verify the required parameter 'ssh_key_id' is set
291
+ if @api_client.config.client_side_validation && ssh_key_id.nil?
292
+ fail ArgumentError, "Missing the required parameter 'ssh_key_id' when calling SSHKeysApi.ssh_keys_ssh_key_id_put"
293
+ end
294
+ # resource path
295
+ local_var_path = '/ssh-keys/{sshKeyId}'.sub('{' + 'sshKeyId' + '}', CGI.escape(ssh_key_id.to_s))
296
+
297
+ # query parameters
298
+ query_params = opts[:query_params] || {}
299
+
300
+ # header parameters
301
+ header_params = opts[:header_params] || {}
302
+ # HTTP header 'Accept' (if needed)
303
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
304
+ # HTTP header 'Content-Type'
305
+ content_type = @api_client.select_header_content_type(['application/json'])
306
+ if !content_type.nil?
307
+ header_params['Content-Type'] = content_type
308
+ end
309
+
310
+ # form parameters
311
+ form_params = opts[:form_params] || {}
312
+
313
+ # http body (model)
314
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ssh_key_update'])
315
+
316
+ # return_type
317
+ return_type = opts[:debug_return_type] || 'SshKey'
318
+
319
+ # auth_names
320
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
321
+
322
+ new_options = opts.merge(
323
+ :operation => :"SSHKeysApi.ssh_keys_ssh_key_id_put",
324
+ :header_params => header_params,
325
+ :query_params => query_params,
326
+ :form_params => form_params,
327
+ :body => post_body,
328
+ :auth_names => auth_names,
329
+ :return_type => return_type
330
+ )
331
+
332
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
333
+ if @api_client.config.debugging
334
+ @api_client.config.logger.debug "API called: SSHKeysApi#ssh_keys_ssh_key_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
335
+ end
336
+ return data, status_code, headers
337
+ end
338
+ end
339
+ end