oci 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.
Files changed (217) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +82 -0
  3. data/README.md +262 -0
  4. data/lib/oci.rb +25 -0
  5. data/lib/oci/api_client.rb +389 -0
  6. data/lib/oci/config.rb +118 -0
  7. data/lib/oci/config_file_loader.rb +96 -0
  8. data/lib/oci/core/blockstorage_client.rb +462 -0
  9. data/lib/oci/core/compute_client.rb +1415 -0
  10. data/lib/oci/core/core.rb +114 -0
  11. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +137 -0
  12. data/lib/oci/core/models/attach_vnic_details.rb +144 -0
  13. data/lib/oci/core/models/attach_volume_details.rb +165 -0
  14. data/lib/oci/core/models/capture_console_history_details.rb +120 -0
  15. data/lib/oci/core/models/console_history.rb +213 -0
  16. data/lib/oci/core/models/cpe.rb +169 -0
  17. data/lib/oci/core/models/create_cpe_details.rb +145 -0
  18. data/lib/oci/core/models/create_cross_connect_details.rb +204 -0
  19. data/lib/oci/core/models/create_cross_connect_group_details.rb +133 -0
  20. data/lib/oci/core/models/create_dhcp_details.rb +153 -0
  21. data/lib/oci/core/models/create_drg_attachment_details.rb +142 -0
  22. data/lib/oci/core/models/create_drg_details.rb +131 -0
  23. data/lib/oci/core/models/create_image_details.rb +159 -0
  24. data/lib/oci/core/models/create_instance_console_connection_details.rb +131 -0
  25. data/lib/oci/core/models/create_internet_gateway_details.rb +153 -0
  26. data/lib/oci/core/models/create_ip_sec_connection_details.rb +168 -0
  27. data/lib/oci/core/models/create_private_ip_details.rb +173 -0
  28. data/lib/oci/core/models/create_route_table_details.rb +153 -0
  29. data/lib/oci/core/models/create_security_list_details.rb +164 -0
  30. data/lib/oci/core/models/create_subnet_details.rb +257 -0
  31. data/lib/oci/core/models/create_vcn_details.rb +171 -0
  32. data/lib/oci/core/models/create_virtual_circuit_details.rb +260 -0
  33. data/lib/oci/core/models/create_vnic_details.rb +214 -0
  34. data/lib/oci/core/models/create_volume_backup_details.rb +133 -0
  35. data/lib/oci/core/models/create_volume_details.rb +170 -0
  36. data/lib/oci/core/models/cross_connect.rb +235 -0
  37. data/lib/oci/core/models/cross_connect_group.rb +187 -0
  38. data/lib/oci/core/models/cross_connect_location.rb +134 -0
  39. data/lib/oci/core/models/cross_connect_mapping.rb +190 -0
  40. data/lib/oci/core/models/cross_connect_port_speed_shape.rb +137 -0
  41. data/lib/oci/core/models/cross_connect_status.rb +200 -0
  42. data/lib/oci/core/models/dhcp_dns_option.rb +171 -0
  43. data/lib/oci/core/models/dhcp_option.rb +135 -0
  44. data/lib/oci/core/models/dhcp_options.rb +208 -0
  45. data/lib/oci/core/models/dhcp_search_domain_option.rb +141 -0
  46. data/lib/oci/core/models/drg.rb +186 -0
  47. data/lib/oci/core/models/drg_attachment.rb +208 -0
  48. data/lib/oci/core/models/egress_security_rule.rb +198 -0
  49. data/lib/oci/core/models/export_image_details.rb +134 -0
  50. data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +150 -0
  51. data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +130 -0
  52. data/lib/oci/core/models/fast_connect_provider_service.rb +145 -0
  53. data/lib/oci/core/models/i_scsi_volume_attachment.rb +212 -0
  54. data/lib/oci/core/models/icmp_options.rb +131 -0
  55. data/lib/oci/core/models/image.rb +245 -0
  56. data/lib/oci/core/models/image_source_details.rb +134 -0
  57. data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +150 -0
  58. data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +128 -0
  59. data/lib/oci/core/models/ingress_security_rule.rb +198 -0
  60. data/lib/oci/core/models/instance.rb +307 -0
  61. data/lib/oci/core/models/instance_console_connection.rb +193 -0
  62. data/lib/oci/core/models/instance_credentials.rb +131 -0
  63. data/lib/oci/core/models/internet_gateway.rb +210 -0
  64. data/lib/oci/core/models/ip_sec_connection.rb +223 -0
  65. data/lib/oci/core/models/ip_sec_connection_device_config.rb +153 -0
  66. data/lib/oci/core/models/ip_sec_connection_device_status.rb +156 -0
  67. data/lib/oci/core/models/launch_instance_details.rb +336 -0
  68. data/lib/oci/core/models/letter_of_authority.rb +194 -0
  69. data/lib/oci/core/models/port_range.rb +133 -0
  70. data/lib/oci/core/models/private_ip.rb +248 -0
  71. data/lib/oci/core/models/route_rule.rb +135 -0
  72. data/lib/oci/core/models/route_table.rb +208 -0
  73. data/lib/oci/core/models/security_list.rb +219 -0
  74. data/lib/oci/core/models/shape.rb +122 -0
  75. data/lib/oci/core/models/subnet.rb +351 -0
  76. data/lib/oci/core/models/tcp_options.rb +135 -0
  77. data/lib/oci/core/models/tunnel_config.rb +151 -0
  78. data/lib/oci/core/models/tunnel_status.rb +178 -0
  79. data/lib/oci/core/models/udp_options.rb +135 -0
  80. data/lib/oci/core/models/update_cpe_details.rb +122 -0
  81. data/lib/oci/core/models/update_cross_connect_details.rb +138 -0
  82. data/lib/oci/core/models/update_cross_connect_group_details.rb +122 -0
  83. data/lib/oci/core/models/update_dhcp_details.rb +132 -0
  84. data/lib/oci/core/models/update_drg_attachment_details.rb +122 -0
  85. data/lib/oci/core/models/update_drg_details.rb +122 -0
  86. data/lib/oci/core/models/update_image_details.rb +124 -0
  87. data/lib/oci/core/models/update_instance_details.rb +124 -0
  88. data/lib/oci/core/models/update_internet_gateway_details.rb +133 -0
  89. data/lib/oci/core/models/update_ip_sec_connection_details.rb +122 -0
  90. data/lib/oci/core/models/update_private_ip_details.rb +157 -0
  91. data/lib/oci/core/models/update_route_table_details.rb +133 -0
  92. data/lib/oci/core/models/update_security_list_details.rb +144 -0
  93. data/lib/oci/core/models/update_subnet_details.rb +122 -0
  94. data/lib/oci/core/models/update_vcn_details.rb +122 -0
  95. data/lib/oci/core/models/update_virtual_circuit_details.rb +240 -0
  96. data/lib/oci/core/models/update_vnic_details.rb +144 -0
  97. data/lib/oci/core/models/update_volume_backup_details.rb +122 -0
  98. data/lib/oci/core/models/update_volume_details.rb +122 -0
  99. data/lib/oci/core/models/vcn.rb +276 -0
  100. data/lib/oci/core/models/virtual_circuit.rb +395 -0
  101. data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +137 -0
  102. data/lib/oci/core/models/vnic.rb +287 -0
  103. data/lib/oci/core/models/vnic_attachment.rb +250 -0
  104. data/lib/oci/core/models/volume.rb +210 -0
  105. data/lib/oci/core/models/volume_attachment.rb +246 -0
  106. data/lib/oci/core/models/volume_backup.rb +235 -0
  107. data/lib/oci/core/util.rb +1 -0
  108. data/lib/oci/core/virtual_network_client.rb +3421 -0
  109. data/lib/oci/errors.rb +78 -0
  110. data/lib/oci/global_context.rb +20 -0
  111. data/lib/oci/identity/identity.rb +55 -0
  112. data/lib/oci/identity/identity_client.rb +2148 -0
  113. data/lib/oci/identity/models/add_user_to_group_details.rb +131 -0
  114. data/lib/oci/identity/models/api_key.rb +211 -0
  115. data/lib/oci/identity/models/availability_domain.rb +131 -0
  116. data/lib/oci/identity/models/compartment.rb +211 -0
  117. data/lib/oci/identity/models/create_api_key_details.rb +120 -0
  118. data/lib/oci/identity/models/create_compartment_details.rb +145 -0
  119. data/lib/oci/identity/models/create_customer_secret_key_details.rb +121 -0
  120. data/lib/oci/identity/models/create_group_details.rb +144 -0
  121. data/lib/oci/identity/models/create_identity_provider_details.rb +215 -0
  122. data/lib/oci/identity/models/create_idp_group_mapping_details.rb +133 -0
  123. data/lib/oci/identity/models/create_policy_details.rb +173 -0
  124. data/lib/oci/identity/models/create_region_subscription_details.rb +128 -0
  125. data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +154 -0
  126. data/lib/oci/identity/models/create_swift_password_details.rb +121 -0
  127. data/lib/oci/identity/models/create_user_details.rb +144 -0
  128. data/lib/oci/identity/models/customer_secret_key.rb +225 -0
  129. data/lib/oci/identity/models/customer_secret_key_summary.rb +213 -0
  130. data/lib/oci/identity/models/group.rb +211 -0
  131. data/lib/oci/identity/models/identity_provider.rb +261 -0
  132. data/lib/oci/identity/models/idp_group_mapping.rb +220 -0
  133. data/lib/oci/identity/models/policy.rb +237 -0
  134. data/lib/oci/identity/models/region.rb +143 -0
  135. data/lib/oci/identity/models/region_subscription.rb +180 -0
  136. data/lib/oci/identity/models/saml2_identity_provider.rb +180 -0
  137. data/lib/oci/identity/models/swift_password.rb +226 -0
  138. data/lib/oci/identity/models/tenancy.rb +159 -0
  139. data/lib/oci/identity/models/ui_password.rb +187 -0
  140. data/lib/oci/identity/models/update_compartment_details.rb +132 -0
  141. data/lib/oci/identity/models/update_customer_secret_key_details.rb +120 -0
  142. data/lib/oci/identity/models/update_group_details.rb +120 -0
  143. data/lib/oci/identity/models/update_identity_provider_details.rb +160 -0
  144. data/lib/oci/identity/models/update_idp_group_mapping_details.rb +131 -0
  145. data/lib/oci/identity/models/update_policy_details.rb +148 -0
  146. data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +145 -0
  147. data/lib/oci/identity/models/update_state_details.rb +121 -0
  148. data/lib/oci/identity/models/update_swift_password_details.rb +120 -0
  149. data/lib/oci/identity/models/update_user_details.rb +120 -0
  150. data/lib/oci/identity/models/user.rb +217 -0
  151. data/lib/oci/identity/models/user_group_membership.rb +209 -0
  152. data/lib/oci/identity/util.rb +1 -0
  153. data/lib/oci/internal/internal.rb +10 -0
  154. data/lib/oci/internal/util.rb +69 -0
  155. data/lib/oci/load_balancer/load_balancer.rb +51 -0
  156. data/lib/oci/load_balancer/load_balancer_client.rb +1449 -0
  157. data/lib/oci/load_balancer/models/backend.rb +220 -0
  158. data/lib/oci/load_balancer/models/backend_details.rb +206 -0
  159. data/lib/oci/load_balancer/models/backend_health.rb +158 -0
  160. data/lib/oci/load_balancer/models/backend_set.rb +182 -0
  161. data/lib/oci/load_balancer/models/backend_set_details.rb +165 -0
  162. data/lib/oci/load_balancer/models/backend_set_health.rb +207 -0
  163. data/lib/oci/load_balancer/models/certificate.rb +169 -0
  164. data/lib/oci/load_balancer/models/certificate_details.rb +205 -0
  165. data/lib/oci/load_balancer/models/create_backend_details.rb +206 -0
  166. data/lib/oci/load_balancer/models/create_backend_set_details.rb +181 -0
  167. data/lib/oci/load_balancer/models/create_certificate_details.rb +205 -0
  168. data/lib/oci/load_balancer/models/create_listener_details.rb +175 -0
  169. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +220 -0
  170. data/lib/oci/load_balancer/models/health_check_result.rb +183 -0
  171. data/lib/oci/load_balancer/models/health_checker.rb +224 -0
  172. data/lib/oci/load_balancer/models/health_checker_details.rb +223 -0
  173. data/lib/oci/load_balancer/models/ip_address.rb +139 -0
  174. data/lib/oci/load_balancer/models/listener.rb +174 -0
  175. data/lib/oci/load_balancer/models/listener_details.rb +160 -0
  176. data/lib/oci/load_balancer/models/load_balancer.rb +280 -0
  177. data/lib/oci/load_balancer/models/load_balancer_health.rb +215 -0
  178. data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +168 -0
  179. data/lib/oci/load_balancer/models/load_balancer_policy.rb +120 -0
  180. data/lib/oci/load_balancer/models/load_balancer_protocol.rb +120 -0
  181. data/lib/oci/load_balancer/models/load_balancer_shape.rb +120 -0
  182. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +141 -0
  183. data/lib/oci/load_balancer/models/ssl_configuration.rb +155 -0
  184. data/lib/oci/load_balancer/models/ssl_configuration_details.rb +155 -0
  185. data/lib/oci/load_balancer/models/update_backend_details.rb +178 -0
  186. data/lib/oci/load_balancer/models/update_backend_set_details.rb +165 -0
  187. data/lib/oci/load_balancer/models/update_health_checker_details.rb +222 -0
  188. data/lib/oci/load_balancer/models/update_listener_details.rb +160 -0
  189. data/lib/oci/load_balancer/models/update_load_balancer_details.rb +124 -0
  190. data/lib/oci/load_balancer/models/work_request.rb +229 -0
  191. data/lib/oci/load_balancer/models/work_request_error.rb +145 -0
  192. data/lib/oci/load_balancer/util.rb +58 -0
  193. data/lib/oci/object_storage/models/bucket.rb +216 -0
  194. data/lib/oci/object_storage/models/bucket_summary.rb +175 -0
  195. data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +133 -0
  196. data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +131 -0
  197. data/lib/oci/object_storage/models/create_bucket_details.rb +173 -0
  198. data/lib/oci/object_storage/models/create_multipart_upload_details.rb +166 -0
  199. data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +171 -0
  200. data/lib/oci/object_storage/models/list_objects.rb +146 -0
  201. data/lib/oci/object_storage/models/multipart_upload.rb +164 -0
  202. data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +153 -0
  203. data/lib/oci/object_storage/models/object_summary.rb +153 -0
  204. data/lib/oci/object_storage/models/preauthenticated_request.rb +207 -0
  205. data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +196 -0
  206. data/lib/oci/object_storage/models/update_bucket_details.rb +171 -0
  207. data/lib/oci/object_storage/object_storage.rb +30 -0
  208. data/lib/oci/object_storage/object_storage_client.rb +1185 -0
  209. data/lib/oci/object_storage/util.rb +1 -0
  210. data/lib/oci/regions.rb +43 -0
  211. data/lib/oci/response.rb +80 -0
  212. data/lib/oci/response_headers.rb +144 -0
  213. data/lib/oci/signer.rb +157 -0
  214. data/lib/oci/version.rb +5 -0
  215. data/lib/oci/waiter.rb +101 -0
  216. data/lib/oraclebmc.rb +3 -0
  217. metadata +375 -0
@@ -0,0 +1,1415 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require "uri"
4
+ require "logger"
5
+
6
+ module OCI
7
+
8
+ class Core::ComputeClient
9
+
10
+ # Client used to make HTTP requests.
11
+ # @return [OCI::ApiClient]
12
+ attr_reader :api_client
13
+
14
+ # Fully qualified endpoint URL
15
+ # @return [String]
16
+ attr_reader :endpoint
17
+
18
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
19
+ # @return [String]
20
+ attr_accessor :region
21
+
22
+ # Creates a new ComputeClient.
23
+ # If a config is not specified, then the global OCI.config will be used.
24
+ #
25
+ # A region must be specified in either the config or the region parameter. If specified
26
+ # in both, then the region parameter will be used.
27
+ #
28
+ # @param [Config] config A Config object.
29
+ # @param [String] region A region used to determine the service endpoint. This will usually
30
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
31
+ #
32
+ def initialize(config:nil, region:nil)
33
+ config ||= OCI.config
34
+ config.validate
35
+
36
+ signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content)
37
+ @api_client = ApiClient.new(config, signer)
38
+
39
+ region ||= config.region
40
+ self.region = region
41
+ end
42
+
43
+ # Set the region that will be used to determine the service endpoint.
44
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
45
+ # but may be an arbitrary string.
46
+ def region=(r)
47
+ @region = r
48
+
49
+ fail 'A region must be specified.' unless @region
50
+
51
+ @endpoint = OCI::Regions.get_service_endpoint(@region, :ComputeClient) + '/20160918'
52
+ logger.info "ComputeClient endpoint set to '#{endpoint}'." if logger
53
+ end
54
+
55
+ # @return [Logger] The logger for this client. May be nil.
56
+ def logger
57
+ @api_client.config.logger
58
+ end
59
+
60
+
61
+ # Creates a secondary VNIC and attaches it to the specified instance.
62
+ # For more information about secondary VNICs, see
63
+ # [Virtual Network Interface Cards (VNICs)](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm).
64
+ #
65
+ # @param [AttachVnicDetails] attach_vnic_details Attach VNIC details.
66
+ # @param [Hash] opts the optional parameters
67
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
68
+ # server error without risk of executing that same action again. Retry tokens expire after 24
69
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
70
+ # has been deleted and purged from the system, then a retry of the original creation request
71
+ # may be rejected).
72
+ #
73
+ # @return [Response] A Response object with data of type OCI::Core::Models::VnicAttachment
74
+ def attach_vnic(attach_vnic_details, opts = {})
75
+ logger.debug "Calling operation ComputeClient#attach_vnic." if logger
76
+
77
+ fail "Missing the required parameter 'attach_vnic_details' when calling attach_vnic." if attach_vnic_details.nil?
78
+
79
+ path = "/vnicAttachments/"
80
+
81
+ # Query Params
82
+ query_params = {}
83
+
84
+ # Header Params
85
+ header_params = {}
86
+ header_params['accept'] = 'application/json'
87
+ header_params['content-type'] = 'application/json'
88
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
89
+
90
+ post_body = @api_client.object_to_http_body(attach_vnic_details)
91
+
92
+ return @api_client.call_api(
93
+ :POST,
94
+ path,
95
+ endpoint,
96
+ :header_params => header_params,
97
+ :query_params => query_params,
98
+ :body => post_body,
99
+ :return_type => 'OCI::Core::Models::VnicAttachment')
100
+ end
101
+
102
+ # Attaches the specified storage volume to the specified instance.
103
+ #
104
+ # @param [AttachVolumeDetails] attach_volume_details Attach volume request
105
+ # @param [Hash] opts the optional parameters
106
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
107
+ # server error without risk of executing that same action again. Retry tokens expire after 24
108
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
109
+ # has been deleted and purged from the system, then a retry of the original creation request
110
+ # may be rejected).
111
+ #
112
+ # @return [Response] A Response object with data of type OCI::Core::Models::VolumeAttachment
113
+ def attach_volume(attach_volume_details, opts = {})
114
+ logger.debug "Calling operation ComputeClient#attach_volume." if logger
115
+
116
+ fail "Missing the required parameter 'attach_volume_details' when calling attach_volume." if attach_volume_details.nil?
117
+
118
+ path = "/volumeAttachments/"
119
+
120
+ # Query Params
121
+ query_params = {}
122
+
123
+ # Header Params
124
+ header_params = {}
125
+ header_params['accept'] = 'application/json'
126
+ header_params['content-type'] = 'application/json'
127
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
128
+
129
+ post_body = @api_client.object_to_http_body(attach_volume_details)
130
+
131
+ return @api_client.call_api(
132
+ :POST,
133
+ path,
134
+ endpoint,
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :body => post_body,
138
+ :return_type => 'OCI::Core::Models::VolumeAttachment')
139
+ end
140
+
141
+ # Captures the most recent serial console data (up to a megabyte) for the
142
+ # specified instance.
143
+ #
144
+ # The `CaptureConsoleHistory` operation works with the other console history operations
145
+ # as described below.
146
+ #
147
+ # 1. Use `CaptureConsoleHistory` to request the capture of up to a megabyte of the
148
+ # most recent console history. This call returns a `ConsoleHistory`
149
+ # object. The object will have a state of REQUESTED.
150
+ # 2. Wait for the capture operation to succeed by polling `GetConsoleHistory` with
151
+ # the identifier of the console history metadata. The state of the
152
+ # `ConsoleHistory` object will go from REQUESTED to GETTING-HISTORY and
153
+ # then SUCCEEDED (or FAILED).
154
+ # 3. Use `GetConsoleHistoryContent` to get the actual console history data (not the
155
+ # metadata).
156
+ # 4. Optionally, use `DeleteConsoleHistory` to delete the console history metadata
157
+ # and the console history data.
158
+ #
159
+ # @param [CaptureConsoleHistoryDetails] capture_console_history_details Console history details
160
+ # @param [Hash] opts the optional parameters
161
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
162
+ # server error without risk of executing that same action again. Retry tokens expire after 24
163
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
164
+ # has been deleted and purged from the system, then a retry of the original creation request
165
+ # may be rejected).
166
+ #
167
+ # @return [Response] A Response object with data of type OCI::Core::Models::ConsoleHistory
168
+ def capture_console_history(capture_console_history_details, opts = {})
169
+ logger.debug "Calling operation ComputeClient#capture_console_history." if logger
170
+
171
+ fail "Missing the required parameter 'capture_console_history_details' when calling capture_console_history." if capture_console_history_details.nil?
172
+
173
+ path = "/instanceConsoleHistories/"
174
+
175
+ # Query Params
176
+ query_params = {}
177
+
178
+ # Header Params
179
+ header_params = {}
180
+ header_params['accept'] = 'application/json'
181
+ header_params['content-type'] = 'application/json'
182
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
183
+
184
+ post_body = @api_client.object_to_http_body(capture_console_history_details)
185
+
186
+ return @api_client.call_api(
187
+ :POST,
188
+ path,
189
+ endpoint,
190
+ :header_params => header_params,
191
+ :query_params => query_params,
192
+ :body => post_body,
193
+ :return_type => 'OCI::Core::Models::ConsoleHistory')
194
+ end
195
+
196
+ # Creates a boot disk image for the specified instance or imports an exported image from the Oracle Bare Metal Cloud Object Storage Service.
197
+ #
198
+ # When creating a new image, you must provide the OCID of the instance you want to use as the basis for the image, and
199
+ # the OCID of the compartment containing that instance. For more information about images,
200
+ # see [Managing Custom Images](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm).
201
+ #
202
+ # When importing an exported image from the Object Storage Service, you specify the source information
203
+ # in {#image_source_details image_source_details}.
204
+ #
205
+ # When importing an image based on the namespace, bucket name, and object name,
206
+ # use {#image_source_via_object_storage_tuple_details image_source_via_object_storage_tuple_details}.
207
+ #
208
+ # When importing an image based on the Object Storage Service URL, use
209
+ # image_source_via_object_storage_uri_details.
210
+ # See [Object Storage URLs](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and [pre-authenticated requests](https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm#pre-auth)
211
+ # for constructing URLs for image import/export.
212
+ #
213
+ # For more information about importing exported images, see
214
+ # [Image Import/Export](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm).
215
+ #
216
+ # You may optionally specify a *display name* for the image, which is simply a friendly name or description.
217
+ # It does not have to be unique, and you can change it. See {#update_image update_image}.
218
+ # Avoid entering confidential information.
219
+ #
220
+ # @param [CreateImageDetails] create_image_details Image creation details
221
+ # @param [Hash] opts the optional parameters
222
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
223
+ # server error without risk of executing that same action again. Retry tokens expire after 24
224
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
225
+ # has been deleted and purged from the system, then a retry of the original creation request
226
+ # may be rejected).
227
+ #
228
+ # @return [Response] A Response object with data of type OCI::Core::Models::Image
229
+ def create_image(create_image_details, opts = {})
230
+ logger.debug "Calling operation ComputeClient#create_image." if logger
231
+
232
+ fail "Missing the required parameter 'create_image_details' when calling create_image." if create_image_details.nil?
233
+
234
+ path = "/images/"
235
+
236
+ # Query Params
237
+ query_params = {}
238
+
239
+ # Header Params
240
+ header_params = {}
241
+ header_params['accept'] = 'application/json'
242
+ header_params['content-type'] = 'application/json'
243
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
244
+
245
+ post_body = @api_client.object_to_http_body(create_image_details)
246
+
247
+ return @api_client.call_api(
248
+ :POST,
249
+ path,
250
+ endpoint,
251
+ :header_params => header_params,
252
+ :query_params => query_params,
253
+ :body => post_body,
254
+ :return_type => 'OCI::Core::Models::Image')
255
+ end
256
+
257
+ # Create a console connection for an instance.
258
+ # @param [CreateInstanceConsoleConnectionDetails] create_instance_console_connection_details Request object for creating an InstanceConsoleConnection
259
+ # @param [Hash] opts the optional parameters
260
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
261
+ # server error without risk of executing that same action again. Retry tokens expire after 24
262
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
263
+ # has been deleted and purged from the system, then a retry of the original creation request
264
+ # may be rejected).
265
+ #
266
+ # @return [Response] A Response object with data of type OCI::Core::Models::InstanceConsoleConnection
267
+ def create_instance_console_connection(create_instance_console_connection_details, opts = {})
268
+ logger.debug "Calling operation ComputeClient#create_instance_console_connection." if logger
269
+
270
+ fail "Missing the required parameter 'create_instance_console_connection_details' when calling create_instance_console_connection." if create_instance_console_connection_details.nil?
271
+
272
+ path = "/instanceConsoleConnections/"
273
+
274
+ # Query Params
275
+ query_params = {}
276
+
277
+ # Header Params
278
+ header_params = {}
279
+ header_params['accept'] = 'application/json'
280
+ header_params['content-type'] = 'application/json'
281
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
282
+
283
+ post_body = @api_client.object_to_http_body(create_instance_console_connection_details)
284
+
285
+ return @api_client.call_api(
286
+ :POST,
287
+ path,
288
+ endpoint,
289
+ :header_params => header_params,
290
+ :query_params => query_params,
291
+ :body => post_body,
292
+ :return_type => 'OCI::Core::Models::InstanceConsoleConnection')
293
+ end
294
+
295
+ # Deletes the specified console history metadata and the console history data.
296
+ # @param [String] instance_console_history_id The OCID of the console history.
297
+ # @param [Hash] opts the optional parameters
298
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
299
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
300
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
301
+ #
302
+ # @return [Response] A Response object with data of type nil
303
+ def delete_console_history(instance_console_history_id, opts = {})
304
+ logger.debug "Calling operation ComputeClient#delete_console_history." if logger
305
+
306
+ fail "Missing the required parameter 'instance_console_history_id' when calling delete_console_history." if instance_console_history_id.nil?
307
+
308
+ path = "/instanceConsoleHistories/{instanceConsoleHistoryId}".sub('{instanceConsoleHistoryId}', instance_console_history_id.to_s)
309
+
310
+ # Query Params
311
+ query_params = {}
312
+
313
+ # Header Params
314
+ header_params = {}
315
+ header_params['accept'] = 'application/json'
316
+ header_params['content-type'] = 'application/json'
317
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
318
+
319
+ post_body = nil
320
+
321
+ return @api_client.call_api(
322
+ :DELETE,
323
+ path,
324
+ endpoint,
325
+ :header_params => header_params,
326
+ :query_params => query_params,
327
+ :body => post_body)
328
+ end
329
+
330
+ # Deletes an image.
331
+ # @param [String] image_id The OCID of the image.
332
+ # @param [Hash] opts the optional parameters
333
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
334
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
335
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
336
+ #
337
+ # @return [Response] A Response object with data of type nil
338
+ def delete_image(image_id, opts = {})
339
+ logger.debug "Calling operation ComputeClient#delete_image." if logger
340
+
341
+ fail "Missing the required parameter 'image_id' when calling delete_image." if image_id.nil?
342
+
343
+ path = "/images/{imageId}".sub('{imageId}', image_id.to_s)
344
+
345
+ # Query Params
346
+ query_params = {}
347
+
348
+ # Header Params
349
+ header_params = {}
350
+ header_params['accept'] = 'application/json'
351
+ header_params['content-type'] = 'application/json'
352
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
353
+
354
+ post_body = nil
355
+
356
+ return @api_client.call_api(
357
+ :DELETE,
358
+ path,
359
+ endpoint,
360
+ :header_params => header_params,
361
+ :query_params => query_params,
362
+ :body => post_body)
363
+ end
364
+
365
+ # Delete the console connection for an instance
366
+ # @param [String] instance_console_connection_id The OCID of the intance console connection
367
+ # @param [Hash] opts the optional parameters
368
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
369
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
370
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
371
+ #
372
+ # @return [Response] A Response object with data of type nil
373
+ def delete_instance_console_connection(instance_console_connection_id, opts = {})
374
+ logger.debug "Calling operation ComputeClient#delete_instance_console_connection." if logger
375
+
376
+ fail "Missing the required parameter 'instance_console_connection_id' when calling delete_instance_console_connection." if instance_console_connection_id.nil?
377
+
378
+ path = "/instanceConsoleConnections/{instanceConsoleConnectionId}".sub('{instanceConsoleConnectionId}', instance_console_connection_id.to_s)
379
+
380
+ # Query Params
381
+ query_params = {}
382
+
383
+ # Header Params
384
+ header_params = {}
385
+ header_params['accept'] = 'application/json'
386
+ header_params['content-type'] = 'application/json'
387
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
388
+
389
+ post_body = nil
390
+
391
+ return @api_client.call_api(
392
+ :DELETE,
393
+ path,
394
+ endpoint,
395
+ :header_params => header_params,
396
+ :query_params => query_params,
397
+ :body => post_body)
398
+ end
399
+
400
+ # Detaches and deletes the specified secondary VNIC.
401
+ # This operation cannot be used on the instance's primary VNIC.
402
+ # When you terminate an instance, all attached VNICs (primary
403
+ # and secondary) are automatically detached and deleted.
404
+ #
405
+ # @param [String] vnic_attachment_id The OCID of the VNIC attachment.
406
+ # @param [Hash] opts the optional parameters
407
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
408
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
409
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
410
+ #
411
+ # @return [Response] A Response object with data of type nil
412
+ def detach_vnic(vnic_attachment_id, opts = {})
413
+ logger.debug "Calling operation ComputeClient#detach_vnic." if logger
414
+
415
+ fail "Missing the required parameter 'vnic_attachment_id' when calling detach_vnic." if vnic_attachment_id.nil?
416
+
417
+ path = "/vnicAttachments/{vnicAttachmentId}".sub('{vnicAttachmentId}', vnic_attachment_id.to_s)
418
+
419
+ # Query Params
420
+ query_params = {}
421
+
422
+ # Header Params
423
+ header_params = {}
424
+ header_params['accept'] = 'application/json'
425
+ header_params['content-type'] = 'application/json'
426
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
427
+
428
+ post_body = nil
429
+
430
+ return @api_client.call_api(
431
+ :DELETE,
432
+ path,
433
+ endpoint,
434
+ :header_params => header_params,
435
+ :query_params => query_params,
436
+ :body => post_body)
437
+ end
438
+
439
+ # Detaches a storage volume from an instance. You must specify the OCID of the volume attachment.
440
+ #
441
+ # This is an asynchronous operation. The attachment's `lifecycleState` will change to DETACHING temporarily
442
+ # until the attachment is completely removed.
443
+ #
444
+ # @param [String] volume_attachment_id The OCID of the volume attachment.
445
+ # @param [Hash] opts the optional parameters
446
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
447
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
448
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
449
+ #
450
+ # @return [Response] A Response object with data of type nil
451
+ def detach_volume(volume_attachment_id, opts = {})
452
+ logger.debug "Calling operation ComputeClient#detach_volume." if logger
453
+
454
+ fail "Missing the required parameter 'volume_attachment_id' when calling detach_volume." if volume_attachment_id.nil?
455
+
456
+ path = "/volumeAttachments/{volumeAttachmentId}".sub('{volumeAttachmentId}', volume_attachment_id.to_s)
457
+
458
+ # Query Params
459
+ query_params = {}
460
+
461
+ # Header Params
462
+ header_params = {}
463
+ header_params['accept'] = 'application/json'
464
+ header_params['content-type'] = 'application/json'
465
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
466
+
467
+ post_body = nil
468
+
469
+ return @api_client.call_api(
470
+ :DELETE,
471
+ path,
472
+ endpoint,
473
+ :header_params => header_params,
474
+ :query_params => query_params,
475
+ :body => post_body)
476
+ end
477
+
478
+ # Exports the specified image to the Oracle Bare Metal Cloud Object Storage Service. You can use the Object Storage Service URL,
479
+ # or the namespace, bucket name, and object name when specifying the location to export to.
480
+ #
481
+ # For more information about exporting images, see [Image Import/Export](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm).
482
+ #
483
+ # To perform an image export, you need write access to the Object Storage Service bucket for the image,
484
+ # see [Let Users Write Objects to Object Storage Buckets](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm#Let4).
485
+ #
486
+ # See [Object Storage URLs](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and [pre-authenticated requests](https://docs.us-phoenix-1.oraclecloud.com/Content/Object/Tasks/managingaccess.htm#pre-auth)
487
+ # for constructing URLs for image import/export.
488
+ #
489
+ # @param [String] image_id The OCID of the image.
490
+ # @param [ExportImageDetails] export_image_details Details for the image export.
491
+ # @param [Hash] opts the optional parameters
492
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
493
+ # server error without risk of executing that same action again. Retry tokens expire after 24
494
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
495
+ # has been deleted and purged from the system, then a retry of the original creation request
496
+ # may be rejected).
497
+ #
498
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
499
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
500
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
501
+ #
502
+ # @return [Response] A Response object with data of type OCI::Core::Models::Image
503
+ def export_image(image_id, export_image_details, opts = {})
504
+ logger.debug "Calling operation ComputeClient#export_image." if logger
505
+
506
+ fail "Missing the required parameter 'image_id' when calling export_image." if image_id.nil?
507
+ fail "Missing the required parameter 'export_image_details' when calling export_image." if export_image_details.nil?
508
+
509
+ path = "/images/{imageId}/actions/export".sub('{imageId}', image_id.to_s)
510
+
511
+ # Query Params
512
+ query_params = {}
513
+
514
+ # Header Params
515
+ header_params = {}
516
+ header_params['accept'] = 'application/json'
517
+ header_params['content-type'] = 'application/json'
518
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
519
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
520
+
521
+ post_body = @api_client.object_to_http_body(export_image_details)
522
+
523
+ return @api_client.call_api(
524
+ :POST,
525
+ path,
526
+ endpoint,
527
+ :header_params => header_params,
528
+ :query_params => query_params,
529
+ :body => post_body,
530
+ :return_type => 'OCI::Core::Models::Image')
531
+ end
532
+
533
+ # Shows the metadata for the specified console history.
534
+ # See {#capture_console_history capture_console_history}
535
+ # for details about using the console history operations.
536
+ #
537
+ # @param [String] instance_console_history_id The OCID of the console history.
538
+ # @param [Hash] opts the optional parameters
539
+ # @return [Response] A Response object with data of type OCI::Core::Models::ConsoleHistory
540
+ def get_console_history(instance_console_history_id, opts = {})
541
+ logger.debug "Calling operation ComputeClient#get_console_history." if logger
542
+
543
+ fail "Missing the required parameter 'instance_console_history_id' when calling get_console_history." if instance_console_history_id.nil?
544
+
545
+ path = "/instanceConsoleHistories/{instanceConsoleHistoryId}".sub('{instanceConsoleHistoryId}', instance_console_history_id.to_s)
546
+
547
+ # Query Params
548
+ query_params = {}
549
+
550
+ # Header Params
551
+ header_params = {}
552
+ header_params['accept'] = 'application/json'
553
+ header_params['content-type'] = 'application/json'
554
+
555
+ post_body = nil
556
+
557
+ return @api_client.call_api(
558
+ :GET,
559
+ path,
560
+ endpoint,
561
+ :header_params => header_params,
562
+ :query_params => query_params,
563
+ :body => post_body,
564
+ :return_type => 'OCI::Core::Models::ConsoleHistory')
565
+ end
566
+
567
+ # Gets the actual console history data (not the metadata).
568
+ # See {#capture_console_history capture_console_history}
569
+ # for details about using the console history operations.
570
+ #
571
+ # @param [String] instance_console_history_id The OCID of the console history.
572
+ # @param [Hash] opts the optional parameters
573
+ # @option opts [Integer] :offset Offset of the snapshot data to retrieve.
574
+ # @option opts [Integer] :length Length of the snapshot data to retrieve.
575
+ # @return [Response] A Response object with data of type String
576
+ def get_console_history_content(instance_console_history_id, opts = {})
577
+ logger.debug "Calling operation ComputeClient#get_console_history_content." if logger
578
+
579
+ fail "Missing the required parameter 'instance_console_history_id' when calling get_console_history_content." if instance_console_history_id.nil?
580
+
581
+ path = "/instanceConsoleHistories/{instanceConsoleHistoryId}/data".sub('{instanceConsoleHistoryId}', instance_console_history_id.to_s)
582
+
583
+ # Query Params
584
+ query_params = {}
585
+ query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
586
+ query_params[:'length'] = opts[:'length'] if opts[:'length']
587
+
588
+ # Header Params
589
+ header_params = {}
590
+ header_params['accept'] = 'application/json'
591
+ header_params['content-type'] = 'application/json'
592
+
593
+ post_body = nil
594
+
595
+ return @api_client.call_api(
596
+ :GET,
597
+ path,
598
+ endpoint,
599
+ :header_params => header_params,
600
+ :query_params => query_params,
601
+ :body => post_body,
602
+ :return_type => 'String')
603
+ end
604
+
605
+ # Gets the specified image.
606
+ # @param [String] image_id The OCID of the image.
607
+ # @param [Hash] opts the optional parameters
608
+ # @return [Response] A Response object with data of type OCI::Core::Models::Image
609
+ def get_image(image_id, opts = {})
610
+ logger.debug "Calling operation ComputeClient#get_image." if logger
611
+
612
+ fail "Missing the required parameter 'image_id' when calling get_image." if image_id.nil?
613
+
614
+ path = "/images/{imageId}".sub('{imageId}', image_id.to_s)
615
+
616
+ # Query Params
617
+ query_params = {}
618
+
619
+ # Header Params
620
+ header_params = {}
621
+ header_params['accept'] = 'application/json'
622
+ header_params['content-type'] = 'application/json'
623
+
624
+ post_body = nil
625
+
626
+ return @api_client.call_api(
627
+ :GET,
628
+ path,
629
+ endpoint,
630
+ :header_params => header_params,
631
+ :query_params => query_params,
632
+ :body => post_body,
633
+ :return_type => 'OCI::Core::Models::Image')
634
+ end
635
+
636
+ # Gets information about the specified instance.
637
+ # @param [String] instance_id The OCID of the instance.
638
+ # @param [Hash] opts the optional parameters
639
+ # @return [Response] A Response object with data of type OCI::Core::Models::Instance
640
+ def get_instance(instance_id, opts = {})
641
+ logger.debug "Calling operation ComputeClient#get_instance." if logger
642
+
643
+ fail "Missing the required parameter 'instance_id' when calling get_instance." if instance_id.nil?
644
+
645
+ path = "/instances/{instanceId}".sub('{instanceId}', instance_id.to_s)
646
+
647
+ # Query Params
648
+ query_params = {}
649
+
650
+ # Header Params
651
+ header_params = {}
652
+ header_params['accept'] = 'application/json'
653
+ header_params['content-type'] = 'application/json'
654
+
655
+ post_body = nil
656
+
657
+ return @api_client.call_api(
658
+ :GET,
659
+ path,
660
+ endpoint,
661
+ :header_params => header_params,
662
+ :query_params => query_params,
663
+ :body => post_body,
664
+ :return_type => 'OCI::Core::Models::Instance')
665
+ end
666
+
667
+ # Get the details of an instance console connection
668
+ # @param [String] instance_console_connection_id The OCID of the intance console connection
669
+ # @param [Hash] opts the optional parameters
670
+ # @return [Response] A Response object with data of type OCI::Core::Models::InstanceConsoleConnection
671
+ def get_instance_console_connection(instance_console_connection_id, opts = {})
672
+ logger.debug "Calling operation ComputeClient#get_instance_console_connection." if logger
673
+
674
+ fail "Missing the required parameter 'instance_console_connection_id' when calling get_instance_console_connection." if instance_console_connection_id.nil?
675
+
676
+ path = "/instanceConsoleConnections/{instanceConsoleConnectionId}".sub('{instanceConsoleConnectionId}', instance_console_connection_id.to_s)
677
+
678
+ # Query Params
679
+ query_params = {}
680
+
681
+ # Header Params
682
+ header_params = {}
683
+ header_params['accept'] = 'application/json'
684
+ header_params['content-type'] = 'application/json'
685
+
686
+ post_body = nil
687
+
688
+ return @api_client.call_api(
689
+ :GET,
690
+ path,
691
+ endpoint,
692
+ :header_params => header_params,
693
+ :query_params => query_params,
694
+ :body => post_body,
695
+ :return_type => 'OCI::Core::Models::InstanceConsoleConnection')
696
+ end
697
+
698
+ # Gets the information for the specified VNIC attachment.
699
+ #
700
+ # @param [String] vnic_attachment_id The OCID of the VNIC attachment.
701
+ # @param [Hash] opts the optional parameters
702
+ # @return [Response] A Response object with data of type OCI::Core::Models::VnicAttachment
703
+ def get_vnic_attachment(vnic_attachment_id, opts = {})
704
+ logger.debug "Calling operation ComputeClient#get_vnic_attachment." if logger
705
+
706
+ fail "Missing the required parameter 'vnic_attachment_id' when calling get_vnic_attachment." if vnic_attachment_id.nil?
707
+
708
+ path = "/vnicAttachments/{vnicAttachmentId}".sub('{vnicAttachmentId}', vnic_attachment_id.to_s)
709
+
710
+ # Query Params
711
+ query_params = {}
712
+
713
+ # Header Params
714
+ header_params = {}
715
+ header_params['accept'] = 'application/json'
716
+ header_params['content-type'] = 'application/json'
717
+
718
+ post_body = nil
719
+
720
+ return @api_client.call_api(
721
+ :GET,
722
+ path,
723
+ endpoint,
724
+ :header_params => header_params,
725
+ :query_params => query_params,
726
+ :body => post_body,
727
+ :return_type => 'OCI::Core::Models::VnicAttachment')
728
+ end
729
+
730
+ # Gets information about the specified volume attachment.
731
+ # @param [String] volume_attachment_id The OCID of the volume attachment.
732
+ # @param [Hash] opts the optional parameters
733
+ # @return [Response] A Response object with data of type OCI::Core::Models::VolumeAttachment
734
+ def get_volume_attachment(volume_attachment_id, opts = {})
735
+ logger.debug "Calling operation ComputeClient#get_volume_attachment." if logger
736
+
737
+ fail "Missing the required parameter 'volume_attachment_id' when calling get_volume_attachment." if volume_attachment_id.nil?
738
+
739
+ path = "/volumeAttachments/{volumeAttachmentId}".sub('{volumeAttachmentId}', volume_attachment_id.to_s)
740
+
741
+ # Query Params
742
+ query_params = {}
743
+
744
+ # Header Params
745
+ header_params = {}
746
+ header_params['accept'] = 'application/json'
747
+ header_params['content-type'] = 'application/json'
748
+
749
+ post_body = nil
750
+
751
+ return @api_client.call_api(
752
+ :GET,
753
+ path,
754
+ endpoint,
755
+ :header_params => header_params,
756
+ :query_params => query_params,
757
+ :body => post_body,
758
+ :return_type => 'OCI::Core::Models::VolumeAttachment')
759
+ end
760
+
761
+ # Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials
762
+ # are only valid for the initial login.
763
+ #
764
+ # @param [String] instance_id The OCID of the instance.
765
+ # @param [Hash] opts the optional parameters
766
+ # @return [Response] A Response object with data of type OCI::Core::Models::InstanceCredentials
767
+ def get_windows_instance_initial_credentials(instance_id, opts = {})
768
+ logger.debug "Calling operation ComputeClient#get_windows_instance_initial_credentials." if logger
769
+
770
+ fail "Missing the required parameter 'instance_id' when calling get_windows_instance_initial_credentials." if instance_id.nil?
771
+
772
+ path = "/instances/{instanceId}/initialCredentials".sub('{instanceId}', instance_id.to_s)
773
+
774
+ # Query Params
775
+ query_params = {}
776
+
777
+ # Header Params
778
+ header_params = {}
779
+ header_params['accept'] = 'application/json'
780
+ header_params['content-type'] = 'application/json'
781
+
782
+ post_body = nil
783
+
784
+ return @api_client.call_api(
785
+ :GET,
786
+ path,
787
+ endpoint,
788
+ :header_params => header_params,
789
+ :query_params => query_params,
790
+ :body => post_body,
791
+ :return_type => 'OCI::Core::Models::InstanceCredentials')
792
+ end
793
+
794
+ # Performs one of the power actions (start, stop, softreset, or reset)
795
+ # on the specified instance.
796
+ #
797
+ # **start** - power on
798
+ #
799
+ # **stop** - power off
800
+ #
801
+ # **softreset** - ACPI shutdown and power on
802
+ #
803
+ # **reset** - power off and power on
804
+ #
805
+ # Note that the **stop** state has no effect on the resources you consume.
806
+ # Billing continues for instances that you stop, and related resources continue
807
+ # to apply against any relevant quotas. You must terminate an instance
808
+ # ({#terminate_instance terminate_instance})
809
+ # to remove its resources from billing and quotas.
810
+ #
811
+ # @param [String] instance_id The OCID of the instance.
812
+ # @param [String] action The action to perform on the instance.
813
+ # @param [Hash] opts the optional parameters
814
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
815
+ # server error without risk of executing that same action again. Retry tokens expire after 24
816
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
817
+ # has been deleted and purged from the system, then a retry of the original creation request
818
+ # may be rejected).
819
+ #
820
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
821
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
822
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
823
+ #
824
+ # @return [Response] A Response object with data of type OCI::Core::Models::Instance
825
+ def instance_action(instance_id, action, opts = {})
826
+ logger.debug "Calling operation ComputeClient#instance_action." if logger
827
+
828
+ fail "Missing the required parameter 'instance_id' when calling instance_action." if instance_id.nil?
829
+ fail "Missing the required parameter 'action' when calling instance_action." if action.nil?
830
+ unless ['STOP', 'START', 'SOFTRESET', 'RESET'].include?(action)
831
+ fail "Invalid value for 'action', must be one of STOP, START, SOFTRESET, RESET."
832
+ end
833
+
834
+ path = "/instances/{instanceId}".sub('{instanceId}', instance_id.to_s)
835
+
836
+ # Query Params
837
+ query_params = {}
838
+ query_params[:'action'] = action
839
+
840
+ # Header Params
841
+ header_params = {}
842
+ header_params['accept'] = 'application/json'
843
+ header_params['content-type'] = 'application/json'
844
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
845
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
846
+
847
+ post_body = nil
848
+
849
+ return @api_client.call_api(
850
+ :POST,
851
+ path,
852
+ endpoint,
853
+ :header_params => header_params,
854
+ :query_params => query_params,
855
+ :body => post_body,
856
+ :return_type => 'OCI::Core::Models::Instance')
857
+ end
858
+
859
+ # Creates a new instance in the specified compartment and the specified Availability Domain.
860
+ # For general information about instances, see
861
+ # [Overview of the Compute Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm).
862
+ #
863
+ # For information about access control and compartments, see
864
+ # [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).
865
+ #
866
+ # For information about Availability Domains, see
867
+ # [Regions and Availability Domains](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm).
868
+ # To get a list of Availability Domains, use the `ListAvailabilityDomains` operation
869
+ # in the Identity and Access Management Service API.
870
+ #
871
+ # All Oracle Bare Metal Cloud Services resources, including instances, get an Oracle-assigned,
872
+ # unique ID called an Oracle Cloud Identifier (OCID).
873
+ # When you create a resource, you can find its OCID in the response. You can
874
+ # also retrieve a resource's OCID by using a List API operation
875
+ # on that resource type, or by viewing the resource in the Console.
876
+ #
877
+ # When you launch an instance, it is automatically attached to a virtual
878
+ # network interface card (VNIC), called the *primary VNIC*. The VNIC
879
+ # has a private IP address from the subnet's CIDR. You can either assign a
880
+ # private IP address of your choice or let Oracle automatically assign one.
881
+ # You can choose whether the instance has a public IP address. To retrieve the
882
+ # addresses, use the {#list_vnic_attachments list_vnic_attachments}
883
+ # operation to get the VNIC ID for the instance, and then call
884
+ # {#get_vnic get_vnic} with the VNIC ID.
885
+ #
886
+ # You can later add secondary VNICs to an instance. For more information, see
887
+ # [Virtual Network Interface Cards (VNICs)](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingVNICs.htm).
888
+ #
889
+ # @param [LaunchInstanceDetails] launch_instance_details Instance details
890
+ # @param [Hash] opts the optional parameters
891
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
892
+ # server error without risk of executing that same action again. Retry tokens expire after 24
893
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
894
+ # has been deleted and purged from the system, then a retry of the original creation request
895
+ # may be rejected).
896
+ #
897
+ # @return [Response] A Response object with data of type OCI::Core::Models::Instance
898
+ def launch_instance(launch_instance_details, opts = {})
899
+ logger.debug "Calling operation ComputeClient#launch_instance." if logger
900
+
901
+ fail "Missing the required parameter 'launch_instance_details' when calling launch_instance." if launch_instance_details.nil?
902
+
903
+ path = "/instances/"
904
+
905
+ # Query Params
906
+ query_params = {}
907
+
908
+ # Header Params
909
+ header_params = {}
910
+ header_params['accept'] = 'application/json'
911
+ header_params['content-type'] = 'application/json'
912
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
913
+
914
+ post_body = @api_client.object_to_http_body(launch_instance_details)
915
+
916
+ return @api_client.call_api(
917
+ :POST,
918
+ path,
919
+ endpoint,
920
+ :header_params => header_params,
921
+ :query_params => query_params,
922
+ :body => post_body,
923
+ :return_type => 'OCI::Core::Models::Instance')
924
+ end
925
+
926
+ # Lists the console history metadata for the specified compartment or instance.
927
+ #
928
+ # @param [String] compartment_id The OCID of the compartment.
929
+ # @param [Hash] opts the optional parameters
930
+ # @option opts [String] :availability_domain The name of the Availability Domain.
931
+ #
932
+ # Example: `Uocm:PHX-AD-1`
933
+ #
934
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
935
+ #
936
+ # Example: `500`
937
+ #
938
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
939
+ #
940
+ # @option opts [String] :instance_id The OCID of the instance.
941
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::ConsoleHistory>
942
+ def list_console_histories(compartment_id, opts = {})
943
+ logger.debug "Calling operation ComputeClient#list_console_histories." if logger
944
+
945
+ fail "Missing the required parameter 'compartment_id' when calling list_console_histories." if compartment_id.nil?
946
+
947
+ path = "/instanceConsoleHistories/"
948
+
949
+ # Query Params
950
+ query_params = {}
951
+ query_params[:'compartmentId'] = compartment_id
952
+ query_params[:'availabilityDomain'] = opts[:'availability_domain'] if opts[:'availability_domain']
953
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
954
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
955
+ query_params[:'instanceId'] = opts[:'instance_id'] if opts[:'instance_id']
956
+
957
+ # Header Params
958
+ header_params = {}
959
+ header_params['accept'] = 'application/json'
960
+ header_params['content-type'] = 'application/json'
961
+
962
+ post_body = nil
963
+
964
+ return @api_client.call_api(
965
+ :GET,
966
+ path,
967
+ endpoint,
968
+ :header_params => header_params,
969
+ :query_params => query_params,
970
+ :body => post_body,
971
+ :return_type => 'Array<OCI::Core::Models::ConsoleHistory>')
972
+ end
973
+
974
+ # Lists the available images in the specified compartment. For more
975
+ # information about images, see
976
+ # [Managing Custom Images](https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm).
977
+ #
978
+ # @param [String] compartment_id The OCID of the compartment.
979
+ # @param [Hash] opts the optional parameters
980
+ # @option opts [String] :display_name A user-friendly name. Does not have to be unique, and it's changeable.
981
+ # Avoid entering confidential information.
982
+ #
983
+ # Example: `My new resource`
984
+ #
985
+ # @option opts [String] :operating_system The image's operating system.
986
+ #
987
+ # Example: `Oracle Linux`
988
+ #
989
+ # @option opts [String] :operating_system_version The image's operating system version.
990
+ #
991
+ # Example: `7.2`
992
+ #
993
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
994
+ #
995
+ # Example: `500`
996
+ #
997
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
998
+ #
999
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::Image>
1000
+ def list_images(compartment_id, opts = {})
1001
+ logger.debug "Calling operation ComputeClient#list_images." if logger
1002
+
1003
+ fail "Missing the required parameter 'compartment_id' when calling list_images." if compartment_id.nil?
1004
+
1005
+ path = "/images/"
1006
+
1007
+ # Query Params
1008
+ query_params = {}
1009
+ query_params[:'compartmentId'] = compartment_id
1010
+ query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name']
1011
+ query_params[:'operatingSystem'] = opts[:'operating_system'] if opts[:'operating_system']
1012
+ query_params[:'operatingSystemVersion'] = opts[:'operating_system_version'] if opts[:'operating_system_version']
1013
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1014
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1015
+
1016
+ # Header Params
1017
+ header_params = {}
1018
+ header_params['accept'] = 'application/json'
1019
+ header_params['content-type'] = 'application/json'
1020
+
1021
+ post_body = nil
1022
+
1023
+ return @api_client.call_api(
1024
+ :GET,
1025
+ path,
1026
+ endpoint,
1027
+ :header_params => header_params,
1028
+ :query_params => query_params,
1029
+ :body => post_body,
1030
+ :return_type => 'Array<OCI::Core::Models::Image>')
1031
+ end
1032
+
1033
+ # Lists the console connections for the specified compartment or instance that have not been deleted.
1034
+ # @param [String] compartment_id The OCID of the compartment.
1035
+ # @param [Hash] opts the optional parameters
1036
+ # @option opts [String] :instance_id The OCID of the instance.
1037
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
1038
+ #
1039
+ # Example: `500`
1040
+ #
1041
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
1042
+ #
1043
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::InstanceConsoleConnection>
1044
+ def list_instance_console_connections(compartment_id, opts = {})
1045
+ logger.debug "Calling operation ComputeClient#list_instance_console_connections." if logger
1046
+
1047
+ fail "Missing the required parameter 'compartment_id' when calling list_instance_console_connections." if compartment_id.nil?
1048
+
1049
+ path = "/instanceConsoleConnections/"
1050
+
1051
+ # Query Params
1052
+ query_params = {}
1053
+ query_params[:'compartmentId'] = compartment_id
1054
+ query_params[:'instanceId'] = opts[:'instance_id'] if opts[:'instance_id']
1055
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1056
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1057
+
1058
+ # Header Params
1059
+ header_params = {}
1060
+ header_params['accept'] = 'application/json'
1061
+ header_params['content-type'] = 'application/json'
1062
+
1063
+ post_body = nil
1064
+
1065
+ return @api_client.call_api(
1066
+ :GET,
1067
+ path,
1068
+ endpoint,
1069
+ :header_params => header_params,
1070
+ :query_params => query_params,
1071
+ :body => post_body,
1072
+ :return_type => 'Array<OCI::Core::Models::InstanceConsoleConnection>')
1073
+ end
1074
+
1075
+ # Lists the instances in the specified compartment and the specified Availability Domain.
1076
+ # You can filter the results by specifying an instance name (the list will include all the identically-named
1077
+ # instances in the compartment).
1078
+ #
1079
+ # @param [String] compartment_id The OCID of the compartment.
1080
+ # @param [Hash] opts the optional parameters
1081
+ # @option opts [String] :availability_domain The name of the Availability Domain.
1082
+ #
1083
+ # Example: `Uocm:PHX-AD-1`
1084
+ #
1085
+ # @option opts [String] :display_name A user-friendly name. Does not have to be unique, and it's changeable.
1086
+ # Avoid entering confidential information.
1087
+ #
1088
+ # Example: `My new resource`
1089
+ #
1090
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
1091
+ #
1092
+ # Example: `500`
1093
+ #
1094
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
1095
+ #
1096
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::Instance>
1097
+ def list_instances(compartment_id, opts = {})
1098
+ logger.debug "Calling operation ComputeClient#list_instances." if logger
1099
+
1100
+ fail "Missing the required parameter 'compartment_id' when calling list_instances." if compartment_id.nil?
1101
+
1102
+ path = "/instances/"
1103
+
1104
+ # Query Params
1105
+ query_params = {}
1106
+ query_params[:'compartmentId'] = compartment_id
1107
+ query_params[:'availabilityDomain'] = opts[:'availability_domain'] if opts[:'availability_domain']
1108
+ query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name']
1109
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1110
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1111
+
1112
+ # Header Params
1113
+ header_params = {}
1114
+ header_params['accept'] = 'application/json'
1115
+ header_params['content-type'] = 'application/json'
1116
+
1117
+ post_body = nil
1118
+
1119
+ return @api_client.call_api(
1120
+ :GET,
1121
+ path,
1122
+ endpoint,
1123
+ :header_params => header_params,
1124
+ :query_params => query_params,
1125
+ :body => post_body,
1126
+ :return_type => 'Array<OCI::Core::Models::Instance>')
1127
+ end
1128
+
1129
+ # Lists the shapes that can be used to launch an instance within the specified compartment. You can
1130
+ # filter the list by compatibility with a specific image.
1131
+ #
1132
+ # @param [String] compartment_id The OCID of the compartment.
1133
+ # @param [Hash] opts the optional parameters
1134
+ # @option opts [String] :availability_domain The name of the Availability Domain.
1135
+ #
1136
+ # Example: `Uocm:PHX-AD-1`
1137
+ #
1138
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
1139
+ #
1140
+ # Example: `500`
1141
+ #
1142
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
1143
+ #
1144
+ # @option opts [String] :image_id The OCID of an image.
1145
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::Shape>
1146
+ def list_shapes(compartment_id, opts = {})
1147
+ logger.debug "Calling operation ComputeClient#list_shapes." if logger
1148
+
1149
+ fail "Missing the required parameter 'compartment_id' when calling list_shapes." if compartment_id.nil?
1150
+
1151
+ path = "/shapes"
1152
+
1153
+ # Query Params
1154
+ query_params = {}
1155
+ query_params[:'compartmentId'] = compartment_id
1156
+ query_params[:'availabilityDomain'] = opts[:'availability_domain'] if opts[:'availability_domain']
1157
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1158
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1159
+ query_params[:'imageId'] = opts[:'image_id'] if opts[:'image_id']
1160
+
1161
+ # Header Params
1162
+ header_params = {}
1163
+ header_params['accept'] = 'application/json'
1164
+ header_params['content-type'] = 'application/json'
1165
+
1166
+ post_body = nil
1167
+
1168
+ return @api_client.call_api(
1169
+ :GET,
1170
+ path,
1171
+ endpoint,
1172
+ :header_params => header_params,
1173
+ :query_params => query_params,
1174
+ :body => post_body,
1175
+ :return_type => 'Array<OCI::Core::Models::Shape>')
1176
+ end
1177
+
1178
+ # Lists the VNIC attachments in the specified compartment. A VNIC attachment
1179
+ # resides in the same compartment as the attached instance. The list can be
1180
+ # filtered by instance, VNIC, or Availability Domain.
1181
+ #
1182
+ # @param [String] compartment_id The OCID of the compartment.
1183
+ # @param [Hash] opts the optional parameters
1184
+ # @option opts [String] :availability_domain The name of the Availability Domain.
1185
+ #
1186
+ # Example: `Uocm:PHX-AD-1`
1187
+ #
1188
+ # @option opts [String] :instance_id The OCID of the instance.
1189
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
1190
+ #
1191
+ # Example: `500`
1192
+ #
1193
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
1194
+ #
1195
+ # @option opts [String] :vnic_id The OCID of the VNIC.
1196
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::VnicAttachment>
1197
+ def list_vnic_attachments(compartment_id, opts = {})
1198
+ logger.debug "Calling operation ComputeClient#list_vnic_attachments." if logger
1199
+
1200
+ fail "Missing the required parameter 'compartment_id' when calling list_vnic_attachments." if compartment_id.nil?
1201
+
1202
+ path = "/vnicAttachments/"
1203
+
1204
+ # Query Params
1205
+ query_params = {}
1206
+ query_params[:'compartmentId'] = compartment_id
1207
+ query_params[:'availabilityDomain'] = opts[:'availability_domain'] if opts[:'availability_domain']
1208
+ query_params[:'instanceId'] = opts[:'instance_id'] if opts[:'instance_id']
1209
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1210
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1211
+ query_params[:'vnicId'] = opts[:'vnic_id'] if opts[:'vnic_id']
1212
+
1213
+ # Header Params
1214
+ header_params = {}
1215
+ header_params['accept'] = 'application/json'
1216
+ header_params['content-type'] = 'application/json'
1217
+
1218
+ post_body = nil
1219
+
1220
+ return @api_client.call_api(
1221
+ :GET,
1222
+ path,
1223
+ endpoint,
1224
+ :header_params => header_params,
1225
+ :query_params => query_params,
1226
+ :body => post_body,
1227
+ :return_type => 'Array<OCI::Core::Models::VnicAttachment>')
1228
+ end
1229
+
1230
+ # Lists the volume attachments in the specified compartment. You can filter the
1231
+ # list by specifying an instance OCID, volume OCID, or both.
1232
+ #
1233
+ # Currently, the only supported volume attachment type is {IScsiVolumeAttachment}.
1234
+ #
1235
+ # @param [String] compartment_id The OCID of the compartment.
1236
+ # @param [Hash] opts the optional parameters
1237
+ # @option opts [String] :availability_domain The name of the Availability Domain.
1238
+ #
1239
+ # Example: `Uocm:PHX-AD-1`
1240
+ #
1241
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
1242
+ #
1243
+ # Example: `500`
1244
+ #
1245
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
1246
+ #
1247
+ # @option opts [String] :instance_id The OCID of the instance.
1248
+ # @option opts [String] :volume_id The OCID of the volume.
1249
+ # @return [Response] A Response object with data of type Array<OCI::Core::Models::VolumeAttachment>
1250
+ def list_volume_attachments(compartment_id, opts = {})
1251
+ logger.debug "Calling operation ComputeClient#list_volume_attachments." if logger
1252
+
1253
+ fail "Missing the required parameter 'compartment_id' when calling list_volume_attachments." if compartment_id.nil?
1254
+
1255
+ path = "/volumeAttachments/"
1256
+
1257
+ # Query Params
1258
+ query_params = {}
1259
+ query_params[:'compartmentId'] = compartment_id
1260
+ query_params[:'availabilityDomain'] = opts[:'availability_domain'] if opts[:'availability_domain']
1261
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1262
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1263
+ query_params[:'instanceId'] = opts[:'instance_id'] if opts[:'instance_id']
1264
+ query_params[:'volumeId'] = opts[:'volume_id'] if opts[:'volume_id']
1265
+
1266
+ # Header Params
1267
+ header_params = {}
1268
+ header_params['accept'] = 'application/json'
1269
+ header_params['content-type'] = 'application/json'
1270
+
1271
+ post_body = nil
1272
+
1273
+ return @api_client.call_api(
1274
+ :GET,
1275
+ path,
1276
+ endpoint,
1277
+ :header_params => header_params,
1278
+ :query_params => query_params,
1279
+ :body => post_body,
1280
+ :return_type => 'Array<OCI::Core::Models::VolumeAttachment>')
1281
+ end
1282
+
1283
+ # Terminates the specified instance. Any attached VNICs and volumes are automatically detached
1284
+ # when the instance terminates.
1285
+ #
1286
+ # This is an asynchronous operation. The instance's `lifecycleState` will change to TERMINATING temporarily
1287
+ # until the instance is completely removed.
1288
+ #
1289
+ # @param [String] instance_id The OCID of the instance.
1290
+ # @param [Hash] opts the optional parameters
1291
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1292
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1293
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1294
+ #
1295
+ # @return [Response] A Response object with data of type nil
1296
+ def terminate_instance(instance_id, opts = {})
1297
+ logger.debug "Calling operation ComputeClient#terminate_instance." if logger
1298
+
1299
+ fail "Missing the required parameter 'instance_id' when calling terminate_instance." if instance_id.nil?
1300
+
1301
+ path = "/instances/{instanceId}".sub('{instanceId}', instance_id.to_s)
1302
+
1303
+ # Query Params
1304
+ query_params = {}
1305
+
1306
+ # Header Params
1307
+ header_params = {}
1308
+ header_params['accept'] = 'application/json'
1309
+ header_params['content-type'] = 'application/json'
1310
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1311
+
1312
+ post_body = nil
1313
+
1314
+ return @api_client.call_api(
1315
+ :DELETE,
1316
+ path,
1317
+ endpoint,
1318
+ :header_params => header_params,
1319
+ :query_params => query_params,
1320
+ :body => post_body)
1321
+ end
1322
+
1323
+ # Updates the display name of the image. Avoid entering confidential information.
1324
+ # @param [String] image_id The OCID of the image.
1325
+ # @param [UpdateImageDetails] update_image_details Updates the image display name field. Avoid entering confidential information.
1326
+ # @param [Hash] opts the optional parameters
1327
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
1328
+ # server error without risk of executing that same action again. Retry tokens expire after 24
1329
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
1330
+ # has been deleted and purged from the system, then a retry of the original creation request
1331
+ # may be rejected).
1332
+ #
1333
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1334
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1335
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1336
+ #
1337
+ # @return [Response] A Response object with data of type OCI::Core::Models::Image
1338
+ def update_image(image_id, update_image_details, opts = {})
1339
+ logger.debug "Calling operation ComputeClient#update_image." if logger
1340
+
1341
+ fail "Missing the required parameter 'image_id' when calling update_image." if image_id.nil?
1342
+ fail "Missing the required parameter 'update_image_details' when calling update_image." if update_image_details.nil?
1343
+
1344
+ path = "/images/{imageId}".sub('{imageId}', image_id.to_s)
1345
+
1346
+ # Query Params
1347
+ query_params = {}
1348
+
1349
+ # Header Params
1350
+ header_params = {}
1351
+ header_params['accept'] = 'application/json'
1352
+ header_params['content-type'] = 'application/json'
1353
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
1354
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1355
+
1356
+ post_body = @api_client.object_to_http_body(update_image_details)
1357
+
1358
+ return @api_client.call_api(
1359
+ :PUT,
1360
+ path,
1361
+ endpoint,
1362
+ :header_params => header_params,
1363
+ :query_params => query_params,
1364
+ :body => post_body,
1365
+ :return_type => 'OCI::Core::Models::Image')
1366
+ end
1367
+
1368
+ # Updates the display name of the specified instance. Avoid entering confidential information.
1369
+ # The OCID of the instance remains the same.
1370
+ #
1371
+ # @param [String] instance_id The OCID of the instance.
1372
+ # @param [UpdateInstanceDetails] update_instance_details Update instance fields
1373
+ # @param [Hash] opts the optional parameters
1374
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
1375
+ # server error without risk of executing that same action again. Retry tokens expire after 24
1376
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
1377
+ # has been deleted and purged from the system, then a retry of the original creation request
1378
+ # may be rejected).
1379
+ #
1380
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1381
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1382
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1383
+ #
1384
+ # @return [Response] A Response object with data of type OCI::Core::Models::Instance
1385
+ def update_instance(instance_id, update_instance_details, opts = {})
1386
+ logger.debug "Calling operation ComputeClient#update_instance." if logger
1387
+
1388
+ fail "Missing the required parameter 'instance_id' when calling update_instance." if instance_id.nil?
1389
+ fail "Missing the required parameter 'update_instance_details' when calling update_instance." if update_instance_details.nil?
1390
+
1391
+ path = "/instances/{instanceId}".sub('{instanceId}', instance_id.to_s)
1392
+
1393
+ # Query Params
1394
+ query_params = {}
1395
+
1396
+ # Header Params
1397
+ header_params = {}
1398
+ header_params['accept'] = 'application/json'
1399
+ header_params['content-type'] = 'application/json'
1400
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
1401
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1402
+
1403
+ post_body = @api_client.object_to_http_body(update_instance_details)
1404
+
1405
+ return @api_client.call_api(
1406
+ :PUT,
1407
+ path,
1408
+ endpoint,
1409
+ :header_params => header_params,
1410
+ :query_params => query_params,
1411
+ :body => post_body,
1412
+ :return_type => 'OCI::Core::Models::Instance')
1413
+ end
1414
+ end
1415
+ end