Class: DatadogAPIClient::V1::Event

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

Overview

Object representing an event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Event

Initializes the object

Parameters:

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

    attributes Model attributes in the form of hash



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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/datadog_api_client/v1/models/event.rb', line 118

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::Event` 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::Event`. 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?(:'alert_type')
    self.alert_type = attributes[:'alert_type']
  end

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#alert_typeObject

Returns the value of attribute alert_type.



26
27
28
# File 'lib/datadog_api_client/v1/models/event.rb', line 26

def alert_type
  @alert_type
end

#date_happenedObject

POSIX timestamp of the event. Must be sent as an integer (that is no quotes). Limited to events no older than 7 days.



29
30
31
# File 'lib/datadog_api_client/v1/models/event.rb', line 29

def date_happened
  @date_happened
end

#device_nameObject

A device name.



32
33
34
# File 'lib/datadog_api_client/v1/models/event.rb', line 32

def device_name
  @device_name
end

#hostObject

Host name to associate with the event. Any tags associated with the host are also applied to this event.



35
36
37
# File 'lib/datadog_api_client/v1/models/event.rb', line 35

def host
  @host
end

#idObject

Integer ID of the event.



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

def id
  @id
end

#id_strObject

Handling IDs as large 64-bit numbers can cause loss of accuracy issues with some programming languages. Instead, use the string representation of the Event ID to avoid losing accuracy.



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

def id_str
  @id_str
end

#payloadObject

Payload of the event.



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

def payload
  @payload
end

#priorityObject

Returns the value of attribute priority.



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

def priority
  @priority
end

#source_type_nameObject

The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).



49
50
51
# File 'lib/datadog_api_client/v1/models/event.rb', line 49

def source_type_name
  @source_type_name
end

#tagsObject

A list of tags to apply to the event.



52
53
54
# File 'lib/datadog_api_client/v1/models/event.rb', line 52

def tags
  @tags
end

#textObject

The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with ‘%%% \n` and end the text block with `\n %%%`. Use `msg_text` with the Datadog Ruby library.



55
56
57
# File 'lib/datadog_api_client/v1/models/event.rb', line 55

def text
  @text
end

#titleObject

The event title.



58
59
60
# File 'lib/datadog_api_client/v1/models/event.rb', line 58

def title
  @title
end

#urlObject

URL of the event.



61
62
63
# File 'lib/datadog_api_client/v1/models/event.rb', line 61

def url
  @url
end