oci 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,176 @@
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
+ # Update details for Condition in a ThresholdPolicy
8
+ #
9
+ class Autoscaling::Models::UpdateConditionDetails # rubocop:disable Metrics/LineLength
10
+ # This attribute is required.
11
+ # @return [OCI::Autoscaling::Models::Action]
12
+ attr_accessor :action
13
+
14
+ # A user-friendly name for the AutoScalingConfiguration condition details. Does not have to be unique, and
15
+ # it's changeable. Avoid entering confidential information.
16
+ #
17
+ # @return [String]
18
+ attr_accessor :display_name
19
+
20
+ # This attribute is required.
21
+ # @return [OCI::Autoscaling::Models::Metric]
22
+ attr_accessor :metric
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ # rubocop:disable Style/SymbolLiteral
28
+ 'action': :'action',
29
+ 'display_name': :'displayName',
30
+ 'metric': :'metric'
31
+ # rubocop:enable Style/SymbolLiteral
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ # rubocop:disable Style/SymbolLiteral
39
+ 'action': :'OCI::Autoscaling::Models::Action',
40
+ 'display_name': :'String',
41
+ 'metric': :'OCI::Autoscaling::Models::Metric'
42
+ # rubocop:enable Style/SymbolLiteral
43
+ }
44
+ end
45
+
46
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
47
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
48
+
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ # @option attributes [OCI::Autoscaling::Models::Action] :action The value to assign to the {#action} property
53
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
54
+ # @option attributes [OCI::Autoscaling::Models::Metric] :metric The value to assign to the {#metric} property
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ self.action = attributes[:'action'] if attributes[:'action']
62
+
63
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
64
+
65
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
66
+
67
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
68
+
69
+ self.metric = attributes[:'metric'] if attributes[:'metric']
70
+ end
71
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
72
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
73
+
74
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
75
+
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] other the other object to be compared
79
+ def ==(other)
80
+ return true if equal?(other)
81
+
82
+ self.class == other.class &&
83
+ action == other.action &&
84
+ display_name == other.display_name &&
85
+ metric == other.metric
86
+ end
87
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
88
+
89
+ # @see the `==` method
90
+ # @param [Object] other the other object to be compared
91
+ def eql?(other)
92
+ self == other
93
+ end
94
+
95
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
96
+
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [action, display_name, metric].hash
102
+ end
103
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
104
+
105
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
106
+
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+
114
+ self.class.swagger_types.each_pair do |key, type|
115
+ if type =~ /^Array<(.*)>/i
116
+ # check to ensure the input is an array given that the the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ public_method("#{key}=").call(
120
+ attributes[self.class.attribute_map[key]]
121
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
122
+ )
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ public_method("#{key}=").call(
126
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
127
+ )
128
+ end
129
+ # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
135
+
136
+ # Returns the string representation of the object
137
+ # @return [String] String presentation of the object
138
+ def to_s
139
+ to_hash.to_s
140
+ end
141
+
142
+ # Returns the object in the form of hash
143
+ # @return [Hash] Returns the object in the form of hash
144
+ def to_hash
145
+ hash = {}
146
+ self.class.attribute_map.each_pair do |attr, param|
147
+ value = public_method(attr).call
148
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ private
156
+
157
+ # Outputs non-array value in the form of hash
158
+ # For object, use to_hash. Otherwise, just return the value
159
+ # @param [Object] value Any valid value
160
+ # @return [Hash] Returns the value in the form of hash
161
+ def _to_hash(value)
162
+ if value.is_a?(Array)
163
+ value.compact.map { |v| _to_hash(v) }
164
+ elsif value.is_a?(Hash)
165
+ {}.tap do |hash|
166
+ value.each { |k, v| hash[k] = _to_hash(v) }
167
+ end
168
+ elsif value.respond_to? :to_hash
169
+ value.to_hash
170
+ else
171
+ value
172
+ end
173
+ end
174
+ end
175
+ end
176
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,164 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'update_auto_scaling_policy_details'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # UpdateThresholdPolicyDetails model.
9
+ class Autoscaling::Models::UpdateThresholdPolicyDetails < Autoscaling::Models::UpdateAutoScalingPolicyDetails # rubocop:disable Metrics/LineLength
10
+ # @return [Array<OCI::Autoscaling::Models::UpdateConditionDetails>]
11
+ attr_accessor :rules
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ # rubocop:disable Style/SymbolLiteral
17
+ 'display_name': :'displayName',
18
+ 'capacity': :'capacity',
19
+ 'policy_type': :'policyType',
20
+ 'rules': :'rules'
21
+ # rubocop:enable Style/SymbolLiteral
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ # rubocop:disable Style/SymbolLiteral
29
+ 'display_name': :'String',
30
+ 'capacity': :'OCI::Autoscaling::Models::Capacity',
31
+ 'policy_type': :'String',
32
+ 'rules': :'Array<OCI::Autoscaling::Models::UpdateConditionDetails>'
33
+ # rubocop:enable Style/SymbolLiteral
34
+ }
35
+ end
36
+
37
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
38
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
39
+
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ # @option attributes [String] :display_name The value to assign to the {OCI::Autoscaling::Models::UpdateAutoScalingPolicyDetails#display_name #display_name} proprety
44
+ # @option attributes [OCI::Autoscaling::Models::Capacity] :capacity The value to assign to the {OCI::Autoscaling::Models::UpdateAutoScalingPolicyDetails#capacity #capacity} proprety
45
+ # @option attributes [Array<OCI::Autoscaling::Models::UpdateConditionDetails>] :rules The value to assign to the {#rules} property
46
+ def initialize(attributes = {})
47
+ return unless attributes.is_a?(Hash)
48
+
49
+ attributes['policyType'] = 'threshold'
50
+
51
+ super(attributes)
52
+
53
+ # convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
55
+
56
+ self.rules = attributes[:'rules'] if attributes[:'rules']
57
+ end
58
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
59
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
60
+
61
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
62
+
63
+
64
+ # Checks equality by comparing each attribute.
65
+ # @param [Object] other the other object to be compared
66
+ def ==(other)
67
+ return true if equal?(other)
68
+
69
+ self.class == other.class &&
70
+ display_name == other.display_name &&
71
+ capacity == other.capacity &&
72
+ policy_type == other.policy_type &&
73
+ rules == other.rules
74
+ end
75
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
76
+
77
+ # @see the `==` method
78
+ # @param [Object] other the other object to be compared
79
+ def eql?(other)
80
+ self == other
81
+ end
82
+
83
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
84
+
85
+
86
+ # Calculates hash code according to all attributes.
87
+ # @return [Fixnum] Hash code
88
+ def hash
89
+ [display_name, capacity, policy_type, rules].hash
90
+ end
91
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
92
+
93
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
94
+
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ if type =~ /^Array<(.*)>/i
104
+ # check to ensure the input is an array given that the the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ public_method("#{key}=").call(
108
+ attributes[self.class.attribute_map[key]]
109
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
110
+ )
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ public_method("#{key}=").call(
114
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
115
+ )
116
+ end
117
+ # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
123
+
124
+ # Returns the string representation of the object
125
+ # @return [String] String presentation of the object
126
+ def to_s
127
+ to_hash.to_s
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = public_method(attr).call
136
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
137
+
138
+ hash[param] = _to_hash(value)
139
+ end
140
+ hash
141
+ end
142
+
143
+ private
144
+
145
+ # Outputs non-array value in the form of hash
146
+ # For object, use to_hash. Otherwise, just return the value
147
+ # @param [Object] value Any valid value
148
+ # @return [Hash] Returns the value in the form of hash
149
+ def _to_hash(value)
150
+ if value.is_a?(Array)
151
+ value.compact.map { |v| _to_hash(v) }
152
+ elsif value.is_a?(Hash)
153
+ {}.tap do |hash|
154
+ value.each { |k, v| hash[k] = _to_hash(v) }
155
+ end
156
+ elsif value.respond_to? :to_hash
157
+ value.to_hash
158
+ else
159
+ value
160
+ end
161
+ end
162
+ end
163
+ end
164
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,2 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
@@ -94,7 +94,7 @@ module OCI
94
94
 
95
95
  raise 'A region must be specified.' unless @region
96
96
 
97
- @endpoint = OCI::Regions.get_service_endpoint(@region, :BlockstorageClient) + '/20160918'
97
+ @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://iaas.{region}.{secondLevelDomain}') + '/20160918'
98
98
  logger.info "BlockstorageClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
99
99
  end
100
100
 
@@ -94,7 +94,7 @@ module OCI
94
94
 
95
95
  raise 'A region must be specified.' unless @region
96
96
 
97
- @endpoint = OCI::Regions.get_service_endpoint(@region, :ComputeClient) + '/20160918'
97
+ @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://iaas.{region}.{secondLevelDomain}') + '/20160918'
98
98
  logger.info "ComputeClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
99
99
  end
100
100
 
@@ -94,7 +94,7 @@ module OCI
94
94
 
95
95
  raise 'A region must be specified.' unless @region
96
96
 
97
- @endpoint = OCI::Regions.get_service_endpoint(@region, :ComputeManagementClient) + '/20160918'
97
+ @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://iaas.{region}.{secondLevelDomain}') + '/20160918'
98
98
  logger.info "ComputeManagementClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
99
99
  end
100
100
 
@@ -108,6 +108,73 @@ module OCI
108
108
  # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
109
109
 
110
110
 
111
+ # Attach load balancer to the instance pool.
112
+ #
113
+ # @param [String] instance_pool_id The OCID of the instance pool.
114
+ # @param [OCI::Core::Models::AttachLoadBalancerDetails] attach_load_balancer_details Load balancer being attached
115
+ # @param [Hash] opts the optional parameters
116
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
117
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
118
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
119
+ # server error without risk of executing that same action again. Retry tokens expire after 24
120
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
121
+ # has been deleted and purged from the system, then a retry of the original creation request
122
+ # may be rejected).
123
+ #
124
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
125
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
126
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
127
+ #
128
+ # @return [Response] A Response object with data of type {OCI::Core::Models::InstancePool InstancePool}
129
+ def attach_load_balancer(instance_pool_id, attach_load_balancer_details, opts = {})
130
+ logger.debug 'Calling operation ComputeManagementClient#attach_load_balancer.' if logger
131
+
132
+ raise "Missing the required parameter 'instance_pool_id' when calling attach_load_balancer." if instance_pool_id.nil?
133
+ raise "Missing the required parameter 'attach_load_balancer_details' when calling attach_load_balancer." if attach_load_balancer_details.nil?
134
+ raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id)
135
+
136
+ path = '/instancePools/{instancePoolId}/actions/attachLoadBalancer'.sub('{instancePoolId}', instance_pool_id.to_s)
137
+ operation_signing_strategy = :standard
138
+
139
+ # rubocop:disable Style/NegatedIf
140
+ # Query Params
141
+ query_params = {}
142
+
143
+ # Header Params
144
+ header_params = {}
145
+ header_params[:accept] = 'application/json'
146
+ header_params[:'content-type'] = 'application/json'
147
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
148
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
149
+ # rubocop:enable Style/NegatedIf
150
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
151
+
152
+ post_body = @api_client.object_to_http_body(attach_load_balancer_details)
153
+
154
+ # rubocop:disable Metrics/BlockLength
155
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ComputeManagementClient#attach_load_balancer') do
156
+ @api_client.call_api(
157
+ :POST,
158
+ path,
159
+ endpoint,
160
+ header_params: header_params,
161
+ query_params: query_params,
162
+ operation_signing_strategy: operation_signing_strategy,
163
+ body: post_body,
164
+ return_type: 'OCI::Core::Models::InstancePool'
165
+ )
166
+ end
167
+ # rubocop:enable Metrics/BlockLength
168
+ end
169
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
170
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
171
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
172
+
173
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
174
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
175
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
176
+
177
+
111
178
  # Creates an instance configuration
112
179
  #
113
180
  # @param [OCI::Core::Models::CreateInstanceConfigurationDetails] create_instance_configuration Instance configuration creation details
@@ -275,6 +342,73 @@ module OCI
275
342
  # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
276
343
  # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
277
344
 
345
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
346
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
347
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
348
+
349
+
350
+ # Detach a load balancer from the instance pool.
351
+ #
352
+ # @param [String] instance_pool_id The OCID of the instance pool.
353
+ # @param [OCI::Core::Models::DetachLoadBalancerDetails] detach_load_balancer_details Load balancer being detached
354
+ # @param [Hash] opts the optional parameters
355
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
356
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
357
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
358
+ # server error without risk of executing that same action again. Retry tokens expire after 24
359
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
360
+ # has been deleted and purged from the system, then a retry of the original creation request
361
+ # may be rejected).
362
+ #
363
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
364
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
365
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
366
+ #
367
+ # @return [Response] A Response object with data of type {OCI::Core::Models::InstancePool InstancePool}
368
+ def detach_load_balancer(instance_pool_id, detach_load_balancer_details, opts = {})
369
+ logger.debug 'Calling operation ComputeManagementClient#detach_load_balancer.' if logger
370
+
371
+ raise "Missing the required parameter 'instance_pool_id' when calling detach_load_balancer." if instance_pool_id.nil?
372
+ raise "Missing the required parameter 'detach_load_balancer_details' when calling detach_load_balancer." if detach_load_balancer_details.nil?
373
+ raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id)
374
+
375
+ path = '/instancePools/{instancePoolId}/actions/detachLoadBalancer'.sub('{instancePoolId}', instance_pool_id.to_s)
376
+ operation_signing_strategy = :standard
377
+
378
+ # rubocop:disable Style/NegatedIf
379
+ # Query Params
380
+ query_params = {}
381
+
382
+ # Header Params
383
+ header_params = {}
384
+ header_params[:accept] = 'application/json'
385
+ header_params[:'content-type'] = 'application/json'
386
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
387
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
388
+ # rubocop:enable Style/NegatedIf
389
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
390
+
391
+ post_body = @api_client.object_to_http_body(detach_load_balancer_details)
392
+
393
+ # rubocop:disable Metrics/BlockLength
394
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ComputeManagementClient#detach_load_balancer') do
395
+ @api_client.call_api(
396
+ :POST,
397
+ path,
398
+ endpoint,
399
+ header_params: header_params,
400
+ query_params: query_params,
401
+ operation_signing_strategy: operation_signing_strategy,
402
+ body: post_body,
403
+ return_type: 'OCI::Core::Models::InstancePool'
404
+ )
405
+ end
406
+ # rubocop:enable Metrics/BlockLength
407
+ end
408
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
409
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
410
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
411
+
278
412
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
279
413
  # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
280
414
  # rubocop:disable Metrics/MethodLength, Layout/EmptyLines