oci 2.5.11 → 2.6.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 (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::TransferPackageClient} 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::TransferPackageClientCompositeOperations
10
+ # The {OCI::Dts::TransferPackageClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Dts::TransferPackageClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new TransferPackageClientCompositeOperations
16
+ #
17
+ # @param [OCI::Dts::TransferPackageClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Dts::TransferPackageClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Dts::TransferPackageClient.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::TransferPackageClient#create_transfer_package} and then waits for the {OCI::Dts::Models::TransferPackage} 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::TransferPackage#lifecycle_state}
32
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferPackageClient#create_transfer_package}
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::TransferPackage}
38
+ def create_transfer_package_and_wait_for_state(id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
39
+ operation_result = @service_client.create_transfer_package(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_package(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::TransferPackageClient#update_transfer_package} and then waits for the {OCI::Dts::Models::TransferPackage} acted upon
67
+ # to enter the given state(s).
68
+ #
69
+ # @param [String] id ID of the Transfer Job
70
+ # @param [String] transfer_package_label Label of the Transfer Package
71
+ # @param [OCI::Dts::Models::UpdateTransferPackageDetails] update_transfer_package_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::TransferPackage#lifecycle_state}
73
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferPackageClient#update_transfer_package}
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::TransferPackage}
79
+ def update_transfer_package_and_wait_for_state(id, transfer_package_label, update_transfer_package_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
80
+ operation_result = @service_client.update_transfer_package(id, transfer_package_label, update_transfer_package_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_package(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,2 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
@@ -40,6 +40,11 @@ module OCI
40
40
  # @return [Hash<String, Hash<String, Object>>]
41
41
  attr_accessor :defined_tags
42
42
 
43
+ # The OCID of KMS key used to encrypt the encryption keys associated with this file system.
44
+ #
45
+ # @return [String]
46
+ attr_accessor :kms_key_id
47
+
43
48
  # Attribute mapping from ruby-style variable name to JSON key.
44
49
  def self.attribute_map
45
50
  {
@@ -48,7 +53,8 @@ module OCI
48
53
  'compartment_id': :'compartmentId',
49
54
  'display_name': :'displayName',
50
55
  'freeform_tags': :'freeformTags',
51
- 'defined_tags': :'definedTags'
56
+ 'defined_tags': :'definedTags',
57
+ 'kms_key_id': :'kmsKeyId'
52
58
  # rubocop:enable Style/SymbolLiteral
53
59
  }
54
60
  end
@@ -61,7 +67,8 @@ module OCI
61
67
  'compartment_id': :'String',
62
68
  'display_name': :'String',
63
69
  'freeform_tags': :'Hash<String, String>',
64
- 'defined_tags': :'Hash<String, Hash<String, Object>>'
70
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
71
+ 'kms_key_id': :'String'
65
72
  # rubocop:enable Style/SymbolLiteral
66
73
  }
67
74
  end
@@ -77,6 +84,7 @@ module OCI
77
84
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
78
85
  # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
79
86
  # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
87
+ # @option attributes [String] :kms_key_id The value to assign to the {#kms_key_id} property
80
88
  def initialize(attributes = {})
81
89
  return unless attributes.is_a?(Hash)
82
90
 
@@ -112,6 +120,12 @@ module OCI
112
120
  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
113
121
 
114
122
  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
123
+
124
+ self.kms_key_id = attributes[:'kmsKeyId'] if attributes[:'kmsKeyId']
125
+
126
+ raise 'You cannot provide both :kmsKeyId and :kms_key_id' if attributes.key?(:'kmsKeyId') && attributes.key?(:'kms_key_id')
127
+
128
+ self.kms_key_id = attributes[:'kms_key_id'] if attributes[:'kms_key_id']
115
129
  end
116
130
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
117
131
  # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -129,7 +143,8 @@ module OCI
129
143
  compartment_id == other.compartment_id &&
130
144
  display_name == other.display_name &&
131
145
  freeform_tags == other.freeform_tags &&
132
- defined_tags == other.defined_tags
146
+ defined_tags == other.defined_tags &&
147
+ kms_key_id == other.kms_key_id
133
148
  end
134
149
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
135
150
 
@@ -145,7 +160,7 @@ module OCI
145
160
  # Calculates hash code according to all attributes.
146
161
  # @return [Fixnum] Hash code
147
162
  def hash
148
- [availability_domain, compartment_id, display_name, freeform_tags, defined_tags].hash
163
+ [availability_domain, compartment_id, display_name, freeform_tags, defined_tags, kms_key_id].hash
149
164
  end
150
165
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
151
166
 
@@ -86,6 +86,11 @@ module OCI
86
86
  # @return [Hash<String, Hash<String, Object>>]
87
87
  attr_accessor :defined_tags
88
88
 
89
+ # The OCID of KMS key used to encrypt the encryption keys associated with this file system.
90
+ #
91
+ # @return [String]
92
+ attr_accessor :kms_key_id
93
+
89
94
  # Attribute mapping from ruby-style variable name to JSON key.
90
95
  def self.attribute_map
91
96
  {
@@ -98,7 +103,8 @@ module OCI
98
103
  'lifecycle_state': :'lifecycleState',
99
104
  'time_created': :'timeCreated',
100
105
  'freeform_tags': :'freeformTags',
101
- 'defined_tags': :'definedTags'
106
+ 'defined_tags': :'definedTags',
107
+ 'kms_key_id': :'kmsKeyId'
102
108
  # rubocop:enable Style/SymbolLiteral
103
109
  }
104
110
  end
@@ -115,7 +121,8 @@ module OCI
115
121
  'lifecycle_state': :'String',
116
122
  'time_created': :'DateTime',
117
123
  'freeform_tags': :'Hash<String, String>',
118
- 'defined_tags': :'Hash<String, Hash<String, Object>>'
124
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
125
+ 'kms_key_id': :'String'
119
126
  # rubocop:enable Style/SymbolLiteral
120
127
  }
121
128
  end
@@ -135,6 +142,7 @@ module OCI
135
142
  # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
136
143
  # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
137
144
  # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
145
+ # @option attributes [String] :kms_key_id The value to assign to the {#kms_key_id} property
138
146
  def initialize(attributes = {})
139
147
  return unless attributes.is_a?(Hash)
140
148
 
@@ -190,6 +198,12 @@ module OCI
190
198
  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
191
199
 
192
200
  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
201
+
202
+ self.kms_key_id = attributes[:'kmsKeyId'] if attributes[:'kmsKeyId']
203
+
204
+ raise 'You cannot provide both :kmsKeyId and :kms_key_id' if attributes.key?(:'kmsKeyId') && attributes.key?(:'kms_key_id')
205
+
206
+ self.kms_key_id = attributes[:'kms_key_id'] if attributes[:'kms_key_id']
193
207
  end
194
208
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
195
209
  # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -224,7 +238,8 @@ module OCI
224
238
  lifecycle_state == other.lifecycle_state &&
225
239
  time_created == other.time_created &&
226
240
  freeform_tags == other.freeform_tags &&
227
- defined_tags == other.defined_tags
241
+ defined_tags == other.defined_tags &&
242
+ kms_key_id == other.kms_key_id
228
243
  end
229
244
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
230
245
 
@@ -240,7 +255,7 @@ module OCI
240
255
  # Calculates hash code according to all attributes.
241
256
  # @return [Fixnum] Hash code
242
257
  def hash
243
- [availability_domain, metered_bytes, compartment_id, display_name, id, lifecycle_state, time_created, freeform_tags, defined_tags].hash
258
+ [availability_domain, metered_bytes, compartment_id, display_name, id, lifecycle_state, time_created, freeform_tags, defined_tags, kms_key_id].hash
244
259
  end
245
260
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
246
261
 
@@ -75,6 +75,11 @@ module OCI
75
75
  # @return [Hash<String, Hash<String, Object>>]
76
76
  attr_accessor :defined_tags
77
77
 
78
+ # The OCID of KMS key used to encrypt the encryption keys associated with this file system.
79
+ #
80
+ # @return [String]
81
+ attr_accessor :kms_key_id
82
+
78
83
  # Attribute mapping from ruby-style variable name to JSON key.
79
84
  def self.attribute_map
80
85
  {
@@ -87,7 +92,8 @@ module OCI
87
92
  'lifecycle_state': :'lifecycleState',
88
93
  'time_created': :'timeCreated',
89
94
  'freeform_tags': :'freeformTags',
90
- 'defined_tags': :'definedTags'
95
+ 'defined_tags': :'definedTags',
96
+ 'kms_key_id': :'kmsKeyId'
91
97
  # rubocop:enable Style/SymbolLiteral
92
98
  }
93
99
  end
@@ -104,7 +110,8 @@ module OCI
104
110
  'lifecycle_state': :'String',
105
111
  'time_created': :'DateTime',
106
112
  'freeform_tags': :'Hash<String, String>',
107
- 'defined_tags': :'Hash<String, Hash<String, Object>>'
113
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
114
+ 'kms_key_id': :'String'
108
115
  # rubocop:enable Style/SymbolLiteral
109
116
  }
110
117
  end
@@ -124,6 +131,7 @@ module OCI
124
131
  # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
125
132
  # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
126
133
  # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
134
+ # @option attributes [String] :kms_key_id The value to assign to the {#kms_key_id} property
127
135
  def initialize(attributes = {})
128
136
  return unless attributes.is_a?(Hash)
129
137
 
@@ -179,6 +187,12 @@ module OCI
179
187
  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
180
188
 
181
189
  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
190
+
191
+ self.kms_key_id = attributes[:'kmsKeyId'] if attributes[:'kmsKeyId']
192
+
193
+ raise 'You cannot provide both :kmsKeyId and :kms_key_id' if attributes.key?(:'kmsKeyId') && attributes.key?(:'kms_key_id')
194
+
195
+ self.kms_key_id = attributes[:'kms_key_id'] if attributes[:'kms_key_id']
182
196
  end
183
197
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
184
198
  # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -213,7 +227,8 @@ module OCI
213
227
  lifecycle_state == other.lifecycle_state &&
214
228
  time_created == other.time_created &&
215
229
  freeform_tags == other.freeform_tags &&
216
- defined_tags == other.defined_tags
230
+ defined_tags == other.defined_tags &&
231
+ kms_key_id == other.kms_key_id
217
232
  end
218
233
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
219
234
 
@@ -229,7 +244,7 @@ module OCI
229
244
  # Calculates hash code according to all attributes.
230
245
  # @return [Fixnum] Hash code
231
246
  def hash
232
- [availability_domain, metered_bytes, compartment_id, display_name, id, lifecycle_state, time_created, freeform_tags, defined_tags].hash
247
+ [availability_domain, metered_bytes, compartment_id, display_name, id, lifecycle_state, time_created, freeform_tags, defined_tags, kms_key_id].hash
233
248
  end
234
249
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
235
250
 
@@ -29,13 +29,22 @@ module OCI
29
29
  # @return [Hash<String, Hash<String, Object>>]
30
30
  attr_accessor :defined_tags
31
31
 
32
+ # A KMS key OCID that will be associated with the given file system. If it is empty the Update operation will
33
+ # actually remove the KMS key, if there is one, from the given file system. Note that the old KMS key should
34
+ # still be enabled in KMS otherwise all the files in the file system encrypted with the old KMS key will no
35
+ # longer be accessible.
36
+ #
37
+ # @return [String]
38
+ attr_accessor :kms_key_id
39
+
32
40
  # Attribute mapping from ruby-style variable name to JSON key.
33
41
  def self.attribute_map
34
42
  {
35
43
  # rubocop:disable Style/SymbolLiteral
36
44
  'display_name': :'displayName',
37
45
  'freeform_tags': :'freeformTags',
38
- 'defined_tags': :'definedTags'
46
+ 'defined_tags': :'definedTags',
47
+ 'kms_key_id': :'kmsKeyId'
39
48
  # rubocop:enable Style/SymbolLiteral
40
49
  }
41
50
  end
@@ -46,7 +55,8 @@ module OCI
46
55
  # rubocop:disable Style/SymbolLiteral
47
56
  'display_name': :'String',
48
57
  'freeform_tags': :'Hash<String, String>',
49
- 'defined_tags': :'Hash<String, Hash<String, Object>>'
58
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
59
+ 'kms_key_id': :'String'
50
60
  # rubocop:enable Style/SymbolLiteral
51
61
  }
52
62
  end
@@ -60,6 +70,7 @@ module OCI
60
70
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
61
71
  # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
62
72
  # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
73
+ # @option attributes [String] :kms_key_id The value to assign to the {#kms_key_id} property
63
74
  def initialize(attributes = {})
64
75
  return unless attributes.is_a?(Hash)
65
76
 
@@ -83,6 +94,12 @@ module OCI
83
94
  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
84
95
 
85
96
  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
97
+
98
+ self.kms_key_id = attributes[:'kmsKeyId'] if attributes[:'kmsKeyId']
99
+
100
+ raise 'You cannot provide both :kmsKeyId and :kms_key_id' if attributes.key?(:'kmsKeyId') && attributes.key?(:'kms_key_id')
101
+
102
+ self.kms_key_id = attributes[:'kms_key_id'] if attributes[:'kms_key_id']
86
103
  end
87
104
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
88
105
  # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
@@ -98,7 +115,8 @@ module OCI
98
115
  self.class == other.class &&
99
116
  display_name == other.display_name &&
100
117
  freeform_tags == other.freeform_tags &&
101
- defined_tags == other.defined_tags
118
+ defined_tags == other.defined_tags &&
119
+ kms_key_id == other.kms_key_id
102
120
  end
103
121
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
104
122
 
@@ -114,7 +132,7 @@ module OCI
114
132
  # Calculates hash code according to all attributes.
115
133
  # @return [Fixnum] Hash code
116
134
  def hash
117
- [display_name, freeform_tags, defined_tags].hash
135
+ [display_name, freeform_tags, defined_tags, kms_key_id].hash
118
136
  end
119
137
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
120
138
 
@@ -11,11 +11,16 @@ end
11
11
 
12
12
  # Require models
13
13
  require 'oci/limits/models/create_quota_details'
14
+ require 'oci/limits/models/limit_definition_summary'
15
+ require 'oci/limits/models/limit_value_summary'
14
16
  require 'oci/limits/models/quota'
15
17
  require 'oci/limits/models/quota_summary'
18
+ require 'oci/limits/models/resource_availability'
19
+ require 'oci/limits/models/service_summary'
16
20
  require 'oci/limits/models/update_quota_details'
17
21
 
18
22
  # Require generated clients
23
+ require 'oci/limits/limits_client'
19
24
  require 'oci/limits/quotas_client'
20
25
  require 'oci/limits/quotas_client_composite_operations'
21
26
 
@@ -0,0 +1,444 @@
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
+ # APIs that interact with the resource limits of a specific resource type
9
+ class Limits::LimitsClient
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 LimitsClient.
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 + '/'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "LimitsClient 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://limits.{region}.oci.{secondLevelDomain}') + '/'
98
+ logger.info "LimitsClient 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
+ # For a given compartmentId, resource limit name, and scope, returns the following:
112
+ # - the number of available resources associated with the given limit
113
+ # - the usage in the selected compartment for the given limit
114
+ # Note: not all resource limits support this API. If the value is not available, the API will return 404.
115
+ #
116
+ # @param [String] service_name The service name of the target quota.
117
+ # @param [String] limit_name The limit name for which to fetch the data.
118
+ # @param [String] compartment_id The OCID of the compartment for which data is being fetched.
119
+ # @param [Hash] opts the optional parameters
120
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
121
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
122
+ # @option opts [String] :availability_domain This field is mandatory if the scopeType of the target resource limit is AD.
123
+ # Otherwise, this field should be omitted.
124
+ # If the above requirements are not met, the API will return a 400 - InvalidParameter response.
125
+ #
126
+ # @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
127
+ # particular request, please provide the request ID.
128
+ #
129
+ # @return [Response] A Response object with data of type {OCI::Limits::Models::ResourceAvailability ResourceAvailability}
130
+ def get_resource_availability(service_name, limit_name, compartment_id, opts = {})
131
+ logger.debug 'Calling operation LimitsClient#get_resource_availability.' if logger
132
+
133
+ raise "Missing the required parameter 'service_name' when calling get_resource_availability." if service_name.nil?
134
+ raise "Missing the required parameter 'limit_name' when calling get_resource_availability." if limit_name.nil?
135
+ raise "Missing the required parameter 'compartment_id' when calling get_resource_availability." if compartment_id.nil?
136
+ raise "Parameter value for 'service_name' must not be blank" if OCI::Internal::Util.blank_string?(service_name)
137
+ raise "Parameter value for 'limit_name' must not be blank" if OCI::Internal::Util.blank_string?(limit_name)
138
+
139
+ path = '/20190729/services/{serviceName}/limits/{limitName}/resourceAvailability'.sub('{serviceName}', service_name.to_s).sub('{limitName}', limit_name.to_s)
140
+ operation_signing_strategy = :standard
141
+
142
+ # rubocop:disable Style/NegatedIf
143
+ # Query Params
144
+ query_params = {}
145
+ query_params[:compartmentId] = compartment_id
146
+ query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
147
+
148
+ # Header Params
149
+ header_params = {}
150
+ header_params[:accept] = 'application/json'
151
+ header_params[:'content-type'] = 'application/json'
152
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
153
+ # rubocop:enable Style/NegatedIf
154
+
155
+ post_body = nil
156
+
157
+ # rubocop:disable Metrics/BlockLength
158
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'LimitsClient#get_resource_availability') do
159
+ @api_client.call_api(
160
+ :GET,
161
+ path,
162
+ endpoint,
163
+ header_params: header_params,
164
+ query_params: query_params,
165
+ operation_signing_strategy: operation_signing_strategy,
166
+ body: post_body,
167
+ return_type: 'OCI::Limits::Models::ResourceAvailability'
168
+ )
169
+ end
170
+ # rubocop:enable Metrics/BlockLength
171
+ end
172
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
173
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
174
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
175
+
176
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
177
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
178
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
179
+
180
+
181
+ # Includes a list of resource limits that are currently supported.
182
+ # If the 'areQuotasSupported' property is true, you can create quota policies on top of this limit at the
183
+ # compartment level.
184
+ #
185
+ # @param [String] compartment_id The OCID of the parent compartment (remember that the tenancy is simply the root compartment).
186
+ #
187
+ # @param [Hash] opts the optional parameters
188
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
189
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
190
+ # @option opts [String] :service_name The target service name.
191
+ # @option opts [String] :name Optional field, filter for a specific resource limit.
192
+ # @option opts [String] :sort_by The field to sort by.
193
+ # (default to name)
194
+ # Allowed values are: name, description
195
+ # @option opts [String] :sort_order The sort order to use, either 'asc' or 'desc'. By default it will be ascending.
196
+ # (default to ASC)
197
+ # Allowed values are: ASC, DESC
198
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
199
+ # (default to 100)
200
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
201
+ #
202
+ # @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
203
+ # particular request, please provide the request ID.
204
+ #
205
+ # @return [Response] A Response object with data of type Array<{OCI::Limits::Models::LimitDefinitionSummary LimitDefinitionSummary}>
206
+ def list_limit_definitions(compartment_id, opts = {})
207
+ logger.debug 'Calling operation LimitsClient#list_limit_definitions.' if logger
208
+
209
+ raise "Missing the required parameter 'compartment_id' when calling list_limit_definitions." if compartment_id.nil?
210
+
211
+ if opts[:sort_by] && !%w[name description].include?(opts[:sort_by])
212
+ raise 'Invalid value for "sort_by", must be one of name, description.'
213
+ end
214
+
215
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
216
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
217
+ end
218
+
219
+ path = '/20190729/limitDefinitions'
220
+ operation_signing_strategy = :standard
221
+
222
+ # rubocop:disable Style/NegatedIf
223
+ # Query Params
224
+ query_params = {}
225
+ query_params[:compartmentId] = compartment_id
226
+ query_params[:serviceName] = opts[:service_name] if opts[:service_name]
227
+ query_params[:name] = opts[:name] if opts[:name]
228
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
229
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
230
+ query_params[:limit] = opts[:limit] if opts[:limit]
231
+ query_params[:page] = opts[:page] if opts[:page]
232
+
233
+ # Header Params
234
+ header_params = {}
235
+ header_params[:accept] = 'application/json'
236
+ header_params[:'content-type'] = 'application/json'
237
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
238
+ # rubocop:enable Style/NegatedIf
239
+
240
+ post_body = nil
241
+
242
+ # rubocop:disable Metrics/BlockLength
243
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'LimitsClient#list_limit_definitions') do
244
+ @api_client.call_api(
245
+ :GET,
246
+ path,
247
+ endpoint,
248
+ header_params: header_params,
249
+ query_params: query_params,
250
+ operation_signing_strategy: operation_signing_strategy,
251
+ body: post_body,
252
+ return_type: 'Array<OCI::Limits::Models::LimitDefinitionSummary>'
253
+ )
254
+ end
255
+ # rubocop:enable Metrics/BlockLength
256
+ end
257
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
258
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
259
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
260
+
261
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
262
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
263
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
264
+
265
+
266
+ # Includes a full list of resource limits belonging to a given service.
267
+ #
268
+ # @param [String] compartment_id The OCID of the parent compartment (remember that the tenancy is simply the root compartment).
269
+ #
270
+ # @param [String] service_name The target service name
271
+ # @param [Hash] opts the optional parameters
272
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
273
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
274
+ # @option opts [String] :scope_type Filter entries by scope type.
275
+ # Allowed values are: GLOBAL, REGION, AD
276
+ # @option opts [String] :availability_domain Filter entries by availability domain. This implies that only AD-specific values will be returned.
277
+ #
278
+ # @option opts [String] :name Optional field, can be used to see a specific resource limit value.
279
+ # @option opts [String] :sort_by The field to sort by. We will be implicitly sorting by availabilityDomain, as a second level field, if available.
280
+ # (default to name)
281
+ # Allowed values are: name
282
+ # @option opts [String] :sort_order The sort order to use, either 'asc' or 'desc'. By default it will be ascending.
283
+ # (default to ASC)
284
+ # Allowed values are: ASC, DESC
285
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
286
+ # (default to 100)
287
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
288
+ #
289
+ # @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
290
+ # particular request, please provide the request ID.
291
+ #
292
+ # @return [Response] A Response object with data of type Array<{OCI::Limits::Models::LimitValueSummary LimitValueSummary}>
293
+ def list_limit_values(compartment_id, service_name, opts = {})
294
+ logger.debug 'Calling operation LimitsClient#list_limit_values.' if logger
295
+
296
+ raise "Missing the required parameter 'compartment_id' when calling list_limit_values." if compartment_id.nil?
297
+ raise "Missing the required parameter 'service_name' when calling list_limit_values." if service_name.nil?
298
+
299
+ if opts[:scope_type] && !%w[GLOBAL REGION AD].include?(opts[:scope_type])
300
+ raise 'Invalid value for "scope_type", must be one of GLOBAL, REGION, AD.'
301
+ end
302
+
303
+ if opts[:sort_by] && !%w[name].include?(opts[:sort_by])
304
+ raise 'Invalid value for "sort_by", must be one of name.'
305
+ end
306
+
307
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
308
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
309
+ end
310
+
311
+ path = '/20190729/limitValues'
312
+ operation_signing_strategy = :standard
313
+
314
+ # rubocop:disable Style/NegatedIf
315
+ # Query Params
316
+ query_params = {}
317
+ query_params[:compartmentId] = compartment_id
318
+ query_params[:serviceName] = service_name
319
+ query_params[:scopeType] = opts[:scope_type] if opts[:scope_type]
320
+ query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain]
321
+ query_params[:name] = opts[:name] if opts[:name]
322
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
323
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
324
+ query_params[:limit] = opts[:limit] if opts[:limit]
325
+ query_params[:page] = opts[:page] if opts[:page]
326
+
327
+ # Header Params
328
+ header_params = {}
329
+ header_params[:accept] = 'application/json'
330
+ header_params[:'content-type'] = 'application/json'
331
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
332
+ # rubocop:enable Style/NegatedIf
333
+
334
+ post_body = nil
335
+
336
+ # rubocop:disable Metrics/BlockLength
337
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'LimitsClient#list_limit_values') do
338
+ @api_client.call_api(
339
+ :GET,
340
+ path,
341
+ endpoint,
342
+ header_params: header_params,
343
+ query_params: query_params,
344
+ operation_signing_strategy: operation_signing_strategy,
345
+ body: post_body,
346
+ return_type: 'Array<OCI::Limits::Models::LimitValueSummary>'
347
+ )
348
+ end
349
+ # rubocop:enable Metrics/BlockLength
350
+ end
351
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
352
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
353
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
354
+
355
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
356
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
357
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
358
+
359
+
360
+ # Returns the list of supported services.
361
+ # This will include the programmatic service name, along with the friendly service name.
362
+ #
363
+ # @param [String] compartment_id The OCID of the parent compartment (remember that the tenancy is simply the root compartment).
364
+ #
365
+ # @param [Hash] opts the optional parameters
366
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
367
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
368
+ # @option opts [String] :sort_by The field to sort by.
369
+ # (default to name)
370
+ # Allowed values are: name, description
371
+ # @option opts [String] :sort_order The sort order to use, either 'asc' or 'desc'. By default it will be ascending.
372
+ # (default to ASC)
373
+ # Allowed values are: ASC, DESC
374
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
375
+ # (default to 100)
376
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
377
+ #
378
+ # @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
379
+ # particular request, please provide the request ID.
380
+ #
381
+ # @return [Response] A Response object with data of type Array<{OCI::Limits::Models::ServiceSummary ServiceSummary}>
382
+ def list_services(compartment_id, opts = {})
383
+ logger.debug 'Calling operation LimitsClient#list_services.' if logger
384
+
385
+ raise "Missing the required parameter 'compartment_id' when calling list_services." if compartment_id.nil?
386
+
387
+ if opts[:sort_by] && !%w[name description].include?(opts[:sort_by])
388
+ raise 'Invalid value for "sort_by", must be one of name, description.'
389
+ end
390
+
391
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
392
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
393
+ end
394
+
395
+ path = '/20190729/services'
396
+ operation_signing_strategy = :standard
397
+
398
+ # rubocop:disable Style/NegatedIf
399
+ # Query Params
400
+ query_params = {}
401
+ query_params[:compartmentId] = compartment_id
402
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
403
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
404
+ query_params[:limit] = opts[:limit] if opts[:limit]
405
+ query_params[:page] = opts[:page] if opts[:page]
406
+
407
+ # Header Params
408
+ header_params = {}
409
+ header_params[:accept] = 'application/json'
410
+ header_params[:'content-type'] = 'application/json'
411
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
412
+ # rubocop:enable Style/NegatedIf
413
+
414
+ post_body = nil
415
+
416
+ # rubocop:disable Metrics/BlockLength
417
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'LimitsClient#list_services') do
418
+ @api_client.call_api(
419
+ :GET,
420
+ path,
421
+ endpoint,
422
+ header_params: header_params,
423
+ query_params: query_params,
424
+ operation_signing_strategy: operation_signing_strategy,
425
+ body: post_body,
426
+ return_type: 'Array<OCI::Limits::Models::ServiceSummary>'
427
+ )
428
+ end
429
+ # rubocop:enable Metrics/BlockLength
430
+ end
431
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
432
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
433
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
434
+
435
+ private
436
+
437
+ def applicable_retry_config(opts = {})
438
+ return @retry_config unless opts.key?(:retry_config)
439
+
440
+ opts[:retry_config]
441
+ end
442
+ end
443
+ end
444
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength