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.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/oci.rb +4 -0
- data/lib/oci/auth/federation_client.rb +4 -4
- data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
- data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
- data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
- data/lib/oci/autoscaling/autoscaling.rb +38 -0
- data/lib/oci/autoscaling/models/action.rb +182 -0
- data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
- data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
- data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
- data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
- data/lib/oci/autoscaling/models/capacity.rb +170 -0
- data/lib/oci/autoscaling/models/condition.rb +186 -0
- data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
- data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
- data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
- data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
- data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
- data/lib/oci/autoscaling/models/metric.rb +186 -0
- data/lib/oci/autoscaling/models/resource.rb +177 -0
- data/lib/oci/autoscaling/models/threshold.rb +188 -0
- data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
- data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
- data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
- data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
- data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
- data/lib/oci/autoscaling/util.rb +2 -0
- data/lib/oci/core/blockstorage_client.rb +1 -1
- data/lib/oci/core/compute_client.rb +1 -1
- data/lib/oci/core/compute_management_client.rb +135 -1
- data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
- data/lib/oci/core/core.rb +8 -0
- data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
- data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
- data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
- data/lib/oci/core/models/image.rb +14 -1
- data/lib/oci/core/models/instance.rb +18 -2
- data/lib/oci/core/models/instance_agent_config.rb +154 -0
- data/lib/oci/core/models/instance_agent_features.rb +154 -0
- data/lib/oci/core/models/instance_pool.rb +19 -4
- data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
- data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
- data/lib/oci/core/models/instance_summary.rb +19 -4
- data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
- data/lib/oci/core/models/launch_instance_details.rb +14 -1
- data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
- data/lib/oci/core/models/update_instance_details.rb +16 -1
- data/lib/oci/core/virtual_network_client.rb +1 -1
- data/lib/oci/database/database_client.rb +12 -14
- data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
- data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
- data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
- data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
- data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
- data/lib/oci/database/models/database_summary.rb +1 -1
- data/lib/oci/database/models/db_node.rb +15 -1
- data/lib/oci/database/models/db_node_summary.rb +15 -1
- data/lib/oci/database/models/db_system.rb +15 -1
- data/lib/oci/database/models/db_system_summary.rb +15 -1
- data/lib/oci/database/models/db_version_summary.rb +1 -1
- data/lib/oci/database/models/launch_db_system_base.rb +33 -2
- data/lib/oci/database/models/launch_db_system_details.rb +5 -1
- data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
- data/lib/oci/database/models/update_db_system_details.rb +1 -1
- data/lib/oci/identity/identity.rb +4 -0
- data/lib/oci/identity/identity_client.rb +468 -12
- data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
- data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
- data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
- data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
- data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
- data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
- data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
- data/lib/oci/identity/models/user.rb +18 -4
- data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
- data/lib/oci/monitoring/models/alarm.rb +538 -0
- data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
- data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
- data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
- data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
- data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
- data/lib/oci/monitoring/models/datapoint.rb +179 -0
- data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
- data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
- data/lib/oci/monitoring/models/metric.rb +197 -0
- data/lib/oci/monitoring/models/metric_data.rb +243 -0
- data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
- data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
- data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
- data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
- data/lib/oci/monitoring/models/suppression.rb +196 -0
- data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
- data/lib/oci/monitoring/monitoring.rb +37 -0
- data/lib/oci/monitoring/monitoring_client.rb +923 -0
- data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
- data/lib/oci/monitoring/util.rb +2 -0
- data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
- data/lib/oci/ons/models/confirmation_result.rb +221 -0
- data/lib/oci/ons/models/create_subscription_details.rb +238 -0
- data/lib/oci/ons/models/create_topic_details.rb +209 -0
- data/lib/oci/ons/models/delivery_policy.rb +153 -0
- data/lib/oci/ons/models/message_details.rb +163 -0
- data/lib/oci/ons/models/notification_topic.rb +302 -0
- data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
- data/lib/oci/ons/models/publish_result.rb +168 -0
- data/lib/oci/ons/models/subscription.rb +273 -0
- data/lib/oci/ons/models/subscription_summary.rb +300 -0
- data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
- data/lib/oci/ons/models/update_subscription_details.rb +188 -0
- data/lib/oci/ons/notification_control_plane_client.rb +463 -0
- data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
- data/lib/oci/ons/notification_data_plane_client.rb +680 -0
- data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
- data/lib/oci/ons/ons.rb +33 -0
- data/lib/oci/ons/util.rb +2 -0
- data/lib/oci/regions.rb +5 -0
- data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
- data/lib/oci/resource_manager/models/config_source.rb +208 -0
- data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
- data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
- data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
- data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
- data/lib/oci/resource_manager/models/failure_details.rb +185 -0
- data/lib/oci/resource_manager/models/job.rb +399 -0
- data/lib/oci/resource_manager/models/job_summary.rb +311 -0
- data/lib/oci/resource_manager/models/log_entry.rb +225 -0
- data/lib/oci/resource_manager/models/stack.rb +305 -0
- data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
- data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
- data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
- data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
- data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
- data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
- data/lib/oci/resource_manager/resource_manager.rb +36 -0
- data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
- data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
- data/lib/oci/resource_manager/util.rb +2 -0
- data/lib/oci/version.rb +1 -1
- metadata +100 -2
@@ -0,0 +1,263 @@
|
|
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::ResourceManager::ResourceManagerClient} 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 ResourceManager::ResourceManagerClientCompositeOperations
|
10
|
+
# The {OCI::ResourceManager::ResourceManagerClient} used to communicate with the service_client
|
11
|
+
#
|
12
|
+
# @return [OCI::ResourceManager::ResourceManagerClient]
|
13
|
+
attr_reader :service_client
|
14
|
+
|
15
|
+
# Initializes a new ResourceManagerClientCompositeOperations
|
16
|
+
#
|
17
|
+
# @param [OCI::ResourceManager::ResourceManagerClient] service_client The client used to communicate with the service.
|
18
|
+
# Defaults to a new service client created via {OCI::ResourceManager::ResourceManagerClient#initialize} with no arguments
|
19
|
+
def initialize(service_client = OCI::ResourceManager::ResourceManagerClient.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::ResourceManager::ResourceManagerClient#cancel_job} and then waits for the {OCI::ResourceManager::Models::Job} acted upon
|
28
|
+
# to enter the given state(s).
|
29
|
+
#
|
30
|
+
# @param [String] job_id The job OCID.
|
31
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ResourceManager::Models::Job#lifecycle_state}
|
32
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ResourceManager::ResourceManagerClient#cancel_job}
|
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 nil
|
38
|
+
def cancel_job_and_wait_for_state(job_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
39
|
+
initial_get_result = @service_client.get_job(job_id)
|
40
|
+
operation_result = @service_client.cancel_job(job_id, base_operation_opts)
|
41
|
+
|
42
|
+
return operation_result if wait_for_states.empty?
|
43
|
+
|
44
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
45
|
+
|
46
|
+
begin
|
47
|
+
waiter_result = initial_get_result.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
|
+
succeed_on_not_found: true
|
52
|
+
)
|
53
|
+
result_to_return = waiter_result
|
54
|
+
|
55
|
+
return result_to_return
|
56
|
+
rescue StandardError
|
57
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
58
|
+
end
|
59
|
+
end
|
60
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
61
|
+
# rubocop:enable Layout/EmptyLines
|
62
|
+
|
63
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
64
|
+
# rubocop:disable Layout/EmptyLines
|
65
|
+
|
66
|
+
|
67
|
+
# Calls {OCI::ResourceManager::ResourceManagerClient#create_job} and then waits for the {OCI::ResourceManager::Models::Job} acted upon
|
68
|
+
# to enter the given state(s).
|
69
|
+
#
|
70
|
+
# @param [OCI::ResourceManager::Models::CreateJobDetails] create_job_details The properties for a request to create a job.
|
71
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ResourceManager::Models::Job#lifecycle_state}
|
72
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ResourceManager::ResourceManagerClient#create_job}
|
73
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
74
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
75
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
76
|
+
#
|
77
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::ResourceManager::Models::Job}
|
78
|
+
def create_job_and_wait_for_state(create_job_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
79
|
+
operation_result = @service_client.create_job(create_job_details, base_operation_opts)
|
80
|
+
|
81
|
+
return operation_result if wait_for_states.empty?
|
82
|
+
|
83
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
84
|
+
wait_for_resource_id = operation_result.data.id
|
85
|
+
|
86
|
+
begin
|
87
|
+
waiter_result = @service_client.get_job(wait_for_resource_id).wait_until(
|
88
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
89
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
90
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
91
|
+
)
|
92
|
+
result_to_return = waiter_result
|
93
|
+
|
94
|
+
return result_to_return
|
95
|
+
rescue StandardError
|
96
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
97
|
+
end
|
98
|
+
end
|
99
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
100
|
+
# rubocop:enable Layout/EmptyLines
|
101
|
+
|
102
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
103
|
+
# rubocop:disable Layout/EmptyLines
|
104
|
+
|
105
|
+
|
106
|
+
# Calls {OCI::ResourceManager::ResourceManagerClient#create_stack} and then waits for the {OCI::ResourceManager::Models::Stack} acted upon
|
107
|
+
# to enter the given state(s).
|
108
|
+
#
|
109
|
+
# @param [OCI::ResourceManager::Models::CreateStackDetails] create_stack_details The properties for creating a stack.
|
110
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ResourceManager::Models::Stack#lifecycle_state}
|
111
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ResourceManager::ResourceManagerClient#create_stack}
|
112
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
113
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
114
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
115
|
+
#
|
116
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::ResourceManager::Models::Stack}
|
117
|
+
def create_stack_and_wait_for_state(create_stack_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
118
|
+
operation_result = @service_client.create_stack(create_stack_details, base_operation_opts)
|
119
|
+
|
120
|
+
return operation_result if wait_for_states.empty?
|
121
|
+
|
122
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
123
|
+
wait_for_resource_id = operation_result.data.id
|
124
|
+
|
125
|
+
begin
|
126
|
+
waiter_result = @service_client.get_stack(wait_for_resource_id).wait_until(
|
127
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
128
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
129
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
130
|
+
)
|
131
|
+
result_to_return = waiter_result
|
132
|
+
|
133
|
+
return result_to_return
|
134
|
+
rescue StandardError
|
135
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
136
|
+
end
|
137
|
+
end
|
138
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
139
|
+
# rubocop:enable Layout/EmptyLines
|
140
|
+
|
141
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
142
|
+
# rubocop:disable Layout/EmptyLines
|
143
|
+
|
144
|
+
|
145
|
+
# Calls {OCI::ResourceManager::ResourceManagerClient#delete_stack} and then waits for the {OCI::ResourceManager::Models::Stack} acted upon
|
146
|
+
# to enter the given state(s).
|
147
|
+
#
|
148
|
+
# @param [String] stack_id The stack OCID.
|
149
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ResourceManager::Models::Stack#lifecycle_state}
|
150
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ResourceManager::ResourceManagerClient#delete_stack}
|
151
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
152
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
153
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
154
|
+
#
|
155
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type nil
|
156
|
+
def delete_stack_and_wait_for_state(stack_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
157
|
+
initial_get_result = @service_client.get_stack(stack_id)
|
158
|
+
operation_result = @service_client.delete_stack(stack_id, base_operation_opts)
|
159
|
+
|
160
|
+
return operation_result if wait_for_states.empty?
|
161
|
+
|
162
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
163
|
+
|
164
|
+
begin
|
165
|
+
waiter_result = initial_get_result.wait_until(
|
166
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
167
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
168
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
|
169
|
+
succeed_on_not_found: true
|
170
|
+
)
|
171
|
+
result_to_return = waiter_result
|
172
|
+
|
173
|
+
return result_to_return
|
174
|
+
rescue StandardError
|
175
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
176
|
+
end
|
177
|
+
end
|
178
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
179
|
+
# rubocop:enable Layout/EmptyLines
|
180
|
+
|
181
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
182
|
+
# rubocop:disable Layout/EmptyLines
|
183
|
+
|
184
|
+
|
185
|
+
# Calls {OCI::ResourceManager::ResourceManagerClient#update_job} and then waits for the {OCI::ResourceManager::Models::Job} acted upon
|
186
|
+
# to enter the given state(s).
|
187
|
+
#
|
188
|
+
# @param [String] job_id The job OCID.
|
189
|
+
# @param [OCI::ResourceManager::Models::UpdateJobDetails] update_job_details Updates properties for the specified job.
|
190
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ResourceManager::Models::Job#lifecycle_state}
|
191
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ResourceManager::ResourceManagerClient#update_job}
|
192
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
193
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
194
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
195
|
+
#
|
196
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::ResourceManager::Models::Job}
|
197
|
+
def update_job_and_wait_for_state(job_id, update_job_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
198
|
+
operation_result = @service_client.update_job(job_id, update_job_details, base_operation_opts)
|
199
|
+
|
200
|
+
return operation_result if wait_for_states.empty?
|
201
|
+
|
202
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
203
|
+
wait_for_resource_id = operation_result.data.id
|
204
|
+
|
205
|
+
begin
|
206
|
+
waiter_result = @service_client.get_job(wait_for_resource_id).wait_until(
|
207
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
208
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
209
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
210
|
+
)
|
211
|
+
result_to_return = waiter_result
|
212
|
+
|
213
|
+
return result_to_return
|
214
|
+
rescue StandardError
|
215
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
216
|
+
end
|
217
|
+
end
|
218
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
219
|
+
# rubocop:enable Layout/EmptyLines
|
220
|
+
|
221
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
222
|
+
# rubocop:disable Layout/EmptyLines
|
223
|
+
|
224
|
+
|
225
|
+
# Calls {OCI::ResourceManager::ResourceManagerClient#update_stack} and then waits for the {OCI::ResourceManager::Models::Stack} acted upon
|
226
|
+
# to enter the given state(s).
|
227
|
+
#
|
228
|
+
# @param [String] stack_id The stack OCID.
|
229
|
+
# @param [OCI::ResourceManager::Models::UpdateStackDetails] update_stack_details Updated information provided for the stack.
|
230
|
+
#
|
231
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ResourceManager::Models::Stack#lifecycle_state}
|
232
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ResourceManager::ResourceManagerClient#update_stack}
|
233
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
234
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
235
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
236
|
+
#
|
237
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::ResourceManager::Models::Stack}
|
238
|
+
def update_stack_and_wait_for_state(stack_id, update_stack_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
239
|
+
operation_result = @service_client.update_stack(stack_id, update_stack_details, base_operation_opts)
|
240
|
+
|
241
|
+
return operation_result if wait_for_states.empty?
|
242
|
+
|
243
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
244
|
+
wait_for_resource_id = operation_result.data.id
|
245
|
+
|
246
|
+
begin
|
247
|
+
waiter_result = @service_client.get_stack(wait_for_resource_id).wait_until(
|
248
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
249
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
250
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
251
|
+
)
|
252
|
+
result_to_return = waiter_result
|
253
|
+
|
254
|
+
return result_to_return
|
255
|
+
rescue StandardError
|
256
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
257
|
+
end
|
258
|
+
end
|
259
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
260
|
+
# rubocop:enable Layout/EmptyLines
|
261
|
+
end
|
262
|
+
end
|
263
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
data/lib/oci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oracle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -245,6 +245,30 @@ files:
|
|
245
245
|
- "./lib/oci/auth/signers/x509_federation_client_based_security_token_signer.rb"
|
246
246
|
- "./lib/oci/auth/url_based_certificate_retriever.rb"
|
247
247
|
- "./lib/oci/auth/util.rb"
|
248
|
+
- "./lib/oci/autoscaling/auto_scaling_client.rb"
|
249
|
+
- "./lib/oci/autoscaling/auto_scaling_client_composite_operations.rb"
|
250
|
+
- "./lib/oci/autoscaling/autoscaling.rb"
|
251
|
+
- "./lib/oci/autoscaling/models/action.rb"
|
252
|
+
- "./lib/oci/autoscaling/models/auto_scaling_configuration.rb"
|
253
|
+
- "./lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb"
|
254
|
+
- "./lib/oci/autoscaling/models/auto_scaling_policy.rb"
|
255
|
+
- "./lib/oci/autoscaling/models/auto_scaling_policy_summary.rb"
|
256
|
+
- "./lib/oci/autoscaling/models/capacity.rb"
|
257
|
+
- "./lib/oci/autoscaling/models/condition.rb"
|
258
|
+
- "./lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb"
|
259
|
+
- "./lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb"
|
260
|
+
- "./lib/oci/autoscaling/models/create_condition_details.rb"
|
261
|
+
- "./lib/oci/autoscaling/models/create_threshold_policy_details.rb"
|
262
|
+
- "./lib/oci/autoscaling/models/instance_pool_resource.rb"
|
263
|
+
- "./lib/oci/autoscaling/models/metric.rb"
|
264
|
+
- "./lib/oci/autoscaling/models/resource.rb"
|
265
|
+
- "./lib/oci/autoscaling/models/threshold.rb"
|
266
|
+
- "./lib/oci/autoscaling/models/threshold_policy.rb"
|
267
|
+
- "./lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb"
|
268
|
+
- "./lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb"
|
269
|
+
- "./lib/oci/autoscaling/models/update_condition_details.rb"
|
270
|
+
- "./lib/oci/autoscaling/models/update_threshold_policy_details.rb"
|
271
|
+
- "./lib/oci/autoscaling/util.rb"
|
248
272
|
- "./lib/oci/base_signer.rb"
|
249
273
|
- "./lib/oci/config.rb"
|
250
274
|
- "./lib/oci/config_file_loader.rb"
|
@@ -296,6 +320,7 @@ files:
|
|
296
320
|
- "./lib/oci/core/models/app_catalog_subscription_summary.rb"
|
297
321
|
- "./lib/oci/core/models/attach_boot_volume_details.rb"
|
298
322
|
- "./lib/oci/core/models/attach_i_scsi_volume_details.rb"
|
323
|
+
- "./lib/oci/core/models/attach_load_balancer_details.rb"
|
299
324
|
- "./lib/oci/core/models/attach_paravirtualized_volume_details.rb"
|
300
325
|
- "./lib/oci/core/models/attach_vnic_details.rb"
|
301
326
|
- "./lib/oci/core/models/attach_volume_details.rb"
|
@@ -356,6 +381,7 @@ files:
|
|
356
381
|
- "./lib/oci/core/models/cross_connect_port_speed_shape.rb"
|
357
382
|
- "./lib/oci/core/models/cross_connect_status.rb"
|
358
383
|
- "./lib/oci/core/models/delete_virtual_circuit_public_prefix_details.rb"
|
384
|
+
- "./lib/oci/core/models/detach_load_balancer_details.rb"
|
359
385
|
- "./lib/oci/core/models/device.rb"
|
360
386
|
- "./lib/oci/core/models/dhcp_dns_option.rb"
|
361
387
|
- "./lib/oci/core/models/dhcp_option.rb"
|
@@ -378,6 +404,8 @@ files:
|
|
378
404
|
- "./lib/oci/core/models/image_source_via_object_storage_uri_details.rb"
|
379
405
|
- "./lib/oci/core/models/ingress_security_rule.rb"
|
380
406
|
- "./lib/oci/core/models/instance.rb"
|
407
|
+
- "./lib/oci/core/models/instance_agent_config.rb"
|
408
|
+
- "./lib/oci/core/models/instance_agent_features.rb"
|
381
409
|
- "./lib/oci/core/models/instance_configuration.rb"
|
382
410
|
- "./lib/oci/core/models/instance_configuration_attach_vnic_details.rb"
|
383
411
|
- "./lib/oci/core/models/instance_configuration_attach_volume_details.rb"
|
@@ -398,6 +426,8 @@ files:
|
|
398
426
|
- "./lib/oci/core/models/instance_console_connection.rb"
|
399
427
|
- "./lib/oci/core/models/instance_credentials.rb"
|
400
428
|
- "./lib/oci/core/models/instance_pool.rb"
|
429
|
+
- "./lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb"
|
430
|
+
- "./lib/oci/core/models/instance_pool_load_balancer_attachment.rb"
|
401
431
|
- "./lib/oci/core/models/instance_pool_placement_configuration.rb"
|
402
432
|
- "./lib/oci/core/models/instance_pool_placement_secondary_vnic_subnet.rb"
|
403
433
|
- "./lib/oci/core/models/instance_pool_summary.rb"
|
@@ -409,6 +439,7 @@ files:
|
|
409
439
|
- "./lib/oci/core/models/ip_sec_connection.rb"
|
410
440
|
- "./lib/oci/core/models/ip_sec_connection_device_config.rb"
|
411
441
|
- "./lib/oci/core/models/ip_sec_connection_device_status.rb"
|
442
|
+
- "./lib/oci/core/models/launch_instance_agent_config_details.rb"
|
412
443
|
- "./lib/oci/core/models/launch_instance_details.rb"
|
413
444
|
- "./lib/oci/core/models/launch_options.rb"
|
414
445
|
- "./lib/oci/core/models/letter_of_authority.rb"
|
@@ -444,6 +475,7 @@ files:
|
|
444
475
|
- "./lib/oci/core/models/update_drg_attachment_details.rb"
|
445
476
|
- "./lib/oci/core/models/update_drg_details.rb"
|
446
477
|
- "./lib/oci/core/models/update_image_details.rb"
|
478
|
+
- "./lib/oci/core/models/update_instance_agent_config_details.rb"
|
447
479
|
- "./lib/oci/core/models/update_instance_configuration_details.rb"
|
448
480
|
- "./lib/oci/core/models/update_instance_details.rb"
|
449
481
|
- "./lib/oci/core/models/update_instance_pool_details.rb"
|
@@ -678,6 +710,7 @@ files:
|
|
678
710
|
- "./lib/oci/identity/models/api_key.rb"
|
679
711
|
- "./lib/oci/identity/models/auth_token.rb"
|
680
712
|
- "./lib/oci/identity/models/availability_domain.rb"
|
713
|
+
- "./lib/oci/identity/models/change_tag_namespace_compartment_detail.rb"
|
681
714
|
- "./lib/oci/identity/models/compartment.rb"
|
682
715
|
- "./lib/oci/identity/models/create_api_key_details.rb"
|
683
716
|
- "./lib/oci/identity/models/create_auth_token_details.rb"
|
@@ -703,6 +736,9 @@ files:
|
|
703
736
|
- "./lib/oci/identity/models/identity_provider.rb"
|
704
737
|
- "./lib/oci/identity/models/identity_provider_group_summary.rb"
|
705
738
|
- "./lib/oci/identity/models/idp_group_mapping.rb"
|
739
|
+
- "./lib/oci/identity/models/mfa_totp_device.rb"
|
740
|
+
- "./lib/oci/identity/models/mfa_totp_device_summary.rb"
|
741
|
+
- "./lib/oci/identity/models/mfa_totp_token.rb"
|
706
742
|
- "./lib/oci/identity/models/policy.rb"
|
707
743
|
- "./lib/oci/identity/models/region.rb"
|
708
744
|
- "./lib/oci/identity/models/region_subscription.rb"
|
@@ -831,6 +867,28 @@ files:
|
|
831
867
|
- "./lib/oci/load_balancer/models/work_request.rb"
|
832
868
|
- "./lib/oci/load_balancer/models/work_request_error.rb"
|
833
869
|
- "./lib/oci/load_balancer/util.rb"
|
870
|
+
- "./lib/oci/monitoring/models/aggregated_datapoint.rb"
|
871
|
+
- "./lib/oci/monitoring/models/alarm.rb"
|
872
|
+
- "./lib/oci/monitoring/models/alarm_history_collection.rb"
|
873
|
+
- "./lib/oci/monitoring/models/alarm_history_entry.rb"
|
874
|
+
- "./lib/oci/monitoring/models/alarm_status_summary.rb"
|
875
|
+
- "./lib/oci/monitoring/models/alarm_summary.rb"
|
876
|
+
- "./lib/oci/monitoring/models/create_alarm_details.rb"
|
877
|
+
- "./lib/oci/monitoring/models/datapoint.rb"
|
878
|
+
- "./lib/oci/monitoring/models/failed_metric_record.rb"
|
879
|
+
- "./lib/oci/monitoring/models/list_metrics_details.rb"
|
880
|
+
- "./lib/oci/monitoring/models/metric.rb"
|
881
|
+
- "./lib/oci/monitoring/models/metric_data.rb"
|
882
|
+
- "./lib/oci/monitoring/models/metric_data_details.rb"
|
883
|
+
- "./lib/oci/monitoring/models/post_metric_data_details.rb"
|
884
|
+
- "./lib/oci/monitoring/models/post_metric_data_response_details.rb"
|
885
|
+
- "./lib/oci/monitoring/models/summarize_metrics_data_details.rb"
|
886
|
+
- "./lib/oci/monitoring/models/suppression.rb"
|
887
|
+
- "./lib/oci/monitoring/models/update_alarm_details.rb"
|
888
|
+
- "./lib/oci/monitoring/monitoring.rb"
|
889
|
+
- "./lib/oci/monitoring/monitoring_client.rb"
|
890
|
+
- "./lib/oci/monitoring/monitoring_client_composite_operations.rb"
|
891
|
+
- "./lib/oci/monitoring/util.rb"
|
834
892
|
- "./lib/oci/object_storage/models/bucket.rb"
|
835
893
|
- "./lib/oci/object_storage/models/bucket_summary.rb"
|
836
894
|
- "./lib/oci/object_storage/models/commit_multipart_upload_details.rb"
|
@@ -872,7 +930,47 @@ files:
|
|
872
930
|
- "./lib/oci/object_storage/transfer/upload_manager.rb"
|
873
931
|
- "./lib/oci/object_storage/transfer/upload_manager_config.rb"
|
874
932
|
- "./lib/oci/object_storage/util.rb"
|
933
|
+
- "./lib/oci/ons/models/backoff_retry_policy.rb"
|
934
|
+
- "./lib/oci/ons/models/confirmation_result.rb"
|
935
|
+
- "./lib/oci/ons/models/create_subscription_details.rb"
|
936
|
+
- "./lib/oci/ons/models/create_topic_details.rb"
|
937
|
+
- "./lib/oci/ons/models/delivery_policy.rb"
|
938
|
+
- "./lib/oci/ons/models/message_details.rb"
|
939
|
+
- "./lib/oci/ons/models/notification_topic.rb"
|
940
|
+
- "./lib/oci/ons/models/notification_topic_summary.rb"
|
941
|
+
- "./lib/oci/ons/models/publish_result.rb"
|
942
|
+
- "./lib/oci/ons/models/subscription.rb"
|
943
|
+
- "./lib/oci/ons/models/subscription_summary.rb"
|
944
|
+
- "./lib/oci/ons/models/topic_attributes_details.rb"
|
945
|
+
- "./lib/oci/ons/models/update_subscription_details.rb"
|
946
|
+
- "./lib/oci/ons/notification_control_plane_client.rb"
|
947
|
+
- "./lib/oci/ons/notification_control_plane_client_composite_operations.rb"
|
948
|
+
- "./lib/oci/ons/notification_data_plane_client.rb"
|
949
|
+
- "./lib/oci/ons/notification_data_plane_client_composite_operations.rb"
|
950
|
+
- "./lib/oci/ons/ons.rb"
|
951
|
+
- "./lib/oci/ons/util.rb"
|
875
952
|
- "./lib/oci/regions.rb"
|
953
|
+
- "./lib/oci/resource_manager/models/apply_job_plan_resolution.rb"
|
954
|
+
- "./lib/oci/resource_manager/models/config_source.rb"
|
955
|
+
- "./lib/oci/resource_manager/models/create_config_source_details.rb"
|
956
|
+
- "./lib/oci/resource_manager/models/create_job_details.rb"
|
957
|
+
- "./lib/oci/resource_manager/models/create_stack_details.rb"
|
958
|
+
- "./lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb"
|
959
|
+
- "./lib/oci/resource_manager/models/failure_details.rb"
|
960
|
+
- "./lib/oci/resource_manager/models/job.rb"
|
961
|
+
- "./lib/oci/resource_manager/models/job_summary.rb"
|
962
|
+
- "./lib/oci/resource_manager/models/log_entry.rb"
|
963
|
+
- "./lib/oci/resource_manager/models/stack.rb"
|
964
|
+
- "./lib/oci/resource_manager/models/stack_summary.rb"
|
965
|
+
- "./lib/oci/resource_manager/models/update_config_source_details.rb"
|
966
|
+
- "./lib/oci/resource_manager/models/update_job_details.rb"
|
967
|
+
- "./lib/oci/resource_manager/models/update_stack_details.rb"
|
968
|
+
- "./lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb"
|
969
|
+
- "./lib/oci/resource_manager/models/zip_upload_config_source.rb"
|
970
|
+
- "./lib/oci/resource_manager/resource_manager.rb"
|
971
|
+
- "./lib/oci/resource_manager/resource_manager_client.rb"
|
972
|
+
- "./lib/oci/resource_manager/resource_manager_client_composite_operations.rb"
|
973
|
+
- "./lib/oci/resource_manager/util.rb"
|
876
974
|
- "./lib/oci/resource_search/models/free_text_search_details.rb"
|
877
975
|
- "./lib/oci/resource_search/models/queryable_field_description.rb"
|
878
976
|
- "./lib/oci/resource_search/models/resource_summary.rb"
|