ibm_cloud_power 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +255 -0
- data/Rakefile +10 -0
- data/docs/CloneTaskReference.md +19 -0
- data/docs/CloneTaskStatus.md +23 -0
- data/docs/ClonedVolume.md +19 -0
- data/docs/ClonedVolumeDetail.md +19 -0
- data/docs/CloudInstance.md +37 -0
- data/docs/CloudInstanceCreate.md +29 -0
- data/docs/CloudInstanceReference.md +31 -0
- data/docs/CloudInstanceUpdate.md +25 -0
- data/docs/CloudInstanceUsageLimits.md +37 -0
- data/docs/CreateDataVolume.md +29 -0
- data/docs/CreateImage.md +37 -0
- data/docs/Error.md +19 -0
- data/docs/Event.md +33 -0
- data/docs/EventUser.md +21 -0
- data/docs/Events.md +17 -0
- data/docs/ExportImage.md +23 -0
- data/docs/IPAddressRange.md +19 -0
- data/docs/Image.md +39 -0
- data/docs/ImageReference.md +33 -0
- data/docs/ImageSpecifications.md +29 -0
- data/docs/ImageVolume.md +23 -0
- data/docs/Images.md +17 -0
- data/docs/MinMaxDefault.md +21 -0
- data/docs/MultiVolumesCreate.md +29 -0
- data/docs/Network.md +37 -0
- data/docs/NetworkCreate.md +29 -0
- data/docs/NetworkIpAddressMetrics.md +23 -0
- data/docs/NetworkPort.md +29 -0
- data/docs/NetworkPortCreate.md +19 -0
- data/docs/NetworkPortPvmInstance.md +19 -0
- data/docs/NetworkPortUpdate.md +19 -0
- data/docs/NetworkPorts.md +17 -0
- data/docs/NetworkReference.md +27 -0
- data/docs/NetworkUpdate.md +23 -0
- data/docs/Networks.md +17 -0
- data/docs/Operations.md +21 -0
- data/docs/PCloudEventsApi.md +114 -0
- data/docs/PCloudImagesApi.md +342 -0
- data/docs/PCloudInstancesApi.md +148 -0
- data/docs/PCloudNetworksApi.md +504 -0
- data/docs/PCloudPVMInstancesApi.md +809 -0
- data/docs/PCloudSAPApi.md +150 -0
- data/docs/PCloudSnapshotsApi.md +200 -0
- data/docs/PCloudSystemPoolsApi.md +54 -0
- data/docs/PCloudTasksApi.md +100 -0
- data/docs/PCloudTenantsApi.md +102 -0
- data/docs/PCloudTenantsSSHKeysApi.md +248 -0
- data/docs/PCloudVolumesApi.md +746 -0
- data/docs/PVMInstance.md +77 -0
- data/docs/PVMInstanceAction.md +17 -0
- data/docs/PVMInstanceAddNetwork.md +19 -0
- data/docs/PVMInstanceCapture.md +29 -0
- data/docs/PVMInstanceClone.md +31 -0
- data/docs/PVMInstanceConsole.md +17 -0
- data/docs/PVMInstanceCreate.md +53 -0
- data/docs/PVMInstanceFault.md +23 -0
- data/docs/PVMInstanceHealth.md +21 -0
- data/docs/PVMInstanceMultiCreate.md +21 -0
- data/docs/PVMInstanceNetwork.md +33 -0
- data/docs/PVMInstanceNetworks.md +17 -0
- data/docs/PVMInstanceOperation.md +19 -0
- data/docs/PVMInstanceReference.md +71 -0
- data/docs/PVMInstanceRemoveNetwork.md +17 -0
- data/docs/PVMInstanceUpdate.md +33 -0
- data/docs/PVMInstanceUpdateResponse.md +27 -0
- data/docs/PVMInstanceVolumeUpdate.md +17 -0
- data/docs/PVMInstances.md +17 -0
- data/docs/PeeringNetwork.md +21 -0
- data/docs/PinPolicy.md +16 -0
- data/docs/SAPCreate.md +33 -0
- data/docs/SAPProfile.md +25 -0
- data/docs/SAPProfileReference.md +19 -0
- data/docs/SAPProfiles.md +17 -0
- data/docs/SRC.md +19 -0
- data/docs/SSHKey.md +21 -0
- data/docs/SSHKeys.md +17 -0
- data/docs/Snapshot.md +35 -0
- data/docs/SnapshotCreate.md +21 -0
- data/docs/SnapshotCreateResponse.md +17 -0
- data/docs/SnapshotRestore.md +17 -0
- data/docs/SnapshotUpdate.md +19 -0
- data/docs/Snapshots.md +17 -0
- data/docs/SoftwareLicenses.md +25 -0
- data/docs/StockImage.md +21 -0
- data/docs/System.md +21 -0
- data/docs/SystemPool.md +31 -0
- data/docs/Task.md +33 -0
- data/docs/TaskReference.md +19 -0
- data/docs/Tenant.md +29 -0
- data/docs/TenantUpdate.md +19 -0
- data/docs/UpdateVolume.md +23 -0
- data/docs/VirtualCores.md +21 -0
- data/docs/Volume.md +41 -0
- data/docs/VolumeInfo.md +19 -0
- data/docs/VolumeReference.md +43 -0
- data/docs/Volumes.md +17 -0
- data/docs/VolumesClone.md +31 -0
- data/docs/VolumesCloneAsyncRequest.md +19 -0
- data/docs/VolumesCloneCancel.md +17 -0
- data/docs/VolumesCloneCreate.md +19 -0
- data/docs/VolumesCloneDetail.md +33 -0
- data/docs/VolumesCloneExecute.md +19 -0
- data/docs/VolumesCloneRequest.md +19 -0
- data/docs/VolumesCloneResponse.md +17 -0
- data/docs/VolumesClones.md +17 -0
- data/git_push.sh +58 -0
- data/ibm_cloud_power.gemspec +38 -0
- data/lib/ibm_cloud_power.rb +144 -0
- data/lib/ibm_cloud_power/api/p_cloud_events_api.rb +163 -0
- data/lib/ibm_cloud_power/api/p_cloud_images_api.rb +473 -0
- data/lib/ibm_cloud_power/api/p_cloud_instances_api.rb +210 -0
- data/lib/ibm_cloud_power/api/p_cloud_networks_api.rb +719 -0
- data/lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb +1166 -0
- data/lib/ibm_cloud_power/api/p_cloud_sap_api.rb +216 -0
- data/lib/ibm_cloud_power/api/p_cloud_snapshots_api.rb +288 -0
- data/lib/ibm_cloud_power/api/p_cloud_system_pools_api.rb +82 -0
- data/lib/ibm_cloud_power/api/p_cloud_tasks_api.rb +142 -0
- data/lib/ibm_cloud_power/api/p_cloud_tenants_api.rb +150 -0
- data/lib/ibm_cloud_power/api/p_cloud_tenants_ssh_keys_api.rb +356 -0
- data/lib/ibm_cloud_power/api/p_cloud_volumes_api.rb +1065 -0
- data/lib/ibm_cloud_power/api_client.rb +387 -0
- data/lib/ibm_cloud_power/api_error.rb +57 -0
- data/lib/ibm_cloud_power/configuration.rb +241 -0
- data/lib/ibm_cloud_power/models/clone_task_reference.rb +229 -0
- data/lib/ibm_cloud_power/models/clone_task_status.rb +285 -0
- data/lib/ibm_cloud_power/models/cloned_volume.rb +219 -0
- data/lib/ibm_cloud_power/models/cloned_volume_detail.rb +227 -0
- data/lib/ibm_cloud_power/models/cloud_instance.rb +361 -0
- data/lib/ibm_cloud_power/models/cloud_instance_create.rb +294 -0
- data/lib/ibm_cloud_power/models/cloud_instance_reference.rb +315 -0
- data/lib/ibm_cloud_power/models/cloud_instance_update.rb +249 -0
- data/lib/ibm_cloud_power/models/cloud_instance_usage_limits.rb +334 -0
- data/lib/ibm_cloud_power/models/create_data_volume.rb +313 -0
- data/lib/ibm_cloud_power/models/create_image.rb +360 -0
- data/lib/ibm_cloud_power/models/error.rb +217 -0
- data/lib/ibm_cloud_power/models/event.rb +357 -0
- data/lib/ibm_cloud_power/models/event_user.rb +234 -0
- data/lib/ibm_cloud_power/models/events.rb +216 -0
- data/lib/ibm_cloud_power/models/export_image.rb +249 -0
- data/lib/ibm_cloud_power/models/image.rb +351 -0
- data/lib/ibm_cloud_power/models/image_reference.rb +333 -0
- data/lib/ibm_cloud_power/models/image_specifications.rb +269 -0
- data/lib/ibm_cloud_power/models/image_volume.rb +259 -0
- data/lib/ibm_cloud_power/models/images.rb +216 -0
- data/lib/ibm_cloud_power/models/ip_address_range.rb +229 -0
- data/lib/ibm_cloud_power/models/min_max_default.rb +244 -0
- data/lib/ibm_cloud_power/models/multi_volumes_create.rb +313 -0
- data/lib/ibm_cloud_power/models/network.rb +395 -0
- data/lib/ibm_cloud_power/models/network_create.rb +314 -0
- data/lib/ibm_cloud_power/models/network_ip_address_metrics.rb +260 -0
- data/lib/ibm_cloud_power/models/network_port.rb +293 -0
- data/lib/ibm_cloud_power/models/network_port_create.rb +219 -0
- data/lib/ibm_cloud_power/models/network_port_pvm_instance.rb +220 -0
- data/lib/ibm_cloud_power/models/network_port_update.rb +219 -0
- data/lib/ibm_cloud_power/models/network_ports.rb +216 -0
- data/lib/ibm_cloud_power/models/network_reference.rb +325 -0
- data/lib/ibm_cloud_power/models/network_update.rb +243 -0
- data/lib/ibm_cloud_power/models/networks.rb +216 -0
- data/lib/ibm_cloud_power/models/operations.rb +287 -0
- data/lib/ibm_cloud_power/models/peering_network.rb +241 -0
- data/lib/ibm_cloud_power/models/pin_policy.rb +37 -0
- data/lib/ibm_cloud_power/models/pvm_instance.rb +612 -0
- data/lib/ibm_cloud_power/models/pvm_instance_action.rb +248 -0
- data/lib/ibm_cloud_power/models/pvm_instance_add_network.rb +224 -0
- data/lib/ibm_cloud_power/models/pvm_instance_capture.rb +317 -0
- data/lib/ibm_cloud_power/models/pvm_instance_clone.rb +328 -0
- data/lib/ibm_cloud_power/models/pvm_instance_console.rb +214 -0
- data/lib/ibm_cloud_power/models/pvm_instance_create.rb +483 -0
- data/lib/ibm_cloud_power/models/pvm_instance_fault.rb +240 -0
- data/lib/ibm_cloud_power/models/pvm_instance_health.rb +230 -0
- data/lib/ibm_cloud_power/models/pvm_instance_multi_create.rb +279 -0
- data/lib/ibm_cloud_power/models/pvm_instance_network.rb +290 -0
- data/lib/ibm_cloud_power/models/pvm_instance_networks.rb +216 -0
- data/lib/ibm_cloud_power/models/pvm_instance_operation.rb +262 -0
- data/lib/ibm_cloud_power/models/pvm_instance_reference.rb +566 -0
- data/lib/ibm_cloud_power/models/pvm_instance_remove_network.rb +209 -0
- data/lib/ibm_cloud_power/models/pvm_instance_update.rb +322 -0
- data/lib/ibm_cloud_power/models/pvm_instance_update_response.rb +292 -0
- data/lib/ibm_cloud_power/models/pvm_instance_volume_update.rb +214 -0
- data/lib/ibm_cloud_power/models/pvm_instances.rb +216 -0
- data/lib/ibm_cloud_power/models/sap_create.rb +311 -0
- data/lib/ibm_cloud_power/models/sap_profile.rb +310 -0
- data/lib/ibm_cloud_power/models/sap_profile_reference.rb +229 -0
- data/lib/ibm_cloud_power/models/sap_profiles.rb +216 -0
- data/lib/ibm_cloud_power/models/snapshot.rb +321 -0
- data/lib/ibm_cloud_power/models/snapshot_create.rb +236 -0
- data/lib/ibm_cloud_power/models/snapshot_create_response.rb +214 -0
- data/lib/ibm_cloud_power/models/snapshot_restore.rb +211 -0
- data/lib/ibm_cloud_power/models/snapshot_update.rb +219 -0
- data/lib/ibm_cloud_power/models/snapshots.rb +216 -0
- data/lib/ibm_cloud_power/models/software_licenses.rb +257 -0
- data/lib/ibm_cloud_power/models/src.rb +219 -0
- data/lib/ibm_cloud_power/models/ssh_key.rb +239 -0
- data/lib/ibm_cloud_power/models/ssh_keys.rb +216 -0
- data/lib/ibm_cloud_power/models/stock_image.rb +230 -0
- data/lib/ibm_cloud_power/models/system.rb +239 -0
- data/lib/ibm_cloud_power/models/system_pool.rb +277 -0
- data/lib/ibm_cloud_power/models/task.rb +334 -0
- data/lib/ibm_cloud_power/models/task_reference.rb +229 -0
- data/lib/ibm_cloud_power/models/tenant.rb +295 -0
- data/lib/ibm_cloud_power/models/tenant_update.rb +221 -0
- data/lib/ibm_cloud_power/models/update_volume.rb +239 -0
- data/lib/ibm_cloud_power/models/virtual_cores.rb +253 -0
- data/lib/ibm_cloud_power/models/volume.rb +356 -0
- data/lib/ibm_cloud_power/models/volume_info.rb +219 -0
- data/lib/ibm_cloud_power/models/volume_reference.rb +396 -0
- data/lib/ibm_cloud_power/models/volumes.rb +216 -0
- data/lib/ibm_cloud_power/models/volumes_clone.rb +284 -0
- data/lib/ibm_cloud_power/models/volumes_clone_async_request.rb +231 -0
- data/lib/ibm_cloud_power/models/volumes_clone_cancel.rb +209 -0
- data/lib/ibm_cloud_power/models/volumes_clone_create.rb +231 -0
- data/lib/ibm_cloud_power/models/volumes_clone_detail.rb +296 -0
- data/lib/ibm_cloud_power/models/volumes_clone_execute.rb +224 -0
- data/lib/ibm_cloud_power/models/volumes_clone_request.rb +231 -0
- data/lib/ibm_cloud_power/models/volumes_clone_response.rb +211 -0
- data/lib/ibm_cloud_power/models/volumes_clones.rb +211 -0
- data/lib/ibm_cloud_power/version.rb +15 -0
- data/spec/api/p_cloud_events_api_spec.rb +62 -0
- data/spec/api/p_cloud_images_api_spec.rb +117 -0
- data/spec/api/p_cloud_instances_api_spec.rb +69 -0
- data/spec/api/p_cloud_networks_api_spec.rb +161 -0
- data/spec/api/p_cloud_pvm_instances_api_spec.rb +240 -0
- data/spec/api/p_cloud_sap_api_spec.rb +70 -0
- data/spec/api/p_cloud_snapshots_api_spec.rb +83 -0
- data/spec/api/p_cloud_system_pools_api_spec.rb +46 -0
- data/spec/api/p_cloud_tasks_api_spec.rb +57 -0
- data/spec/api/p_cloud_tenants_api_spec.rb +58 -0
- data/spec/api/p_cloud_tenants_ssh_keys_api_spec.rb +95 -0
- data/spec/api/p_cloud_volumes_api_spec.rb +223 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/clone_task_reference_spec.rb +47 -0
- data/spec/models/clone_task_status_spec.rb +63 -0
- data/spec/models/cloned_volume_detail_spec.rb +47 -0
- data/spec/models/cloned_volume_spec.rb +47 -0
- data/spec/models/cloud_instance_create_spec.rb +77 -0
- data/spec/models/cloud_instance_reference_spec.rb +83 -0
- data/spec/models/cloud_instance_spec.rb +101 -0
- data/spec/models/cloud_instance_update_spec.rb +65 -0
- data/spec/models/cloud_instance_usage_limits_spec.rb +101 -0
- data/spec/models/create_data_volume_spec.rb +81 -0
- data/spec/models/create_image_spec.rb +109 -0
- data/spec/models/error_spec.rb +47 -0
- data/spec/models/event_spec.rb +93 -0
- data/spec/models/event_user_spec.rb +53 -0
- data/spec/models/events_spec.rb +41 -0
- data/spec/models/export_image_spec.rb +59 -0
- data/spec/models/image_reference_spec.rb +89 -0
- data/spec/models/image_spec.rb +107 -0
- data/spec/models/image_specifications_spec.rb +77 -0
- data/spec/models/image_volume_spec.rb +59 -0
- data/spec/models/images_spec.rb +41 -0
- data/spec/models/ip_address_range_spec.rb +47 -0
- data/spec/models/min_max_default_spec.rb +53 -0
- data/spec/models/multi_volumes_create_spec.rb +81 -0
- data/spec/models/network_create_spec.rb +81 -0
- data/spec/models/network_ip_address_metrics_spec.rb +59 -0
- data/spec/models/network_port_create_spec.rb +47 -0
- data/spec/models/network_port_pvm_instance_spec.rb +47 -0
- data/spec/models/network_port_spec.rb +77 -0
- data/spec/models/network_port_update_spec.rb +47 -0
- data/spec/models/network_ports_spec.rb +41 -0
- data/spec/models/network_reference_spec.rb +75 -0
- data/spec/models/network_spec.rb +105 -0
- data/spec/models/network_update_spec.rb +59 -0
- data/spec/models/networks_spec.rb +41 -0
- data/spec/models/operations_spec.rb +65 -0
- data/spec/models/peering_network_spec.rb +53 -0
- data/spec/models/pin_policy_spec.rb +35 -0
- data/spec/models/pvm_instance_action_spec.rb +45 -0
- data/spec/models/pvm_instance_add_network_spec.rb +47 -0
- data/spec/models/pvm_instance_capture_spec.rb +81 -0
- data/spec/models/pvm_instance_clone_spec.rb +87 -0
- data/spec/models/pvm_instance_console_spec.rb +41 -0
- data/spec/models/pvm_instance_create_spec.rb +161 -0
- data/spec/models/pvm_instance_fault_spec.rb +59 -0
- data/spec/models/pvm_instance_health_spec.rb +53 -0
- data/spec/models/pvm_instance_multi_create_spec.rb +61 -0
- data/spec/models/pvm_instance_network_spec.rb +89 -0
- data/spec/models/pvm_instance_networks_spec.rb +41 -0
- data/spec/models/pvm_instance_operation_spec.rb +51 -0
- data/spec/models/pvm_instance_reference_spec.rb +207 -0
- data/spec/models/pvm_instance_remove_network_spec.rb +41 -0
- data/spec/models/pvm_instance_spec.rb +225 -0
- data/spec/models/pvm_instance_update_response_spec.rb +75 -0
- data/spec/models/pvm_instance_update_spec.rb +93 -0
- data/spec/models/pvm_instance_volume_update_spec.rb +41 -0
- data/spec/models/pvm_instances_spec.rb +41 -0
- data/spec/models/sap_create_spec.rb +89 -0
- data/spec/models/sap_profile_reference_spec.rb +47 -0
- data/spec/models/sap_profile_spec.rb +69 -0
- data/spec/models/sap_profiles_spec.rb +41 -0
- data/spec/models/snapshot_create_response_spec.rb +41 -0
- data/spec/models/snapshot_create_spec.rb +53 -0
- data/spec/models/snapshot_restore_spec.rb +41 -0
- data/spec/models/snapshot_spec.rb +95 -0
- data/spec/models/snapshot_update_spec.rb +47 -0
- data/spec/models/snapshots_spec.rb +41 -0
- data/spec/models/software_licenses_spec.rb +65 -0
- data/spec/models/src_spec.rb +47 -0
- data/spec/models/ssh_key_spec.rb +53 -0
- data/spec/models/ssh_keys_spec.rb +41 -0
- data/spec/models/stock_image_spec.rb +53 -0
- data/spec/models/system_pool_spec.rb +83 -0
- data/spec/models/system_spec.rb +53 -0
- data/spec/models/task_reference_spec.rb +47 -0
- data/spec/models/task_spec.rb +89 -0
- data/spec/models/tenant_spec.rb +77 -0
- data/spec/models/tenant_update_spec.rb +47 -0
- data/spec/models/update_volume_spec.rb +59 -0
- data/spec/models/virtual_cores_spec.rb +53 -0
- data/spec/models/volume_info_spec.rb +47 -0
- data/spec/models/volume_reference_spec.rb +119 -0
- data/spec/models/volume_spec.rb +113 -0
- data/spec/models/volumes_clone_async_request_spec.rb +47 -0
- data/spec/models/volumes_clone_cancel_spec.rb +41 -0
- data/spec/models/volumes_clone_create_spec.rb +47 -0
- data/spec/models/volumes_clone_detail_spec.rb +89 -0
- data/spec/models/volumes_clone_execute_spec.rb +47 -0
- data/spec/models/volumes_clone_request_spec.rb +47 -0
- data/spec/models/volumes_clone_response_spec.rb +47 -0
- data/spec/models/volumes_clone_spec.rb +83 -0
- data/spec/models/volumes_clones_spec.rb +41 -0
- data/spec/models/volumes_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +519 -0
@@ -0,0 +1,226 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe IbmCloudPower::ApiClient do
|
16
|
+
context 'initialization' do
|
17
|
+
context 'URL stuff' do
|
18
|
+
context 'host' do
|
19
|
+
it 'removes http from host' do
|
20
|
+
IbmCloudPower.configure { |c| c.host = 'http://example.com' }
|
21
|
+
expect(IbmCloudPower::Configuration.default.host).to eq('example.com')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'removes https from host' do
|
25
|
+
IbmCloudPower.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
+
expect(IbmCloudPower::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'removes trailing path from host' do
|
30
|
+
IbmCloudPower.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
+
expect(IbmCloudPower::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
|
+
IbmCloudPower.configure { |c| c.base_path = 'v4/dog' }
|
38
|
+
expect(IbmCloudPower::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
|
+
IbmCloudPower.configure { |c| c.base_path = '/v4/dog' }
|
43
|
+
expect(IbmCloudPower::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
+
end
|
45
|
+
|
46
|
+
it "ends up as a blank string if nil" do
|
47
|
+
IbmCloudPower.configure { |c| c.base_path = nil }
|
48
|
+
expect(IbmCloudPower::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) { IbmCloudPower::Configuration.new }
|
56
|
+
let(:api_client) { IbmCloudPower::ApiClient.new(config) }
|
57
|
+
|
58
|
+
it 'defaults to nil' do
|
59
|
+
expect(IbmCloudPower::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) { IbmCloudPower::Configuration.new }
|
75
|
+
let(:api_client) { IbmCloudPower::ApiClient.new(config) }
|
76
|
+
|
77
|
+
it 'defaults to 0' do
|
78
|
+
expect(IbmCloudPower::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 = IbmCloudPower::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 = IbmCloudPower::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 = IbmCloudPower::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 = IbmCloudPower::ApiClient.new
|
125
|
+
# _model = IbmCloudPower::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) { IbmCloudPower::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) { IbmCloudPower::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) { IbmCloudPower::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) { IbmCloudPower::ApiClient.new }
|
198
|
+
|
199
|
+
it 'works' do
|
200
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
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) { IbmCloudPower::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
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe IbmCloudPower::Configuration do
|
16
|
+
let(:config) { IbmCloudPower::Configuration.default }
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
# uncomment below to setup host and base_path
|
20
|
+
# require 'URI'
|
21
|
+
# uri = URI.parse("http://localhost")
|
22
|
+
# IbmCloudPower.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("http://localhost")
|
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("http://localhost")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for IbmCloudPower::CloneTaskReference
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'CloneTaskReference' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = IbmCloudPower::CloneTaskReference.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of CloneTaskReference' do
|
31
|
+
it 'should create an instance of CloneTaskReference' do
|
32
|
+
expect(@instance).to be_instance_of(IbmCloudPower::CloneTaskReference)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "clone_task_id"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "href"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for IbmCloudPower::CloneTaskStatus
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'CloneTaskStatus' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = IbmCloudPower::CloneTaskStatus.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of CloneTaskStatus' do
|
31
|
+
it 'should create an instance of CloneTaskStatus' do
|
32
|
+
expect(@instance).to be_instance_of(IbmCloudPower::CloneTaskStatus)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "status"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["running", "completed", "failed", "unknown"])
|
39
|
+
# validator.allowable_values.each do |value|
|
40
|
+
# expect { @instance.status = value }.not_to raise_error
|
41
|
+
# end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe 'test attribute "percent_complete"' do
|
46
|
+
it 'should work' do
|
47
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe 'test attribute "cloned_volumes"' do
|
52
|
+
it 'should work' do
|
53
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe 'test attribute "failed_reason"' do
|
58
|
+
it 'should work' do
|
59
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for IbmCloudPower::ClonedVolumeDetail
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'ClonedVolumeDetail' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = IbmCloudPower::ClonedVolumeDetail.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of ClonedVolumeDetail' do
|
31
|
+
it 'should create an instance of ClonedVolumeDetail' do
|
32
|
+
expect(@instance).to be_instance_of(IbmCloudPower::ClonedVolumeDetail)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "source"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "clone"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#Power Cloud API
|
3
|
+
|
4
|
+
#IBM Power Cloud API for Power Hardware / Infrastructure
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: kylej@us.ibm.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for IbmCloudPower::ClonedVolume
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'ClonedVolume' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = IbmCloudPower::ClonedVolume.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of ClonedVolume' do
|
31
|
+
it 'should create an instance of ClonedVolume' do
|
32
|
+
expect(@instance).to be_instance_of(IbmCloudPower::ClonedVolume)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "source_volume_id"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "cloned_volume_id"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|