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
data/docs/SshKey.md ADDED
@@ -0,0 +1,30 @@
1
+ # BmcApi::SshKey
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | The unique identifier of the SSH Key. | |
8
+ | **default** | **Boolean** | Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request. | |
9
+ | **name** | **String** | Friendly SSH key name to represent an SSH key. | |
10
+ | **key** | **String** | SSH Key value. | |
11
+ | **fingerprint** | **String** | SSH key auto-generated SHA-256 fingerprint. | |
12
+ | **created_on** | **Time** | Date and time of creation. | |
13
+ | **last_updated_on** | **Time** | Date and time of last update. | |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'pnap_bmc_api'
19
+
20
+ instance = BmcApi::SshKey.new(
21
+ id: 5fa54d1e91867c03a0a7b4a4,
22
+ default: true,
23
+ name: sshkey-name-01,
24
+ key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDF9LdAFElNCi7JoWh6KUcchrJ2Gac1aqGRPpdZNowObpRtmiRCecAMb7bUgNAaNfcmwiQi7tos9TlnFgprIcfMWb8MSs3ABYHmBgqEEt3RWYf0fAc9CsIpJdMCUG28TPGTlRXCEUVNKgLMdcseAlJoGp1CgbHWIN65fB3he3kAZcfpPn5mapV0tsl2p+ZyuAGRYdn5dJv2RZDHUZBkOeUobwsij+weHCKAFmKQKtCP7ybgVHaQjAPrj8MGnk1jBbjDt5ws+Be+9JNjQJee9zCKbAOsIo3i+GcUIkrw5jxPU/RTGlWBcemPaKHdciSzGcjWboapzIy49qypQhZe1U75 user@my_ip,
25
+ fingerprint: iL4k5YTrOnzvlxFMN+WU4BPI/QqrMcvvhU0xlfeMwZI,
26
+ created_on: 2020-03-19T16:39Z,
27
+ last_updated_on: 2020-03-19T16:39Z
28
+ )
29
+ ```
30
+
@@ -0,0 +1,22 @@
1
+ # BmcApi::SshKeyCreate
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **default** | **Boolean** | Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request. | |
8
+ | **name** | **String** | Friendly SSH key name to represent an SSH key. | |
9
+ | **key** | **String** | SSH key actual key value. | |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'pnap_bmc_api'
15
+
16
+ instance = BmcApi::SshKeyCreate.new(
17
+ default: true,
18
+ name: sshkey-name-01,
19
+ key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDF9LdAFElNCi7JoWh6KUcchrJ2Gac1aqGRPpdZNowObpRtmiRCecAMb7bUgNAaNfcmwiQi7tos9TlnFgprIcfMWb8MSs3ABYHmBgqEEt3RWYf0fAc9CsIpJdMCUG28TPGTlRXCEUVNKgLMdcseAlJoGp1CgbHWIN65fB3he3kAZcfpPn5mapV0tsl2p+ZyuAGRYdn5dJv2RZDHUZBkOeUobwsij+weHCKAFmKQKtCP7ybgVHaQjAPrj8MGnk1jBbjDt5ws+Be+9JNjQJee9zCKbAOsIo3i+GcUIkrw5jxPU/RTGlWBcemPaKHdciSzGcjWboapzIy49qypQhZe1U75 user@my_ip
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # BmcApi::SshKeyUpdate
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **default** | **Boolean** | Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request. | |
8
+ | **name** | **String** | SSH key name that can represent the key as an alternative to its ID. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'pnap_bmc_api'
14
+
15
+ instance = BmcApi::SshKeyUpdate.new(
16
+ default: true,
17
+ name: sshkey-name-01
18
+ )
19
+ ```
20
+
@@ -0,0 +1,26 @@
1
+ # BmcApi::TagAssignment
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | The unique id of the tag. | |
8
+ | **name** | **String** | The name of the tag. | |
9
+ | **value** | **String** | The value of the tag assigned to the resource. | [optional] |
10
+ | **is_billing_tag** | **Boolean** | Whether or not to show the tag as part of billing and invoices | |
11
+ | **created_by** | **String** | Who the tag was created by. | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'pnap_bmc_api'
17
+
18
+ instance = BmcApi::TagAssignment.new(
19
+ id: 60ffafcdffb8b074c7968dad,
20
+ name: Environment,
21
+ value: PROD,
22
+ is_billing_tag: true,
23
+ created_by: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,20 @@
1
+ # BmcApi::TagAssignmentRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | The name of the tag. Tag names are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}. | |
8
+ | **value** | **String** | The value of the tag assigned to the resource. Tag values are case-sensitive, and should be composed of a maximum of 100 characters including UTF-8 Unicode letters, numbers, and the following symbols: '-', '_'. Regex: [A-zÀ-ú0-9_-]{1,100}. | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'pnap_bmc_api'
14
+
15
+ instance = BmcApi::TagAssignmentRequest.new(
16
+ name: Environment,
17
+ value: PROD
18
+ )
19
+ ```
20
+
@@ -0,0 +1,212 @@
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 QuotasApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List quotas
23
+ # Get account quota details.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Array<Quota>]
26
+ def quotas_get(opts = {})
27
+ data, _status_code, _headers = quotas_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # List quotas
32
+ # Get account quota details.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Array<Quota>, Integer, Hash)>] Array<Quota> data, response status code and response headers
35
+ def quotas_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: QuotasApi.quotas_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/quotas'
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<Quota>'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"QuotasApi.quotas_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: QuotasApi#quotas_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Request quota limit change.
80
+ # Sends a request to edit the limit of a quota.
81
+ # @param quota_id [String] The ID of the Quota.
82
+ # @param [Hash] opts the optional parameters
83
+ # @option opts [QuotaEditLimitRequest] :quota_edit_limit_request
84
+ # @return [nil]
85
+ def quotas_quota_id_actions_request_edit_post(quota_id, opts = {})
86
+ quotas_quota_id_actions_request_edit_post_with_http_info(quota_id, opts)
87
+ nil
88
+ end
89
+
90
+ # Request quota limit change.
91
+ # Sends a request to edit the limit of a quota.
92
+ # @param quota_id [String] The ID of the Quota.
93
+ # @param [Hash] opts the optional parameters
94
+ # @option opts [QuotaEditLimitRequest] :quota_edit_limit_request
95
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
96
+ def quotas_quota_id_actions_request_edit_post_with_http_info(quota_id, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug 'Calling API: QuotasApi.quotas_quota_id_actions_request_edit_post ...'
99
+ end
100
+ # verify the required parameter 'quota_id' is set
101
+ if @api_client.config.client_side_validation && quota_id.nil?
102
+ fail ArgumentError, "Missing the required parameter 'quota_id' when calling QuotasApi.quotas_quota_id_actions_request_edit_post"
103
+ end
104
+ # resource path
105
+ local_var_path = '/quotas/{quotaId}/actions/request-edit'.sub('{' + 'quotaId' + '}', CGI.escape(quota_id.to_s))
106
+
107
+ # query parameters
108
+ query_params = opts[:query_params] || {}
109
+
110
+ # header parameters
111
+ header_params = opts[:header_params] || {}
112
+ # HTTP header 'Accept' (if needed)
113
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
114
+ # HTTP header 'Content-Type'
115
+ content_type = @api_client.select_header_content_type(['application/json'])
116
+ if !content_type.nil?
117
+ header_params['Content-Type'] = content_type
118
+ end
119
+
120
+ # form parameters
121
+ form_params = opts[:form_params] || {}
122
+
123
+ # http body (model)
124
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'quota_edit_limit_request'])
125
+
126
+ # return_type
127
+ return_type = opts[:debug_return_type]
128
+
129
+ # auth_names
130
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
131
+
132
+ new_options = opts.merge(
133
+ :operation => :"QuotasApi.quotas_quota_id_actions_request_edit_post",
134
+ :header_params => header_params,
135
+ :query_params => query_params,
136
+ :form_params => form_params,
137
+ :body => post_body,
138
+ :auth_names => auth_names,
139
+ :return_type => return_type
140
+ )
141
+
142
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
143
+ if @api_client.config.debugging
144
+ @api_client.config.logger.debug "API called: QuotasApi#quotas_quota_id_actions_request_edit_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
145
+ end
146
+ return data, status_code, headers
147
+ end
148
+
149
+ # Get a quota.
150
+ # Get account quota details.
151
+ # @param quota_id [String] The ID of the Quota.
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [Quota]
154
+ def quotas_quota_id_get(quota_id, opts = {})
155
+ data, _status_code, _headers = quotas_quota_id_get_with_http_info(quota_id, opts)
156
+ data
157
+ end
158
+
159
+ # Get a quota.
160
+ # Get account quota details.
161
+ # @param quota_id [String] The ID of the Quota.
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [Array<(Quota, Integer, Hash)>] Quota data, response status code and response headers
164
+ def quotas_quota_id_get_with_http_info(quota_id, opts = {})
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug 'Calling API: QuotasApi.quotas_quota_id_get ...'
167
+ end
168
+ # verify the required parameter 'quota_id' is set
169
+ if @api_client.config.client_side_validation && quota_id.nil?
170
+ fail ArgumentError, "Missing the required parameter 'quota_id' when calling QuotasApi.quotas_quota_id_get"
171
+ end
172
+ # resource path
173
+ local_var_path = '/quotas/{quotaId}'.sub('{' + 'quotaId' + '}', CGI.escape(quota_id.to_s))
174
+
175
+ # query parameters
176
+ query_params = opts[:query_params] || {}
177
+
178
+ # header parameters
179
+ header_params = opts[:header_params] || {}
180
+ # HTTP header 'Accept' (if needed)
181
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
182
+
183
+ # form parameters
184
+ form_params = opts[:form_params] || {}
185
+
186
+ # http body (model)
187
+ post_body = opts[:debug_body]
188
+
189
+ # return_type
190
+ return_type = opts[:debug_return_type] || 'Quota'
191
+
192
+ # auth_names
193
+ auth_names = opts[:debug_auth_names] || ['OAuth2']
194
+
195
+ new_options = opts.merge(
196
+ :operation => :"QuotasApi.quotas_quota_id_get",
197
+ :header_params => header_params,
198
+ :query_params => query_params,
199
+ :form_params => form_params,
200
+ :body => post_body,
201
+ :auth_names => auth_names,
202
+ :return_type => return_type
203
+ )
204
+
205
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "API called: QuotasApi#quotas_quota_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
+ end
209
+ return data, status_code, headers
210
+ end
211
+ end
212
+ end