Class: OpsgenieSdk::AlertApi

Inherits:
Object
  • Object
show all
Defined in:
lib/opsgenie_sdk/api/alert_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AlertApi

Returns a new instance of AlertApi.



19
20
21
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#acknowledge_alert(identifier, opts = {}) ⇒ SuccessResponse

Acknowledge Alert Acknowledges alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id)

  • :body (AcknowledgeAlertPayload)

    Request payload of acknowledging alert action

Returns:



29
30
31
32
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 29

def acknowledge_alert(identifier, opts = {})
  data, _status_code, _headers = acknowledge_alert_with_http_info(identifier, opts)
  data
end

#acknowledge_alert_with_http_info(identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Acknowledge Alert Acknowledges alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :body (AcknowledgeAlertPayload)

    Request payload of acknowledging alert action

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 41

def acknowledge_alert_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.acknowledge_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.acknowledge_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/acknowledge'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#acknowledge_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_attachment(identifier, file, opts = {}) ⇒ SuccessResponse

Add Alert Attachment Add Alert Attachment to related alert

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • file

    Attachment file to be uploaded

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :user (String)

    Display name of the request owner

  • :index_file (String)

    Name of html file which will be shown when attachment clicked on UI

Returns:



91
92
93
94
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 91

def add_attachment(identifier, file, opts = {})
  data, _status_code, _headers = add_attachment_with_http_info(identifier, file, opts)
  data
end

#add_attachment_with_http_info(identifier, file, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Add Alert Attachment Add Alert Attachment to related alert

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • file

    Attachment file to be uploaded

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :user (String)

    Display name of the request owner

  • :index_file (String)

    Name of html file which will be shown when attachment clicked on UI

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



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
147
148
149
150
151
152
153
154
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 105

def add_attachment_with_http_info(identifier, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.add_attachment ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.add_attachment"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling AlertApi.add_attachment"
  end
  if @api_client.config.client_side_validation && opts[:'alert_identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'alert_identifier_type'])
    fail ArgumentError, 'invalid value for "alert_identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/attachments'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'alertIdentifierType'] = opts[:'alert_identifier_type'] if !opts[:'alert_identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = file
  form_params['user'] = opts[:'user'] if !opts[:'user'].nil?
  form_params['indexFile'] = opts[:'index_file'] if !opts[:'index_file'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#add_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_details(identifier, body, opts = {}) ⇒ SuccessResponse

Add Details Add details to the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding alert details action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



162
163
164
165
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 162

def add_details(identifier, body, opts = {})
  data, _status_code, _headers = add_details_with_http_info(identifier, body, opts)
  data
end

#add_details_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Add Details Add details to the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding alert details action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 174

def add_details_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.add_details ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.add_details"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.add_details"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/details'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#add_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_note(identifier, body, opts = {}) ⇒ SuccessResponse

Add Note Adds note to alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding note to alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



226
227
228
229
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 226

def add_note(identifier, body, opts = {})
  data, _status_code, _headers = add_note_with_http_info(identifier, body, opts)
  data
end

#add_note_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Add Note Adds note to alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding note to alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 238

def add_note_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.add_note ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.add_note"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.add_note"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/notes'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#add_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_responder(identifier, body, opts = {}) ⇒ SuccessResponse

Add Responder Add responder to alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding responder to alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



290
291
292
293
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 290

def add_responder(identifier, body, opts = {})
  data, _status_code, _headers = add_responder_with_http_info(identifier, body, opts)
  data
end

#add_responder_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Add Responder Add responder to alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding responder to alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 302

def add_responder_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.add_responder ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.add_responder"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.add_responder"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/responders'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#add_responder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_tags(identifier, body, opts = {}) ⇒ SuccessResponse

Add Tags Add tags to the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of creating alert tags action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



354
355
356
357
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 354

def add_tags(identifier, body, opts = {})
  data, _status_code, _headers = add_tags_with_http_info(identifier, body, opts)
  data
end

#add_tags_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Add Tags Add tags to the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of creating alert tags action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 366

def add_tags_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.add_tags ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.add_tags"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.add_tags"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/tags'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#add_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_team(identifier, body, opts = {}) ⇒ SuccessResponse

Add Team Add team to alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding team to alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



418
419
420
421
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 418

def add_team(identifier, body, opts = {})
  data, _status_code, _headers = add_team_with_http_info(identifier, body, opts)
  data
end

#add_team_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Add Team Add team to alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of adding team to alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 430

def add_team_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.add_team ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.add_team"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.add_team"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/teams'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#add_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#assign_alert(identifier, body, opts = {}) ⇒ SuccessResponse

Assign Alert Assign alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of assigning alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



482
483
484
485
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 482

def assign_alert(identifier, body, opts = {})
  data, _status_code, _headers = assign_alert_with_http_info(identifier, body, opts)
  data
end

#assign_alert_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Assign Alert Assign alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of assigning alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 494

def assign_alert_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.assign_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.assign_alert"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.assign_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/assign'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#assign_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#close_alert(identifier, opts = {}) ⇒ SuccessResponse

Close Alert Closes alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :body (CloseAlertPayload)

    Request payload of closing alert action

Returns:



546
547
548
549
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 546

def close_alert(identifier, opts = {})
  data, _status_code, _headers = close_alert_with_http_info(identifier, opts)
  data
end

#close_alert_with_http_info(identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Close Alert Closes alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :body (CloseAlertPayload)

    Request payload of closing alert action

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 558

def close_alert_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.close_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.close_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/close'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#close_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#count_alerts(opts = {}) ⇒ GetCountAlertsResponse

Count Alerts Count alerts in Opsgenie

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    Search query to apply while filtering the alerts

  • :search_identifier (String)

    Identifier of the saved search query to apply while filtering the alerts

  • :search_identifier_type (String)

    Identifier type of the saved search query. Possible values are id and name. Default value is id. If searchIdentifier is not provided, this value is ignored. (default to id)

Returns:



606
607
608
609
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 606

def count_alerts(opts = {})
  data, _status_code, _headers = count_alerts_with_http_info(opts)
  data
end

#count_alerts_with_http_info(opts = {}) ⇒ Array<(GetCountAlertsResponse, Fixnum, Hash)>

Count Alerts Count alerts in Opsgenie

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    Search query to apply while filtering the alerts

  • :search_identifier (String)

    Identifier of the saved search query to apply while filtering the alerts

  • :search_identifier_type (String)

    Identifier type of the saved search query. Possible values are id and name. Default value is id. If searchIdentifier is not provided, this value is ignored.

Returns:

  • (Array<(GetCountAlertsResponse, Fixnum, Hash)>)

    GetCountAlertsResponse data, response status code and response headers



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 618

def count_alerts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.count_alerts ...'
  end
  if @api_client.config.client_side_validation && opts[:'search_identifier_type'] && !['id', 'name'].include?(opts[:'search_identifier_type'])
    fail ArgumentError, 'invalid value for "search_identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/alerts/count'

  # query parameters
  query_params = {}
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'searchIdentifier'] = opts[:'search_identifier'] if !opts[:'search_identifier'].nil?
  query_params[:'searchIdentifierType'] = opts[:'search_identifier_type'] if !opts[:'search_identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetCountAlertsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#count_alerts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_alert(body, opts = {}) ⇒ SuccessResponse

Create Alert Creates a new alert

Parameters:

  • body

    Request payload of created alert

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

    the optional parameters

Returns:



662
663
664
665
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 662

def create_alert(body, opts = {})
  data, _status_code, _headers = create_alert_with_http_info(body, opts)
  data
end

#create_alert_with_http_info(body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Create Alert Creates a new alert

Parameters:

  • body

    Request payload of created alert

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

    the optional parameters

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 672

def create_alert_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.create_alert ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.create_alert"
  end
  # resource path
  local_var_path = '/v2/alerts'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#create_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_saved_searches(body, opts = {}) ⇒ CreateSavedSearchResponse

Create Saved Search Create saved search with given fields

Parameters:

  • body

    Request payload of creating saved search

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

    the optional parameters

Returns:



714
715
716
717
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 714

def create_saved_searches(body, opts = {})
  data, _status_code, _headers = create_saved_searches_with_http_info(body, opts)
  data
end

#create_saved_searches_with_http_info(body, opts = {}) ⇒ Array<(CreateSavedSearchResponse, Fixnum, Hash)>

Create Saved Search Create saved search with given fields

Parameters:

  • body

    Request payload of creating saved search

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

    the optional parameters

Returns:

  • (Array<(CreateSavedSearchResponse, Fixnum, Hash)>)

    CreateSavedSearchResponse data, response status code and response headers



724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 724

def create_saved_searches_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.create_saved_searches ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.create_saved_searches"
  end
  # resource path
  local_var_path = '/v2/alerts/saved-searches'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreateSavedSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#create_saved_searches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_alert(identifier, opts = {}) ⇒ SuccessResponse

Delete Alert Deletes an alert using alert id, tiny id or alias

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :user (String)

    Display name of the request owner

  • :source (String)

    Display name of the request source

Returns:



769
770
771
772
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 769

def delete_alert(identifier, opts = {})
  data, _status_code, _headers = delete_alert_with_http_info(identifier, opts)
  data
end

#delete_alert_with_http_info(identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Delete Alert Deletes an alert using alert id, tiny id or alias

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :user (String)

    Display name of the request owner

  • :source (String)

    Display name of the request source

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 782

def delete_alert_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.delete_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.delete_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?
  query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#delete_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_saved_search(identifier, opts = {}) ⇒ SuccessResponse

Delete Saved Search Deletes saved search using given search identifier

Parameters:

  • identifier

    Identifier of the saved search which could be &#39;id&#39; or &#39;name&#39;

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, or &#39;name&#39; (default to id)

Returns:



831
832
833
834
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 831

def delete_saved_search(identifier, opts = {})
  data, _status_code, _headers = delete_saved_search_with_http_info(identifier, opts)
  data
end

#delete_saved_search_with_http_info(identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Delete Saved Search Deletes saved search using given search identifier

Parameters:

  • identifier

    Identifier of the saved search which could be &#39;id&#39; or &#39;name&#39;

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, or &#39;name&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 842

def delete_saved_search_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.delete_saved_search ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.delete_saved_search"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'name'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/alerts/saved-searches/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#delete_saved_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#escalate_alert(identifier, body, opts = {}) ⇒ SuccessResponse

Escalate Alert Escalate alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of escalating alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



890
891
892
893
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 890

def escalate_alert(identifier, body, opts = {})
  data, _status_code, _headers = escalate_alert_with_http_info(identifier, body, opts)
  data
end

#escalate_alert_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Escalate Alert Escalate alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of escalating alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 902

def escalate_alert_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.escalate_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.escalate_alert"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.escalate_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/escalate'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#escalate_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#execute_custom_alert_action(identifier, action_name, opts = {}) ⇒ SuccessResponse

Custom Alert Action Custom actions for the alert

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • action_name

    Name of the action to execute

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :body (ExecuteCustomAlertActionPayload)

    Request payload of executing custom alert action

Returns:



955
956
957
958
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 955

def execute_custom_alert_action(identifier, action_name, opts = {})
  data, _status_code, _headers = execute_custom_alert_action_with_http_info(identifier, action_name, opts)
  data
end

#execute_custom_alert_action_with_http_info(identifier, action_name, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Custom Alert Action Custom actions for the alert

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • action_name

    Name of the action to execute

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :body (ExecuteCustomAlertActionPayload)

    Request payload of executing custom alert action

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 968

def execute_custom_alert_action_with_http_info(identifier, action_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.execute_custom_alert_action ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.execute_custom_alert_action"
  end
  # verify the required parameter 'action_name' is set
  if @api_client.config.client_side_validation && action_name.nil?
    fail ArgumentError, "Missing the required parameter 'action_name' when calling AlertApi.execute_custom_alert_action"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/actions/{actionName}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'actionName' + '}', action_name.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#execute_custom_alert_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_alert(identifier, opts = {}) ⇒ GetAlertResponse

Get Alert Returns alert with given id, tiny id or alias

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



1019
1020
1021
1022
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1019

def get_alert(identifier, opts = {})
  data, _status_code, _headers = get_alert_with_http_info(identifier, opts)
  data
end

#get_alert_with_http_info(identifier, opts = {}) ⇒ Array<(GetAlertResponse, Fixnum, Hash)>

Get Alert Returns alert with given id, tiny id or alias

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(GetAlertResponse, Fixnum, Hash)>)

    GetAlertResponse data, response status code and response headers



1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1030

def get_alert_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.get_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.get_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetAlertResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#get_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_attachment(identifier, attachment_id, opts = {}) ⇒ GetAlertAttachmentResponse

Get Alert Attachment Get alert attachment name and url for the given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • attachment_id

    Identifier of alert attachment

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



1078
1079
1080
1081
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1078

def get_attachment(identifier, attachment_id, opts = {})
  data, _status_code, _headers = get_attachment_with_http_info(identifier, attachment_id, opts)
  data
end

#get_attachment_with_http_info(identifier, attachment_id, opts = {}) ⇒ Array<(GetAlertAttachmentResponse, Fixnum, Hash)>

Get Alert Attachment Get alert attachment name and url for the given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • attachment_id

    Identifier of alert attachment

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(GetAlertAttachmentResponse, Fixnum, Hash)>)

    GetAlertAttachmentResponse data, response status code and response headers



1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1090

def get_attachment_with_http_info(identifier, attachment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.get_attachment ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.get_attachment"
  end
  # verify the required parameter 'attachment_id' is set
  if @api_client.config.client_side_validation && attachment_id.nil?
    fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AlertApi.get_attachment"
  end
  if @api_client.config.client_side_validation && opts[:'alert_identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'alert_identifier_type'])
    fail ArgumentError, 'invalid value for "alert_identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/attachments/{attachmentId}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'attachmentId' + '}', attachment_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'alertIdentifierType'] = opts[:'alert_identifier_type'] if !opts[:'alert_identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetAlertAttachmentResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#get_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_request_status(request_id, opts = {}) ⇒ GetRequestStatusResponse

Get Request Status of Alert Used to track the status and alert details (if any) of the request whose identifier is given

Parameters:

  • request_id

    Universally unique identifier of the questioned request

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

    the optional parameters

Returns:



1140
1141
1142
1143
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1140

def get_request_status(request_id, opts = {})
  data, _status_code, _headers = get_request_status_with_http_info(request_id, opts)
  data
end

#get_request_status_with_http_info(request_id, opts = {}) ⇒ Array<(GetRequestStatusResponse, Fixnum, Hash)>

Get Request Status of Alert Used to track the status and alert details (if any) of the request whose identifier is given

Parameters:

  • request_id

    Universally unique identifier of the questioned request

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

    the optional parameters

Returns:

  • (Array<(GetRequestStatusResponse, Fixnum, Hash)>)

    GetRequestStatusResponse data, response status code and response headers



1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1150

def get_request_status_with_http_info(request_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.get_request_status ...'
  end
  # verify the required parameter 'request_id' is set
  if @api_client.config.client_side_validation && request_id.nil?
    fail ArgumentError, "Missing the required parameter 'request_id' when calling AlertApi.get_request_status"
  end
  # resource path
  local_var_path = '/v2/alerts/requests/{requestId}'.sub('{' + 'requestId' + '}', request_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetRequestStatusResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#get_request_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_saved_search(identifier, opts = {}) ⇒ GetSavedSearchResponse

Get Saved Search Get saved search for the given search identifier

Parameters:

  • identifier

    Identifier of the saved search which could be &#39;id&#39; or &#39;name&#39;

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, or &#39;name&#39; (default to id)

Returns:



1193
1194
1195
1196
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1193

def get_saved_search(identifier, opts = {})
  data, _status_code, _headers = get_saved_search_with_http_info(identifier, opts)
  data
end

#get_saved_search_with_http_info(identifier, opts = {}) ⇒ Array<(GetSavedSearchResponse, Fixnum, Hash)>

Get Saved Search Get saved search for the given search identifier

Parameters:

  • identifier

    Identifier of the saved search which could be &#39;id&#39; or &#39;name&#39;

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, or &#39;name&#39;

Returns:

  • (Array<(GetSavedSearchResponse, Fixnum, Hash)>)

    GetSavedSearchResponse data, response status code and response headers



1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1204

def get_saved_search_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.get_saved_search ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.get_saved_search"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'name'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/alerts/saved-searches/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetSavedSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#get_saved_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_alerts(opts = {}) ⇒ ListAlertsResponse

List Alerts Returns list of alerts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    Search query to apply while filtering the alerts

  • :search_identifier (String)

    Identifier of the saved search query to apply while filtering the alerts

  • :search_identifier_type (String)

    Identifier type of the saved search query. Possible values are &#39;id&#39;, or &#39;name&#39; (default to id)

  • :offset (Integer)

    Start index of the result set (to apply pagination). Minimum value (and also default value) is 0

  • :limit (Integer)

    Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100

  • :sort (String)

    Name of the field that result set will be sorted by (default to createdAt)

  • :order (String)

    Sorting order of the result set (default to desc)

Returns:



1256
1257
1258
1259
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1256

def list_alerts(opts = {})
  data, _status_code, _headers = list_alerts_with_http_info(opts)
  data
end

#list_alerts_with_http_info(opts = {}) ⇒ Array<(ListAlertsResponse, Fixnum, Hash)>

List Alerts Returns list of alerts

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :query (String)

    Search query to apply while filtering the alerts

  • :search_identifier (String)

    Identifier of the saved search query to apply while filtering the alerts

  • :search_identifier_type (String)

    Identifier type of the saved search query. Possible values are &#39;id&#39;, or &#39;name&#39;

  • :offset (Integer)

    Start index of the result set (to apply pagination). Minimum value (and also default value) is 0

  • :limit (Integer)

    Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100

  • :sort (String)

    Name of the field that result set will be sorted by

  • :order (String)

    Sorting order of the result set

Returns:

  • (Array<(ListAlertsResponse, Fixnum, Hash)>)

    ListAlertsResponse data, response status code and response headers



1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1272

def list_alerts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.list_alerts ...'
  end
  if @api_client.config.client_side_validation && opts[:'search_identifier_type'] && !['id', 'name'].include?(opts[:'search_identifier_type'])
    fail ArgumentError, 'invalid value for "search_identifier_type", must be one of id, name'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling AlertApi.list_alerts, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AlertApi.list_alerts, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AlertApi.list_alerts, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && opts[:'sort'] && !['createdAt', 'updatedAt', 'tinyId', 'alias', 'message', 'status', 'acknowledged', 'isSeen', 'snoozed', 'snoozedUntil', 'count', 'lastOccurredAt', 'source', 'owner', 'integration.name', 'integration.type', 'report.ackTime', 'report.closeTime', 'report.acknowledgedBy', 'report.closedBy'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of createdAt, updatedAt, tinyId, alias, message, status, acknowledged, isSeen, snoozed, snoozedUntil, count, lastOccurredAt, source, owner, integration.name, integration.type, report.ackTime, report.closeTime, report.acknowledgedBy, report.closedBy'
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of asc, desc'
  end
  # resource path
  local_var_path = '/v2/alerts'

  # query parameters
  query_params = {}
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'searchIdentifier'] = opts[:'search_identifier'] if !opts[:'search_identifier'].nil?
  query_params[:'searchIdentifierType'] = opts[:'search_identifier_type'] if !opts[:'search_identifier_type'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAlertsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#list_alerts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_attachments(identifier, opts = {}) ⇒ ListAlertAttachmentsResponse

List Alert Attachments List alert attachment names and urls for related alert

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



1339
1340
1341
1342
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1339

def list_attachments(identifier, opts = {})
  data, _status_code, _headers = list_attachments_with_http_info(identifier, opts)
  data
end

#list_attachments_with_http_info(identifier, opts = {}) ⇒ Array<(ListAlertAttachmentsResponse, Fixnum, Hash)>

List Alert Attachments List alert attachment names and urls for related alert

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:



1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1350

def list_attachments_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.list_attachments ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.list_attachments"
  end
  if @api_client.config.client_side_validation && opts[:'alert_identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'alert_identifier_type'])
    fail ArgumentError, 'invalid value for "alert_identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/attachments'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'alertIdentifierType'] = opts[:'alert_identifier_type'] if !opts[:'alert_identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAlertAttachmentsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#list_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_logs(identifier, opts = {}) ⇒ ListAlertLogsResponse

List Alert Logs List alert logs for the given alert identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :offset (String)

    Starting value of the offset property

  • :direction (String)

    Page direction to apply for the given offset with &#39;next&#39; and &#39;prev&#39; (default to next)

  • :limit (Integer)

    Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100

  • :order (String)

    Sorting order of the result set (default to desc)

Returns:



1401
1402
1403
1404
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1401

def list_logs(identifier, opts = {})
  data, _status_code, _headers = list_logs_with_http_info(identifier, opts)
  data
end

#list_logs_with_http_info(identifier, opts = {}) ⇒ Array<(ListAlertLogsResponse, Fixnum, Hash)>

List Alert Logs List alert logs for the given alert identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :offset (String)

    Starting value of the offset property

  • :direction (String)

    Page direction to apply for the given offset with &#39;next&#39; and &#39;prev&#39;

  • :limit (Integer)

    Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100

  • :order (String)

    Sorting order of the result set

Returns:

  • (Array<(ListAlertLogsResponse, Fixnum, Hash)>)

    ListAlertLogsResponse data, response status code and response headers



1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1416

def list_logs_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.list_logs ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.list_logs"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  if @api_client.config.client_side_validation && opts[:'direction'] && !['next', 'prev'].include?(opts[:'direction'])
    fail ArgumentError, 'invalid value for "direction", must be one of next, prev'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AlertApi.list_logs, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AlertApi.list_logs, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of asc, desc'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/logs'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAlertLogsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#list_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_notes(identifier, opts = {}) ⇒ ListAlertNotesResponse

List Alert Notes List alert notes for the given alert identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :offset (String)

    Starting value of the offset property

  • :direction (String)

    Page direction to apply for the given offset with &#39;next&#39; and &#39;prev&#39; (default to next)

  • :limit (Integer)

    Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100

  • :order (String)

    Sorting order of the result set (default to desc)

Returns:



1485
1486
1487
1488
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1485

def list_notes(identifier, opts = {})
  data, _status_code, _headers = list_notes_with_http_info(identifier, opts)
  data
end

#list_notes_with_http_info(identifier, opts = {}) ⇒ Array<(ListAlertNotesResponse, Fixnum, Hash)>

List Alert Notes List alert notes for the given alert identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :offset (String)

    Starting value of the offset property

  • :direction (String)

    Page direction to apply for the given offset with &#39;next&#39; and &#39;prev&#39;

  • :limit (Integer)

    Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100

  • :order (String)

    Sorting order of the result set

Returns:

  • (Array<(ListAlertNotesResponse, Fixnum, Hash)>)

    ListAlertNotesResponse data, response status code and response headers



1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1500

def list_notes_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.list_notes ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.list_notes"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  if @api_client.config.client_side_validation && opts[:'direction'] && !['next', 'prev'].include?(opts[:'direction'])
    fail ArgumentError, 'invalid value for "direction", must be one of next, prev'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AlertApi.list_notes, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AlertApi.list_notes, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && opts[:'order'] && !['asc', 'desc'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of asc, desc'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/notes'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAlertNotesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#list_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_recipients(identifier, opts = {}) ⇒ ListAlertRecipientsResponse

List Alert Recipients List alert recipients for the given alert identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



1565
1566
1567
1568
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1565

def list_recipients(identifier, opts = {})
  data, _status_code, _headers = list_recipients_with_http_info(identifier, opts)
  data
end

#list_recipients_with_http_info(identifier, opts = {}) ⇒ Array<(ListAlertRecipientsResponse, Fixnum, Hash)>

List Alert Recipients List alert recipients for the given alert identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:



1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1576

def list_recipients_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.list_recipients ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.list_recipients"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/recipients'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAlertRecipientsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#list_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_saved_searches(opts = {}) ⇒ ListSavedSearchesResponse

Lists Saved Searches List all saved searches

Parameters:

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

    the optional parameters

Returns:



1621
1622
1623
1624
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1621

def list_saved_searches(opts = {})
  data, _status_code, _headers = list_saved_searches_with_http_info(opts)
  data
end

#list_saved_searches_with_http_info(opts = {}) ⇒ Array<(ListSavedSearchesResponse, Fixnum, Hash)>

Lists Saved Searches List all saved searches

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ListSavedSearchesResponse, Fixnum, Hash)>)

    ListSavedSearchesResponse data, response status code and response headers



1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1630

def list_saved_searches_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.list_saved_searches ...'
  end
  # resource path
  local_var_path = '/v2/alerts/saved-searches'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListSavedSearchesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#list_saved_searches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_attachment(identifier, attachment_id, opts = {}) ⇒ SuccessResponse

Remove Alert Attachment Remove alert attachment for the given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • attachment_id

    Identifier of alert attachment

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :user (String)

    Display name of the request owner

Returns:



1671
1672
1673
1674
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1671

def remove_attachment(identifier, attachment_id, opts = {})
  data, _status_code, _headers = remove_attachment_with_http_info(identifier, attachment_id, opts)
  data
end

#remove_attachment_with_http_info(identifier, attachment_id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Remove Alert Attachment Remove alert attachment for the given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • attachment_id

    Identifier of alert attachment

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

    the optional parameters

Options Hash (opts):

  • :alert_identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :user (String)

    Display name of the request owner

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1684

def remove_attachment_with_http_info(identifier, attachment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.remove_attachment ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.remove_attachment"
  end
  # verify the required parameter 'attachment_id' is set
  if @api_client.config.client_side_validation && attachment_id.nil?
    fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AlertApi.remove_attachment"
  end
  if @api_client.config.client_side_validation && opts[:'alert_identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'alert_identifier_type'])
    fail ArgumentError, 'invalid value for "alert_identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/attachments/{attachmentId}'.sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'attachmentId' + '}', attachment_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'alertIdentifierType'] = opts[:'alert_identifier_type'] if !opts[:'alert_identifier_type'].nil?
  query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#remove_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_details(identifier, keys, opts = {}) ⇒ SuccessResponse

Remove Details Remove details of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • keys

    Comma separated list of keys to remove from the custom properties of the alert (e.g. &#39;key1,key2&#39;)

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :user (String)

    Display name of the request owner

  • :note (String)

    Additional alert note to add

  • :source (String)

    Display name of the request source

Returns:



1740
1741
1742
1743
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1740

def remove_details(identifier, keys, opts = {})
  data, _status_code, _headers = remove_details_with_http_info(identifier, keys, opts)
  data
end

#remove_details_with_http_info(identifier, keys, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Remove Details Remove details of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • keys

    Comma separated list of keys to remove from the custom properties of the alert (e.g. &#39;key1,key2&#39;)

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :user (String)

    Display name of the request owner

  • :note (String)

    Additional alert note to add

  • :source (String)

    Display name of the request source

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1755

def remove_details_with_http_info(identifier, keys, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.remove_details ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.remove_details"
  end
  # verify the required parameter 'keys' is set
  if @api_client.config.client_side_validation && keys.nil?
    fail ArgumentError, "Missing the required parameter 'keys' when calling AlertApi.remove_details"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/details'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'keys'] = @api_client.build_collection_param(keys, :csv)
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?
  query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
  query_params[:'note'] = opts[:'note'] if !opts[:'note'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#remove_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_tags(identifier, tags, opts = {}) ⇒ SuccessResponse

Remove Tags Remove tags of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • tags

    Tags field of the given alert as comma seperated values (e.g. &#39;tag1, tag2&#39;)

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :user (String)

    Display name of the request owner

  • :note (String)

    Additional alert note to add

  • :source (String)

    Display name of the request source

Returns:



1814
1815
1816
1817
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1814

def remove_tags(identifier, tags, opts = {})
  data, _status_code, _headers = remove_tags_with_http_info(identifier, tags, opts)
  data
end

#remove_tags_with_http_info(identifier, tags, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Remove Tags Remove tags of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • tags

    Tags field of the given alert as comma seperated values (e.g. &#39;tag1, tag2&#39;)

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :user (String)

    Display name of the request owner

  • :note (String)

    Additional alert note to add

  • :source (String)

    Display name of the request source

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1829

def remove_tags_with_http_info(identifier, tags, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.remove_tags ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.remove_tags"
  end
  # verify the required parameter 'tags' is set
  if @api_client.config.client_side_validation && tags.nil?
    fail ArgumentError, "Missing the required parameter 'tags' when calling AlertApi.remove_tags"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/tags'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'tags'] = @api_client.build_collection_param(tags, :csv)
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?
  query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
  query_params[:'note'] = opts[:'note'] if !opts[:'note'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#remove_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#snooze_alert(identifier, body, opts = {}) ⇒ SuccessResponse

Snooze Alert Snooze alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of snoozing alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



1885
1886
1887
1888
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1885

def snooze_alert(identifier, body, opts = {})
  data, _status_code, _headers = snooze_alert_with_http_info(identifier, body, opts)
  data
end

#snooze_alert_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Snooze Alert Snooze alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of snoozing alert action

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1897

def snooze_alert_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.snooze_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.snooze_alert"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.snooze_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/snooze'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#snooze_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#un_acknowledge_alert(identifier, opts = {}) ⇒ SuccessResponse

UnAcknowledge Alert UnAcknowledge alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

  • :body (UnAcknowledgeAlertPayload)

    Request payload of unacknowledging alert action

Returns:



1949
1950
1951
1952
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1949

def un_acknowledge_alert(identifier, opts = {})
  data, _status_code, _headers = un_acknowledge_alert_with_http_info(identifier, opts)
  data
end

#un_acknowledge_alert_with_http_info(identifier, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

UnAcknowledge Alert UnAcknowledge alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

  • :body (UnAcknowledgeAlertPayload)

    Request payload of unacknowledging alert action

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 1961

def un_acknowledge_alert_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.un_acknowledge_alert ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.un_acknowledge_alert"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/unacknowledge'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#un_acknowledge_alert\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_alert_description(identifier, body, opts = {}) ⇒ SuccessResponse

Update Alert Description Update the description of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of update alert description

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



2009
2010
2011
2012
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2009

def update_alert_description(identifier, body, opts = {})
  data, _status_code, _headers = update_alert_description_with_http_info(identifier, body, opts)
  data
end

#update_alert_description_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Update Alert Description Update the description of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of update alert description

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2021

def update_alert_description_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.update_alert_description ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.update_alert_description"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.update_alert_description"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/description'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#update_alert_description\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_alert_message(identifier, body, opts = {}) ⇒ SuccessResponse

Update Alert Message Update the message of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of update alert message

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



2073
2074
2075
2076
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2073

def update_alert_message(identifier, body, opts = {})
  data, _status_code, _headers = update_alert_message_with_http_info(identifier, body, opts)
  data
end

#update_alert_message_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Update Alert Message Update the message of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of update alert message

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2085

def update_alert_message_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.update_alert_message ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.update_alert_message"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.update_alert_message"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/message'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#update_alert_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_alert_priority(identifier, body, opts = {}) ⇒ SuccessResponse

Update Alert Priority Update the priority of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of update alert priority

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39; (default to id)

Returns:



2137
2138
2139
2140
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2137

def update_alert_priority(identifier, body, opts = {})
  data, _status_code, _headers = update_alert_priority_with_http_info(identifier, body, opts)
  data
end

#update_alert_priority_with_http_info(identifier, body, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Update Alert Priority Update the priority of the alert with given identifier

Parameters:

  • identifier

    Identifier of alert which could be alert id, tiny id or alert alias

  • body

    Request payload of update alert priority

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, &#39;alias&#39; or &#39;tiny&#39;

Returns:

  • (Array<(SuccessResponse, Fixnum, Hash)>)

    SuccessResponse data, response status code and response headers



2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2149

def update_alert_priority_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.update_alert_priority ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.update_alert_priority"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.update_alert_priority"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'alias', 'tiny'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, alias, tiny'
  end
  # resource path
  local_var_path = '/v2/alerts/{identifier}/priority'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#update_alert_priority\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_saved_search(identifier, body, opts = {}) ⇒ GetSavedSearchResponse

Update Saved Search Update saved search for the given search identifier

Parameters:

  • identifier

    Identifier of the saved search which could be &#39;id&#39; or &#39;name&#39;

  • body

    Request payload of updating saved search

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, or &#39;name&#39; (default to id)

Returns:



2201
2202
2203
2204
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2201

def update_saved_search(identifier, body, opts = {})
  data, _status_code, _headers = update_saved_search_with_http_info(identifier, body, opts)
  data
end

#update_saved_search_with_http_info(identifier, body, opts = {}) ⇒ Array<(GetSavedSearchResponse, Fixnum, Hash)>

Update Saved Search Update saved search for the given search identifier

Parameters:

  • identifier

    Identifier of the saved search which could be &#39;id&#39; or &#39;name&#39;

  • body

    Request payload of updating saved search

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

    the optional parameters

Options Hash (opts):

  • :identifier_type (String)

    Type of the identifier that is provided as an in-line parameter. Possible values are &#39;id&#39;, or &#39;name&#39;

Returns:

  • (Array<(GetSavedSearchResponse, Fixnum, Hash)>)

    GetSavedSearchResponse data, response status code and response headers



2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
# File 'lib/opsgenie_sdk/api/alert_api.rb', line 2213

def update_saved_search_with_http_info(identifier, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AlertApi.update_saved_search ...'
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling AlertApi.update_saved_search"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AlertApi.update_saved_search"
  end
  if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'name'].include?(opts[:'identifier_type'])
    fail ArgumentError, 'invalid value for "identifier_type", must be one of id, name'
  end
  # resource path
  local_var_path = '/v2/alerts/saved-searches/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['GenieKey']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetSavedSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertApi#update_saved_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end