pnap_bmc_api 1.4.0 → 2.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.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/VERSION +1 -1
- data/docs/DeleteResult.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/OsConfigurationNetrisController.md +1 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/QuotaEditLimitRequest.md +1 -1
- data/docs/QuotaEditLimitRequestDetails.md +1 -1
- data/docs/QuotasApi.md +6 -8
- data/docs/SSHKeysApi.md +12 -16
- data/docs/Server.md +14 -8
- data/docs/ServerCreate.md +7 -5
- data/docs/ServerNetworkUpdate.md +2 -2
- data/docs/ServerPrivateNetwork.md +3 -3
- data/docs/ServerProvision.md +38 -0
- data/docs/ServerPublicNetwork.md +2 -2
- data/docs/ServersApi.md +173 -111
- data/docs/StorageConfiguration.md +18 -0
- data/docs/StorageConfigurationRootPartition.md +20 -0
- data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
- data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
- data/lib/pnap_bmc_api/api_client.rb +24 -21
- data/lib/pnap_bmc_api/api_error.rb +2 -1
- data/lib/pnap_bmc_api/configuration.rb +28 -9
- data/lib/pnap_bmc_api/models/action_result.rb +16 -19
- data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
- data/lib/pnap_bmc_api/models/error.rb +16 -19
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +19 -20
- data/lib/pnap_bmc_api/models/network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +15 -20
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +16 -21
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +66 -20
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +15 -20
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/quota.rb +30 -19
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +40 -20
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +43 -22
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +14 -19
- data/lib/pnap_bmc_api/models/reset_result.rb +16 -19
- data/lib/pnap_bmc_api/models/server.rb +94 -34
- data/lib/pnap_bmc_api/models/server_create.rb +43 -27
- data/lib/pnap_bmc_api/models/server_ip_block.rb +16 -19
- data/lib/pnap_bmc_api/models/server_network_update.rb +15 -20
- data/lib/pnap_bmc_api/models/server_patch.rb +27 -24
- data/lib/pnap_bmc_api/models/server_private_network.rb +27 -26
- data/lib/pnap_bmc_api/models/server_provision.rb +395 -0
- data/lib/pnap_bmc_api/models/server_public_network.rb +17 -20
- data/lib/pnap_bmc_api/models/server_reserve.rb +16 -19
- data/lib/pnap_bmc_api/models/server_reset.rb +14 -19
- data/lib/pnap_bmc_api/models/ssh_key.rb +28 -19
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +52 -19
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +29 -19
- data/lib/pnap_bmc_api/models/storage_configuration.rb +215 -0
- data/lib/pnap_bmc_api/models/{quota_edit_limit_request_details_all_of.rb → storage_configuration_root_partition.rb} +40 -36
- data/lib/pnap_bmc_api/models/tag_assignment.rb +20 -19
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +16 -19
- data/lib/pnap_bmc_api/version.rb +1 -1
- data/lib/pnap_bmc_api.rb +4 -2
- data/pnap_bmc_api.gemspec +2 -2
- data/spec/api/quotas_api_spec.rb +6 -6
- data/spec/api/servers_api_spec.rb +109 -36
- data/spec/api/ssh_keys_api_spec.rb +9 -9
- data/spec/models/action_result_spec.rb +6 -4
- data/spec/models/delete_result_spec.rb +7 -5
- data/spec/models/delete_ssh_key_result_spec.rb +7 -5
- data/spec/models/error_spec.rb +7 -5
- data/spec/models/ip_blocks_configuration_spec.rb +7 -5
- data/spec/models/network_configuration_spec.rb +19 -5
- data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
- data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
- data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
- data/spec/models/os_configuration_map_spec.rb +8 -6
- data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
- data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
- data/spec/models/os_configuration_spec.rb +33 -7
- data/spec/models/os_configuration_windows_spec.rb +6 -4
- data/spec/models/private_network_configuration_spec.rb +8 -6
- data/spec/models/public_network_configuration_spec.rb +6 -4
- data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
- data/spec/models/quota_edit_limit_request_spec.rb +7 -5
- data/spec/models/quota_spec.rb +13 -15
- data/spec/models/relinquish_ip_block_spec.rb +6 -4
- data/spec/models/reset_result_spec.rb +8 -6
- data/spec/models/server_create_spec.rb +25 -17
- data/spec/models/server_ip_block_spec.rb +7 -5
- data/spec/models/server_network_update_spec.rb +5 -3
- data/spec/models/server_patch_spec.rb +7 -5
- data/spec/models/server_private_network_spec.rb +9 -7
- data/spec/models/server_provision_spec.rb +96 -0
- data/spec/models/server_public_network_spec.rb +8 -6
- data/spec/models/server_reserve_spec.rb +6 -4
- data/spec/models/server_reset_spec.rb +9 -7
- data/spec/models/server_spec.rb +47 -27
- data/spec/models/ssh_key_create_spec.rb +8 -6
- data/spec/models/ssh_key_spec.rb +12 -10
- data/spec/models/ssh_key_update_spec.rb +7 -5
- data/spec/models/storage_configuration_root_partition_spec.rb +42 -0
- data/spec/models/storage_configuration_spec.rb +36 -0
- data/spec/models/tag_assignment_request_spec.rb +7 -5
- data/spec/models/tag_assignment_spec.rb +10 -8
- data/spec/spec_helper.rb +1 -1
- metadata +41 -37
- data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/quota_edit_limit_request_details_all_of_spec.rb +0 -34
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pnap_bmc_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PhoenixNAP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -80,7 +80,6 @@ files:
|
|
80
80
|
- docs/Quota.md
|
81
81
|
- docs/QuotaEditLimitRequest.md
|
82
82
|
- docs/QuotaEditLimitRequestDetails.md
|
83
|
-
- docs/QuotaEditLimitRequestDetailsAllOf.md
|
84
83
|
- docs/QuotasApi.md
|
85
84
|
- docs/RelinquishIpBlock.md
|
86
85
|
- docs/ResetResult.md
|
@@ -91,6 +90,7 @@ files:
|
|
91
90
|
- docs/ServerNetworkUpdate.md
|
92
91
|
- docs/ServerPatch.md
|
93
92
|
- docs/ServerPrivateNetwork.md
|
93
|
+
- docs/ServerProvision.md
|
94
94
|
- docs/ServerPublicNetwork.md
|
95
95
|
- docs/ServerReserve.md
|
96
96
|
- docs/ServerReset.md
|
@@ -98,6 +98,8 @@ files:
|
|
98
98
|
- docs/SshKey.md
|
99
99
|
- docs/SshKeyCreate.md
|
100
100
|
- docs/SshKeyUpdate.md
|
101
|
+
- docs/StorageConfiguration.md
|
102
|
+
- docs/StorageConfigurationRootPartition.md
|
101
103
|
- docs/TagAssignment.md
|
102
104
|
- docs/TagAssignmentRequest.md
|
103
105
|
- lib/pnap_bmc_api.rb
|
@@ -126,7 +128,6 @@ files:
|
|
126
128
|
- lib/pnap_bmc_api/models/quota.rb
|
127
129
|
- lib/pnap_bmc_api/models/quota_edit_limit_request.rb
|
128
130
|
- lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb
|
129
|
-
- lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb
|
130
131
|
- lib/pnap_bmc_api/models/relinquish_ip_block.rb
|
131
132
|
- lib/pnap_bmc_api/models/reset_result.rb
|
132
133
|
- lib/pnap_bmc_api/models/server.rb
|
@@ -135,12 +136,15 @@ files:
|
|
135
136
|
- lib/pnap_bmc_api/models/server_network_update.rb
|
136
137
|
- lib/pnap_bmc_api/models/server_patch.rb
|
137
138
|
- lib/pnap_bmc_api/models/server_private_network.rb
|
139
|
+
- lib/pnap_bmc_api/models/server_provision.rb
|
138
140
|
- lib/pnap_bmc_api/models/server_public_network.rb
|
139
141
|
- lib/pnap_bmc_api/models/server_reserve.rb
|
140
142
|
- lib/pnap_bmc_api/models/server_reset.rb
|
141
143
|
- lib/pnap_bmc_api/models/ssh_key.rb
|
142
144
|
- lib/pnap_bmc_api/models/ssh_key_create.rb
|
143
145
|
- lib/pnap_bmc_api/models/ssh_key_update.rb
|
146
|
+
- lib/pnap_bmc_api/models/storage_configuration.rb
|
147
|
+
- lib/pnap_bmc_api/models/storage_configuration_root_partition.rb
|
144
148
|
- lib/pnap_bmc_api/models/tag_assignment.rb
|
145
149
|
- lib/pnap_bmc_api/models/tag_assignment_request.rb
|
146
150
|
- lib/pnap_bmc_api/version.rb
|
@@ -148,8 +152,6 @@ files:
|
|
148
152
|
- spec/api/quotas_api_spec.rb
|
149
153
|
- spec/api/servers_api_spec.rb
|
150
154
|
- spec/api/ssh_keys_api_spec.rb
|
151
|
-
- spec/api_client_spec.rb
|
152
|
-
- spec/configuration_spec.rb
|
153
155
|
- spec/models/action_result_spec.rb
|
154
156
|
- spec/models/delete_result_spec.rb
|
155
157
|
- spec/models/delete_ssh_key_result_spec.rb
|
@@ -166,7 +168,6 @@ files:
|
|
166
168
|
- spec/models/os_configuration_windows_spec.rb
|
167
169
|
- spec/models/private_network_configuration_spec.rb
|
168
170
|
- spec/models/public_network_configuration_spec.rb
|
169
|
-
- spec/models/quota_edit_limit_request_details_all_of_spec.rb
|
170
171
|
- spec/models/quota_edit_limit_request_details_spec.rb
|
171
172
|
- spec/models/quota_edit_limit_request_spec.rb
|
172
173
|
- spec/models/quota_spec.rb
|
@@ -177,6 +178,7 @@ files:
|
|
177
178
|
- spec/models/server_network_update_spec.rb
|
178
179
|
- spec/models/server_patch_spec.rb
|
179
180
|
- spec/models/server_private_network_spec.rb
|
181
|
+
- spec/models/server_provision_spec.rb
|
180
182
|
- spec/models/server_public_network_spec.rb
|
181
183
|
- spec/models/server_reserve_spec.rb
|
182
184
|
- spec/models/server_reset_spec.rb
|
@@ -184,6 +186,8 @@ files:
|
|
184
186
|
- spec/models/ssh_key_create_spec.rb
|
185
187
|
- spec/models/ssh_key_spec.rb
|
186
188
|
- spec/models/ssh_key_update_spec.rb
|
189
|
+
- spec/models/storage_configuration_root_partition_spec.rb
|
190
|
+
- spec/models/storage_configuration_spec.rb
|
187
191
|
- spec/models/tag_assignment_request_spec.rb
|
188
192
|
- spec/models/tag_assignment_spec.rb
|
189
193
|
- spec/spec_helper.rb
|
@@ -200,7 +204,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
204
|
requirements:
|
201
205
|
- - ">="
|
202
206
|
- !ruby/object:Gem::Version
|
203
|
-
version: '2.
|
207
|
+
version: '2.7'
|
204
208
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
209
|
requirements:
|
206
210
|
- - ">="
|
@@ -212,45 +216,45 @@ signing_key:
|
|
212
216
|
specification_version: 4
|
213
217
|
summary: Bare Metal Cloud API Ruby Gem
|
214
218
|
test_files:
|
215
|
-
- spec/api/quotas_api_spec.rb
|
216
|
-
- spec/api/servers_api_spec.rb
|
217
219
|
- spec/api/ssh_keys_api_spec.rb
|
218
|
-
- spec/
|
219
|
-
- spec/
|
220
|
+
- spec/api/servers_api_spec.rb
|
221
|
+
- spec/api/quotas_api_spec.rb
|
220
222
|
- spec/models/public_network_configuration_spec.rb
|
221
|
-
- spec/models/
|
222
|
-
- spec/models/relinquish_ip_block_spec.rb
|
223
|
-
- spec/models/quota_edit_limit_request_details_spec.rb
|
223
|
+
- spec/models/quota_spec.rb
|
224
224
|
- spec/models/delete_ssh_key_result_spec.rb
|
225
|
-
- spec/models/server_patch_spec.rb
|
226
|
-
- spec/models/server_spec.rb
|
227
225
|
- spec/models/error_spec.rb
|
228
|
-
- spec/models/
|
226
|
+
- spec/models/ip_blocks_configuration_spec.rb
|
227
|
+
- spec/models/server_network_update_spec.rb
|
229
228
|
- spec/models/network_configuration_spec.rb
|
230
|
-
- spec/models/
|
231
|
-
- spec/models/
|
232
|
-
- spec/models/
|
233
|
-
- spec/models/
|
234
|
-
- spec/models/
|
229
|
+
- spec/models/server_spec.rb
|
230
|
+
- spec/models/tag_assignment_request_spec.rb
|
231
|
+
- spec/models/os_configuration_cloud_init_spec.rb
|
232
|
+
- spec/models/os_configuration_windows_spec.rb
|
233
|
+
- spec/models/delete_result_spec.rb
|
234
|
+
- spec/models/ssh_key_create_spec.rb
|
235
|
+
- spec/models/server_private_network_spec.rb
|
236
|
+
- spec/models/server_patch_spec.rb
|
237
|
+
- spec/models/storage_configuration_root_partition_spec.rb
|
235
238
|
- spec/models/server_reset_spec.rb
|
239
|
+
- spec/models/server_ip_block_spec.rb
|
236
240
|
- spec/models/os_configuration_netris_softgate_spec.rb
|
237
|
-
- spec/models/
|
238
|
-
- spec/models/
|
239
|
-
- spec/models/server_create_spec.rb
|
241
|
+
- spec/models/ssh_key_spec.rb
|
242
|
+
- spec/models/server_provision_spec.rb
|
240
243
|
- spec/models/quota_edit_limit_request_spec.rb
|
241
|
-
- spec/models/os_configuration_cloud_init_spec.rb
|
242
|
-
- spec/models/os_configuration_netris_controller_spec.rb
|
243
244
|
- spec/models/os_configuration_map_esxi_spec.rb
|
244
|
-
- spec/models/quota_spec.rb
|
245
245
|
- spec/models/os_configuration_map_spec.rb
|
246
|
-
- spec/models/
|
247
|
-
- spec/models/
|
248
|
-
- spec/models/
|
249
|
-
- spec/models/os_configuration_windows_spec.rb
|
250
|
-
- spec/models/tag_assignment_request_spec.rb
|
246
|
+
- spec/models/os_configuration_map_proxmox_spec.rb
|
247
|
+
- spec/models/server_create_spec.rb
|
248
|
+
- spec/models/tag_assignment_spec.rb
|
251
249
|
- spec/models/ssh_key_update_spec.rb
|
250
|
+
- spec/models/action_result_spec.rb
|
251
|
+
- spec/models/quota_edit_limit_request_details_spec.rb
|
252
|
+
- spec/models/os_configuration_netris_controller_spec.rb
|
253
|
+
- spec/models/reset_result_spec.rb
|
254
|
+
- spec/models/private_network_configuration_spec.rb
|
255
|
+
- spec/models/server_reserve_spec.rb
|
256
|
+
- spec/models/storage_configuration_spec.rb
|
252
257
|
- spec/models/os_configuration_spec.rb
|
253
|
-
- spec/models/
|
254
|
-
- spec/models/
|
255
|
-
- spec/models/ip_blocks_configuration_spec.rb
|
258
|
+
- spec/models/relinquish_ip_block_spec.rb
|
259
|
+
- spec/models/server_public_network_spec.rb
|
256
260
|
- spec/spec_helper.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# BmcApi::QuotaEditLimitRequestDetailsAllOf
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **requested_on** | **Time** | The point in time the request was submitted. | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'pnap_bmc_api'
|
13
|
-
|
14
|
-
instance = BmcApi::QuotaEditLimitRequestDetailsAllOf.new(
|
15
|
-
requested_on: 2021-09-01T10:10:10Z
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
data/spec/api_client_spec.rb
DELETED
@@ -1,226 +0,0 @@
|
|
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, assign public IPs, assign servers to networks 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: 6.1.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
|
15
|
-
describe BmcApi::ApiClient do
|
16
|
-
context 'initialization' do
|
17
|
-
context 'URL stuff' do
|
18
|
-
context 'host' do
|
19
|
-
it 'removes http from host' do
|
20
|
-
BmcApi.configure { |c| c.host = 'http://example.com' }
|
21
|
-
expect(BmcApi::Configuration.default.host).to eq('example.com')
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'removes https from host' do
|
25
|
-
BmcApi.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
-
expect(BmcApi::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'removes trailing path from host' do
|
30
|
-
BmcApi.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
-
expect(BmcApi::Configuration.default.host).to eq('hobo.com')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'base_path' do
|
36
|
-
it "prepends a slash to base_path" do
|
37
|
-
BmcApi.configure { |c| c.base_path = 'v4/dog' }
|
38
|
-
expect(BmcApi::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
-
end
|
40
|
-
|
41
|
-
it "doesn't prepend a slash if one is already there" do
|
42
|
-
BmcApi.configure { |c| c.base_path = '/v4/dog' }
|
43
|
-
expect(BmcApi::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
-
end
|
45
|
-
|
46
|
-
it "ends up as a blank string if nil" do
|
47
|
-
BmcApi.configure { |c| c.base_path = nil }
|
48
|
-
expect(BmcApi::Configuration.default.base_path).to eq('')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe 'params_encoding in #build_request' do
|
55
|
-
let(:config) { BmcApi::Configuration.new }
|
56
|
-
let(:api_client) { BmcApi::ApiClient.new(config) }
|
57
|
-
|
58
|
-
it 'defaults to nil' do
|
59
|
-
expect(BmcApi::Configuration.default.params_encoding).to eq(nil)
|
60
|
-
expect(config.params_encoding).to eq(nil)
|
61
|
-
|
62
|
-
request = api_client.build_request(:get, '/test')
|
63
|
-
expect(request.options[:params_encoding]).to eq(nil)
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'can be customized' do
|
67
|
-
config.params_encoding = :multi
|
68
|
-
request = api_client.build_request(:get, '/test')
|
69
|
-
expect(request.options[:params_encoding]).to eq(:multi)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe 'timeout in #build_request' do
|
74
|
-
let(:config) { BmcApi::Configuration.new }
|
75
|
-
let(:api_client) { BmcApi::ApiClient.new(config) }
|
76
|
-
|
77
|
-
it 'defaults to 0' do
|
78
|
-
expect(BmcApi::Configuration.default.timeout).to eq(0)
|
79
|
-
expect(config.timeout).to eq(0)
|
80
|
-
|
81
|
-
request = api_client.build_request(:get, '/test')
|
82
|
-
expect(request.options[:timeout]).to eq(0)
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'can be customized' do
|
86
|
-
config.timeout = 100
|
87
|
-
request = api_client.build_request(:get, '/test')
|
88
|
-
expect(request.options[:timeout]).to eq(100)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe '#deserialize' do
|
93
|
-
it "handles Array<Integer>" do
|
94
|
-
api_client = BmcApi::ApiClient.new
|
95
|
-
headers = { 'Content-Type' => 'application/json' }
|
96
|
-
response = double('response', headers: headers, body: '[12, 34]')
|
97
|
-
data = api_client.deserialize(response, 'Array<Integer>')
|
98
|
-
expect(data).to be_instance_of(Array)
|
99
|
-
expect(data).to eq([12, 34])
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'handles Array<Array<Integer>>' do
|
103
|
-
api_client = BmcApi::ApiClient.new
|
104
|
-
headers = { 'Content-Type' => 'application/json' }
|
105
|
-
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
|
-
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
|
-
expect(data).to be_instance_of(Array)
|
108
|
-
expect(data).to eq([[12, 34], [56]])
|
109
|
-
end
|
110
|
-
|
111
|
-
it 'handles Hash<String, String>' do
|
112
|
-
api_client = BmcApi::ApiClient.new
|
113
|
-
headers = { 'Content-Type' => 'application/json' }
|
114
|
-
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
|
-
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
|
-
expect(data).to be_instance_of(Hash)
|
117
|
-
expect(data).to eq(:message => 'Hello')
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
describe "#object_to_hash" do
|
122
|
-
it 'ignores nils and includes empty arrays' do
|
123
|
-
# uncomment below to test object_to_hash for model
|
124
|
-
# api_client = BmcApi::ApiClient.new
|
125
|
-
# _model = BmcApi::ModelName.new
|
126
|
-
# update the model attribute below
|
127
|
-
# _model.id = 1
|
128
|
-
# update the expected value (hash) below
|
129
|
-
# expected = {id: 1, name: '', tags: []}
|
130
|
-
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
describe '#build_collection_param' do
|
135
|
-
let(:param) { ['aa', 'bb', 'cc'] }
|
136
|
-
let(:api_client) { BmcApi::ApiClient.new }
|
137
|
-
|
138
|
-
it 'works for csv' do
|
139
|
-
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
|
-
end
|
141
|
-
|
142
|
-
it 'works for ssv' do
|
143
|
-
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
|
-
end
|
145
|
-
|
146
|
-
it 'works for tsv' do
|
147
|
-
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
|
-
end
|
149
|
-
|
150
|
-
it 'works for pipes' do
|
151
|
-
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
|
-
end
|
153
|
-
|
154
|
-
it 'works for multi' do
|
155
|
-
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
|
-
end
|
157
|
-
|
158
|
-
it 'fails for invalid collection format' do
|
159
|
-
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
describe '#json_mime?' do
|
164
|
-
let(:api_client) { BmcApi::ApiClient.new }
|
165
|
-
|
166
|
-
it 'works' do
|
167
|
-
expect(api_client.json_mime?(nil)).to eq false
|
168
|
-
expect(api_client.json_mime?('')).to eq false
|
169
|
-
|
170
|
-
expect(api_client.json_mime?('application/json')).to eq true
|
171
|
-
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
172
|
-
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
173
|
-
|
174
|
-
expect(api_client.json_mime?('application/xml')).to eq false
|
175
|
-
expect(api_client.json_mime?('text/plain')).to eq false
|
176
|
-
expect(api_client.json_mime?('application/jsonp')).to eq false
|
177
|
-
end
|
178
|
-
end
|
179
|
-
|
180
|
-
describe '#select_header_accept' do
|
181
|
-
let(:api_client) { BmcApi::ApiClient.new }
|
182
|
-
|
183
|
-
it 'works' do
|
184
|
-
expect(api_client.select_header_accept(nil)).to be_nil
|
185
|
-
expect(api_client.select_header_accept([])).to be_nil
|
186
|
-
|
187
|
-
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
188
|
-
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
189
|
-
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
190
|
-
|
191
|
-
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
192
|
-
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe '#select_header_content_type' do
|
197
|
-
let(:api_client) { BmcApi::ApiClient.new }
|
198
|
-
|
199
|
-
it 'works' do
|
200
|
-
expect(api_client.select_header_content_type(nil)).to be_nil
|
201
|
-
expect(api_client.select_header_content_type([])).to be_nil
|
202
|
-
|
203
|
-
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
204
|
-
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
205
|
-
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
206
|
-
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
207
|
-
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
describe '#sanitize_filename' do
|
212
|
-
let(:api_client) { BmcApi::ApiClient.new }
|
213
|
-
|
214
|
-
it 'works' do
|
215
|
-
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
|
-
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
|
-
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
218
|
-
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
219
|
-
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
220
|
-
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
221
|
-
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
222
|
-
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
223
|
-
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
224
|
-
end
|
225
|
-
end
|
226
|
-
end
|
data/spec/configuration_spec.rb
DELETED
@@ -1,42 +0,0 @@
|
|
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, assign public IPs, assign servers to networks 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: 6.1.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
|
15
|
-
describe BmcApi::Configuration do
|
16
|
-
let(:config) { BmcApi::Configuration.default }
|
17
|
-
|
18
|
-
before(:each) do
|
19
|
-
# uncomment below to setup host and base_path
|
20
|
-
# require 'URI'
|
21
|
-
# uri = URI.parse("https://api.phoenixnap.com/bmc/v1")
|
22
|
-
# BmcApi.configure do |c|
|
23
|
-
# c.host = uri.host
|
24
|
-
# c.base_path = uri.path
|
25
|
-
# end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe '#base_url' do
|
29
|
-
it 'should have the default value' do
|
30
|
-
# uncomment below to test default value of the base path
|
31
|
-
# expect(config.base_url).to eq("https://api.phoenixnap.com/bmc/v1")
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should remove trailing slashes' do
|
35
|
-
[nil, '', '/', '//'].each do |base_path|
|
36
|
-
config.base_path = base_path
|
37
|
-
# uncomment below to test trailing slashes
|
38
|
-
# expect(config.base_url).to eq("https://api.phoenixnap.com/bmc/v1")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,34 +0,0 @@
|
|
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 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
16
|
-
|
17
|
-
# Unit tests for BmcApi::QuotaEditLimitRequestDetailsAllOf
|
18
|
-
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
-
# Please update as you see appropriate
|
20
|
-
describe BmcApi::QuotaEditLimitRequestDetailsAllOf do
|
21
|
-
let(:instance) { BmcApi::QuotaEditLimitRequestDetailsAllOf.new }
|
22
|
-
|
23
|
-
describe 'test an instance of QuotaEditLimitRequestDetailsAllOf' do
|
24
|
-
it 'should create an instance of QuotaEditLimitRequestDetailsAllOf' do
|
25
|
-
expect(instance).to be_instance_of(BmcApi::QuotaEditLimitRequestDetailsAllOf)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
describe 'test attribute "requested_on"' do
|
29
|
-
it 'should work' do
|
30
|
-
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|