Class: DatadogAPIClient::V1::ServiceLevelObjectiveRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v1/models/service_level_objective_request.rb

Overview

A service level objective object includes a service level indicator, thresholds for one or more timeframes, and metadata (‘name`, `description`, `tags`, etc.).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ServiceLevelObjectiveRequest

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    attributes Model attributes in the form of hash



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 94

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::ServiceLevelObjectiveRequest` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::ServiceLevelObjectiveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

  if attributes.key?(:'groups')
    if (value = attributes[:'groups']).is_a?(Array)
      self.groups = value
    end
  end

  if attributes.key?(:'monitor_ids')
    if (value = attributes[:'monitor_ids']).is_a?(Array)
      self.monitor_ids = value
    end
  end

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

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

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  end

  if attributes.key?(:'thresholds')
    if (value = attributes[:'thresholds']).is_a?(Array)
      self.thresholds = value
    end
  end

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

Instance Attribute Details

#descriptionObject

A user-defined description of the service level objective. Always included in service level objective responses (but may be ‘null`). Optional in create/update requests.



27
28
29
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 27

def description
  @description
end

#groupsObject

A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the ‘monitor_ids` field is one.



30
31
32
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 30

def groups
  @groups
end

#monitor_idsObject

A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is ‘monitor`**.



33
34
35
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 33

def monitor_ids
  @monitor_ids
end

#nameObject

The name of the service level objective object.



36
37
38
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 36

def name
  @name
end

#queryObject

Returns the value of attribute query.



38
39
40
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 38

def query
  @query
end

#tagsObject

A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests.



41
42
43
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 41

def tags
  @tags
end

#thresholdsObject

The thresholds (timeframes and associated targets) for this service level objective object.



44
45
46
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 44

def thresholds
  @thresholds
end

#typeObject

Returns the value of attribute type.



46
47
48
# File 'lib/datadog_api_client/v1/models/service_level_objective_request.rb', line 46

def type
  @type
end