Class: DatadogAPIClient::V1::EventCreateRequest

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

Overview

Object representing an event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EventCreateRequest

Initializes the object

Parameters:

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

    attributes Model attributes in the form of hash



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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/datadog_api_client/v1/models/event_create_request.rb', line 108

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

  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?(:'priority')
    self.priority = attributes[:'priority']
  end

  if attributes.key?(:'related_event_id')
    self.related_event_id = attributes[:'related_event_id']
  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
end

Instance Attribute Details

#aggregation_keyObject

An arbitrary string to use for aggregation. Limited to 100 characters. If you specify a key, all events using that key are grouped together in the Event Stream.



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

def aggregation_key
  @aggregation_key
end

#alert_typeObject

Returns the value of attribute alert_type.



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

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.



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

def date_happened
  @date_happened
end

#device_nameObject

A device name.



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

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.



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

def host
  @host
end

#priorityObject

Returns the value of attribute priority.



40
41
42
# File 'lib/datadog_api_client/v1/models/event_create_request.rb', line 40

def priority
  @priority
end

ID of the parent event. Must be sent as an integer (that is no quotes).



43
44
45
# File 'lib/datadog_api_client/v1/models/event_create_request.rb', line 43

def related_event_id
  @related_event_id
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).



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

def source_type_name
  @source_type_name
end

#tagsObject

A list of tags to apply to the event.



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

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.



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

def text
  @text
end

#titleObject

The event title.



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

def title
  @title
end