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,104 @@
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
4
|
+
module OCI
|
5
|
+
# This class provides a wrapper around {OCI::Ons::NotificationDataPlaneClient} 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 Ons::NotificationDataPlaneClientCompositeOperations
|
10
|
+
# The {OCI::Ons::NotificationDataPlaneClient} used to communicate with the service_client
|
11
|
+
#
|
12
|
+
# @return [OCI::Ons::NotificationDataPlaneClient]
|
13
|
+
attr_reader :service_client
|
14
|
+
|
15
|
+
# Initializes a new NotificationDataPlaneClientCompositeOperations
|
16
|
+
#
|
17
|
+
# @param [OCI::Ons::NotificationDataPlaneClient] service_client The client used to communicate with the service.
|
18
|
+
# Defaults to a new service client created via {OCI::Ons::NotificationDataPlaneClient#initialize} with no arguments
|
19
|
+
def initialize(service_client = OCI::Ons::NotificationDataPlaneClient.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::Ons::NotificationDataPlaneClient#create_subscription} and then waits for the {OCI::Ons::Models::Subscription} acted upon
|
28
|
+
# to enter the given state(s).
|
29
|
+
#
|
30
|
+
# @param [OCI::Ons::Models::CreateSubscriptionDetails] create_subscription_details The subscription to create.
|
31
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Ons::Models::Subscription#lifecycle_state}
|
32
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Ons::NotificationDataPlaneClient#create_subscription}
|
33
|
+
# @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
|
34
|
+
# * max_interval_seconds: The maximum interval between queries, in seconds.
|
35
|
+
# * max_wait_seconds The maximum time to wait, in seconds
|
36
|
+
#
|
37
|
+
# @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Ons::Models::Subscription}
|
38
|
+
def create_subscription_and_wait_for_state(create_subscription_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
39
|
+
operation_result = @service_client.create_subscription(create_subscription_details, base_operation_opts)
|
40
|
+
|
41
|
+
return operation_result if wait_for_states.empty?
|
42
|
+
|
43
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
44
|
+
wait_for_resource_id = operation_result.data.id
|
45
|
+
|
46
|
+
begin
|
47
|
+
waiter_result = @service_client.get_subscription(wait_for_resource_id).wait_until(
|
48
|
+
eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
|
49
|
+
max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
|
50
|
+
max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
|
51
|
+
)
|
52
|
+
result_to_return = waiter_result
|
53
|
+
|
54
|
+
return result_to_return
|
55
|
+
rescue StandardError
|
56
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
60
|
+
# rubocop:enable Layout/EmptyLines
|
61
|
+
|
62
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
63
|
+
# rubocop:disable Layout/EmptyLines
|
64
|
+
|
65
|
+
|
66
|
+
# Calls {OCI::Ons::NotificationDataPlaneClient#delete_subscription} and then waits for the {OCI::Ons::Models::Subscription} acted upon
|
67
|
+
# to enter the given state(s).
|
68
|
+
#
|
69
|
+
# @param [String] subscription_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription to delete.
|
70
|
+
#
|
71
|
+
# @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Ons::Models::Subscription#lifecycle_state}
|
72
|
+
# @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Ons::NotificationDataPlaneClient#delete_subscription}
|
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 nil
|
78
|
+
def delete_subscription_and_wait_for_state(subscription_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
|
79
|
+
initial_get_result = @service_client.get_subscription(subscription_id)
|
80
|
+
operation_result = @service_client.delete_subscription(subscription_id, base_operation_opts)
|
81
|
+
|
82
|
+
return operation_result if wait_for_states.empty?
|
83
|
+
|
84
|
+
lowered_wait_for_states = wait_for_states.map(&:downcase)
|
85
|
+
|
86
|
+
begin
|
87
|
+
waiter_result = initial_get_result.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
|
+
succeed_on_not_found: true
|
92
|
+
)
|
93
|
+
result_to_return = waiter_result
|
94
|
+
|
95
|
+
return result_to_return
|
96
|
+
rescue StandardError
|
97
|
+
raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
|
98
|
+
end
|
99
|
+
end
|
100
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
|
101
|
+
# rubocop:enable Layout/EmptyLines
|
102
|
+
end
|
103
|
+
end
|
104
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
data/lib/oci/ons/ons.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
module OCI
|
4
|
+
module Ons
|
5
|
+
# Module containing models for requests made to, and responses received from,
|
6
|
+
# OCI Ons services
|
7
|
+
module Models
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# Require models
|
13
|
+
require 'oci/ons/models/backoff_retry_policy'
|
14
|
+
require 'oci/ons/models/confirmation_result'
|
15
|
+
require 'oci/ons/models/create_subscription_details'
|
16
|
+
require 'oci/ons/models/create_topic_details'
|
17
|
+
require 'oci/ons/models/delivery_policy'
|
18
|
+
require 'oci/ons/models/message_details'
|
19
|
+
require 'oci/ons/models/notification_topic'
|
20
|
+
require 'oci/ons/models/notification_topic_summary'
|
21
|
+
require 'oci/ons/models/publish_result'
|
22
|
+
require 'oci/ons/models/subscription'
|
23
|
+
require 'oci/ons/models/subscription_summary'
|
24
|
+
require 'oci/ons/models/topic_attributes_details'
|
25
|
+
require 'oci/ons/models/update_subscription_details'
|
26
|
+
|
27
|
+
# Require generated clients
|
28
|
+
require 'oci/ons/notification_control_plane_client'
|
29
|
+
require 'oci/ons/notification_data_plane_client'
|
30
|
+
require 'oci/ons/notification_data_plane_client_composite_operations'
|
31
|
+
|
32
|
+
# Require service utilities
|
33
|
+
require 'oci/ons/util'
|
data/lib/oci/ons/util.rb
ADDED
data/lib/oci/regions.rb
CHANGED
@@ -54,6 +54,7 @@ module OCI
|
|
54
54
|
AnnouncementClient: 'announcements',
|
55
55
|
AuditClient: 'audit',
|
56
56
|
Auth: 'auth',
|
57
|
+
AutoScalingClient: 'autoscaling',
|
57
58
|
BlockstorageClient: 'iaas',
|
58
59
|
ComputeClient: 'iaas',
|
59
60
|
ComputeManagementClient: 'iaas',
|
@@ -66,7 +67,11 @@ module OCI
|
|
66
67
|
IdentityClient: 'identity',
|
67
68
|
KmsVaultClient: 'kms',
|
68
69
|
LoadBalancerClient: 'iaas',
|
70
|
+
MonitoringClient: 'telemetry',
|
71
|
+
NotificationControlPlaneClient: 'notification',
|
72
|
+
NotificationDataPlaneClient: 'notification',
|
69
73
|
ObjectStorageClient: 'objectstorage',
|
74
|
+
ResourceManagerClient: 'resourcemanager',
|
70
75
|
ResourceSearchClient: 'query',
|
71
76
|
StreamAdminClient: 'streams',
|
72
77
|
StreamClient: 'streams',
|
@@ -0,0 +1,189 @@
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# Specifies which plan job provides an execution plan for input to the apply or destroy job.
|
8
|
+
# You can set only one of the three job properties. For destroy jobs, only `isAutoApproved` is permitted.
|
9
|
+
#
|
10
|
+
class ResourceManager::Models::ApplyJobPlanResolution # rubocop:disable Metrics/LineLength
|
11
|
+
# OCID that specifies the most recently executed plan job.
|
12
|
+
#
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :plan_job_id
|
15
|
+
|
16
|
+
# Specifies whether to use the OCID of the most recently run plan job.
|
17
|
+
# `True` if using the latest job OCID. Must be a plan job that completed successfully.
|
18
|
+
#
|
19
|
+
# @return [BOOLEAN]
|
20
|
+
attr_accessor :is_use_latest_job_id
|
21
|
+
|
22
|
+
# Specifies whether to use the configuration directly, without reference to a Plan job.
|
23
|
+
# `True` if using the configuration directly. Note that it is not necessary
|
24
|
+
# for a Plan job to have run successfully.
|
25
|
+
#
|
26
|
+
# @return [BOOLEAN]
|
27
|
+
attr_accessor :is_auto_approved
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
# rubocop:disable Style/SymbolLiteral
|
33
|
+
'plan_job_id': :'planJobId',
|
34
|
+
'is_use_latest_job_id': :'isUseLatestJobId',
|
35
|
+
'is_auto_approved': :'isAutoApproved'
|
36
|
+
# rubocop:enable Style/SymbolLiteral
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
# rubocop:disable Style/SymbolLiteral
|
44
|
+
'plan_job_id': :'String',
|
45
|
+
'is_use_latest_job_id': :'BOOLEAN',
|
46
|
+
'is_auto_approved': :'BOOLEAN'
|
47
|
+
# rubocop:enable Style/SymbolLiteral
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
52
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
53
|
+
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
# @option attributes [String] :plan_job_id The value to assign to the {#plan_job_id} property
|
58
|
+
# @option attributes [BOOLEAN] :is_use_latest_job_id The value to assign to the {#is_use_latest_job_id} property
|
59
|
+
# @option attributes [BOOLEAN] :is_auto_approved The value to assign to the {#is_auto_approved} property
|
60
|
+
def initialize(attributes = {})
|
61
|
+
return unless attributes.is_a?(Hash)
|
62
|
+
|
63
|
+
# convert string to symbol for hash key
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
65
|
+
|
66
|
+
self.plan_job_id = attributes[:'planJobId'] if attributes[:'planJobId']
|
67
|
+
|
68
|
+
raise 'You cannot provide both :planJobId and :plan_job_id' if attributes.key?(:'planJobId') && attributes.key?(:'plan_job_id')
|
69
|
+
|
70
|
+
self.plan_job_id = attributes[:'plan_job_id'] if attributes[:'plan_job_id']
|
71
|
+
|
72
|
+
self.is_use_latest_job_id = attributes[:'isUseLatestJobId'] unless attributes[:'isUseLatestJobId'].nil?
|
73
|
+
|
74
|
+
raise 'You cannot provide both :isUseLatestJobId and :is_use_latest_job_id' if attributes.key?(:'isUseLatestJobId') && attributes.key?(:'is_use_latest_job_id')
|
75
|
+
|
76
|
+
self.is_use_latest_job_id = attributes[:'is_use_latest_job_id'] unless attributes[:'is_use_latest_job_id'].nil?
|
77
|
+
|
78
|
+
self.is_auto_approved = attributes[:'isAutoApproved'] unless attributes[:'isAutoApproved'].nil?
|
79
|
+
|
80
|
+
raise 'You cannot provide both :isAutoApproved and :is_auto_approved' if attributes.key?(:'isAutoApproved') && attributes.key?(:'is_auto_approved')
|
81
|
+
|
82
|
+
self.is_auto_approved = attributes[:'is_auto_approved'] unless attributes[:'is_auto_approved'].nil?
|
83
|
+
end
|
84
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
85
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
86
|
+
|
87
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
88
|
+
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] other the other object to be compared
|
92
|
+
def ==(other)
|
93
|
+
return true if equal?(other)
|
94
|
+
|
95
|
+
self.class == other.class &&
|
96
|
+
plan_job_id == other.plan_job_id &&
|
97
|
+
is_use_latest_job_id == other.is_use_latest_job_id &&
|
98
|
+
is_auto_approved == other.is_auto_approved
|
99
|
+
end
|
100
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
101
|
+
|
102
|
+
# @see the `==` method
|
103
|
+
# @param [Object] other the other object to be compared
|
104
|
+
def eql?(other)
|
105
|
+
self == other
|
106
|
+
end
|
107
|
+
|
108
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
109
|
+
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Fixnum] Hash code
|
113
|
+
def hash
|
114
|
+
[plan_job_id, is_use_latest_job_id, is_auto_approved].hash
|
115
|
+
end
|
116
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
117
|
+
|
118
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
119
|
+
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
|
127
|
+
self.class.swagger_types.each_pair do |key, type|
|
128
|
+
if type =~ /^Array<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
132
|
+
public_method("#{key}=").call(
|
133
|
+
attributes[self.class.attribute_map[key]]
|
134
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
135
|
+
)
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
public_method("#{key}=").call(
|
139
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
140
|
+
)
|
141
|
+
end
|
142
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
143
|
+
end
|
144
|
+
|
145
|
+
self
|
146
|
+
end
|
147
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
148
|
+
|
149
|
+
# Returns the string representation of the object
|
150
|
+
# @return [String] String presentation of the object
|
151
|
+
def to_s
|
152
|
+
to_hash.to_s
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the object in the form of hash
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_hash
|
158
|
+
hash = {}
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
160
|
+
value = public_method(attr).call
|
161
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
162
|
+
|
163
|
+
hash[param] = _to_hash(value)
|
164
|
+
end
|
165
|
+
hash
|
166
|
+
end
|
167
|
+
|
168
|
+
private
|
169
|
+
|
170
|
+
# Outputs non-array value in the form of hash
|
171
|
+
# For object, use to_hash. Otherwise, just return the value
|
172
|
+
# @param [Object] value Any valid value
|
173
|
+
# @return [Hash] Returns the value in the form of hash
|
174
|
+
def _to_hash(value)
|
175
|
+
if value.is_a?(Array)
|
176
|
+
value.compact.map { |v| _to_hash(v) }
|
177
|
+
elsif value.is_a?(Hash)
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
180
|
+
end
|
181
|
+
elsif value.respond_to? :to_hash
|
182
|
+
value.to_hash
|
183
|
+
else
|
184
|
+
value
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,208 @@
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
7
|
+
module OCI
|
8
|
+
# Location of the zip file that contains the Terraform configuration.
|
9
|
+
#
|
10
|
+
# This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
|
11
|
+
class ResourceManager::Models::ConfigSource # rubocop:disable Metrics/LineLength
|
12
|
+
CONFIG_SOURCE_TYPE_ENUM = [
|
13
|
+
CONFIG_SOURCE_TYPE_ZIP_UPLOAD = 'ZIP_UPLOAD'.freeze,
|
14
|
+
CONFIG_SOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
15
|
+
].freeze
|
16
|
+
|
17
|
+
# **[Required]** The configuration file type.
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
attr_reader :config_source_type
|
21
|
+
|
22
|
+
# File path to the directory from which Terraform runs.
|
23
|
+
# If not specified, we use the root directory.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :working_directory
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
# rubocop:disable Style/SymbolLiteral
|
32
|
+
'config_source_type': :'configSourceType',
|
33
|
+
'working_directory': :'workingDirectory'
|
34
|
+
# rubocop:enable Style/SymbolLiteral
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
# rubocop:disable Style/SymbolLiteral
|
42
|
+
'config_source_type': :'String',
|
43
|
+
'working_directory': :'String'
|
44
|
+
# rubocop:enable Style/SymbolLiteral
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Layout/EmptyLines
|
49
|
+
|
50
|
+
|
51
|
+
# Given the hash representation of a subtype of this class,
|
52
|
+
# use the info in the hash to return the class of the subtype.
|
53
|
+
def self.get_subtype(object_hash)
|
54
|
+
type = object_hash[:'configSourceType'] # rubocop:disable Style/SymbolLiteral
|
55
|
+
|
56
|
+
return 'OCI::ResourceManager::Models::ZipUploadConfigSource' if type == 'ZIP_UPLOAD'
|
57
|
+
|
58
|
+
# TODO: Log a warning when the subtype is not found.
|
59
|
+
'OCI::ResourceManager::Models::ConfigSource'
|
60
|
+
end
|
61
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Layout/EmptyLines
|
62
|
+
|
63
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
64
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
65
|
+
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
# @option attributes [String] :config_source_type The value to assign to the {#config_source_type} property
|
70
|
+
# @option attributes [String] :working_directory The value to assign to the {#working_directory} property
|
71
|
+
def initialize(attributes = {})
|
72
|
+
return unless attributes.is_a?(Hash)
|
73
|
+
|
74
|
+
# convert string to symbol for hash key
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
76
|
+
|
77
|
+
self.config_source_type = attributes[:'configSourceType'] if attributes[:'configSourceType']
|
78
|
+
|
79
|
+
raise 'You cannot provide both :configSourceType and :config_source_type' if attributes.key?(:'configSourceType') && attributes.key?(:'config_source_type')
|
80
|
+
|
81
|
+
self.config_source_type = attributes[:'config_source_type'] if attributes[:'config_source_type']
|
82
|
+
|
83
|
+
self.working_directory = attributes[:'workingDirectory'] if attributes[:'workingDirectory']
|
84
|
+
|
85
|
+
raise 'You cannot provide both :workingDirectory and :working_directory' if attributes.key?(:'workingDirectory') && attributes.key?(:'working_directory')
|
86
|
+
|
87
|
+
self.working_directory = attributes[:'working_directory'] if attributes[:'working_directory']
|
88
|
+
end
|
89
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
90
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
91
|
+
|
92
|
+
# Custom attribute writer method checking allowed values (enum).
|
93
|
+
# @param [Object] config_source_type Object to be assigned
|
94
|
+
def config_source_type=(config_source_type)
|
95
|
+
# rubocop:disable Style/ConditionalAssignment
|
96
|
+
if config_source_type && !CONFIG_SOURCE_TYPE_ENUM.include?(config_source_type)
|
97
|
+
# rubocop: disable Metrics/LineLength
|
98
|
+
OCI.logger.debug("Unknown value for 'config_source_type' [" + config_source_type + "]. Mapping to 'CONFIG_SOURCE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
99
|
+
# rubocop: enable Metrics/LineLength
|
100
|
+
@config_source_type = CONFIG_SOURCE_TYPE_UNKNOWN_ENUM_VALUE
|
101
|
+
else
|
102
|
+
@config_source_type = config_source_type
|
103
|
+
end
|
104
|
+
# rubocop:enable Style/ConditionalAssignment
|
105
|
+
end
|
106
|
+
|
107
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
108
|
+
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] other the other object to be compared
|
112
|
+
def ==(other)
|
113
|
+
return true if equal?(other)
|
114
|
+
|
115
|
+
self.class == other.class &&
|
116
|
+
config_source_type == other.config_source_type &&
|
117
|
+
working_directory == other.working_directory
|
118
|
+
end
|
119
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] other the other object to be compared
|
123
|
+
def eql?(other)
|
124
|
+
self == other
|
125
|
+
end
|
126
|
+
|
127
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
128
|
+
|
129
|
+
|
130
|
+
# Calculates hash code according to all attributes.
|
131
|
+
# @return [Fixnum] Hash code
|
132
|
+
def hash
|
133
|
+
[config_source_type, working_directory].hash
|
134
|
+
end
|
135
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
136
|
+
|
137
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
138
|
+
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
|
146
|
+
self.class.swagger_types.each_pair do |key, type|
|
147
|
+
if type =~ /^Array<(.*)>/i
|
148
|
+
# check to ensure the input is an array given that the the attribute
|
149
|
+
# is documented as an array but the input is not
|
150
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
151
|
+
public_method("#{key}=").call(
|
152
|
+
attributes[self.class.attribute_map[key]]
|
153
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
154
|
+
)
|
155
|
+
end
|
156
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
157
|
+
public_method("#{key}=").call(
|
158
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
159
|
+
)
|
160
|
+
end
|
161
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
162
|
+
end
|
163
|
+
|
164
|
+
self
|
165
|
+
end
|
166
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
167
|
+
|
168
|
+
# Returns the string representation of the object
|
169
|
+
# @return [String] String presentation of the object
|
170
|
+
def to_s
|
171
|
+
to_hash.to_s
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the object in the form of hash
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_hash
|
177
|
+
hash = {}
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
179
|
+
value = public_method(attr).call
|
180
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
181
|
+
|
182
|
+
hash[param] = _to_hash(value)
|
183
|
+
end
|
184
|
+
hash
|
185
|
+
end
|
186
|
+
|
187
|
+
private
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map { |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|