oci 2.5.11 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/auth/federation_client.rb +2 -1
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +6 -1
  6. data/lib/oci/auth/url_based_certificate_retriever.rb +6 -2
  7. data/lib/oci/auth/util.rb +18 -0
  8. data/lib/oci/core/compute_client.rb +730 -48
  9. data/lib/oci/core/compute_client_composite_operations.rb +119 -0
  10. data/lib/oci/core/compute_management_client.rb +11 -4
  11. data/lib/oci/core/core.rb +13 -0
  12. data/lib/oci/core/models/add_security_rule_details.rb +4 -2
  13. data/lib/oci/core/models/attach_vnic_details.rb +1 -0
  14. data/lib/oci/core/models/capture_console_history_details.rb +1 -0
  15. data/lib/oci/core/models/change_dedicated_vm_host_compartment_details.rb +155 -0
  16. data/lib/oci/core/models/change_dhcp_options_compartment_details.rb +155 -0
  17. data/lib/oci/core/models/change_internet_gateway_compartment_details.rb +155 -0
  18. data/lib/oci/core/models/change_local_peering_gateway_compartment_details.rb +155 -0
  19. data/lib/oci/core/models/change_network_security_group_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_public_ip_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/create_dedicated_vm_host_details.rb +262 -0
  22. data/lib/oci/core/models/create_drg_attachment_details.rb +4 -2
  23. data/lib/oci/core/models/create_image_details.rb +1 -1
  24. data/lib/oci/core/models/create_instance_configuration_base.rb +16 -6
  25. data/lib/oci/core/models/create_instance_configuration_details.rb +1 -1
  26. data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +3 -2
  27. data/lib/oci/core/models/create_instance_pool_details.rb +3 -1
  28. data/lib/oci/core/models/create_local_peering_gateway_details.rb +1 -1
  29. data/lib/oci/core/models/create_service_gateway_details.rb +1 -1
  30. data/lib/oci/core/models/create_volume_group_backup_details.rb +3 -1
  31. data/lib/oci/core/models/create_volume_group_details.rb +1 -1
  32. data/lib/oci/core/models/cross_connect_mapping.rb +4 -0
  33. data/lib/oci/core/models/dedicated_vm_host.rb +359 -0
  34. data/lib/oci/core/models/dedicated_vm_host_instance_shape_summary.rb +170 -0
  35. data/lib/oci/core/models/dedicated_vm_host_instance_summary.rb +215 -0
  36. data/lib/oci/core/models/dedicated_vm_host_shape_summary.rb +171 -0
  37. data/lib/oci/core/models/dedicated_vm_host_summary.rb +325 -0
  38. data/lib/oci/core/models/drg_attachment.rb +6 -3
  39. data/lib/oci/core/models/egress_security_rule.rb +1 -0
  40. data/lib/oci/core/models/image.rb +2 -0
  41. data/lib/oci/core/models/ingress_security_rule.rb +2 -1
  42. data/lib/oci/core/models/instance.rb +16 -1
  43. data/lib/oci/core/models/instance_configuration.rb +10 -7
  44. data/lib/oci/core/models/ipv6.rb +2 -0
  45. data/lib/oci/core/models/launch_instance_details.rb +16 -1
  46. data/lib/oci/core/models/launch_options.rb +3 -2
  47. data/lib/oci/core/models/local_peering_gateway.rb +4 -3
  48. data/lib/oci/core/models/route_rule.rb +2 -1
  49. data/lib/oci/core/models/security_rule.rb +3 -1
  50. data/lib/oci/core/models/service_gateway.rb +4 -3
  51. data/lib/oci/core/models/subnet.rb +2 -1
  52. data/lib/oci/core/models/update_console_history_details.rb +1 -0
  53. data/lib/oci/core/models/update_dedicated_vm_host_details.rb +194 -0
  54. data/lib/oci/core/models/update_drg_attachment_details.rb +6 -3
  55. data/lib/oci/core/models/update_instance_pool_details.rb +3 -1
  56. data/lib/oci/core/models/update_local_peering_gateway_details.rb +4 -3
  57. data/lib/oci/core/models/update_network_security_group_details.rb +2 -0
  58. data/lib/oci/core/models/update_security_rule_details.rb +4 -2
  59. data/lib/oci/core/models/update_service_gateway_details.rb +4 -3
  60. data/lib/oci/core/models/update_vnic_details.rb +2 -0
  61. data/lib/oci/core/models/update_volume_backup_details.rb +1 -1
  62. data/lib/oci/core/models/update_volume_group_backup_details.rb +2 -1
  63. data/lib/oci/core/models/update_volume_group_details.rb +2 -1
  64. data/lib/oci/core/models/vcn.rb +2 -1
  65. data/lib/oci/core/models/volume_backup_schedule.rb +1 -1
  66. data/lib/oci/core/virtual_network_client.rb +396 -59
  67. data/lib/oci/dts/dts.rb +57 -0
  68. data/lib/oci/dts/models/attach_devices_details.rb +153 -0
  69. data/lib/oci/dts/models/change_transfer_job_compartment_details.rb +154 -0
  70. data/lib/oci/dts/models/create_transfer_appliance_details.rb +152 -0
  71. data/lib/oci/dts/models/create_transfer_appliance_entitlement_details.rb +178 -0
  72. data/lib/oci/dts/models/create_transfer_device_details.rb +165 -0
  73. data/lib/oci/dts/models/create_transfer_job_details.rb +238 -0
  74. data/lib/oci/dts/models/create_transfer_package_details.rb +178 -0
  75. data/lib/oci/dts/models/detach_devices_details.rb +153 -0
  76. data/lib/oci/dts/models/multiple_transfer_appliances.rb +153 -0
  77. data/lib/oci/dts/models/multiple_transfer_devices.rb +153 -0
  78. data/lib/oci/dts/models/multiple_transfer_packages.rb +153 -0
  79. data/lib/oci/dts/models/new_transfer_device.rb +246 -0
  80. data/lib/oci/dts/models/shipping_address.rb +263 -0
  81. data/lib/oci/dts/models/shipping_vendors.rb +149 -0
  82. data/lib/oci/dts/models/transfer_appliance.rb +367 -0
  83. data/lib/oci/dts/models/transfer_appliance_certificate.rb +148 -0
  84. data/lib/oci/dts/models/transfer_appliance_encryption_passphrase.rb +152 -0
  85. data/lib/oci/dts/models/transfer_appliance_entitlement.rb +240 -0
  86. data/lib/oci/dts/models/transfer_appliance_public_key.rb +152 -0
  87. data/lib/oci/dts/models/transfer_appliance_summary.rb +223 -0
  88. data/lib/oci/dts/models/transfer_device.rb +268 -0
  89. data/lib/oci/dts/models/transfer_device_summary.rb +254 -0
  90. data/lib/oci/dts/models/transfer_job.rb +356 -0
  91. data/lib/oci/dts/models/transfer_job_summary.rb +296 -0
  92. data/lib/oci/dts/models/transfer_package.rb +281 -0
  93. data/lib/oci/dts/models/transfer_package_summary.rb +201 -0
  94. data/lib/oci/dts/models/update_transfer_appliance_details.rb +180 -0
  95. data/lib/oci/dts/models/update_transfer_device_details.rb +166 -0
  96. data/lib/oci/dts/models/update_transfer_job_details.rb +237 -0
  97. data/lib/oci/dts/models/update_transfer_package_details.rb +204 -0
  98. data/lib/oci/dts/shipping_vendors_client.rb +165 -0
  99. data/lib/oci/dts/shipping_vendors_client_composite_operations.rb +24 -0
  100. data/lib/oci/dts/transfer_appliance_client.rb +569 -0
  101. data/lib/oci/dts/transfer_appliance_client_composite_operations.rb +104 -0
  102. data/lib/oci/dts/transfer_appliance_entitlement_client.rb +223 -0
  103. data/lib/oci/dts/transfer_appliance_entitlement_client_composite_operations.rb +24 -0
  104. data/lib/oci/dts/transfer_device_client.rb +402 -0
  105. data/lib/oci/dts/transfer_device_client_composite_operations.rb +65 -0
  106. data/lib/oci/dts/transfer_job_client.rb +458 -0
  107. data/lib/oci/dts/transfer_job_client_composite_operations.rb +143 -0
  108. data/lib/oci/dts/transfer_package_client.rb +515 -0
  109. data/lib/oci/dts/transfer_package_client_composite_operations.rb +104 -0
  110. data/lib/oci/dts/util.rb +2 -0
  111. data/lib/oci/file_storage/models/create_file_system_details.rb +19 -4
  112. data/lib/oci/file_storage/models/file_system.rb +19 -4
  113. data/lib/oci/file_storage/models/file_system_summary.rb +19 -4
  114. data/lib/oci/file_storage/models/update_file_system_details.rb +22 -4
  115. data/lib/oci/limits/limits.rb +5 -0
  116. data/lib/oci/limits/limits_client.rb +444 -0
  117. data/lib/oci/limits/limits_client_composite_operations.rb +24 -0
  118. data/lib/oci/limits/models/create_quota_details.rb +1 -1
  119. data/lib/oci/limits/models/limit_definition_summary.rb +241 -0
  120. data/lib/oci/limits/models/limit_value_summary.rb +210 -0
  121. data/lib/oci/limits/models/quota.rb +1 -1
  122. data/lib/oci/limits/models/resource_availability.rb +163 -0
  123. data/lib/oci/limits/models/service_summary.rb +159 -0
  124. data/lib/oci/limits/models/update_quota_details.rb +1 -1
  125. data/lib/oci/limits/quotas_client.rb +12 -11
  126. data/lib/oci/monitoring/models/alarm.rb +20 -1
  127. data/lib/oci/monitoring/models/create_alarm_details.rb +20 -1
  128. data/lib/oci/monitoring/models/list_metrics_details.rb +23 -3
  129. data/lib/oci/monitoring/models/metric.rb +20 -1
  130. data/lib/oci/monitoring/models/metric_data.rb +20 -1
  131. data/lib/oci/monitoring/models/metric_data_details.rb +20 -1
  132. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +20 -1
  133. data/lib/oci/monitoring/models/update_alarm_details.rb +20 -1
  134. data/lib/oci/regions.rb +14 -8
  135. data/lib/oci/streaming/models/archiver.rb +291 -0
  136. data/lib/oci/streaming/models/archiver_error.rb +159 -0
  137. data/lib/oci/streaming/models/archiver_lifecycle_state.rb +14 -0
  138. data/lib/oci/streaming/models/archiver_start_position.rb +10 -0
  139. data/lib/oci/streaming/models/create_archiver_details.rb +223 -0
  140. data/lib/oci/streaming/models/update_archiver_details.rb +222 -0
  141. data/lib/oci/streaming/stream_admin_client.rb +304 -0
  142. data/lib/oci/streaming/stream_admin_client_composite_operations.rb +162 -0
  143. data/lib/oci/streaming/streaming.rb +6 -0
  144. data/lib/oci/version.rb +1 -1
  145. data/lib/oci/waas/models/access_rule.rb +121 -4
  146. data/lib/oci/waas/models/access_rule_criteria.rb +12 -0
  147. data/lib/oci/waas/models/address_list.rb +289 -0
  148. data/lib/oci/waas/models/address_list_summary.rb +279 -0
  149. data/lib/oci/waas/models/caching_rule.rb +243 -0
  150. data/lib/oci/waas/models/caching_rule_criteria.rb +194 -0
  151. data/lib/oci/waas/models/caching_rule_summary.rb +246 -0
  152. data/lib/oci/waas/models/certificate.rb +22 -9
  153. data/lib/oci/waas/models/certificate_extensions.rb +3 -0
  154. data/lib/oci/waas/models/certificate_issuer_name.rb +225 -0
  155. data/lib/oci/waas/models/certificate_public_key_info.rb +4 -1
  156. data/lib/oci/waas/models/certificate_subject_name.rb +8 -1
  157. data/lib/oci/waas/models/certificate_summary.rb +10 -2
  158. data/lib/oci/waas/models/change_address_list_compartment_details.rb +154 -0
  159. data/lib/oci/waas/models/change_custom_protection_rule_compartment_details.rb +154 -0
  160. data/lib/oci/waas/models/create_address_list_details.rb +213 -0
  161. data/lib/oci/waas/models/create_certificate_details.rb +22 -3
  162. data/lib/oci/waas/models/create_custom_protection_rule_details.rb +251 -0
  163. data/lib/oci/waas/models/create_waas_policy_details.rb +26 -4
  164. data/lib/oci/waas/models/custom_protection_rule.rb +326 -0
  165. data/lib/oci/waas/models/custom_protection_rule_setting.rb +180 -0
  166. data/lib/oci/waas/models/custom_protection_rule_summary.rb +279 -0
  167. data/lib/oci/waas/models/origin_group.rb +149 -0
  168. data/lib/oci/waas/models/origin_group_origins.rb +159 -0
  169. data/lib/oci/waas/models/policy_config.rb +201 -4
  170. data/lib/oci/waas/models/protection_rule_exclusion.rb +2 -2
  171. data/lib/oci/waas/models/purge_cache.rb +149 -0
  172. data/lib/oci/waas/models/update_address_list_details.rb +199 -0
  173. data/lib/oci/waas/models/update_certificate_details.rb +10 -2
  174. data/lib/oci/waas/models/update_custom_protection_rule_details.rb +237 -0
  175. data/lib/oci/waas/models/update_waas_policy_details.rb +26 -4
  176. data/lib/oci/waas/models/waas_policy.rb +25 -3
  177. data/lib/oci/waas/models/waas_policy_custom_protection_rule_summary.rb +207 -0
  178. data/lib/oci/waas/models/waas_policy_summary.rb +10 -2
  179. data/lib/oci/waas/models/waf_config.rb +43 -1
  180. data/lib/oci/waas/models/waf_config_details.rb +43 -1
  181. data/lib/oci/waas/models/waf_log.rb +3 -3
  182. data/lib/oci/waas/models/work_request.rb +4 -1
  183. data/lib/oci/waas/models/work_request_operation_types.rb +4 -1
  184. data/lib/oci/waas/models/work_request_summary.rb +4 -1
  185. data/lib/oci/waas/waas.rb +19 -0
  186. data/lib/oci/waas/waas_client.rb +1147 -61
  187. data/lib/oci/waas/waas_client_composite_operations.rb +386 -0
  188. metadata +90 -2
@@ -0,0 +1,65 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
4
+ module OCI
5
+ # This class provides a wrapper around {OCI::Dts::TransferDeviceClient} and offers convenience methods
6
+ # for operations that would otherwise need to be chained together. For example, instead of performing an action
7
+ # on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
8
+ # to enter a given state, you can call a single method in this class to accomplish the same functionality
9
+ class Dts::TransferDeviceClientCompositeOperations
10
+ # The {OCI::Dts::TransferDeviceClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Dts::TransferDeviceClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new TransferDeviceClientCompositeOperations
16
+ #
17
+ # @param [OCI::Dts::TransferDeviceClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Dts::TransferDeviceClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Dts::TransferDeviceClient.new)
20
+ @service_client = service_client
21
+ end
22
+
23
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
24
+ # rubocop:disable Layout/EmptyLines
25
+
26
+
27
+ # Calls {OCI::Dts::TransferDeviceClient#update_transfer_device} and then waits for the {OCI::Dts::Models::TransferDevice} acted upon
28
+ # to enter the given state(s).
29
+ #
30
+ # @param [String] id ID of the Transfer Job
31
+ # @param [String] transfer_device_label Label of the Transfer Device
32
+ # @param [OCI::Dts::Models::UpdateTransferDeviceDetails] update_transfer_device_details fields to update
33
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Dts::Models::TransferDevice#lifecycle_state}
34
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferDeviceClient#update_transfer_device}
35
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
36
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
37
+ # * max_wait_seconds The maximum time to wait, in seconds
38
+ #
39
+ # @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Dts::Models::TransferDevice}
40
+ def update_transfer_device_and_wait_for_state(id, transfer_device_label, update_transfer_device_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
41
+ operation_result = @service_client.update_transfer_device(id, transfer_device_label, update_transfer_device_details, base_operation_opts)
42
+
43
+ return operation_result if wait_for_states.empty?
44
+
45
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
46
+ wait_for_resource_id = operation_result.data.id
47
+
48
+ begin
49
+ waiter_result = @service_client.get_transfer_device(wait_for_resource_id).wait_until(
50
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
51
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
52
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
53
+ )
54
+ result_to_return = waiter_result
55
+
56
+ return result_to_return
57
+ rescue StandardError
58
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
59
+ end
60
+ end
61
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
62
+ # rubocop:enable Layout/EmptyLines
63
+ end
64
+ end
65
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,458 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'uri'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # A description of the DTS API
9
+ class Dts::TransferJobClient
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 default retry configuration to apply to all operations in this service client. This can be overridden
19
+ # on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
20
+ # will not perform any retries
21
+ # @return [OCI::Retry::RetryConfig]
22
+ attr_reader :retry_config
23
+
24
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
25
+ # @return [String]
26
+ attr_reader :region
27
+
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
+
30
+
31
+ # Creates a new TransferJobClient.
32
+ # Notes:
33
+ # If a config is not specified, then the global OCI.config will be used.
34
+ #
35
+ # This client is not thread-safe
36
+ #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
40
+ # @param [Config] config A Config object.
41
+ # @param [String] region A region used to determine the service endpoint. This will usually
42
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
44
+ # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
45
+ # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
46
+ # so that the instance principals signer can be provided to the client
47
+ # @param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
48
+ # the details for the proxy can be provided in this parameter
49
+ # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
50
+ # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
51
+ # will not perform any retries
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
53
+ # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
54
+ # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
55
+ # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
56
+ # pass it to this constructor.
57
+ #
58
+ # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
59
+ # so try and load the config from the default file.
60
+ config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
61
+ config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
62
+ config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
63
+
64
+ if signer.nil?
65
+ signer = OCI::Signer.new(
66
+ config.user,
67
+ config.fingerprint,
68
+ config.tenancy,
69
+ config.key_file,
70
+ pass_phrase: config.pass_phrase,
71
+ private_key_content: config.key_content
72
+ )
73
+ end
74
+
75
+ @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
76
+ @retry_config = retry_config
77
+
78
+ if endpoint
79
+ @endpoint = endpoint + '/20171001'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "TransferJobClient endpoint set to '#{@endpoint}'." if logger
86
+ end
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
88
+
89
+ # Set the region that will be used to determine the service endpoint.
90
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
91
+ # but may be an arbitrary string.
92
+ def region=(new_region)
93
+ @region = new_region
94
+
95
+ raise 'A region must be specified.' unless @region
96
+
97
+ @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://datatransfer.{region}.{secondLevelDomain}') + '/20171001'
98
+ logger.info "TransferJobClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
99
+ end
100
+
101
+ # @return [Logger] The logger for this client. May be nil.
102
+ def logger
103
+ @api_client.config.logger
104
+ end
105
+
106
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
107
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
108
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
109
+
110
+
111
+ # Moves a TransferJob into a different compartment.
112
+ # @param [String] transfer_job_id ID of the Transfer Job
113
+ # @param [OCI::Dts::Models::ChangeTransferJobCompartmentDetails] change_transfer_job_compartment_details CompartmentId of the destination compartment
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
116
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
117
+ # @option opts [String] :if_match The entity tag to match. Optional, if set, the update will be successful only if the
118
+ # object's tag matches the tag specified in the request.
119
+ #
120
+ # @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about
121
+ # a particular request, please provide the request ID.
122
+ #
123
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
124
+ # server error without risk of executing that same action again. Retry tokens expire after 24
125
+ # hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
126
+ # has been deleted and purged from the system, then a retry of the original creation request
127
+ # may be rejected).
128
+ #
129
+ # @return [Response] A Response object with data of type nil
130
+ def change_transfer_job_compartment(transfer_job_id, change_transfer_job_compartment_details, opts = {})
131
+ logger.debug 'Calling operation TransferJobClient#change_transfer_job_compartment.' if logger
132
+
133
+ raise "Missing the required parameter 'transfer_job_id' when calling change_transfer_job_compartment." if transfer_job_id.nil?
134
+ raise "Missing the required parameter 'change_transfer_job_compartment_details' when calling change_transfer_job_compartment." if change_transfer_job_compartment_details.nil?
135
+ raise "Parameter value for 'transfer_job_id' must not be blank" if OCI::Internal::Util.blank_string?(transfer_job_id)
136
+
137
+ path = '/transferJobs/{transferJobId}/actions/changeCompartment'.sub('{transferJobId}', transfer_job_id.to_s)
138
+ operation_signing_strategy = :standard
139
+
140
+ # rubocop:disable Style/NegatedIf
141
+ # Query Params
142
+ query_params = {}
143
+
144
+ # Header Params
145
+ header_params = {}
146
+ header_params[:accept] = 'application/json'
147
+ header_params[:'content-type'] = 'application/json'
148
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
149
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
150
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
151
+ # rubocop:enable Style/NegatedIf
152
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
153
+
154
+ post_body = @api_client.object_to_http_body(change_transfer_job_compartment_details)
155
+
156
+ # rubocop:disable Metrics/BlockLength
157
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferJobClient#change_transfer_job_compartment') do
158
+ @api_client.call_api(
159
+ :POST,
160
+ path,
161
+ endpoint,
162
+ header_params: header_params,
163
+ query_params: query_params,
164
+ operation_signing_strategy: operation_signing_strategy,
165
+ body: post_body
166
+ )
167
+ end
168
+ # rubocop:enable Metrics/BlockLength
169
+ end
170
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
171
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
172
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
173
+
174
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
175
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
176
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
177
+
178
+
179
+ # Create a new Transfer Job that corresponds with customer's logical dataset e.g. a DB or a filesystem.
180
+ # @param [OCI::Dts::Models::CreateTransferJobDetails] create_transfer_job_details Creates a New Transfer Job
181
+ # @param [Hash] opts the optional parameters
182
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
183
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
184
+ # @option opts [String] :opc_retry_token
185
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferJob TransferJob}
186
+ def create_transfer_job(create_transfer_job_details, opts = {})
187
+ logger.debug 'Calling operation TransferJobClient#create_transfer_job.' if logger
188
+
189
+ raise "Missing the required parameter 'create_transfer_job_details' when calling create_transfer_job." if create_transfer_job_details.nil?
190
+
191
+ path = '/transferJobs'
192
+ operation_signing_strategy = :standard
193
+
194
+ # rubocop:disable Style/NegatedIf
195
+ # Query Params
196
+ query_params = {}
197
+
198
+ # Header Params
199
+ header_params = {}
200
+ header_params[:accept] = 'application/json'
201
+ header_params[:'content-type'] = 'application/json'
202
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
203
+ # rubocop:enable Style/NegatedIf
204
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
205
+
206
+ post_body = @api_client.object_to_http_body(create_transfer_job_details)
207
+
208
+ # rubocop:disable Metrics/BlockLength
209
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferJobClient#create_transfer_job') do
210
+ @api_client.call_api(
211
+ :POST,
212
+ path,
213
+ endpoint,
214
+ header_params: header_params,
215
+ query_params: query_params,
216
+ operation_signing_strategy: operation_signing_strategy,
217
+ body: post_body,
218
+ return_type: 'OCI::Dts::Models::TransferJob'
219
+ )
220
+ end
221
+ # rubocop:enable Metrics/BlockLength
222
+ end
223
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
224
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
225
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
226
+
227
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
228
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
229
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
230
+ # rubocop:disable Lint/UnusedMethodArgument
231
+
232
+
233
+ # deletes a transfer job
234
+ # @param [String] id ID of the Transfer Job
235
+ # @param [Hash] opts the optional parameters
236
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
237
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
238
+ # @return [Response] A Response object with data of type nil
239
+ def delete_transfer_job(id, opts = {})
240
+ logger.debug 'Calling operation TransferJobClient#delete_transfer_job.' if logger
241
+
242
+ raise "Missing the required parameter 'id' when calling delete_transfer_job." if id.nil?
243
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
244
+
245
+ path = '/transferJobs/{id}'.sub('{id}', id.to_s)
246
+ operation_signing_strategy = :standard
247
+
248
+ # rubocop:disable Style/NegatedIf
249
+ # Query Params
250
+ query_params = {}
251
+
252
+ # Header Params
253
+ header_params = {}
254
+ header_params[:accept] = 'application/json'
255
+ header_params[:'content-type'] = 'application/json'
256
+ # rubocop:enable Style/NegatedIf
257
+
258
+ post_body = nil
259
+
260
+ # rubocop:disable Metrics/BlockLength
261
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferJobClient#delete_transfer_job') do
262
+ @api_client.call_api(
263
+ :DELETE,
264
+ path,
265
+ endpoint,
266
+ header_params: header_params,
267
+ query_params: query_params,
268
+ operation_signing_strategy: operation_signing_strategy,
269
+ body: post_body
270
+ )
271
+ end
272
+ # rubocop:enable Metrics/BlockLength
273
+ end
274
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
275
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
276
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
277
+ # rubocop:enable Lint/UnusedMethodArgument
278
+
279
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
280
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
281
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
282
+ # rubocop:disable Lint/UnusedMethodArgument
283
+
284
+
285
+ # Describes a transfer job in detail
286
+ # @param [String] id OCID of the Transfer Job
287
+ # @param [Hash] opts the optional parameters
288
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
289
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
290
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferJob TransferJob}
291
+ def get_transfer_job(id, opts = {})
292
+ logger.debug 'Calling operation TransferJobClient#get_transfer_job.' if logger
293
+
294
+ raise "Missing the required parameter 'id' when calling get_transfer_job." if id.nil?
295
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
296
+
297
+ path = '/transferJobs/{id}'.sub('{id}', id.to_s)
298
+ operation_signing_strategy = :standard
299
+
300
+ # rubocop:disable Style/NegatedIf
301
+ # Query Params
302
+ query_params = {}
303
+
304
+ # Header Params
305
+ header_params = {}
306
+ header_params[:accept] = 'application/json'
307
+ header_params[:'content-type'] = 'application/json'
308
+ # rubocop:enable Style/NegatedIf
309
+
310
+ post_body = nil
311
+
312
+ # rubocop:disable Metrics/BlockLength
313
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferJobClient#get_transfer_job') do
314
+ @api_client.call_api(
315
+ :GET,
316
+ path,
317
+ endpoint,
318
+ header_params: header_params,
319
+ query_params: query_params,
320
+ operation_signing_strategy: operation_signing_strategy,
321
+ body: post_body,
322
+ return_type: 'OCI::Dts::Models::TransferJob'
323
+ )
324
+ end
325
+ # rubocop:enable Metrics/BlockLength
326
+ end
327
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
328
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
329
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
330
+ # rubocop:enable Lint/UnusedMethodArgument
331
+
332
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
333
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
334
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
335
+
336
+
337
+ # Lists Transfer Jobs in a given compartment
338
+ # @param [String] compartment_id compartment id
339
+ # @param [Hash] opts the optional parameters
340
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
341
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
342
+ # @option opts [String] :lifecycle_state filtering by lifecycleState
343
+ # Allowed values are: INITIATED, PREPARING, ACTIVE, DELETED, CLOSED
344
+ # @option opts [String] :display_name filtering by displayName
345
+ # @return [Response] A Response object with data of type Array<{OCI::Dts::Models::TransferJobSummary TransferJobSummary}>
346
+ def list_transfer_jobs(compartment_id, opts = {})
347
+ logger.debug 'Calling operation TransferJobClient#list_transfer_jobs.' if logger
348
+
349
+ raise "Missing the required parameter 'compartment_id' when calling list_transfer_jobs." if compartment_id.nil?
350
+
351
+ if opts[:lifecycle_state] && !%w[INITIATED PREPARING ACTIVE DELETED CLOSED].include?(opts[:lifecycle_state])
352
+ raise 'Invalid value for "lifecycle_state", must be one of INITIATED, PREPARING, ACTIVE, DELETED, CLOSED.'
353
+ end
354
+
355
+ path = '/transferJobs'
356
+ operation_signing_strategy = :standard
357
+
358
+ # rubocop:disable Style/NegatedIf
359
+ # Query Params
360
+ query_params = {}
361
+ query_params[:compartmentId] = compartment_id
362
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
363
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
364
+
365
+ # Header Params
366
+ header_params = {}
367
+ header_params[:accept] = 'application/json'
368
+ header_params[:'content-type'] = 'application/json'
369
+ # rubocop:enable Style/NegatedIf
370
+
371
+ post_body = nil
372
+
373
+ # rubocop:disable Metrics/BlockLength
374
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferJobClient#list_transfer_jobs') do
375
+ @api_client.call_api(
376
+ :GET,
377
+ path,
378
+ endpoint,
379
+ header_params: header_params,
380
+ query_params: query_params,
381
+ operation_signing_strategy: operation_signing_strategy,
382
+ body: post_body,
383
+ return_type: 'Array<OCI::Dts::Models::TransferJobSummary>'
384
+ )
385
+ end
386
+ # rubocop:enable Metrics/BlockLength
387
+ end
388
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
389
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
390
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
391
+
392
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
393
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
394
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
395
+
396
+
397
+ # Updates a Transfer Job that corresponds with customer's logical dataset e.g. a DB or a filesystem.
398
+ # @param [String] id ID of the Transfer Job
399
+ # @param [OCI::Dts::Models::UpdateTransferJobDetails] update_transfer_job_details fields to update
400
+ # @param [Hash] opts the optional parameters
401
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
402
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
403
+ # @option opts [String] :if_match The entity tag to match. Optional, if set, the update will be successful only if the
404
+ # object's tag matches the tag specified in the request.
405
+ #
406
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferJob TransferJob}
407
+ def update_transfer_job(id, update_transfer_job_details, opts = {})
408
+ logger.debug 'Calling operation TransferJobClient#update_transfer_job.' if logger
409
+
410
+ raise "Missing the required parameter 'id' when calling update_transfer_job." if id.nil?
411
+ raise "Missing the required parameter 'update_transfer_job_details' when calling update_transfer_job." if update_transfer_job_details.nil?
412
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
413
+
414
+ path = '/transferJobs/{id}'.sub('{id}', id.to_s)
415
+ operation_signing_strategy = :standard
416
+
417
+ # rubocop:disable Style/NegatedIf
418
+ # Query Params
419
+ query_params = {}
420
+
421
+ # Header Params
422
+ header_params = {}
423
+ header_params[:accept] = 'application/json'
424
+ header_params[:'content-type'] = 'application/json'
425
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
426
+ # rubocop:enable Style/NegatedIf
427
+
428
+ post_body = @api_client.object_to_http_body(update_transfer_job_details)
429
+
430
+ # rubocop:disable Metrics/BlockLength
431
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferJobClient#update_transfer_job') do
432
+ @api_client.call_api(
433
+ :PUT,
434
+ path,
435
+ endpoint,
436
+ header_params: header_params,
437
+ query_params: query_params,
438
+ operation_signing_strategy: operation_signing_strategy,
439
+ body: post_body,
440
+ return_type: 'OCI::Dts::Models::TransferJob'
441
+ )
442
+ end
443
+ # rubocop:enable Metrics/BlockLength
444
+ end
445
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
446
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
447
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
448
+
449
+ private
450
+
451
+ def applicable_retry_config(opts = {})
452
+ return @retry_config unless opts.key?(:retry_config)
453
+
454
+ opts[:retry_config]
455
+ end
456
+ end
457
+ end
458
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength