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,196 @@
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
+ # The configuration details for suppressing an alarm.
9
+ # For information about alarms, see [Alarms Overview](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#AlarmsOverview).
10
+ #
11
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
12
+ #
13
+ class Monitoring::Models::Suppression # rubocop:disable Metrics/LineLength
14
+ # Human-readable reason for suppressing alarm notifications.
15
+ # It does not have to be unique, and it's changeable.
16
+ # Avoid entering confidential information.
17
+ #
18
+ # Oracle recommends including tracking information for the event or associated work,
19
+ # such as a ticket number.
20
+ #
21
+ # Example: `Planned outage due to change IT-1234.`
22
+ #
23
+ # @return [String]
24
+ attr_accessor :description
25
+
26
+ # **[Required]** The start date and time for the suppression to take place, inclusive. Format defined by RFC3339.
27
+ #
28
+ # Example: `2019-02-01T01:02:29.600Z`
29
+ #
30
+ # @return [DateTime]
31
+ attr_accessor :time_suppress_from
32
+
33
+ # **[Required]** The end date and time for the suppression to take place, inclusive. Format defined by RFC3339.
34
+ #
35
+ # Example: `2019-02-01T02:02:29.600Z`
36
+ #
37
+ # @return [DateTime]
38
+ attr_accessor :time_suppress_until
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ # rubocop:disable Style/SymbolLiteral
44
+ 'description': :'description',
45
+ 'time_suppress_from': :'timeSuppressFrom',
46
+ 'time_suppress_until': :'timeSuppressUntil'
47
+ # rubocop:enable Style/SymbolLiteral
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.swagger_types
53
+ {
54
+ # rubocop:disable Style/SymbolLiteral
55
+ 'description': :'String',
56
+ 'time_suppress_from': :'DateTime',
57
+ 'time_suppress_until': :'DateTime'
58
+ # rubocop:enable Style/SymbolLiteral
59
+ }
60
+ end
61
+
62
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
63
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
64
+
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ # @option attributes [String] :description The value to assign to the {#description} property
69
+ # @option attributes [DateTime] :time_suppress_from The value to assign to the {#time_suppress_from} property
70
+ # @option attributes [DateTime] :time_suppress_until The value to assign to the {#time_suppress_until} 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.description = attributes[:'description'] if attributes[:'description']
78
+
79
+ self.time_suppress_from = attributes[:'timeSuppressFrom'] if attributes[:'timeSuppressFrom']
80
+
81
+ raise 'You cannot provide both :timeSuppressFrom and :time_suppress_from' if attributes.key?(:'timeSuppressFrom') && attributes.key?(:'time_suppress_from')
82
+
83
+ self.time_suppress_from = attributes[:'time_suppress_from'] if attributes[:'time_suppress_from']
84
+
85
+ self.time_suppress_until = attributes[:'timeSuppressUntil'] if attributes[:'timeSuppressUntil']
86
+
87
+ raise 'You cannot provide both :timeSuppressUntil and :time_suppress_until' if attributes.key?(:'timeSuppressUntil') && attributes.key?(:'time_suppress_until')
88
+
89
+ self.time_suppress_until = attributes[:'time_suppress_until'] if attributes[:'time_suppress_until']
90
+ end
91
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
92
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
93
+
94
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
95
+
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] other the other object to be compared
99
+ def ==(other)
100
+ return true if equal?(other)
101
+
102
+ self.class == other.class &&
103
+ description == other.description &&
104
+ time_suppress_from == other.time_suppress_from &&
105
+ time_suppress_until == other.time_suppress_until
106
+ end
107
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
108
+
109
+ # @see the `==` method
110
+ # @param [Object] other the other object to be compared
111
+ def eql?(other)
112
+ self == other
113
+ end
114
+
115
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
116
+
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [description, time_suppress_from, time_suppress_until].hash
122
+ end
123
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
124
+
125
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
126
+
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+
134
+ self.class.swagger_types.each_pair do |key, type|
135
+ if type =~ /^Array<(.*)>/i
136
+ # check to ensure the input is an array given that the the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ public_method("#{key}=").call(
140
+ attributes[self.class.attribute_map[key]]
141
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
142
+ )
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ public_method("#{key}=").call(
146
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
147
+ )
148
+ end
149
+ # or else data not found in attributes(hash), not an issue as the data can be optional
150
+ end
151
+
152
+ self
153
+ end
154
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ self.class.attribute_map.each_pair do |attr, param|
167
+ value = public_method(attr).call
168
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ private
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+ end
195
+ end
196
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,423 @@
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 configuration details for updating an alarm.
8
+ #
9
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
10
+ #
11
+ class Monitoring::Models::UpdateAlarmDetails # rubocop:disable Metrics/LineLength
12
+ # A user-friendly name for the alarm. It does not have to be unique, and it's changeable.
13
+ # Avoid entering confidential information.
14
+ #
15
+ # This name is sent as the title for notifications related to this alarm.
16
+ #
17
+ # Example: `High CPU Utilization`
18
+ #
19
+ # @return [String]
20
+ attr_accessor :display_name
21
+
22
+ # The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the alarm.
23
+ #
24
+ # @return [String]
25
+ attr_accessor :compartment_id
26
+
27
+ # The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the metric
28
+ # being evaluated by the alarm.
29
+ #
30
+ # @return [String]
31
+ attr_accessor :metric_compartment_id
32
+
33
+ # When true, the alarm evaluates metrics from all compartments and subcompartments. The parameter can
34
+ # only be set to true when metricCompartmentId is the tenancy OCID (the tenancy is the root compartment).
35
+ # A true value requires the user to have tenancy-level permissions. If this requirement is not met,
36
+ # then the call is rejected. When false, the alarm evaluates metrics from only the compartment specified
37
+ # in metricCompartmentId. Default is false.
38
+ #
39
+ # Example: `true`
40
+ #
41
+ # @return [BOOLEAN]
42
+ attr_accessor :metric_compartment_id_in_subtree
43
+
44
+ # The source service or application emitting the metric that is evaluated by the alarm.
45
+ #
46
+ # Example: `oci_computeagent`
47
+ #
48
+ # @return [String]
49
+ attr_accessor :namespace
50
+
51
+ # The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of
52
+ # the Monitoring service interprets results for each returned time series as Boolean values,
53
+ # where zero represents false and a non-zero value represents true. A true value means that the trigger
54
+ # rule condition has been met. The query must specify a metric, statistic, interval, and trigger
55
+ # rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally
56
+ # specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`.
57
+ # For details about Monitoring Query Language (MQL), see [Monitoring Query Language (MQL) Reference](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Reference/mql.htm).
58
+ # For available dimensions, review the metric definition for the supported service.
59
+ # See [Supported Services](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices).
60
+ #
61
+ # Example of threshold alarm:
62
+ #
63
+ # -----
64
+ #
65
+ # CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.groupBy(availabilityDomain).percentile(0.9) > 85
66
+ #
67
+ # -----
68
+ #
69
+ # Example of absence alarm:
70
+ #
71
+ # -----
72
+ #
73
+ # CpuUtilization[1m]{availabilityDomain=\"cumS:PHX-AD-1\"}.absent()
74
+ #
75
+ # -----
76
+ #
77
+ # @return [String]
78
+ attr_accessor :query
79
+
80
+ # The time between calculated aggregation windows for the alarm. Supported value: `1m`
81
+ #
82
+ # @return [String]
83
+ attr_accessor :resolution
84
+
85
+ # The period of time that the condition defined in the alarm must persist before the alarm state
86
+ # changes from \"OK\" to \"FIRING\" or vice versa. For example, a value of 5 minutes means that the
87
+ # alarm must persist in breaching the condition for five minutes before the alarm updates its
88
+ # state to \"FIRING\"; likewise, the alarm must persist in not breaching the condition for five
89
+ # minutes before the alarm updates its state to \"OK.\"
90
+ #
91
+ # The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H`
92
+ # for one hour). Minimum: PT1M. Maximum: PT1H. Default: PT1M.
93
+ #
94
+ # Under the default value of PT1M, the first evaluation that breaches the alarm updates the
95
+ # state to \"FIRING\" and the first evaluation that does not breach the alarm updates the state
96
+ # to \"OK\".
97
+ #
98
+ # Example: `PT5M`
99
+ #
100
+ # @return [String]
101
+ attr_accessor :pending_duration
102
+
103
+ # The perceived severity of the alarm with regard to the affected system.
104
+ #
105
+ # Example: `CRITICAL`
106
+ #
107
+ # @return [String]
108
+ attr_accessor :severity
109
+
110
+ # The human-readable content of the notification delivered. Oracle recommends providing guidance
111
+ # to operators for resolving the alarm condition. Consider adding links to standard runbook
112
+ # practices. Avoid entering confidential information.
113
+ #
114
+ # Example: `High CPU usage alert. Follow runbook instructions for resolution.`
115
+ #
116
+ # @return [String]
117
+ attr_accessor :body
118
+
119
+ # An array of [OCIDs](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) to which the notifications for
120
+ # this alarm will be delivered. An example destination is an OCID for a topic managed by the
121
+ # Oracle Cloud Infrastructure Notification service.
122
+ #
123
+ # @return [Array<String>]
124
+ attr_accessor :destinations
125
+
126
+ # The frequency at which notifications are re-submitted, if the alarm keeps firing without
127
+ # interruption. Format defined by ISO 8601. For example, `PT4H` indicates four hours.
128
+ # Minimum: PT1M. Maximum: P30D.
129
+ #
130
+ # Default value: null (notifications are not re-submitted).
131
+ #
132
+ # Example: `PT2H`
133
+ #
134
+ # @return [String]
135
+ attr_accessor :repeat_notification_duration
136
+
137
+ # The configuration details for suppressing an alarm.
138
+ #
139
+ # @return [OCI::Monitoring::Models::Suppression]
140
+ attr_accessor :suppression
141
+
142
+ # Whether the alarm is enabled.
143
+ #
144
+ # Example: `true`
145
+ #
146
+ # @return [BOOLEAN]
147
+ attr_accessor :is_enabled
148
+
149
+ # Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
150
+ # Example: `{\"Department\": \"Finance\"}`
151
+ #
152
+ # @return [Hash<String, String>]
153
+ attr_accessor :freeform_tags
154
+
155
+ # Usage of predefined tag keys. These predefined keys are scoped to namespaces.
156
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
157
+ #
158
+ # @return [Hash<String, Hash<String, Object>>]
159
+ attr_accessor :defined_tags
160
+
161
+ # Attribute mapping from ruby-style variable name to JSON key.
162
+ def self.attribute_map
163
+ {
164
+ # rubocop:disable Style/SymbolLiteral
165
+ 'display_name': :'displayName',
166
+ 'compartment_id': :'compartmentId',
167
+ 'metric_compartment_id': :'metricCompartmentId',
168
+ 'metric_compartment_id_in_subtree': :'metricCompartmentIdInSubtree',
169
+ 'namespace': :'namespace',
170
+ 'query': :'query',
171
+ 'resolution': :'resolution',
172
+ 'pending_duration': :'pendingDuration',
173
+ 'severity': :'severity',
174
+ 'body': :'body',
175
+ 'destinations': :'destinations',
176
+ 'repeat_notification_duration': :'repeatNotificationDuration',
177
+ 'suppression': :'suppression',
178
+ 'is_enabled': :'isEnabled',
179
+ 'freeform_tags': :'freeformTags',
180
+ 'defined_tags': :'definedTags'
181
+ # rubocop:enable Style/SymbolLiteral
182
+ }
183
+ end
184
+
185
+ # Attribute type mapping.
186
+ def self.swagger_types
187
+ {
188
+ # rubocop:disable Style/SymbolLiteral
189
+ 'display_name': :'String',
190
+ 'compartment_id': :'String',
191
+ 'metric_compartment_id': :'String',
192
+ 'metric_compartment_id_in_subtree': :'BOOLEAN',
193
+ 'namespace': :'String',
194
+ 'query': :'String',
195
+ 'resolution': :'String',
196
+ 'pending_duration': :'String',
197
+ 'severity': :'String',
198
+ 'body': :'String',
199
+ 'destinations': :'Array<String>',
200
+ 'repeat_notification_duration': :'String',
201
+ 'suppression': :'OCI::Monitoring::Models::Suppression',
202
+ 'is_enabled': :'BOOLEAN',
203
+ 'freeform_tags': :'Hash<String, String>',
204
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
205
+ # rubocop:enable Style/SymbolLiteral
206
+ }
207
+ end
208
+
209
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
210
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
211
+
212
+
213
+ # Initializes the object
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
216
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
217
+ # @option attributes [String] :metric_compartment_id The value to assign to the {#metric_compartment_id} property
218
+ # @option attributes [BOOLEAN] :metric_compartment_id_in_subtree The value to assign to the {#metric_compartment_id_in_subtree} property
219
+ # @option attributes [String] :namespace The value to assign to the {#namespace} property
220
+ # @option attributes [String] :query The value to assign to the {#query} property
221
+ # @option attributes [String] :resolution The value to assign to the {#resolution} property
222
+ # @option attributes [String] :pending_duration The value to assign to the {#pending_duration} property
223
+ # @option attributes [String] :severity The value to assign to the {#severity} property
224
+ # @option attributes [String] :body The value to assign to the {#body} property
225
+ # @option attributes [Array<String>] :destinations The value to assign to the {#destinations} property
226
+ # @option attributes [String] :repeat_notification_duration The value to assign to the {#repeat_notification_duration} property
227
+ # @option attributes [OCI::Monitoring::Models::Suppression] :suppression The value to assign to the {#suppression} property
228
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
229
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
230
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
231
+ def initialize(attributes = {})
232
+ return unless attributes.is_a?(Hash)
233
+
234
+ # convert string to symbol for hash key
235
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
236
+
237
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
238
+
239
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
240
+
241
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
242
+
243
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
244
+
245
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
246
+
247
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
248
+
249
+ self.metric_compartment_id = attributes[:'metricCompartmentId'] if attributes[:'metricCompartmentId']
250
+
251
+ raise 'You cannot provide both :metricCompartmentId and :metric_compartment_id' if attributes.key?(:'metricCompartmentId') && attributes.key?(:'metric_compartment_id')
252
+
253
+ self.metric_compartment_id = attributes[:'metric_compartment_id'] if attributes[:'metric_compartment_id']
254
+
255
+ self.metric_compartment_id_in_subtree = attributes[:'metricCompartmentIdInSubtree'] unless attributes[:'metricCompartmentIdInSubtree'].nil?
256
+
257
+ raise 'You cannot provide both :metricCompartmentIdInSubtree and :metric_compartment_id_in_subtree' if attributes.key?(:'metricCompartmentIdInSubtree') && attributes.key?(:'metric_compartment_id_in_subtree')
258
+
259
+ self.metric_compartment_id_in_subtree = attributes[:'metric_compartment_id_in_subtree'] unless attributes[:'metric_compartment_id_in_subtree'].nil?
260
+
261
+ self.namespace = attributes[:'namespace'] if attributes[:'namespace']
262
+
263
+ self.query = attributes[:'query'] if attributes[:'query']
264
+
265
+ self.resolution = attributes[:'resolution'] if attributes[:'resolution']
266
+
267
+ self.pending_duration = attributes[:'pendingDuration'] if attributes[:'pendingDuration']
268
+
269
+ raise 'You cannot provide both :pendingDuration and :pending_duration' if attributes.key?(:'pendingDuration') && attributes.key?(:'pending_duration')
270
+
271
+ self.pending_duration = attributes[:'pending_duration'] if attributes[:'pending_duration']
272
+
273
+ self.severity = attributes[:'severity'] if attributes[:'severity']
274
+
275
+ self.body = attributes[:'body'] if attributes[:'body']
276
+
277
+ self.destinations = attributes[:'destinations'] if attributes[:'destinations']
278
+
279
+ self.repeat_notification_duration = attributes[:'repeatNotificationDuration'] if attributes[:'repeatNotificationDuration']
280
+
281
+ raise 'You cannot provide both :repeatNotificationDuration and :repeat_notification_duration' if attributes.key?(:'repeatNotificationDuration') && attributes.key?(:'repeat_notification_duration')
282
+
283
+ self.repeat_notification_duration = attributes[:'repeat_notification_duration'] if attributes[:'repeat_notification_duration']
284
+
285
+ self.suppression = attributes[:'suppression'] if attributes[:'suppression']
286
+
287
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
288
+
289
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
290
+
291
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
292
+
293
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
294
+
295
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
296
+
297
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
298
+
299
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
300
+
301
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
302
+
303
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
304
+ end
305
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
306
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
307
+
308
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
309
+
310
+
311
+ # Checks equality by comparing each attribute.
312
+ # @param [Object] other the other object to be compared
313
+ def ==(other)
314
+ return true if equal?(other)
315
+
316
+ self.class == other.class &&
317
+ display_name == other.display_name &&
318
+ compartment_id == other.compartment_id &&
319
+ metric_compartment_id == other.metric_compartment_id &&
320
+ metric_compartment_id_in_subtree == other.metric_compartment_id_in_subtree &&
321
+ namespace == other.namespace &&
322
+ query == other.query &&
323
+ resolution == other.resolution &&
324
+ pending_duration == other.pending_duration &&
325
+ severity == other.severity &&
326
+ body == other.body &&
327
+ destinations == other.destinations &&
328
+ repeat_notification_duration == other.repeat_notification_duration &&
329
+ suppression == other.suppression &&
330
+ is_enabled == other.is_enabled &&
331
+ freeform_tags == other.freeform_tags &&
332
+ defined_tags == other.defined_tags
333
+ end
334
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
335
+
336
+ # @see the `==` method
337
+ # @param [Object] other the other object to be compared
338
+ def eql?(other)
339
+ self == other
340
+ end
341
+
342
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
343
+
344
+
345
+ # Calculates hash code according to all attributes.
346
+ # @return [Fixnum] Hash code
347
+ def hash
348
+ [display_name, compartment_id, metric_compartment_id, metric_compartment_id_in_subtree, namespace, query, resolution, pending_duration, severity, body, destinations, repeat_notification_duration, suppression, is_enabled, freeform_tags, defined_tags].hash
349
+ end
350
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
351
+
352
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
353
+
354
+
355
+ # Builds the object from hash
356
+ # @param [Hash] attributes Model attributes in the form of hash
357
+ # @return [Object] Returns the model itself
358
+ def build_from_hash(attributes)
359
+ return nil unless attributes.is_a?(Hash)
360
+
361
+ self.class.swagger_types.each_pair do |key, type|
362
+ if type =~ /^Array<(.*)>/i
363
+ # check to ensure the input is an array given that the the attribute
364
+ # is documented as an array but the input is not
365
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
366
+ public_method("#{key}=").call(
367
+ attributes[self.class.attribute_map[key]]
368
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
369
+ )
370
+ end
371
+ elsif !attributes[self.class.attribute_map[key]].nil?
372
+ public_method("#{key}=").call(
373
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
374
+ )
375
+ end
376
+ # or else data not found in attributes(hash), not an issue as the data can be optional
377
+ end
378
+
379
+ self
380
+ end
381
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
382
+
383
+ # Returns the string representation of the object
384
+ # @return [String] String presentation of the object
385
+ def to_s
386
+ to_hash.to_s
387
+ end
388
+
389
+ # Returns the object in the form of hash
390
+ # @return [Hash] Returns the object in the form of hash
391
+ def to_hash
392
+ hash = {}
393
+ self.class.attribute_map.each_pair do |attr, param|
394
+ value = public_method(attr).call
395
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
396
+
397
+ hash[param] = _to_hash(value)
398
+ end
399
+ hash
400
+ end
401
+
402
+ private
403
+
404
+ # Outputs non-array value in the form of hash
405
+ # For object, use to_hash. Otherwise, just return the value
406
+ # @param [Object] value Any valid value
407
+ # @return [Hash] Returns the value in the form of hash
408
+ def _to_hash(value)
409
+ if value.is_a?(Array)
410
+ value.compact.map { |v| _to_hash(v) }
411
+ elsif value.is_a?(Hash)
412
+ {}.tap do |hash|
413
+ value.each { |k, v| hash[k] = _to_hash(v) }
414
+ end
415
+ elsif value.respond_to? :to_hash
416
+ value.to_hash
417
+ else
418
+ value
419
+ end
420
+ end
421
+ end
422
+ end
423
+ # rubocop:enable Lint/UnneededCopDisableDirective