oci 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/oci.rb +4 -0
  4. data/lib/oci/auth/federation_client.rb +4 -4
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
  6. data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
  7. data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
  8. data/lib/oci/autoscaling/autoscaling.rb +38 -0
  9. data/lib/oci/autoscaling/models/action.rb +182 -0
  10. data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
  11. data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
  12. data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
  13. data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
  14. data/lib/oci/autoscaling/models/capacity.rb +170 -0
  15. data/lib/oci/autoscaling/models/condition.rb +186 -0
  16. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
  17. data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
  18. data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
  19. data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
  20. data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
  21. data/lib/oci/autoscaling/models/metric.rb +186 -0
  22. data/lib/oci/autoscaling/models/resource.rb +177 -0
  23. data/lib/oci/autoscaling/models/threshold.rb +188 -0
  24. data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
  25. data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
  26. data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
  27. data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
  28. data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
  29. data/lib/oci/autoscaling/util.rb +2 -0
  30. data/lib/oci/core/blockstorage_client.rb +1 -1
  31. data/lib/oci/core/compute_client.rb +1 -1
  32. data/lib/oci/core/compute_management_client.rb +135 -1
  33. data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
  34. data/lib/oci/core/core.rb +8 -0
  35. data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
  36. data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
  37. data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
  38. data/lib/oci/core/models/image.rb +14 -1
  39. data/lib/oci/core/models/instance.rb +18 -2
  40. data/lib/oci/core/models/instance_agent_config.rb +154 -0
  41. data/lib/oci/core/models/instance_agent_features.rb +154 -0
  42. data/lib/oci/core/models/instance_pool.rb +19 -4
  43. data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
  44. data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
  45. data/lib/oci/core/models/instance_summary.rb +19 -4
  46. data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
  47. data/lib/oci/core/models/launch_instance_details.rb +14 -1
  48. data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
  49. data/lib/oci/core/models/update_instance_details.rb +16 -1
  50. data/lib/oci/core/virtual_network_client.rb +1 -1
  51. data/lib/oci/database/database_client.rb +12 -14
  52. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
  53. data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
  54. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
  55. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
  56. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
  57. data/lib/oci/database/models/database_summary.rb +1 -1
  58. data/lib/oci/database/models/db_node.rb +15 -1
  59. data/lib/oci/database/models/db_node_summary.rb +15 -1
  60. data/lib/oci/database/models/db_system.rb +15 -1
  61. data/lib/oci/database/models/db_system_summary.rb +15 -1
  62. data/lib/oci/database/models/db_version_summary.rb +1 -1
  63. data/lib/oci/database/models/launch_db_system_base.rb +33 -2
  64. data/lib/oci/database/models/launch_db_system_details.rb +5 -1
  65. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
  66. data/lib/oci/database/models/update_db_system_details.rb +1 -1
  67. data/lib/oci/identity/identity.rb +4 -0
  68. data/lib/oci/identity/identity_client.rb +468 -12
  69. data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
  70. data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
  71. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
  72. data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
  73. data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
  74. data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
  75. data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
  76. data/lib/oci/identity/models/user.rb +18 -4
  77. data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
  78. data/lib/oci/monitoring/models/alarm.rb +538 -0
  79. data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
  80. data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
  81. data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
  82. data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
  83. data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
  84. data/lib/oci/monitoring/models/datapoint.rb +179 -0
  85. data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
  86. data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
  87. data/lib/oci/monitoring/models/metric.rb +197 -0
  88. data/lib/oci/monitoring/models/metric_data.rb +243 -0
  89. data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
  90. data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
  91. data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
  92. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
  93. data/lib/oci/monitoring/models/suppression.rb +196 -0
  94. data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
  95. data/lib/oci/monitoring/monitoring.rb +37 -0
  96. data/lib/oci/monitoring/monitoring_client.rb +923 -0
  97. data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
  98. data/lib/oci/monitoring/util.rb +2 -0
  99. data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
  100. data/lib/oci/ons/models/confirmation_result.rb +221 -0
  101. data/lib/oci/ons/models/create_subscription_details.rb +238 -0
  102. data/lib/oci/ons/models/create_topic_details.rb +209 -0
  103. data/lib/oci/ons/models/delivery_policy.rb +153 -0
  104. data/lib/oci/ons/models/message_details.rb +163 -0
  105. data/lib/oci/ons/models/notification_topic.rb +302 -0
  106. data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
  107. data/lib/oci/ons/models/publish_result.rb +168 -0
  108. data/lib/oci/ons/models/subscription.rb +273 -0
  109. data/lib/oci/ons/models/subscription_summary.rb +300 -0
  110. data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
  111. data/lib/oci/ons/models/update_subscription_details.rb +188 -0
  112. data/lib/oci/ons/notification_control_plane_client.rb +463 -0
  113. data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
  114. data/lib/oci/ons/notification_data_plane_client.rb +680 -0
  115. data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
  116. data/lib/oci/ons/ons.rb +33 -0
  117. data/lib/oci/ons/util.rb +2 -0
  118. data/lib/oci/regions.rb +5 -0
  119. data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
  120. data/lib/oci/resource_manager/models/config_source.rb +208 -0
  121. data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
  122. data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
  123. data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
  124. data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
  125. data/lib/oci/resource_manager/models/failure_details.rb +185 -0
  126. data/lib/oci/resource_manager/models/job.rb +399 -0
  127. data/lib/oci/resource_manager/models/job_summary.rb +311 -0
  128. data/lib/oci/resource_manager/models/log_entry.rb +225 -0
  129. data/lib/oci/resource_manager/models/stack.rb +305 -0
  130. data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
  131. data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
  132. data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
  133. data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
  134. data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
  135. data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
  136. data/lib/oci/resource_manager/resource_manager.rb +36 -0
  137. data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
  138. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
  139. data/lib/oci/resource_manager/util.rb +2 -0
  140. data/lib/oci/version.rb +1 -1
  141. metadata +100 -2
@@ -0,0 +1,194 @@
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
+ # An array of metric objects containing raw metric data points to be posted to the Monitoring service.
8
+ #
9
+ class Monitoring::Models::PostMetricDataDetails # rubocop:disable Metrics/LineLength
10
+ BATCH_ATOMICITY_ENUM = [
11
+ BATCH_ATOMICITY_ATOMIC = 'ATOMIC'.freeze,
12
+ BATCH_ATOMICITY_NON_ATOMIC = 'NON_ATOMIC'.freeze
13
+ ].freeze
14
+
15
+ # **[Required]** A metric object containing raw metric data points to be posted to the Monitoring service.
16
+ #
17
+ # @return [Array<OCI::Monitoring::Models::MetricDataDetails>]
18
+ attr_accessor :metric_data
19
+
20
+ # Batch atomicity behavior. Requires either partial or full pass of input validation for
21
+ # metric objects in PostMetricData requests. The default value of NON_ATOMIC requires a
22
+ # partial pass: at least one metric object in the request must pass input validation, and
23
+ # any objects that failed validation are identified in the returned summary, along with
24
+ # their error messages. A value of ATOMIC requires a full pass: all metric objects in
25
+ # the request must pass input validation.
26
+ #
27
+ # Example: `NON_ATOMIC`
28
+ #
29
+ # @return [String]
30
+ attr_reader :batch_atomicity
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ # rubocop:disable Style/SymbolLiteral
36
+ 'metric_data': :'metricData',
37
+ 'batch_atomicity': :'batchAtomicity'
38
+ # rubocop:enable Style/SymbolLiteral
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ # rubocop:disable Style/SymbolLiteral
46
+ 'metric_data': :'Array<OCI::Monitoring::Models::MetricDataDetails>',
47
+ 'batch_atomicity': :'String'
48
+ # rubocop:enable Style/SymbolLiteral
49
+ }
50
+ end
51
+
52
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
53
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
54
+
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ # @option attributes [Array<OCI::Monitoring::Models::MetricDataDetails>] :metric_data The value to assign to the {#metric_data} property
59
+ # @option attributes [String] :batch_atomicity The value to assign to the {#batch_atomicity} 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.metric_data = attributes[:'metricData'] if attributes[:'metricData']
67
+
68
+ raise 'You cannot provide both :metricData and :metric_data' if attributes.key?(:'metricData') && attributes.key?(:'metric_data')
69
+
70
+ self.metric_data = attributes[:'metric_data'] if attributes[:'metric_data']
71
+
72
+ self.batch_atomicity = attributes[:'batchAtomicity'] if attributes[:'batchAtomicity']
73
+ self.batch_atomicity = "NON_ATOMIC" if batch_atomicity.nil? && !attributes.key?(:'batchAtomicity') # rubocop:disable Style/StringLiterals
74
+
75
+ raise 'You cannot provide both :batchAtomicity and :batch_atomicity' if attributes.key?(:'batchAtomicity') && attributes.key?(:'batch_atomicity')
76
+
77
+ self.batch_atomicity = attributes[:'batch_atomicity'] if attributes[:'batch_atomicity']
78
+ self.batch_atomicity = "NON_ATOMIC" if batch_atomicity.nil? && !attributes.key?(:'batchAtomicity') && !attributes.key?(:'batch_atomicity') # rubocop:disable Style/StringLiterals
79
+ end
80
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
81
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
82
+
83
+ # Custom attribute writer method checking allowed values (enum).
84
+ # @param [Object] batch_atomicity Object to be assigned
85
+ def batch_atomicity=(batch_atomicity)
86
+ # rubocop: disable Metrics/LineLength
87
+ raise "Invalid value for 'batch_atomicity': this must be one of the values in BATCH_ATOMICITY_ENUM." if batch_atomicity && !BATCH_ATOMICITY_ENUM.include?(batch_atomicity)
88
+
89
+ # rubocop: enable Metrics/LineLength
90
+ @batch_atomicity = batch_atomicity
91
+ end
92
+
93
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
94
+
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] other the other object to be compared
98
+ def ==(other)
99
+ return true if equal?(other)
100
+
101
+ self.class == other.class &&
102
+ metric_data == other.metric_data &&
103
+ batch_atomicity == other.batch_atomicity
104
+ end
105
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
106
+
107
+ # @see the `==` method
108
+ # @param [Object] other the other object to be compared
109
+ def eql?(other)
110
+ self == other
111
+ end
112
+
113
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
114
+
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Fixnum] Hash code
118
+ def hash
119
+ [metric_data, batch_atomicity].hash
120
+ end
121
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
122
+
123
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
124
+
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+
132
+ self.class.swagger_types.each_pair do |key, type|
133
+ if type =~ /^Array<(.*)>/i
134
+ # check to ensure the input is an array given that the the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ public_method("#{key}=").call(
138
+ attributes[self.class.attribute_map[key]]
139
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
140
+ )
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ public_method("#{key}=").call(
144
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
145
+ )
146
+ end
147
+ # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
153
+
154
+ # Returns the string representation of the object
155
+ # @return [String] String presentation of the object
156
+ def to_s
157
+ to_hash.to_s
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = public_method(attr).call
166
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ private
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+ end
193
+ end
194
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,170 @@
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
+ # The response object returned from a PostMetricData operation.
8
+ #
9
+ class Monitoring::Models::PostMetricDataResponseDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The number of metric objects that failed input validation.
11
+ # @return [Integer]
12
+ attr_accessor :failed_metrics_count
13
+
14
+ # A list of records identifying metric objects that failed input validation
15
+ # and the reasons for the failures.
16
+ #
17
+ # @return [Array<OCI::Monitoring::Models::FailedMetricRecord>]
18
+ attr_accessor :failed_metrics
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ # rubocop:disable Style/SymbolLiteral
24
+ 'failed_metrics_count': :'failedMetricsCount',
25
+ 'failed_metrics': :'failedMetrics'
26
+ # rubocop:enable Style/SymbolLiteral
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ # rubocop:disable Style/SymbolLiteral
34
+ 'failed_metrics_count': :'Integer',
35
+ 'failed_metrics': :'Array<OCI::Monitoring::Models::FailedMetricRecord>'
36
+ # rubocop:enable Style/SymbolLiteral
37
+ }
38
+ end
39
+
40
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
41
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
42
+
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ # @option attributes [Integer] :failed_metrics_count The value to assign to the {#failed_metrics_count} property
47
+ # @option attributes [Array<OCI::Monitoring::Models::FailedMetricRecord>] :failed_metrics The value to assign to the {#failed_metrics} property
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
53
+
54
+ self.failed_metrics_count = attributes[:'failedMetricsCount'] if attributes[:'failedMetricsCount']
55
+
56
+ raise 'You cannot provide both :failedMetricsCount and :failed_metrics_count' if attributes.key?(:'failedMetricsCount') && attributes.key?(:'failed_metrics_count')
57
+
58
+ self.failed_metrics_count = attributes[:'failed_metrics_count'] if attributes[:'failed_metrics_count']
59
+
60
+ self.failed_metrics = attributes[:'failedMetrics'] if attributes[:'failedMetrics']
61
+
62
+ raise 'You cannot provide both :failedMetrics and :failed_metrics' if attributes.key?(:'failedMetrics') && attributes.key?(:'failed_metrics')
63
+
64
+ self.failed_metrics = attributes[:'failed_metrics'] if attributes[:'failed_metrics']
65
+ end
66
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
67
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
68
+
69
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
70
+
71
+
72
+ # Checks equality by comparing each attribute.
73
+ # @param [Object] other the other object to be compared
74
+ def ==(other)
75
+ return true if equal?(other)
76
+
77
+ self.class == other.class &&
78
+ failed_metrics_count == other.failed_metrics_count &&
79
+ failed_metrics == other.failed_metrics
80
+ end
81
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
82
+
83
+ # @see the `==` method
84
+ # @param [Object] other the other object to be compared
85
+ def eql?(other)
86
+ self == other
87
+ end
88
+
89
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
90
+
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Fixnum] Hash code
94
+ def hash
95
+ [failed_metrics_count, failed_metrics].hash
96
+ end
97
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
98
+
99
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
100
+
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /^Array<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ public_method("#{key}=").call(
114
+ attributes[self.class.attribute_map[key]]
115
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
116
+ )
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ public_method("#{key}=").call(
120
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
121
+ )
122
+ end
123
+ # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
129
+
130
+ # Returns the string representation of the object
131
+ # @return [String] String presentation of the object
132
+ def to_s
133
+ to_hash.to_s
134
+ end
135
+
136
+ # Returns the object in the form of hash
137
+ # @return [Hash] Returns the object in the form of hash
138
+ def to_hash
139
+ hash = {}
140
+ self.class.attribute_map.each_pair do |attr, param|
141
+ value = public_method(attr).call
142
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
143
+
144
+ hash[param] = _to_hash(value)
145
+ end
146
+ hash
147
+ end
148
+
149
+ private
150
+
151
+ # Outputs non-array value in the form of hash
152
+ # For object, use to_hash. Otherwise, just return the value
153
+ # @param [Object] value Any valid value
154
+ # @return [Hash] Returns the value in the form of hash
155
+ def _to_hash(value)
156
+ if value.is_a?(Array)
157
+ value.compact.map { |v| _to_hash(v) }
158
+ elsif value.is_a?(Hash)
159
+ {}.tap do |hash|
160
+ value.each { |k, v| hash[k] = _to_hash(v) }
161
+ end
162
+ elsif value.respond_to? :to_hash
163
+ value.to_hash
164
+ else
165
+ value
166
+ end
167
+ end
168
+ end
169
+ end
170
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,229 @@
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
+ # The request details for retrieving aggregated data.
8
+ # Use the query and optional properties to filter the returned results.
9
+ #
10
+ class Monitoring::Models::SummarizeMetricsDataDetails # rubocop:disable Metrics/LineLength
11
+ # **[Required]** The source service or application to use when searching for metric data points to aggregate.
12
+ #
13
+ # Example: `oci_computeagent`
14
+ #
15
+ # @return [String]
16
+ attr_accessor :namespace
17
+
18
+ # **[Required]** The Monitoring Query Language (MQL) expression to use when searching for metric data points to
19
+ # aggregate. The query must specify a metric, statistic, and interval. Supported values for
20
+ # interval: `1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions.
21
+ # Supported grouping functions: `grouping()`, `groupBy()`.
22
+ # For details about Monitoring Query Language (MQL), see
23
+ # [Monitoring Query Language (MQL) Reference](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Reference/mql.htm).
24
+ # For available dimensions, review the metric definition for the supported service.
25
+ # See [Supported Services](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices).
26
+ #
27
+ # Example: `CpuUtilization[1m].sum()`
28
+ #
29
+ # @return [String]
30
+ attr_accessor :query
31
+
32
+ # The beginning of the time range to use when searching for metric data points.
33
+ # Format is defined by RFC3339. The response includes metric data points for the startTime.
34
+ # Default value: the timestamp 3 hours before the call was sent.
35
+ #
36
+ # Example: `2019-02-01T01:02:29.600Z`
37
+ #
38
+ # @return [DateTime]
39
+ attr_accessor :start_time
40
+
41
+ # The end of the time range to use when searching for metric data points.
42
+ # Format is defined by RFC3339. The response excludes metric data points for the endTime.
43
+ # Default value: the timestamp representing when the call was sent.
44
+ #
45
+ # Example: `2019-02-01T02:02:29.600Z`
46
+ #
47
+ # @return [DateTime]
48
+ attr_accessor :end_time
49
+
50
+ # The time between calculated aggregation windows. Use with the query interval to vary the
51
+ # frequency at which aggregated data points are returned. For example, use a query interval of
52
+ # 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute
53
+ # frequency. The resolution must be equal or less than the interval in the query. The default
54
+ # resolution is 1m (one minute). Supported values: `1m`-`60m` (also `1h`).
55
+ #
56
+ # Example: `5m`
57
+ #
58
+ # @return [String]
59
+ attr_accessor :resolution
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ # rubocop:disable Style/SymbolLiteral
65
+ 'namespace': :'namespace',
66
+ 'query': :'query',
67
+ 'start_time': :'startTime',
68
+ 'end_time': :'endTime',
69
+ 'resolution': :'resolution'
70
+ # rubocop:enable Style/SymbolLiteral
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.swagger_types
76
+ {
77
+ # rubocop:disable Style/SymbolLiteral
78
+ 'namespace': :'String',
79
+ 'query': :'String',
80
+ 'start_time': :'DateTime',
81
+ 'end_time': :'DateTime',
82
+ 'resolution': :'String'
83
+ # rubocop:enable Style/SymbolLiteral
84
+ }
85
+ end
86
+
87
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
88
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
89
+
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @option attributes [String] :namespace The value to assign to the {#namespace} property
94
+ # @option attributes [String] :query The value to assign to the {#query} property
95
+ # @option attributes [DateTime] :start_time The value to assign to the {#start_time} property
96
+ # @option attributes [DateTime] :end_time The value to assign to the {#end_time} property
97
+ # @option attributes [String] :resolution The value to assign to the {#resolution} property
98
+ def initialize(attributes = {})
99
+ return unless attributes.is_a?(Hash)
100
+
101
+ # convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
103
+
104
+ self.namespace = attributes[:'namespace'] if attributes[:'namespace']
105
+
106
+ self.query = attributes[:'query'] if attributes[:'query']
107
+
108
+ self.start_time = attributes[:'startTime'] if attributes[:'startTime']
109
+
110
+ raise 'You cannot provide both :startTime and :start_time' if attributes.key?(:'startTime') && attributes.key?(:'start_time')
111
+
112
+ self.start_time = attributes[:'start_time'] if attributes[:'start_time']
113
+
114
+ self.end_time = attributes[:'endTime'] if attributes[:'endTime']
115
+
116
+ raise 'You cannot provide both :endTime and :end_time' if attributes.key?(:'endTime') && attributes.key?(:'end_time')
117
+
118
+ self.end_time = attributes[:'end_time'] if attributes[:'end_time']
119
+
120
+ self.resolution = attributes[:'resolution'] if attributes[:'resolution']
121
+ end
122
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
123
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
124
+
125
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
126
+
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] other the other object to be compared
130
+ def ==(other)
131
+ return true if equal?(other)
132
+
133
+ self.class == other.class &&
134
+ namespace == other.namespace &&
135
+ query == other.query &&
136
+ start_time == other.start_time &&
137
+ end_time == other.end_time &&
138
+ resolution == other.resolution
139
+ end
140
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
141
+
142
+ # @see the `==` method
143
+ # @param [Object] other the other object to be compared
144
+ def eql?(other)
145
+ self == other
146
+ end
147
+
148
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
149
+
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Fixnum] Hash code
153
+ def hash
154
+ [namespace, query, start_time, end_time, resolution].hash
155
+ end
156
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
157
+
158
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
159
+
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+
167
+ self.class.swagger_types.each_pair do |key, type|
168
+ if type =~ /^Array<(.*)>/i
169
+ # check to ensure the input is an array given that the the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
172
+ public_method("#{key}=").call(
173
+ attributes[self.class.attribute_map[key]]
174
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
175
+ )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ public_method("#{key}=").call(
179
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
180
+ )
181
+ end
182
+ # or else data not found in attributes(hash), not an issue as the data can be optional
183
+ end
184
+
185
+ self
186
+ end
187
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = public_method(attr).call
201
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ private
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end
229
+ # rubocop:enable Lint/UnneededCopDisableDirective