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,104 @@
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::TransferApplianceClient} 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::TransferApplianceClientCompositeOperations
10
+ # The {OCI::Dts::TransferApplianceClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Dts::TransferApplianceClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new TransferApplianceClientCompositeOperations
16
+ #
17
+ # @param [OCI::Dts::TransferApplianceClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Dts::TransferApplianceClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Dts::TransferApplianceClient.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::TransferApplianceClient#create_transfer_appliance} and then waits for the {OCI::Dts::Models::TransferAppliance} acted upon
28
+ # to enter the given state(s).
29
+ #
30
+ # @param [String] id ID of the Transfer Job
31
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Dts::Models::TransferAppliance#lifecycle_state}
32
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferApplianceClient#create_transfer_appliance}
33
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
34
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
35
+ # * max_wait_seconds The maximum time to wait, in seconds
36
+ #
37
+ # @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Dts::Models::TransferAppliance}
38
+ def create_transfer_appliance_and_wait_for_state(id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
39
+ operation_result = @service_client.create_transfer_appliance(id, base_operation_opts)
40
+
41
+ return operation_result if wait_for_states.empty?
42
+
43
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
44
+ wait_for_resource_id = operation_result.data.id
45
+
46
+ begin
47
+ waiter_result = @service_client.get_transfer_appliance(wait_for_resource_id).wait_until(
48
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
49
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
50
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
51
+ )
52
+ result_to_return = waiter_result
53
+
54
+ return result_to_return
55
+ rescue StandardError
56
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
57
+ end
58
+ end
59
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
60
+ # rubocop:enable Layout/EmptyLines
61
+
62
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
63
+ # rubocop:disable Layout/EmptyLines
64
+
65
+
66
+ # Calls {OCI::Dts::TransferApplianceClient#update_transfer_appliance} and then waits for the {OCI::Dts::Models::TransferAppliance} acted upon
67
+ # to enter the given state(s).
68
+ #
69
+ # @param [String] id ID of the Transfer Job
70
+ # @param [String] transfer_appliance_label Label of the Transfer Appliance
71
+ # @param [OCI::Dts::Models::UpdateTransferApplianceDetails] update_transfer_appliance_details fields to update
72
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Dts::Models::TransferAppliance#lifecycle_state}
73
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferApplianceClient#update_transfer_appliance}
74
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
75
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
76
+ # * max_wait_seconds The maximum time to wait, in seconds
77
+ #
78
+ # @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Dts::Models::TransferAppliance}
79
+ def update_transfer_appliance_and_wait_for_state(id, transfer_appliance_label, update_transfer_appliance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
80
+ operation_result = @service_client.update_transfer_appliance(id, transfer_appliance_label, update_transfer_appliance_details, base_operation_opts)
81
+
82
+ return operation_result if wait_for_states.empty?
83
+
84
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
85
+ wait_for_resource_id = operation_result.data.id
86
+
87
+ begin
88
+ waiter_result = @service_client.get_transfer_appliance(wait_for_resource_id).wait_until(
89
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
90
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
91
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
92
+ )
93
+ result_to_return = waiter_result
94
+
95
+ return result_to_return
96
+ rescue StandardError
97
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
98
+ end
99
+ end
100
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
101
+ # rubocop:enable Layout/EmptyLines
102
+ end
103
+ end
104
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,223 @@
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::TransferApplianceEntitlementClient
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 TransferApplianceEntitlementClient.
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 "TransferApplianceEntitlementClient 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 "TransferApplianceEntitlementClient 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
+ # Create the Transfer Appliance Entitlement that allows customers to use Transfer Appliance
112
+ # @param [OCI::Dts::Models::CreateTransferApplianceEntitlementDetails] create_transfer_appliance_entitlement_details Creates a Transfer Appliance Entitlement
113
+ # @param [Hash] opts the optional parameters
114
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
115
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
116
+ # @option opts [String] :opc_retry_token opc retry token
117
+ # @option opts [String] :opc_request_id opc request id
118
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferApplianceEntitlement TransferApplianceEntitlement}
119
+ def create_transfer_appliance_entitlement(create_transfer_appliance_entitlement_details, opts = {})
120
+ logger.debug 'Calling operation TransferApplianceEntitlementClient#create_transfer_appliance_entitlement.' if logger
121
+
122
+ raise "Missing the required parameter 'create_transfer_appliance_entitlement_details' when calling create_transfer_appliance_entitlement." if create_transfer_appliance_entitlement_details.nil?
123
+
124
+ path = '/transferApplianceEntitlement'
125
+ operation_signing_strategy = :standard
126
+
127
+ # rubocop:disable Style/NegatedIf
128
+ # Query Params
129
+ query_params = {}
130
+
131
+ # Header Params
132
+ header_params = {}
133
+ header_params[:accept] = 'application/json'
134
+ header_params[:'content-type'] = 'application/json'
135
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
136
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
137
+ # rubocop:enable Style/NegatedIf
138
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
139
+
140
+ post_body = @api_client.object_to_http_body(create_transfer_appliance_entitlement_details)
141
+
142
+ # rubocop:disable Metrics/BlockLength
143
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferApplianceEntitlementClient#create_transfer_appliance_entitlement') do
144
+ @api_client.call_api(
145
+ :POST,
146
+ path,
147
+ endpoint,
148
+ header_params: header_params,
149
+ query_params: query_params,
150
+ operation_signing_strategy: operation_signing_strategy,
151
+ body: post_body,
152
+ return_type: 'OCI::Dts::Models::TransferApplianceEntitlement'
153
+ )
154
+ end
155
+ # rubocop:enable Metrics/BlockLength
156
+ end
157
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
158
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
159
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
160
+
161
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
162
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
163
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
164
+
165
+
166
+ # Describes the Transfer Appliance Entitlement in detail
167
+ # @param [String] tenant_id Tenant Id
168
+ # @param [Hash] opts the optional parameters
169
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
170
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
171
+ # @option opts [String] :opc_request_id opc request id
172
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferApplianceEntitlement TransferApplianceEntitlement}
173
+ def get_transfer_appliance_entitlement(tenant_id, opts = {})
174
+ logger.debug 'Calling operation TransferApplianceEntitlementClient#get_transfer_appliance_entitlement.' if logger
175
+
176
+ raise "Missing the required parameter 'tenant_id' when calling get_transfer_appliance_entitlement." if tenant_id.nil?
177
+ raise "Parameter value for 'tenant_id' must not be blank" if OCI::Internal::Util.blank_string?(tenant_id)
178
+
179
+ path = '/transferApplianceEntitlement/{tenantId}'.sub('{tenantId}', tenant_id.to_s)
180
+ operation_signing_strategy = :standard
181
+
182
+ # rubocop:disable Style/NegatedIf
183
+ # Query Params
184
+ query_params = {}
185
+
186
+ # Header Params
187
+ header_params = {}
188
+ header_params[:accept] = 'application/json'
189
+ header_params[:'content-type'] = 'application/json'
190
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
191
+ # rubocop:enable Style/NegatedIf
192
+
193
+ post_body = nil
194
+
195
+ # rubocop:disable Metrics/BlockLength
196
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferApplianceEntitlementClient#get_transfer_appliance_entitlement') do
197
+ @api_client.call_api(
198
+ :GET,
199
+ path,
200
+ endpoint,
201
+ header_params: header_params,
202
+ query_params: query_params,
203
+ operation_signing_strategy: operation_signing_strategy,
204
+ body: post_body,
205
+ return_type: 'OCI::Dts::Models::TransferApplianceEntitlement'
206
+ )
207
+ end
208
+ # rubocop:enable Metrics/BlockLength
209
+ end
210
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
211
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
212
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
213
+
214
+ private
215
+
216
+ def applicable_retry_config(opts = {})
217
+ return @retry_config unless opts.key?(:retry_config)
218
+
219
+ opts[:retry_config]
220
+ end
221
+ end
222
+ end
223
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,24 @@
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::TransferApplianceEntitlementClient} 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::TransferApplianceEntitlementClientCompositeOperations
10
+ # The {OCI::Dts::TransferApplianceEntitlementClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Dts::TransferApplianceEntitlementClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new TransferApplianceEntitlementClientCompositeOperations
16
+ #
17
+ # @param [OCI::Dts::TransferApplianceEntitlementClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Dts::TransferApplianceEntitlementClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Dts::TransferApplianceEntitlementClient.new)
20
+ @service_client = service_client
21
+ end
22
+ end
23
+ end
24
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,402 @@
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::TransferDeviceClient
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 TransferDeviceClient.
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 "TransferDeviceClient 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 "TransferDeviceClient 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
+ # Create a new Transfer Device
112
+ # @param [String] id ID of the Transfer Job
113
+ # @param [OCI::Dts::Models::CreateTransferDeviceDetails] create_transfer_device_details Creates a New Transfer Device
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] :opc_retry_token
118
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::NewTransferDevice NewTransferDevice}
119
+ def create_transfer_device(id, create_transfer_device_details, opts = {})
120
+ logger.debug 'Calling operation TransferDeviceClient#create_transfer_device.' if logger
121
+
122
+ raise "Missing the required parameter 'id' when calling create_transfer_device." if id.nil?
123
+ raise "Missing the required parameter 'create_transfer_device_details' when calling create_transfer_device." if create_transfer_device_details.nil?
124
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
125
+
126
+ path = '/transferJobs/{id}/transferDevices'.sub('{id}', id.to_s)
127
+ operation_signing_strategy = :standard
128
+
129
+ # rubocop:disable Style/NegatedIf
130
+ # Query Params
131
+ query_params = {}
132
+
133
+ # Header Params
134
+ header_params = {}
135
+ header_params[:accept] = 'application/json'
136
+ header_params[:'content-type'] = 'application/json'
137
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
138
+ # rubocop:enable Style/NegatedIf
139
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
140
+
141
+ post_body = @api_client.object_to_http_body(create_transfer_device_details)
142
+
143
+ # rubocop:disable Metrics/BlockLength
144
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferDeviceClient#create_transfer_device') do
145
+ @api_client.call_api(
146
+ :POST,
147
+ path,
148
+ endpoint,
149
+ header_params: header_params,
150
+ query_params: query_params,
151
+ operation_signing_strategy: operation_signing_strategy,
152
+ body: post_body,
153
+ return_type: 'OCI::Dts::Models::NewTransferDevice'
154
+ )
155
+ end
156
+ # rubocop:enable Metrics/BlockLength
157
+ end
158
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
159
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
160
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
161
+
162
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
163
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
164
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
165
+ # rubocop:disable Lint/UnusedMethodArgument
166
+
167
+
168
+ # deletes a transfer Device
169
+ # @param [String] id ID of the Transfer Job
170
+ # @param [String] transfer_device_label Label of the Transfer Device
171
+ # @param [Hash] opts the optional parameters
172
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
173
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
174
+ # @return [Response] A Response object with data of type nil
175
+ def delete_transfer_device(id, transfer_device_label, opts = {})
176
+ logger.debug 'Calling operation TransferDeviceClient#delete_transfer_device.' if logger
177
+
178
+ raise "Missing the required parameter 'id' when calling delete_transfer_device." if id.nil?
179
+ raise "Missing the required parameter 'transfer_device_label' when calling delete_transfer_device." if transfer_device_label.nil?
180
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
181
+ raise "Parameter value for 'transfer_device_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_device_label)
182
+
183
+ path = '/transferJobs/{id}/transferDevices/{transferDeviceLabel}'.sub('{id}', id.to_s).sub('{transferDeviceLabel}', transfer_device_label.to_s)
184
+ operation_signing_strategy = :standard
185
+
186
+ # rubocop:disable Style/NegatedIf
187
+ # Query Params
188
+ query_params = {}
189
+
190
+ # Header Params
191
+ header_params = {}
192
+ header_params[:accept] = 'application/json'
193
+ header_params[:'content-type'] = 'application/json'
194
+ # rubocop:enable Style/NegatedIf
195
+
196
+ post_body = nil
197
+
198
+ # rubocop:disable Metrics/BlockLength
199
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferDeviceClient#delete_transfer_device') do
200
+ @api_client.call_api(
201
+ :DELETE,
202
+ path,
203
+ endpoint,
204
+ header_params: header_params,
205
+ query_params: query_params,
206
+ operation_signing_strategy: operation_signing_strategy,
207
+ body: post_body
208
+ )
209
+ end
210
+ # rubocop:enable Metrics/BlockLength
211
+ end
212
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
213
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
214
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
215
+ # rubocop:enable Lint/UnusedMethodArgument
216
+
217
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
218
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
219
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
220
+ # rubocop:disable Lint/UnusedMethodArgument
221
+
222
+
223
+ # Describes a transfer package in detail
224
+ # @param [String] id ID of the Transfer Job
225
+ # @param [String] transfer_device_label Label of the Transfer Device
226
+ # @param [Hash] opts the optional parameters
227
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
228
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
229
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferDevice TransferDevice}
230
+ def get_transfer_device(id, transfer_device_label, opts = {})
231
+ logger.debug 'Calling operation TransferDeviceClient#get_transfer_device.' if logger
232
+
233
+ raise "Missing the required parameter 'id' when calling get_transfer_device." if id.nil?
234
+ raise "Missing the required parameter 'transfer_device_label' when calling get_transfer_device." if transfer_device_label.nil?
235
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
236
+ raise "Parameter value for 'transfer_device_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_device_label)
237
+
238
+ path = '/transferJobs/{id}/transferDevices/{transferDeviceLabel}'.sub('{id}', id.to_s).sub('{transferDeviceLabel}', transfer_device_label.to_s)
239
+ operation_signing_strategy = :standard
240
+
241
+ # rubocop:disable Style/NegatedIf
242
+ # Query Params
243
+ query_params = {}
244
+
245
+ # Header Params
246
+ header_params = {}
247
+ header_params[:accept] = 'application/json'
248
+ header_params[:'content-type'] = 'application/json'
249
+ # rubocop:enable Style/NegatedIf
250
+
251
+ post_body = nil
252
+
253
+ # rubocop:disable Metrics/BlockLength
254
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferDeviceClient#get_transfer_device') do
255
+ @api_client.call_api(
256
+ :GET,
257
+ path,
258
+ endpoint,
259
+ header_params: header_params,
260
+ query_params: query_params,
261
+ operation_signing_strategy: operation_signing_strategy,
262
+ body: post_body,
263
+ return_type: 'OCI::Dts::Models::TransferDevice'
264
+ )
265
+ end
266
+ # rubocop:enable Metrics/BlockLength
267
+ end
268
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
269
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
270
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
271
+ # rubocop:enable Lint/UnusedMethodArgument
272
+
273
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
274
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
275
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
276
+
277
+
278
+ # Lists Transfer Devices associated with a transferJob
279
+ # @param [String] id ID of the Transfer Job
280
+ # @param [Hash] opts the optional parameters
281
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
282
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
283
+ # @option opts [String] :lifecycle_state filtering by lifecycleState
284
+ # Allowed values are: PREPARING, READY, PACKAGED, ACTIVE, PROCESSING, COMPLETE, MISSING, ERROR, DELETED, CANCELLED
285
+ # @option opts [String] :display_name filtering by displayName
286
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::MultipleTransferDevices MultipleTransferDevices}
287
+ def list_transfer_devices(id, opts = {})
288
+ logger.debug 'Calling operation TransferDeviceClient#list_transfer_devices.' if logger
289
+
290
+ raise "Missing the required parameter 'id' when calling list_transfer_devices." if id.nil?
291
+
292
+ if opts[:lifecycle_state] && !%w[PREPARING READY PACKAGED ACTIVE PROCESSING COMPLETE MISSING ERROR DELETED CANCELLED].include?(opts[:lifecycle_state])
293
+ raise 'Invalid value for "lifecycle_state", must be one of PREPARING, READY, PACKAGED, ACTIVE, PROCESSING, COMPLETE, MISSING, ERROR, DELETED, CANCELLED.'
294
+ end
295
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
296
+
297
+ path = '/transferJobs/{id}/transferDevices'.sub('{id}', id.to_s)
298
+ operation_signing_strategy = :standard
299
+
300
+ # rubocop:disable Style/NegatedIf
301
+ # Query Params
302
+ query_params = {}
303
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
304
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
305
+
306
+ # Header Params
307
+ header_params = {}
308
+ header_params[:accept] = 'application/json'
309
+ header_params[:'content-type'] = 'application/json'
310
+ # rubocop:enable Style/NegatedIf
311
+
312
+ post_body = nil
313
+
314
+ # rubocop:disable Metrics/BlockLength
315
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferDeviceClient#list_transfer_devices') do
316
+ @api_client.call_api(
317
+ :GET,
318
+ path,
319
+ endpoint,
320
+ header_params: header_params,
321
+ query_params: query_params,
322
+ operation_signing_strategy: operation_signing_strategy,
323
+ body: post_body,
324
+ return_type: 'OCI::Dts::Models::MultipleTransferDevices'
325
+ )
326
+ end
327
+ # rubocop:enable Metrics/BlockLength
328
+ end
329
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
330
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
331
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
332
+
333
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
334
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
335
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
336
+
337
+
338
+ # Updates a Transfer Device
339
+ # @param [String] id ID of the Transfer Job
340
+ # @param [String] transfer_device_label Label of the Transfer Device
341
+ # @param [OCI::Dts::Models::UpdateTransferDeviceDetails] update_transfer_device_details fields to update
342
+ # @param [Hash] opts the optional parameters
343
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
344
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
345
+ # @option opts [String] :if_match The entity tag to match. Optional, if set, the update will be successful only if the
346
+ # object's tag matches the tag specified in the request.
347
+ #
348
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferDevice TransferDevice}
349
+ def update_transfer_device(id, transfer_device_label, update_transfer_device_details, opts = {})
350
+ logger.debug 'Calling operation TransferDeviceClient#update_transfer_device.' if logger
351
+
352
+ raise "Missing the required parameter 'id' when calling update_transfer_device." if id.nil?
353
+ raise "Missing the required parameter 'transfer_device_label' when calling update_transfer_device." if transfer_device_label.nil?
354
+ raise "Missing the required parameter 'update_transfer_device_details' when calling update_transfer_device." if update_transfer_device_details.nil?
355
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
356
+ raise "Parameter value for 'transfer_device_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_device_label)
357
+
358
+ path = '/transferJobs/{id}/transferDevices/{transferDeviceLabel}'.sub('{id}', id.to_s).sub('{transferDeviceLabel}', transfer_device_label.to_s)
359
+ operation_signing_strategy = :standard
360
+
361
+ # rubocop:disable Style/NegatedIf
362
+ # Query Params
363
+ query_params = {}
364
+
365
+ # Header Params
366
+ header_params = {}
367
+ header_params[:accept] = 'application/json'
368
+ header_params[:'content-type'] = 'application/json'
369
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
370
+ # rubocop:enable Style/NegatedIf
371
+
372
+ post_body = @api_client.object_to_http_body(update_transfer_device_details)
373
+
374
+ # rubocop:disable Metrics/BlockLength
375
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferDeviceClient#update_transfer_device') do
376
+ @api_client.call_api(
377
+ :PUT,
378
+ path,
379
+ endpoint,
380
+ header_params: header_params,
381
+ query_params: query_params,
382
+ operation_signing_strategy: operation_signing_strategy,
383
+ body: post_body,
384
+ return_type: 'OCI::Dts::Models::TransferDevice'
385
+ )
386
+ end
387
+ # rubocop:enable Metrics/BlockLength
388
+ end
389
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
390
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
391
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
392
+
393
+ private
394
+
395
+ def applicable_retry_config(opts = {})
396
+ return @retry_config unless opts.key?(:retry_config)
397
+
398
+ opts[:retry_config]
399
+ end
400
+ end
401
+ end
402
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength