Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33708,10 +33708,27 @@ components:
example: 3600
format: int64
type: integer
fail_on_no_data:
default: true
description: Whether the rule should fail if a matching monitor group is in a NO DATA state.
example: false
type: boolean
fail_on_no_groups_found:
default: false
description: Whether the rule should fail if no monitor groups are found for the query.
example: false
type: boolean
query:
description: Monitors that match this query are evaluated.
example: "service:my-service env:prod"
type: string
warmup:
default: 0
description: Seconds to wait after a deployment starts before evaluating the monitor's status.
example: 0
format: int64
minimum: 0
type: integer
required:
- query
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,27 @@ class DeploymentRuleOptionsMonitor
# Seconds the monitor needs to stay in OK status for the rule to pass.
attr_accessor :duration

# Whether the rule should fail if a matching monitor group is in a NO DATA state.
attr_accessor :fail_on_no_data

# Whether the rule should fail if no monitor groups are found for the query.
attr_accessor :fail_on_no_groups_found

# Monitors that match this query are evaluated.
attr_reader :query

# Seconds to wait after a deployment starts before evaluating the monitor's status.
attr_reader :warmup

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'duration' => :'duration',
:'query' => :'query'
:'fail_on_no_data' => :'fail_on_no_data',
:'fail_on_no_groups_found' => :'fail_on_no_groups_found',
:'query' => :'query',
:'warmup' => :'warmup'
}
end

Expand All @@ -41,7 +53,10 @@ def self.attribute_map
def self.openapi_types
{
:'duration' => :'Integer',
:'query' => :'String'
:'fail_on_no_data' => :'Boolean',
:'fail_on_no_groups_found' => :'Boolean',
:'query' => :'String',
:'warmup' => :'Integer'
}
end

Expand All @@ -65,16 +80,29 @@ def initialize(attributes = {})
self.duration = attributes[:'duration']
end

if attributes.key?(:'fail_on_no_data')
self.fail_on_no_data = attributes[:'fail_on_no_data']
end

if attributes.key?(:'fail_on_no_groups_found')
self.fail_on_no_groups_found = attributes[:'fail_on_no_groups_found']
end

if attributes.key?(:'query')
self.query = attributes[:'query']
end

if attributes.key?(:'warmup')
self.warmup = attributes[:'warmup']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @query.nil?
return false if !@warmup.nil? && @warmup < 0
true
end

Expand All @@ -88,21 +116,34 @@ def query=(query)
@query = query
end

# Custom attribute writer method with validation
# @param warmup [Object] Object to be assigned
# @!visibility private
def warmup=(warmup)
if !warmup.nil? && warmup < 0
fail ArgumentError, 'invalid value for "warmup", must be greater than or equal to 0.'
end
@warmup = warmup
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
duration == o.duration &&
query == o.query
fail_on_no_data == o.fail_on_no_data &&
fail_on_no_groups_found == o.fail_on_no_groups_found &&
query == o.query &&
warmup == o.warmup
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[duration, query].hash
[duration, fail_on_no_data, fail_on_no_groups_found, query, warmup].hash
end
end
end
Loading