oci 2.5.0 → 2.5.1

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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/oci.rb +4 -0
  4. data/lib/oci/auth/federation_client.rb +4 -4
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
  6. data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
  7. data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
  8. data/lib/oci/autoscaling/autoscaling.rb +38 -0
  9. data/lib/oci/autoscaling/models/action.rb +182 -0
  10. data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
  11. data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
  12. data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
  13. data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
  14. data/lib/oci/autoscaling/models/capacity.rb +170 -0
  15. data/lib/oci/autoscaling/models/condition.rb +186 -0
  16. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
  17. data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
  18. data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
  19. data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
  20. data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
  21. data/lib/oci/autoscaling/models/metric.rb +186 -0
  22. data/lib/oci/autoscaling/models/resource.rb +177 -0
  23. data/lib/oci/autoscaling/models/threshold.rb +188 -0
  24. data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
  25. data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
  26. data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
  27. data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
  28. data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
  29. data/lib/oci/autoscaling/util.rb +2 -0
  30. data/lib/oci/core/blockstorage_client.rb +1 -1
  31. data/lib/oci/core/compute_client.rb +1 -1
  32. data/lib/oci/core/compute_management_client.rb +135 -1
  33. data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
  34. data/lib/oci/core/core.rb +8 -0
  35. data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
  36. data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
  37. data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
  38. data/lib/oci/core/models/image.rb +14 -1
  39. data/lib/oci/core/models/instance.rb +18 -2
  40. data/lib/oci/core/models/instance_agent_config.rb +154 -0
  41. data/lib/oci/core/models/instance_agent_features.rb +154 -0
  42. data/lib/oci/core/models/instance_pool.rb +19 -4
  43. data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
  44. data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
  45. data/lib/oci/core/models/instance_summary.rb +19 -4
  46. data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
  47. data/lib/oci/core/models/launch_instance_details.rb +14 -1
  48. data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
  49. data/lib/oci/core/models/update_instance_details.rb +16 -1
  50. data/lib/oci/core/virtual_network_client.rb +1 -1
  51. data/lib/oci/database/database_client.rb +12 -14
  52. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
  53. data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
  54. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
  55. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
  56. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
  57. data/lib/oci/database/models/database_summary.rb +1 -1
  58. data/lib/oci/database/models/db_node.rb +15 -1
  59. data/lib/oci/database/models/db_node_summary.rb +15 -1
  60. data/lib/oci/database/models/db_system.rb +15 -1
  61. data/lib/oci/database/models/db_system_summary.rb +15 -1
  62. data/lib/oci/database/models/db_version_summary.rb +1 -1
  63. data/lib/oci/database/models/launch_db_system_base.rb +33 -2
  64. data/lib/oci/database/models/launch_db_system_details.rb +5 -1
  65. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
  66. data/lib/oci/database/models/update_db_system_details.rb +1 -1
  67. data/lib/oci/identity/identity.rb +4 -0
  68. data/lib/oci/identity/identity_client.rb +468 -12
  69. data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
  70. data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
  71. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
  72. data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
  73. data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
  74. data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
  75. data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
  76. data/lib/oci/identity/models/user.rb +18 -4
  77. data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
  78. data/lib/oci/monitoring/models/alarm.rb +538 -0
  79. data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
  80. data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
  81. data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
  82. data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
  83. data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
  84. data/lib/oci/monitoring/models/datapoint.rb +179 -0
  85. data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
  86. data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
  87. data/lib/oci/monitoring/models/metric.rb +197 -0
  88. data/lib/oci/monitoring/models/metric_data.rb +243 -0
  89. data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
  90. data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
  91. data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
  92. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
  93. data/lib/oci/monitoring/models/suppression.rb +196 -0
  94. data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
  95. data/lib/oci/monitoring/monitoring.rb +37 -0
  96. data/lib/oci/monitoring/monitoring_client.rb +923 -0
  97. data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
  98. data/lib/oci/monitoring/util.rb +2 -0
  99. data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
  100. data/lib/oci/ons/models/confirmation_result.rb +221 -0
  101. data/lib/oci/ons/models/create_subscription_details.rb +238 -0
  102. data/lib/oci/ons/models/create_topic_details.rb +209 -0
  103. data/lib/oci/ons/models/delivery_policy.rb +153 -0
  104. data/lib/oci/ons/models/message_details.rb +163 -0
  105. data/lib/oci/ons/models/notification_topic.rb +302 -0
  106. data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
  107. data/lib/oci/ons/models/publish_result.rb +168 -0
  108. data/lib/oci/ons/models/subscription.rb +273 -0
  109. data/lib/oci/ons/models/subscription_summary.rb +300 -0
  110. data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
  111. data/lib/oci/ons/models/update_subscription_details.rb +188 -0
  112. data/lib/oci/ons/notification_control_plane_client.rb +463 -0
  113. data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
  114. data/lib/oci/ons/notification_data_plane_client.rb +680 -0
  115. data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
  116. data/lib/oci/ons/ons.rb +33 -0
  117. data/lib/oci/ons/util.rb +2 -0
  118. data/lib/oci/regions.rb +5 -0
  119. data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
  120. data/lib/oci/resource_manager/models/config_source.rb +208 -0
  121. data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
  122. data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
  123. data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
  124. data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
  125. data/lib/oci/resource_manager/models/failure_details.rb +185 -0
  126. data/lib/oci/resource_manager/models/job.rb +399 -0
  127. data/lib/oci/resource_manager/models/job_summary.rb +311 -0
  128. data/lib/oci/resource_manager/models/log_entry.rb +225 -0
  129. data/lib/oci/resource_manager/models/stack.rb +305 -0
  130. data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
  131. data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
  132. data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
  133. data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
  134. data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
  135. data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
  136. data/lib/oci/resource_manager/resource_manager.rb +36 -0
  137. data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
  138. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
  139. data/lib/oci/resource_manager/util.rb +2 -0
  140. data/lib/oci/version.rb +1 -1
  141. metadata +100 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf6aff98d6f342152483db6ce35a1bfb4027282bcf917c4107516061cb7f5251
4
- data.tar.gz: fefda2f66264fd6b8f70783b89ec7fcd8cba808b8295f336c6a43af508e067d6
3
+ metadata.gz: 29db1f4d6f69e96943e0e45ac89cd8624f8a0b417871009c2bfad477c6264386
4
+ data.tar.gz: 2799206e495987a0dd5520907bb856d12872a6eb5c81cc68d934e6909f849beb
5
5
  SHA512:
6
- metadata.gz: 4ca16c082548a1d88944371c5f7de08df026fb398920272a86a30d68e4b97945088245527b631aa3d0f731190ee42a1f1976e561618d83db3c1d4c46d82514d3
7
- data.tar.gz: c31bba2b0656027fe0e184e3dae745a0db44d39b318720c24779b72b4834659e9a01cc99956d3e3651d0628629cd04a364821bacae64c676d8930b499ec9001e
6
+ metadata.gz: f765d9de2ec3d96e0a8c22eaa23befceed00d0353bd71c374cfc09cb4525177cc48ddfe0bd1ef04f002e63ca0fbc5f4a16087f6651aea078b53e1ae3a756da0c
7
+ data.tar.gz: 75a10e122c18bf0679aeead98aaee72111ea23ecd8c95551634873ae1bcc946a5e621d2c607f5d9078f192ba0a762ebe2c0ba18eb791bb3c7c4247559abcf3ef
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Oracle Cloud Infrastructure Ruby SDK
2
- **Version 2.5.0**
2
+ **Version 2.5.1**
3
3
 
4
4
  This topic describes how to install, configure, and use the Oracle Cloud Infrastructure Ruby SDK.
5
5
 
@@ -9,6 +9,7 @@ The Ruby SDK supports the following services:
9
9
 
10
10
  * Announcements
11
11
  * Audit
12
+ * Compute Autoscaling
12
13
  * Container Engine
13
14
  * Core Services (which includes Networking, Compute, and Block Volume)
14
15
  * Database
@@ -19,7 +20,10 @@ The Ruby SDK supports the following services:
19
20
  * Identity and Access Management
20
21
  * Key Management
21
22
  * Load Balancing
23
+ * Monitoring
24
+ * Notification
22
25
  * Object Storage
26
+ * Resource Manager
23
27
  * Search
24
28
  * Streaming
25
29
  * Web Application Acceleration and Security
data/lib/oci.rb CHANGED
@@ -34,6 +34,10 @@ require 'oci/announcements_service/announcements_service'
34
34
  require 'oci/waas/waas'
35
35
  require 'oci/healthchecks/healthchecks'
36
36
  require 'oci/streaming/streaming'
37
+ require 'oci/monitoring/monitoring'
38
+ require 'oci/resource_manager/resource_manager'
39
+ require 'oci/autoscaling/autoscaling'
40
+ require 'oci/ons/ons'
37
41
 
38
42
  # Top level module for the Oracle Cloud Infrastructure SDK
39
43
  module OCI
@@ -113,14 +113,14 @@ module OCI
113
113
  request.body = request_payload.to_json
114
114
 
115
115
  header_params = {}
116
- header_params['content-type'] = 'application/json'
116
+ header_params[:'content-type'] = 'application/json'
117
117
  signer.sign(:post, @federation_endpoint, header_params, request.body)
118
118
  header_params.each { |key, value| request[key.to_s] = value }
119
119
 
120
120
  # Additional header info to aid in debugging issues
121
- request['opc-client-info'] = OCI::ApiClient.build_user_info
122
- request['opc-request-id'] ||= OCI::ApiClient.build_request_id
123
- request['User-Agent'] = OCI::ApiClient.build_user_agent
121
+ request[:'opc-client-info'] = OCI::ApiClient.build_user_info
122
+ request[:'opc-request-id'] ||= OCI::ApiClient.build_request_id
123
+ request[:'User-Agent'] = OCI::ApiClient.build_user_agent
124
124
 
125
125
  raw_body = nil
126
126
  @federation_http_client.start do
@@ -17,13 +17,17 @@ module OCI
17
17
  # A SecurityTokenSigner which uses a security token for an instance principal. This signer can also
18
18
  # refresh its token as needed.
19
19
  #
20
- # This signer is self-sufficient in that its internals know how to source the required information to request and use
21
- # the token:
20
+ # This signer is self-sufficient in that its internals know how to source the required information to request and
21
+ # use the token:
22
22
  #
23
- # * Using the metadata endpoint for the instance (http://169.254.169.254/opc/v1) we can discover the region the instance is in, its leaf certificate and any intermediate certificates (for requesting the token) and the tenancy (as) that is in the leaf certificate.
24
- # * The signer leverages {OCI::Auth::FederationClient} so it can refresh the security token and also get the private key needed to sign requests (via the client's session_key_supplier)
23
+ # * Using the metadata endpoint for the instance (http://169.254.169.254/opc/v1) we can discover the region the
24
+ # instance is in, its leaf certificate and any intermediate certificates (for requesting the token) and the
25
+ # tenancy (as) that is in the leaf certificate.
26
+ # * The signer leverages {OCI::Auth::FederationClient} so it can refresh the security token and also get the
27
+ # private key needed to sign requests (via the client's session_key_supplier)
25
28
  class InstancePrincipalsSecurityTokenSigner < OCI::Auth::Signers::X509FederationClientBasedSecurityTokenSigner
26
- # The region the instance is in, as returned from the metadata endpoint for the instance (http://169.254.169.254/opc/v1/instance/region)
29
+ # The region the instance is in, as returned from the metadata endpoint for the instance
30
+ # (http://169.254.169.254/opc/v1/instance/region)
27
31
  # @return [String] The region for the instance
28
32
  attr_reader :region
29
33
 
@@ -35,12 +39,18 @@ module OCI
35
39
 
36
40
  # Creates a new InstancePrincipalsSecurityTokenSigner
37
41
  #
38
- # @param [String] federation_endpoint The endpoint where we will retrieve the instance principals auth token from. If not provided, this will
39
- # default to the endpoint which the instance is in
40
- # @param [String] federation_client_cert_bundle The full file path to a custom certificate bundle which can be used for SSL verification against the federation_endpoint. If not provided (e.g. because a custom bundle is not needed), defaults to nil
41
- # @param [String] signing_strategy Whether this signer is used for Object Storage requests or not. Acceptable values are {OCI::BaseSigner::STANDARD} and {OCI::BaseSigner::OBJECT_STORAGE}. If not provided, defaults to {OCI::BaseSigner::STANDARD}
42
- # @param [Array<String>] headers_to_sign_in_all_requests An array of headers which will be signed in each request. If not provided, defaults to {OCI::BaseSigner::GENERIC_HEADERS}
43
- # @param [Array<String>] body_headers_to_sign An array of headers which should be signed on requests with bodies. If not provided, defaults to {OCI::BaseSigner::BODY_HEADERS}
42
+ # @param [String] federation_endpoint The endpoint where we will retrieve the instance principals auth token
43
+ # from. If not provided, this will default to the endpoint which the instance is in
44
+ # @param [String] federation_client_cert_bundle The full file path to a custom certificate bundle which can be
45
+ # used for SSL verification against the federation_endpoint. If not provided (e.g. because a custom bundle is
46
+ # not needed), defaults to nil
47
+ # @param [String] signing_strategy Whether this signer is used for Object Storage requests or not. Acceptable
48
+ # values are {OCI::BaseSigner::STANDARD} and {OCI::BaseSigner::OBJECT_STORAGE}. If not provided, defaults to
49
+ # {OCI::BaseSigner::STANDARD}
50
+ # @param [Array<String>] headers_to_sign_in_all_requests An array of headers which will be signed in each
51
+ # request. If not provided, defaults to {OCI::BaseSigner::GENERIC_HEADERS}
52
+ # @param [Array<String>] body_headers_to_sign An array of headers which should be signed on requests with
53
+ # bodies. If not provided, defaults to {OCI::BaseSigner::BODY_HEADERS}
44
54
  def initialize(
45
55
  federation_endpoint: nil,
46
56
  federation_client_cert_bundle: nil,
@@ -68,11 +78,7 @@ module OCI
68
78
  raw_region
69
79
  end
70
80
 
71
- @federation_endpoint = if defined?(federation_endpoint)
72
- federation_endpoint
73
- else
74
- "#{OCI::Regions.get_service_endpoint(@region, :Auth)}/v1/x509"
75
- end
81
+ @federation_endpoint = federation_endpoint || "#{OCI::Regions.get_service_endpoint(@region, :Auth)}/v1/x509"
76
82
 
77
83
  @federation_client = OCI::Auth::FederationClient.new(
78
84
  @federation_endpoint,
@@ -0,0 +1,774 @@
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
+ # Auto Scaling API spec
9
+ class Autoscaling::AutoScalingClient
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 AutoScalingClient.
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 + '/20181001'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "AutoScalingClient 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://autoscaling.{region}.oci.{secondLevelDomain}') + '/20181001'
98
+ logger.info "AutoScalingClient 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 an AutoScalingConfiguration
112
+ # @param [OCI::Autoscaling::Models::CreateAutoScalingConfigurationDetails] create_auto_scaling_configuration_details AutoScalingConfiguration creation details
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_request_id
117
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
118
+ # server error without risk of executing that same action again. Retry tokens expire after 24
119
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
120
+ # has been deleted and purged from the system, then a retry of the original creation request
121
+ # may be rejected).
122
+ #
123
+ # @return [Response] A Response object with data of type {OCI::Autoscaling::Models::AutoScalingConfiguration AutoScalingConfiguration}
124
+ def create_auto_scaling_configuration(create_auto_scaling_configuration_details, opts = {})
125
+ logger.debug 'Calling operation AutoScalingClient#create_auto_scaling_configuration.' if logger
126
+
127
+ raise "Missing the required parameter 'create_auto_scaling_configuration_details' when calling create_auto_scaling_configuration." if create_auto_scaling_configuration_details.nil?
128
+
129
+ path = '/autoScalingConfigurations'
130
+ operation_signing_strategy = :standard
131
+
132
+ # rubocop:disable Style/NegatedIf
133
+ # Query Params
134
+ query_params = {}
135
+
136
+ # Header Params
137
+ header_params = {}
138
+ header_params[:accept] = 'application/json'
139
+ header_params[:'content-type'] = 'application/json'
140
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
141
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
142
+ # rubocop:enable Style/NegatedIf
143
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
144
+
145
+ post_body = @api_client.object_to_http_body(create_auto_scaling_configuration_details)
146
+
147
+ # rubocop:disable Metrics/BlockLength
148
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#create_auto_scaling_configuration') do
149
+ @api_client.call_api(
150
+ :POST,
151
+ path,
152
+ endpoint,
153
+ header_params: header_params,
154
+ query_params: query_params,
155
+ operation_signing_strategy: operation_signing_strategy,
156
+ body: post_body,
157
+ return_type: 'OCI::Autoscaling::Models::AutoScalingConfiguration'
158
+ )
159
+ end
160
+ # rubocop:enable Metrics/BlockLength
161
+ end
162
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
163
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
164
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
165
+
166
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
167
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
168
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
169
+
170
+
171
+ # Create a Policy for AutoScalingConfiguration
172
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
173
+ # @param [OCI::Autoscaling::Models::CreateAutoScalingPolicyDetails] create_auto_scaling_policy_details AutoScalingConfiguration Policy creation details
174
+ # @param [Hash] opts the optional parameters
175
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
176
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
177
+ # @option opts [String] :opc_request_id
178
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
179
+ # server error without risk of executing that same action again. Retry tokens expire after 24
180
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
181
+ # has been deleted and purged from the system, then a retry of the original creation request
182
+ # may be rejected).
183
+ #
184
+ # @return [Response] A Response object with data of type {OCI::Autoscaling::Models::AutoScalingPolicy AutoScalingPolicy}
185
+ def create_auto_scaling_policy(auto_scaling_configuration_id, create_auto_scaling_policy_details, opts = {})
186
+ logger.debug 'Calling operation AutoScalingClient#create_auto_scaling_policy.' if logger
187
+
188
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling create_auto_scaling_policy." if auto_scaling_configuration_id.nil?
189
+ raise "Missing the required parameter 'create_auto_scaling_policy_details' when calling create_auto_scaling_policy." if create_auto_scaling_policy_details.nil?
190
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
191
+
192
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}/policies'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s)
193
+ operation_signing_strategy = :standard
194
+
195
+ # rubocop:disable Style/NegatedIf
196
+ # Query Params
197
+ query_params = {}
198
+
199
+ # Header Params
200
+ header_params = {}
201
+ header_params[:accept] = 'application/json'
202
+ header_params[:'content-type'] = 'application/json'
203
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
204
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
205
+ # rubocop:enable Style/NegatedIf
206
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
207
+
208
+ post_body = @api_client.object_to_http_body(create_auto_scaling_policy_details)
209
+
210
+ # rubocop:disable Metrics/BlockLength
211
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#create_auto_scaling_policy') do
212
+ @api_client.call_api(
213
+ :POST,
214
+ path,
215
+ endpoint,
216
+ header_params: header_params,
217
+ query_params: query_params,
218
+ operation_signing_strategy: operation_signing_strategy,
219
+ body: post_body,
220
+ return_type: 'OCI::Autoscaling::Models::AutoScalingPolicy'
221
+ )
222
+ end
223
+ # rubocop:enable Metrics/BlockLength
224
+ end
225
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
226
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
227
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
228
+
229
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
230
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
231
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
232
+
233
+
234
+ # Deletes an AutoScalingConfiguration
235
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
236
+ # @param [Hash] opts the optional parameters
237
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
238
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
239
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
240
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
241
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
242
+ #
243
+ # @option opts [String] :opc_request_id
244
+ # @return [Response] A Response object with data of type nil
245
+ def delete_auto_scaling_configuration(auto_scaling_configuration_id, opts = {})
246
+ logger.debug 'Calling operation AutoScalingClient#delete_auto_scaling_configuration.' if logger
247
+
248
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling delete_auto_scaling_configuration." if auto_scaling_configuration_id.nil?
249
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
250
+
251
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s)
252
+ operation_signing_strategy = :standard
253
+
254
+ # rubocop:disable Style/NegatedIf
255
+ # Query Params
256
+ query_params = {}
257
+
258
+ # Header Params
259
+ header_params = {}
260
+ header_params[:accept] = 'application/json'
261
+ header_params[:'content-type'] = 'application/json'
262
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
263
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
264
+ # rubocop:enable Style/NegatedIf
265
+
266
+ post_body = nil
267
+
268
+ # rubocop:disable Metrics/BlockLength
269
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#delete_auto_scaling_configuration') do
270
+ @api_client.call_api(
271
+ :DELETE,
272
+ path,
273
+ endpoint,
274
+ header_params: header_params,
275
+ query_params: query_params,
276
+ operation_signing_strategy: operation_signing_strategy,
277
+ body: post_body
278
+ )
279
+ end
280
+ # rubocop:enable Metrics/BlockLength
281
+ end
282
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
283
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
284
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
285
+
286
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
287
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
288
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
289
+
290
+
291
+ # Deletes an AutoScalingConfiguration Policy
292
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
293
+ # @param [String] auto_scaling_policy_id The ID of the auto scaling configuration policy.
294
+ # @param [Hash] opts the optional parameters
295
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
296
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
297
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
298
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
299
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
300
+ #
301
+ # @option opts [String] :opc_request_id
302
+ # @return [Response] A Response object with data of type nil
303
+ def delete_auto_scaling_policy(auto_scaling_configuration_id, auto_scaling_policy_id, opts = {})
304
+ logger.debug 'Calling operation AutoScalingClient#delete_auto_scaling_policy.' if logger
305
+
306
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling delete_auto_scaling_policy." if auto_scaling_configuration_id.nil?
307
+ raise "Missing the required parameter 'auto_scaling_policy_id' when calling delete_auto_scaling_policy." if auto_scaling_policy_id.nil?
308
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
309
+ raise "Parameter value for 'auto_scaling_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_policy_id)
310
+
311
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}/policies/{autoScalingPolicyId}'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s).sub('{autoScalingPolicyId}', auto_scaling_policy_id.to_s)
312
+ operation_signing_strategy = :standard
313
+
314
+ # rubocop:disable Style/NegatedIf
315
+ # Query Params
316
+ query_params = {}
317
+
318
+ # Header Params
319
+ header_params = {}
320
+ header_params[:accept] = 'application/json'
321
+ header_params[:'content-type'] = 'application/json'
322
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
323
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
324
+ # rubocop:enable Style/NegatedIf
325
+
326
+ post_body = nil
327
+
328
+ # rubocop:disable Metrics/BlockLength
329
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#delete_auto_scaling_policy') do
330
+ @api_client.call_api(
331
+ :DELETE,
332
+ path,
333
+ endpoint,
334
+ header_params: header_params,
335
+ query_params: query_params,
336
+ operation_signing_strategy: operation_signing_strategy,
337
+ body: post_body
338
+ )
339
+ end
340
+ # rubocop:enable Metrics/BlockLength
341
+ end
342
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
343
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
344
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
345
+
346
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
347
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
348
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
349
+
350
+
351
+ # Get AutoScalingConfiguration
352
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
353
+ # @param [Hash] opts the optional parameters
354
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
355
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
356
+ # @option opts [String] :opc_request_id
357
+ # @return [Response] A Response object with data of type {OCI::Autoscaling::Models::AutoScalingConfiguration AutoScalingConfiguration}
358
+ def get_auto_scaling_configuration(auto_scaling_configuration_id, opts = {})
359
+ logger.debug 'Calling operation AutoScalingClient#get_auto_scaling_configuration.' if logger
360
+
361
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling get_auto_scaling_configuration." if auto_scaling_configuration_id.nil?
362
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
363
+
364
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s)
365
+ operation_signing_strategy = :standard
366
+
367
+ # rubocop:disable Style/NegatedIf
368
+ # Query Params
369
+ query_params = {}
370
+
371
+ # Header Params
372
+ header_params = {}
373
+ header_params[:accept] = 'application/json'
374
+ header_params[:'content-type'] = 'application/json'
375
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
376
+ # rubocop:enable Style/NegatedIf
377
+
378
+ post_body = nil
379
+
380
+ # rubocop:disable Metrics/BlockLength
381
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#get_auto_scaling_configuration') do
382
+ @api_client.call_api(
383
+ :GET,
384
+ path,
385
+ endpoint,
386
+ header_params: header_params,
387
+ query_params: query_params,
388
+ operation_signing_strategy: operation_signing_strategy,
389
+ body: post_body,
390
+ return_type: 'OCI::Autoscaling::Models::AutoScalingConfiguration'
391
+ )
392
+ end
393
+ # rubocop:enable Metrics/BlockLength
394
+ end
395
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
396
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
397
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
398
+
399
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
400
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
401
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
402
+
403
+
404
+ # Get Policy from a specific AutoScalingConfiguration
405
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
406
+ # @param [String] auto_scaling_policy_id The ID of the auto scaling configuration policy.
407
+ # @param [Hash] opts the optional parameters
408
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
409
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
410
+ # @option opts [String] :opc_request_id
411
+ # @return [Response] A Response object with data of type {OCI::Autoscaling::Models::AutoScalingPolicy AutoScalingPolicy}
412
+ def get_auto_scaling_policy(auto_scaling_configuration_id, auto_scaling_policy_id, opts = {})
413
+ logger.debug 'Calling operation AutoScalingClient#get_auto_scaling_policy.' if logger
414
+
415
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling get_auto_scaling_policy." if auto_scaling_configuration_id.nil?
416
+ raise "Missing the required parameter 'auto_scaling_policy_id' when calling get_auto_scaling_policy." if auto_scaling_policy_id.nil?
417
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
418
+ raise "Parameter value for 'auto_scaling_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_policy_id)
419
+
420
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}/policies/{autoScalingPolicyId}'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s).sub('{autoScalingPolicyId}', auto_scaling_policy_id.to_s)
421
+ operation_signing_strategy = :standard
422
+
423
+ # rubocop:disable Style/NegatedIf
424
+ # Query Params
425
+ query_params = {}
426
+
427
+ # Header Params
428
+ header_params = {}
429
+ header_params[:accept] = 'application/json'
430
+ header_params[:'content-type'] = 'application/json'
431
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
432
+ # rubocop:enable Style/NegatedIf
433
+
434
+ post_body = nil
435
+
436
+ # rubocop:disable Metrics/BlockLength
437
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#get_auto_scaling_policy') do
438
+ @api_client.call_api(
439
+ :GET,
440
+ path,
441
+ endpoint,
442
+ header_params: header_params,
443
+ query_params: query_params,
444
+ operation_signing_strategy: operation_signing_strategy,
445
+ body: post_body,
446
+ return_type: 'OCI::Autoscaling::Models::AutoScalingPolicy'
447
+ )
448
+ end
449
+ # rubocop:enable Metrics/BlockLength
450
+ end
451
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
452
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
453
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
454
+
455
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
456
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
457
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
458
+
459
+
460
+ # Lists AutoScalingConfigurations in the specific compartment.
461
+ #
462
+ # @param [String] compartment_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment containing the
463
+ # resources monitored by the metric that you are searching for. Use tenancyId to search in
464
+ # the root compartment.
465
+ #
466
+ # @param [Hash] opts the optional parameters
467
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
468
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
469
+ # @option opts [String] :display_name A filter to return only resources that match the given display name exactly.
470
+ #
471
+ # @option opts [String] :opc_request_id
472
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call. For information about pagination, see
473
+ # [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/#API/Concepts/usingapi.htm#List_Pagination).
474
+ #
475
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call. For information about
476
+ # pagination, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/#API/Concepts/usingapi.htm#List_Pagination).
477
+ #
478
+ # @option opts [String] :sort_by The field to sort by. You can provide one sort order (`sortOrder`). Default order for
479
+ # TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME
480
+ # sort order is case sensitive.
481
+ #
482
+ # Allowed values are: TIMECREATED, DISPLAYNAME
483
+ # @option opts [String] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order
484
+ # is case sensitive.
485
+ #
486
+ # Allowed values are: ASC, DESC
487
+ # @return [Response] A Response object with data of type Array<{OCI::Autoscaling::Models::AutoScalingConfigurationSummary AutoScalingConfigurationSummary}>
488
+ def list_auto_scaling_configurations(compartment_id, opts = {})
489
+ logger.debug 'Calling operation AutoScalingClient#list_auto_scaling_configurations.' if logger
490
+
491
+ raise "Missing the required parameter 'compartment_id' when calling list_auto_scaling_configurations." if compartment_id.nil?
492
+
493
+ if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
494
+ raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
495
+ end
496
+
497
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
498
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
499
+ end
500
+
501
+ path = '/autoScalingConfigurations'
502
+ operation_signing_strategy = :standard
503
+
504
+ # rubocop:disable Style/NegatedIf
505
+ # Query Params
506
+ query_params = {}
507
+ query_params[:compartmentId] = compartment_id
508
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
509
+ query_params[:limit] = opts[:limit] if opts[:limit]
510
+ query_params[:page] = opts[:page] if opts[:page]
511
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
512
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
513
+
514
+ # Header Params
515
+ header_params = {}
516
+ header_params[:accept] = 'application/json'
517
+ header_params[:'content-type'] = 'application/json'
518
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
519
+ # rubocop:enable Style/NegatedIf
520
+
521
+ post_body = nil
522
+
523
+ # rubocop:disable Metrics/BlockLength
524
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#list_auto_scaling_configurations') do
525
+ @api_client.call_api(
526
+ :GET,
527
+ path,
528
+ endpoint,
529
+ header_params: header_params,
530
+ query_params: query_params,
531
+ operation_signing_strategy: operation_signing_strategy,
532
+ body: post_body,
533
+ return_type: 'Array<OCI::Autoscaling::Models::AutoScalingConfigurationSummary>'
534
+ )
535
+ end
536
+ # rubocop:enable Metrics/BlockLength
537
+ end
538
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
539
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
540
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
541
+
542
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
543
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
544
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
545
+
546
+
547
+ # Lists Policies in an AutoScalingConfiguration.
548
+ #
549
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
550
+ # @param [Hash] opts the optional parameters
551
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
552
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
553
+ # @option opts [String] :display_name A filter to return only resources that match the given display name exactly.
554
+ #
555
+ # @option opts [String] :opc_request_id
556
+ # @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call. For information about pagination, see
557
+ # [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/#API/Concepts/usingapi.htm#List_Pagination).
558
+ #
559
+ # @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call. For information about
560
+ # pagination, see [List Pagination](https://docs.us-phoenix-1.oraclecloud.com/#API/Concepts/usingapi.htm#List_Pagination).
561
+ #
562
+ # @option opts [String] :sort_by The field to sort by. You can provide one sort order (`sortOrder`). Default order for
563
+ # TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME
564
+ # sort order is case sensitive.
565
+ #
566
+ # Allowed values are: TIMECREATED, DISPLAYNAME
567
+ # @option opts [String] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order
568
+ # is case sensitive.
569
+ #
570
+ # Allowed values are: ASC, DESC
571
+ # @return [Response] A Response object with data of type Array<{OCI::Autoscaling::Models::AutoScalingPolicySummary AutoScalingPolicySummary}>
572
+ def list_auto_scaling_policies(auto_scaling_configuration_id, opts = {})
573
+ logger.debug 'Calling operation AutoScalingClient#list_auto_scaling_policies.' if logger
574
+
575
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling list_auto_scaling_policies." if auto_scaling_configuration_id.nil?
576
+
577
+ if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
578
+ raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
579
+ end
580
+
581
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
582
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
583
+ end
584
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
585
+
586
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}/policies'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s)
587
+ operation_signing_strategy = :standard
588
+
589
+ # rubocop:disable Style/NegatedIf
590
+ # Query Params
591
+ query_params = {}
592
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
593
+ query_params[:limit] = opts[:limit] if opts[:limit]
594
+ query_params[:page] = opts[:page] if opts[:page]
595
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
596
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
597
+
598
+ # Header Params
599
+ header_params = {}
600
+ header_params[:accept] = 'application/json'
601
+ header_params[:'content-type'] = 'application/json'
602
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
603
+ # rubocop:enable Style/NegatedIf
604
+
605
+ post_body = nil
606
+
607
+ # rubocop:disable Metrics/BlockLength
608
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#list_auto_scaling_policies') do
609
+ @api_client.call_api(
610
+ :GET,
611
+ path,
612
+ endpoint,
613
+ header_params: header_params,
614
+ query_params: query_params,
615
+ operation_signing_strategy: operation_signing_strategy,
616
+ body: post_body,
617
+ return_type: 'Array<OCI::Autoscaling::Models::AutoScalingPolicySummary>'
618
+ )
619
+ end
620
+ # rubocop:enable Metrics/BlockLength
621
+ end
622
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
623
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
624
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
625
+
626
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
627
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
628
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
629
+
630
+
631
+ # Updates an AutoScalingConfiguration
632
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
633
+ # @param [OCI::Autoscaling::Models::UpdateAutoScalingConfigurationDetails] update_auto_scaling_configuration_details AutoScalingConfiguration update details
634
+ # @param [Hash] opts the optional parameters
635
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
636
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
637
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
638
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
639
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
640
+ #
641
+ # @option opts [String] :opc_request_id
642
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
643
+ # server error without risk of executing that same action again. Retry tokens expire after 24
644
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
645
+ # has been deleted and purged from the system, then a retry of the original creation request
646
+ # may be rejected).
647
+ #
648
+ # @return [Response] A Response object with data of type {OCI::Autoscaling::Models::AutoScalingConfiguration AutoScalingConfiguration}
649
+ def update_auto_scaling_configuration(auto_scaling_configuration_id, update_auto_scaling_configuration_details, opts = {})
650
+ logger.debug 'Calling operation AutoScalingClient#update_auto_scaling_configuration.' if logger
651
+
652
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling update_auto_scaling_configuration." if auto_scaling_configuration_id.nil?
653
+ raise "Missing the required parameter 'update_auto_scaling_configuration_details' when calling update_auto_scaling_configuration." if update_auto_scaling_configuration_details.nil?
654
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
655
+
656
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s)
657
+ operation_signing_strategy = :standard
658
+
659
+ # rubocop:disable Style/NegatedIf
660
+ # Query Params
661
+ query_params = {}
662
+
663
+ # Header Params
664
+ header_params = {}
665
+ header_params[:accept] = 'application/json'
666
+ header_params[:'content-type'] = 'application/json'
667
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
668
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
669
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
670
+ # rubocop:enable Style/NegatedIf
671
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
672
+
673
+ post_body = @api_client.object_to_http_body(update_auto_scaling_configuration_details)
674
+
675
+ # rubocop:disable Metrics/BlockLength
676
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#update_auto_scaling_configuration') do
677
+ @api_client.call_api(
678
+ :PUT,
679
+ path,
680
+ endpoint,
681
+ header_params: header_params,
682
+ query_params: query_params,
683
+ operation_signing_strategy: operation_signing_strategy,
684
+ body: post_body,
685
+ return_type: 'OCI::Autoscaling::Models::AutoScalingConfiguration'
686
+ )
687
+ end
688
+ # rubocop:enable Metrics/BlockLength
689
+ end
690
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
691
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
692
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
693
+
694
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
695
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
696
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
697
+
698
+
699
+ # Updates a Policy in the specific AutoScalingConfiguration
700
+ # @param [String] auto_scaling_configuration_id The OCID of the auto scaling configuration.
701
+ # @param [String] auto_scaling_policy_id The ID of the auto scaling configuration policy.
702
+ # @param [OCI::Autoscaling::Models::UpdateAutoScalingPolicyDetails] update_auto_scaling_policy_details AutoScalingConfiguration Policy update details
703
+ # @param [Hash] opts the optional parameters
704
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
705
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
706
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
707
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
708
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
709
+ #
710
+ # @option opts [String] :opc_request_id
711
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
712
+ # server error without risk of executing that same action again. Retry tokens expire after 24
713
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
714
+ # has been deleted and purged from the system, then a retry of the original creation request
715
+ # may be rejected).
716
+ #
717
+ # @return [Response] A Response object with data of type {OCI::Autoscaling::Models::AutoScalingPolicy AutoScalingPolicy}
718
+ def update_auto_scaling_policy(auto_scaling_configuration_id, auto_scaling_policy_id, update_auto_scaling_policy_details, opts = {})
719
+ logger.debug 'Calling operation AutoScalingClient#update_auto_scaling_policy.' if logger
720
+
721
+ raise "Missing the required parameter 'auto_scaling_configuration_id' when calling update_auto_scaling_policy." if auto_scaling_configuration_id.nil?
722
+ raise "Missing the required parameter 'auto_scaling_policy_id' when calling update_auto_scaling_policy." if auto_scaling_policy_id.nil?
723
+ raise "Missing the required parameter 'update_auto_scaling_policy_details' when calling update_auto_scaling_policy." if update_auto_scaling_policy_details.nil?
724
+ raise "Parameter value for 'auto_scaling_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_configuration_id)
725
+ raise "Parameter value for 'auto_scaling_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(auto_scaling_policy_id)
726
+
727
+ path = '/autoScalingConfigurations/{autoScalingConfigurationId}/policies/{autoScalingPolicyId}'.sub('{autoScalingConfigurationId}', auto_scaling_configuration_id.to_s).sub('{autoScalingPolicyId}', auto_scaling_policy_id.to_s)
728
+ operation_signing_strategy = :standard
729
+
730
+ # rubocop:disable Style/NegatedIf
731
+ # Query Params
732
+ query_params = {}
733
+
734
+ # Header Params
735
+ header_params = {}
736
+ header_params[:accept] = 'application/json'
737
+ header_params[:'content-type'] = 'application/json'
738
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
739
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
740
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
741
+ # rubocop:enable Style/NegatedIf
742
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
743
+
744
+ post_body = @api_client.object_to_http_body(update_auto_scaling_policy_details)
745
+
746
+ # rubocop:disable Metrics/BlockLength
747
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AutoScalingClient#update_auto_scaling_policy') do
748
+ @api_client.call_api(
749
+ :PUT,
750
+ path,
751
+ endpoint,
752
+ header_params: header_params,
753
+ query_params: query_params,
754
+ operation_signing_strategy: operation_signing_strategy,
755
+ body: post_body,
756
+ return_type: 'OCI::Autoscaling::Models::AutoScalingPolicy'
757
+ )
758
+ end
759
+ # rubocop:enable Metrics/BlockLength
760
+ end
761
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
762
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
763
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
764
+
765
+ private
766
+
767
+ def applicable_retry_config(opts = {})
768
+ return @retry_config unless opts.key?(:retry_config)
769
+
770
+ opts[:retry_config]
771
+ end
772
+ end
773
+ end
774
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength