pnap_bmc_api 2.2.1 → 2.3.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 +2 -0
- data/VERSION +1 -1
- data/docs/IpBlocksConfiguration.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/OsConfigurationWindows.md +3 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/PublicNetworkConfiguration.md +1 -1
- data/docs/ReservationTransferDetails.md +18 -0
- data/docs/Server.md +3 -3
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +1 -1
- data/docs/ServerPrivateNetwork.md +4 -2
- data/docs/ServerProvision.md +1 -1
- data/docs/ServerPublicNetwork.md +5 -3
- data/docs/ServersApi.md +72 -0
- data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
- data/lib/pnap_bmc_api/api/servers_api.rb +97 -23
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
- data/lib/pnap_bmc_api/api_client.rb +17 -14
- data/lib/pnap_bmc_api/api_error.rb +1 -1
- data/lib/pnap_bmc_api/api_model_base.rb +88 -0
- data/lib/pnap_bmc_api/configuration.rb +11 -1
- data/lib/pnap_bmc_api/models/action_result.rb +21 -78
- data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
- data/lib/pnap_bmc_api/models/error.rb +21 -78
- data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
- data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/quota.rb +61 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +11 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +22 -79
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
- data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
- data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
- data/lib/pnap_bmc_api/models/server.rb +116 -83
- data/lib/pnap_bmc_api/models/server_create.rb +46 -83
- data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
- data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
- data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
- data/lib/pnap_bmc_api/models/server_private_network.rb +36 -83
- data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
- data/lib/pnap_bmc_api/models/server_public_network.rb +36 -83
- data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
- data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
- data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
- data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
- data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
- data/lib/pnap_bmc_api/version.rb +1 -2
- data/lib/pnap_bmc_api.rb +3 -1
- data/pnap_bmc_api.gemspec +6 -6
- data/spec/api/quotas_api_spec.rb +1 -1
- data/spec/api/servers_api_spec.rb +14 -1
- data/spec/api/ssh_keys_api_spec.rb +1 -1
- data/spec/models/action_result_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/delete_ssh_key_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
- data/spec/models/esxi_os_configuration_spec.rb +2 -2
- data/spec/models/gpu_configuration_spec.rb +2 -2
- data/spec/models/ip_blocks_configuration_spec.rb +2 -2
- data/spec/models/network_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
- data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
- data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
- data/spec/models/os_configuration_map_spec.rb +2 -2
- data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
- data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
- data/spec/models/os_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_windows_spec.rb +8 -2
- data/spec/models/private_network_configuration_spec.rb +2 -2
- data/spec/models/public_network_configuration_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_spec.rb +2 -2
- data/spec/models/quota_spec.rb +2 -2
- data/spec/models/relinquish_ip_block_spec.rb +2 -2
- data/spec/models/reservation_transfer_details_spec.rb +36 -0
- data/spec/models/reset_result_spec.rb +2 -2
- data/spec/models/server_create_spec.rb +2 -2
- data/spec/models/server_ip_block_spec.rb +2 -2
- data/spec/models/server_network_update_spec.rb +2 -2
- data/spec/models/server_patch_spec.rb +2 -2
- data/spec/models/server_private_network_spec.rb +8 -2
- data/spec/models/server_provision_spec.rb +2 -2
- data/spec/models/server_public_network_spec.rb +8 -2
- data/spec/models/server_reserve_spec.rb +2 -2
- data/spec/models/server_reset_spec.rb +2 -2
- data/spec/models/server_spec.rb +2 -2
- data/spec/models/ssh_key_create_spec.rb +2 -2
- data/spec/models/ssh_key_spec.rb +2 -2
- data/spec/models/ssh_key_update_spec.rb +2 -2
- data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
- data/spec/models/storage_configuration_spec.rb +2 -2
- data/spec/models/tag_assignment_request_spec.rb +2 -2
- data/spec/models/tag_assignment_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +48 -39
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -57,7 +57,7 @@ module BmcApi
|
|
|
57
57
|
# header parameters
|
|
58
58
|
header_params = opts[:header_params] || {}
|
|
59
59
|
# HTTP header 'Accept' (if needed)
|
|
60
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
61
|
|
|
62
62
|
# form parameters
|
|
63
63
|
form_params = opts[:form_params] || {}
|
|
@@ -117,7 +117,7 @@ module BmcApi
|
|
|
117
117
|
# header parameters
|
|
118
118
|
header_params = opts[:header_params] || {}
|
|
119
119
|
# HTTP header 'Accept' (if needed)
|
|
120
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
121
121
|
|
|
122
122
|
# form parameters
|
|
123
123
|
form_params = opts[:form_params] || {}
|
|
@@ -183,7 +183,7 @@ module BmcApi
|
|
|
183
183
|
# header parameters
|
|
184
184
|
header_params = opts[:header_params] || {}
|
|
185
185
|
# HTTP header 'Accept' (if needed)
|
|
186
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
187
187
|
# HTTP header 'Content-Type'
|
|
188
188
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
189
189
|
if !content_type.nil?
|
|
@@ -257,7 +257,7 @@ module BmcApi
|
|
|
257
257
|
# header parameters
|
|
258
258
|
header_params = opts[:header_params] || {}
|
|
259
259
|
# HTTP header 'Accept' (if needed)
|
|
260
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
260
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
261
261
|
# HTTP header 'Content-Type'
|
|
262
262
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
263
263
|
if !content_type.nil?
|
|
@@ -325,7 +325,7 @@ module BmcApi
|
|
|
325
325
|
# header parameters
|
|
326
326
|
header_params = opts[:header_params] || {}
|
|
327
327
|
# HTTP header 'Accept' (if needed)
|
|
328
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
328
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
329
329
|
|
|
330
330
|
# form parameters
|
|
331
331
|
form_params = opts[:form_params] || {}
|
|
@@ -388,7 +388,7 @@ module BmcApi
|
|
|
388
388
|
# header parameters
|
|
389
389
|
header_params = opts[:header_params] || {}
|
|
390
390
|
# HTTP header 'Accept' (if needed)
|
|
391
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
391
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
392
392
|
|
|
393
393
|
# form parameters
|
|
394
394
|
form_params = opts[:form_params] || {}
|
|
@@ -460,7 +460,7 @@ module BmcApi
|
|
|
460
460
|
# header parameters
|
|
461
461
|
header_params = opts[:header_params] || {}
|
|
462
462
|
# HTTP header 'Accept' (if needed)
|
|
463
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
463
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
464
464
|
# HTTP header 'Content-Type'
|
|
465
465
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
466
466
|
if !content_type.nil?
|
|
@@ -528,7 +528,7 @@ module BmcApi
|
|
|
528
528
|
# header parameters
|
|
529
529
|
header_params = opts[:header_params] || {}
|
|
530
530
|
# HTTP header 'Accept' (if needed)
|
|
531
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
531
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
532
532
|
|
|
533
533
|
# form parameters
|
|
534
534
|
form_params = opts[:form_params] || {}
|
|
@@ -597,7 +597,7 @@ module BmcApi
|
|
|
597
597
|
# header parameters
|
|
598
598
|
header_params = opts[:header_params] || {}
|
|
599
599
|
# HTTP header 'Accept' (if needed)
|
|
600
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
600
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
601
601
|
# HTTP header 'Content-Type'
|
|
602
602
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
603
603
|
if !content_type.nil?
|
|
@@ -671,7 +671,7 @@ module BmcApi
|
|
|
671
671
|
# header parameters
|
|
672
672
|
header_params = opts[:header_params] || {}
|
|
673
673
|
# HTTP header 'Accept' (if needed)
|
|
674
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
674
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
675
675
|
# HTTP header 'Content-Type'
|
|
676
676
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
677
677
|
if !content_type.nil?
|
|
@@ -739,7 +739,7 @@ module BmcApi
|
|
|
739
739
|
# header parameters
|
|
740
740
|
header_params = opts[:header_params] || {}
|
|
741
741
|
# HTTP header 'Accept' (if needed)
|
|
742
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
742
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
743
743
|
|
|
744
744
|
# form parameters
|
|
745
745
|
form_params = opts[:form_params] || {}
|
|
@@ -770,6 +770,80 @@ module BmcApi
|
|
|
770
770
|
return data, status_code, headers
|
|
771
771
|
end
|
|
772
772
|
|
|
773
|
+
# Transfer server reservation.
|
|
774
|
+
# Transfer server reservation. An active (READY) reservation can be transferred from a server in ERROR or RESERVED status to another HOURLY provisioned server of the same location and type.
|
|
775
|
+
# @param server_id [String] The server's ID.
|
|
776
|
+
# @param reservation_transfer_details [ReservationTransferDetails]
|
|
777
|
+
# @param [Hash] opts the optional parameters
|
|
778
|
+
# @return [Server]
|
|
779
|
+
def servers_server_id_actions_transfer_reservation(server_id, reservation_transfer_details, opts = {})
|
|
780
|
+
data, _status_code, _headers = servers_server_id_actions_transfer_reservation_with_http_info(server_id, reservation_transfer_details, opts)
|
|
781
|
+
data
|
|
782
|
+
end
|
|
783
|
+
|
|
784
|
+
# Transfer server reservation.
|
|
785
|
+
# Transfer server reservation. An active (READY) reservation can be transferred from a server in ERROR or RESERVED status to another HOURLY provisioned server of the same location and type.
|
|
786
|
+
# @param server_id [String] The server's ID.
|
|
787
|
+
# @param reservation_transfer_details [ReservationTransferDetails]
|
|
788
|
+
# @param [Hash] opts the optional parameters
|
|
789
|
+
# @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
|
|
790
|
+
def servers_server_id_actions_transfer_reservation_with_http_info(server_id, reservation_transfer_details, opts = {})
|
|
791
|
+
if @api_client.config.debugging
|
|
792
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_transfer_reservation ...'
|
|
793
|
+
end
|
|
794
|
+
# verify the required parameter 'server_id' is set
|
|
795
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
|
796
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_transfer_reservation"
|
|
797
|
+
end
|
|
798
|
+
# verify the required parameter 'reservation_transfer_details' is set
|
|
799
|
+
if @api_client.config.client_side_validation && reservation_transfer_details.nil?
|
|
800
|
+
fail ArgumentError, "Missing the required parameter 'reservation_transfer_details' when calling ServersApi.servers_server_id_actions_transfer_reservation"
|
|
801
|
+
end
|
|
802
|
+
# resource path
|
|
803
|
+
local_var_path = '/servers/{serverId}/actions/transfer-reservation'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
|
804
|
+
|
|
805
|
+
# query parameters
|
|
806
|
+
query_params = opts[:query_params] || {}
|
|
807
|
+
|
|
808
|
+
# header parameters
|
|
809
|
+
header_params = opts[:header_params] || {}
|
|
810
|
+
# HTTP header 'Accept' (if needed)
|
|
811
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
812
|
+
# HTTP header 'Content-Type'
|
|
813
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
814
|
+
if !content_type.nil?
|
|
815
|
+
header_params['Content-Type'] = content_type
|
|
816
|
+
end
|
|
817
|
+
|
|
818
|
+
# form parameters
|
|
819
|
+
form_params = opts[:form_params] || {}
|
|
820
|
+
|
|
821
|
+
# http body (model)
|
|
822
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(reservation_transfer_details)
|
|
823
|
+
|
|
824
|
+
# return_type
|
|
825
|
+
return_type = opts[:debug_return_type] || 'Server'
|
|
826
|
+
|
|
827
|
+
# auth_names
|
|
828
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
|
829
|
+
|
|
830
|
+
new_options = opts.merge(
|
|
831
|
+
:operation => :"ServersApi.servers_server_id_actions_transfer_reservation",
|
|
832
|
+
:header_params => header_params,
|
|
833
|
+
:query_params => query_params,
|
|
834
|
+
:form_params => form_params,
|
|
835
|
+
:body => post_body,
|
|
836
|
+
:auth_names => auth_names,
|
|
837
|
+
:return_type => return_type
|
|
838
|
+
)
|
|
839
|
+
|
|
840
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
841
|
+
if @api_client.config.debugging
|
|
842
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_transfer_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
843
|
+
end
|
|
844
|
+
return data, status_code, headers
|
|
845
|
+
end
|
|
846
|
+
|
|
773
847
|
# Delete server.
|
|
774
848
|
# Deprovision specific server. Any IP blocks assigned to this server will also be relinquished and deleted. Deprecated: see /servers/{serverId}/actions/deprovision
|
|
775
849
|
# @param server_id [String] The server's ID.
|
|
@@ -802,7 +876,7 @@ module BmcApi
|
|
|
802
876
|
# header parameters
|
|
803
877
|
header_params = opts[:header_params] || {}
|
|
804
878
|
# HTTP header 'Accept' (if needed)
|
|
805
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
879
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
806
880
|
|
|
807
881
|
# form parameters
|
|
808
882
|
form_params = opts[:form_params] || {}
|
|
@@ -865,7 +939,7 @@ module BmcApi
|
|
|
865
939
|
# header parameters
|
|
866
940
|
header_params = opts[:header_params] || {}
|
|
867
941
|
# HTTP header 'Accept' (if needed)
|
|
868
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
942
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
869
943
|
|
|
870
944
|
# form parameters
|
|
871
945
|
form_params = opts[:form_params] || {}
|
|
@@ -940,7 +1014,7 @@ module BmcApi
|
|
|
940
1014
|
# header parameters
|
|
941
1015
|
header_params = opts[:header_params] || {}
|
|
942
1016
|
# HTTP header 'Accept' (if needed)
|
|
943
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1017
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
944
1018
|
# HTTP header 'Content-Type'
|
|
945
1019
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
946
1020
|
if !content_type.nil?
|
|
@@ -1014,7 +1088,7 @@ module BmcApi
|
|
|
1014
1088
|
# header parameters
|
|
1015
1089
|
header_params = opts[:header_params] || {}
|
|
1016
1090
|
# HTTP header 'Accept' (if needed)
|
|
1017
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1091
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1018
1092
|
# HTTP header 'Content-Type'
|
|
1019
1093
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1020
1094
|
if !content_type.nil?
|
|
@@ -1088,7 +1162,7 @@ module BmcApi
|
|
|
1088
1162
|
# header parameters
|
|
1089
1163
|
header_params = opts[:header_params] || {}
|
|
1090
1164
|
# HTTP header 'Accept' (if needed)
|
|
1091
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1165
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1092
1166
|
# HTTP header 'Content-Type'
|
|
1093
1167
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1094
1168
|
if !content_type.nil?
|
|
@@ -1171,7 +1245,7 @@ module BmcApi
|
|
|
1171
1245
|
# header parameters
|
|
1172
1246
|
header_params = opts[:header_params] || {}
|
|
1173
1247
|
# HTTP header 'Accept' (if needed)
|
|
1174
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1248
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1175
1249
|
# HTTP header 'Content-Type'
|
|
1176
1250
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1177
1251
|
if !content_type.nil?
|
|
@@ -1248,7 +1322,7 @@ module BmcApi
|
|
|
1248
1322
|
# header parameters
|
|
1249
1323
|
header_params = opts[:header_params] || {}
|
|
1250
1324
|
# HTTP header 'Accept' (if needed)
|
|
1251
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1325
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1252
1326
|
# HTTP header 'Content-Type'
|
|
1253
1327
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1254
1328
|
if !content_type.nil?
|
|
@@ -1322,7 +1396,7 @@ module BmcApi
|
|
|
1322
1396
|
# header parameters
|
|
1323
1397
|
header_params = opts[:header_params] || {}
|
|
1324
1398
|
# HTTP header 'Accept' (if needed)
|
|
1325
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1399
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1326
1400
|
|
|
1327
1401
|
# form parameters
|
|
1328
1402
|
form_params = opts[:form_params] || {}
|
|
@@ -1400,7 +1474,7 @@ module BmcApi
|
|
|
1400
1474
|
# header parameters
|
|
1401
1475
|
header_params = opts[:header_params] || {}
|
|
1402
1476
|
# HTTP header 'Accept' (if needed)
|
|
1403
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1477
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1404
1478
|
# HTTP header 'Content-Type'
|
|
1405
1479
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1406
1480
|
if !content_type.nil?
|
|
@@ -1477,7 +1551,7 @@ module BmcApi
|
|
|
1477
1551
|
# header parameters
|
|
1478
1552
|
header_params = opts[:header_params] || {}
|
|
1479
1553
|
# HTTP header 'Accept' (if needed)
|
|
1480
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1554
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1481
1555
|
# HTTP header 'Content-Type'
|
|
1482
1556
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1483
1557
|
if !content_type.nil?
|
|
@@ -1551,7 +1625,7 @@ module BmcApi
|
|
|
1551
1625
|
# header parameters
|
|
1552
1626
|
header_params = opts[:header_params] || {}
|
|
1553
1627
|
# HTTP header 'Accept' (if needed)
|
|
1554
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1628
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1555
1629
|
# HTTP header 'Content-Type'
|
|
1556
1630
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1557
1631
|
if !content_type.nil?
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -45,7 +45,7 @@ module BmcApi
|
|
|
45
45
|
# header parameters
|
|
46
46
|
header_params = opts[:header_params] || {}
|
|
47
47
|
# HTTP header 'Accept' (if needed)
|
|
48
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
49
|
|
|
50
50
|
# form parameters
|
|
51
51
|
form_params = opts[:form_params] || {}
|
|
@@ -108,7 +108,7 @@ module BmcApi
|
|
|
108
108
|
# header parameters
|
|
109
109
|
header_params = opts[:header_params] || {}
|
|
110
110
|
# HTTP header 'Accept' (if needed)
|
|
111
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
112
112
|
# HTTP header 'Content-Type'
|
|
113
113
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
114
114
|
if !content_type.nil?
|
|
@@ -176,7 +176,7 @@ module BmcApi
|
|
|
176
176
|
# header parameters
|
|
177
177
|
header_params = opts[:header_params] || {}
|
|
178
178
|
# HTTP header 'Accept' (if needed)
|
|
179
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
179
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
180
180
|
|
|
181
181
|
# form parameters
|
|
182
182
|
form_params = opts[:form_params] || {}
|
|
@@ -239,7 +239,7 @@ module BmcApi
|
|
|
239
239
|
# header parameters
|
|
240
240
|
header_params = opts[:header_params] || {}
|
|
241
241
|
# HTTP header 'Accept' (if needed)
|
|
242
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
242
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
243
243
|
|
|
244
244
|
# form parameters
|
|
245
245
|
form_params = opts[:form_params] || {}
|
|
@@ -308,7 +308,7 @@ module BmcApi
|
|
|
308
308
|
# header parameters
|
|
309
309
|
header_params = opts[:header_params] || {}
|
|
310
310
|
# HTTP header 'Accept' (if needed)
|
|
311
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
311
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
312
312
|
# HTTP header 'Content-Type'
|
|
313
313
|
content_type = @api_client.select_header_content_type(['application/json'])
|
|
314
314
|
if !content_type.nil?
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -52,7 +52,8 @@ module BmcApi
|
|
|
52
52
|
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
|
53
53
|
def call_api(http_method, path, opts = {})
|
|
54
54
|
request = build_request(http_method, path, opts)
|
|
55
|
-
tempfile =
|
|
55
|
+
tempfile = nil
|
|
56
|
+
(download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File'
|
|
56
57
|
response = request.run
|
|
57
58
|
|
|
58
59
|
if @config.debugging
|
|
@@ -191,19 +192,17 @@ module BmcApi
|
|
|
191
192
|
chunk.force_encoding(encoding)
|
|
192
193
|
tempfile.write(chunk)
|
|
193
194
|
end
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
request.on_complete do
|
|
196
|
+
if !tempfile
|
|
197
|
+
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
198
|
+
end
|
|
197
199
|
tempfile.close
|
|
198
200
|
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
|
|
199
201
|
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
|
|
200
202
|
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
|
|
201
203
|
"explicitly with `tempfile.delete`"
|
|
202
|
-
|
|
203
|
-
fail ApiError.new("Failed to create the tempfile based on the HTTP response from the server: #{request.inspect}")
|
|
204
|
+
yield tempfile if block_given?
|
|
204
205
|
end
|
|
205
|
-
|
|
206
|
-
tempfile
|
|
207
206
|
end
|
|
208
207
|
|
|
209
208
|
# Check if the given MIME is a JSON MIME.
|
|
@@ -215,7 +214,7 @@ module BmcApi
|
|
|
215
214
|
# @param [String] mime MIME
|
|
216
215
|
# @return [Boolean] True if the MIME is application/json
|
|
217
216
|
def json_mime?(mime)
|
|
218
|
-
(mime == '*/*') || !(mime =~
|
|
217
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
|
219
218
|
end
|
|
220
219
|
|
|
221
220
|
# Deserialize the response to the given return type.
|
|
@@ -282,9 +281,13 @@ module BmcApi
|
|
|
282
281
|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
|
|
283
282
|
end
|
|
284
283
|
else
|
|
285
|
-
# models (e.g. Pet) or oneOf
|
|
284
|
+
# models (e.g. Pet) or oneOf/anyOf
|
|
286
285
|
klass = BmcApi.const_get(return_type)
|
|
287
|
-
klass.respond_to?(:openapi_one_of)
|
|
286
|
+
if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of)
|
|
287
|
+
klass.build(data)
|
|
288
|
+
else
|
|
289
|
+
klass.build_from_hash(data)
|
|
290
|
+
end
|
|
288
291
|
end
|
|
289
292
|
end
|
|
290
293
|
|
|
@@ -294,7 +297,7 @@ module BmcApi
|
|
|
294
297
|
# @param [String] filename the filename to be sanitized
|
|
295
298
|
# @return [String] the sanitized filename
|
|
296
299
|
def sanitize_filename(filename)
|
|
297
|
-
filename.
|
|
300
|
+
filename.split(/[\/\\]/).last
|
|
298
301
|
end
|
|
299
302
|
|
|
300
303
|
def build_request_url(path, opts = {})
|
|
@@ -394,4 +397,4 @@ module BmcApi
|
|
|
394
397
|
end
|
|
395
398
|
end
|
|
396
399
|
end
|
|
397
|
-
end
|
|
400
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
Generator version: 7.20.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module BmcApi
|
|
14
|
+
class ApiModelBase
|
|
15
|
+
# Deserializes the data based on type
|
|
16
|
+
# @param string type Data type
|
|
17
|
+
# @param string value Value to be deserialized
|
|
18
|
+
# @return [Object] Deserialized data
|
|
19
|
+
def self._deserialize(type, value)
|
|
20
|
+
case type.to_sym
|
|
21
|
+
when :Time
|
|
22
|
+
Time.parse(value)
|
|
23
|
+
when :Date
|
|
24
|
+
Date.parse(value)
|
|
25
|
+
when :String
|
|
26
|
+
value.to_s
|
|
27
|
+
when :Integer
|
|
28
|
+
value.to_i
|
|
29
|
+
when :Float
|
|
30
|
+
value.to_f
|
|
31
|
+
when :Boolean
|
|
32
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
33
|
+
true
|
|
34
|
+
else
|
|
35
|
+
false
|
|
36
|
+
end
|
|
37
|
+
when :Object
|
|
38
|
+
# generic object (usually a Hash), return directly
|
|
39
|
+
value
|
|
40
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
41
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
42
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
43
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
44
|
+
k_type = Regexp.last_match[:k_type]
|
|
45
|
+
v_type = Regexp.last_match[:v_type]
|
|
46
|
+
{}.tap do |hash|
|
|
47
|
+
value.each do |k, v|
|
|
48
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
else # model
|
|
52
|
+
# models (e.g. Pet) or oneOf
|
|
53
|
+
klass = BmcApi.const_get(type)
|
|
54
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns the string representation of the object
|
|
59
|
+
# @return [String] String presentation of the object
|
|
60
|
+
def to_s
|
|
61
|
+
to_hash.to_s
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
65
|
+
# @return [Hash] Returns the object in the form of hash
|
|
66
|
+
def to_body
|
|
67
|
+
to_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Outputs non-array value in the form of hash
|
|
71
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
72
|
+
# @param [Object] value Any valid value
|
|
73
|
+
# @return [Hash] Returns the value in the form of hash
|
|
74
|
+
def _to_hash(value)
|
|
75
|
+
if value.is_a?(Array)
|
|
76
|
+
value.compact.map { |v| _to_hash(v) }
|
|
77
|
+
elsif value.is_a?(Hash)
|
|
78
|
+
{}.tap do |hash|
|
|
79
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
80
|
+
end
|
|
81
|
+
elsif value.respond_to? :to_hash
|
|
82
|
+
value.to_hash
|
|
83
|
+
else
|
|
84
|
+
value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
|
7
7
|
Contact: support@phoenixnap.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -79,6 +79,14 @@ module BmcApi
|
|
|
79
79
|
# @return [true, false]
|
|
80
80
|
attr_accessor :debugging
|
|
81
81
|
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
|
86
|
+
# Default to false.
|
|
87
|
+
# @return [true, false]
|
|
88
|
+
attr_accessor :ignore_operation_servers
|
|
89
|
+
|
|
82
90
|
# Defines the logger used for debugging.
|
|
83
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
|
84
92
|
#
|
|
@@ -166,6 +174,7 @@ module BmcApi
|
|
|
166
174
|
@timeout = 0
|
|
167
175
|
@params_encoding = nil
|
|
168
176
|
@debugging = false
|
|
177
|
+
@ignore_operation_servers = false
|
|
169
178
|
@inject_format = false
|
|
170
179
|
@force_ending_format = false
|
|
171
180
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
|
@@ -200,6 +209,7 @@ module BmcApi
|
|
|
200
209
|
|
|
201
210
|
# Returns base URL for specified operation based on server settings
|
|
202
211
|
def base_url(operation = nil)
|
|
212
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
|
203
213
|
if operation_server_settings.key?(operation) then
|
|
204
214
|
index = server_operation_index.fetch(operation, server_index)
|
|
205
215
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|