Class: OpsgenieSdk::HeartbeatApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ HeartbeatApi

Returns a new instance of HeartbeatApi.



19
20
21
# File 'lib/opsgenie_sdk/api/heartbeat_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/heartbeat_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_heartbeat(body, opts = {}) ⇒ CreateHeartbeatResponse

Create Heartbeat Create a new heartbeat

Parameters:

  • body

    Request payload of created heartbeat

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 27

def create_heartbeat(body, opts = {})
  data, _status_code, _headers = create_heartbeat_with_http_info(body, opts)
  data
end

#create_heartbeat_with_http_info(body, opts = {}) ⇒ Array<(CreateHeartbeatResponse, Fixnum, Hash)>

Create Heartbeat Create a new heartbeat

Parameters:

  • body

    Request payload of created heartbeat

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

    the optional parameters

Returns:

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

    CreateHeartbeatResponse data, response status code and response headers



37
38
39
40
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
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 37

def create_heartbeat_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.create_heartbeat ...'
  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 HeartbeatApi.create_heartbeat"
  end
  # resource path
  local_var_path = '/v2/heartbeats'

  # 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 => 'CreateHeartbeatResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#create_heartbeat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_heartbeat(name, opts = {}) ⇒ SuccessResponse

Delete Heartbeat Delete heartbeat with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:



79
80
81
82
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 79

def delete_heartbeat(name, opts = {})
  data, _status_code, _headers = delete_heartbeat_with_http_info(name, opts)
  data
end

#delete_heartbeat_with_http_info(name, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Delete Heartbeat Delete heartbeat with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 89

def delete_heartbeat_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.delete_heartbeat ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HeartbeatApi.delete_heartbeat"
  end
  # resource path
  local_var_path = '/v2/heartbeats/{name}'.sub('{' + 'name' + '}', name.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(: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: HeartbeatApi#delete_heartbeat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_heartbeat(name, opts = {}) ⇒ DisableHeartbeatResponse

Disable Heartbeat Disable heartbeat request with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:



131
132
133
134
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 131

def disable_heartbeat(name, opts = {})
  data, _status_code, _headers = disable_heartbeat_with_http_info(name, opts)
  data
end

#disable_heartbeat_with_http_info(name, opts = {}) ⇒ Array<(DisableHeartbeatResponse, Fixnum, Hash)>

Disable Heartbeat Disable heartbeat request with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:

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

    DisableHeartbeatResponse data, response status code and response headers



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 141

def disable_heartbeat_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.disable_heartbeat ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HeartbeatApi.disable_heartbeat"
  end
  # resource path
  local_var_path = '/v2/heartbeats/{name}/disable'.sub('{' + 'name' + '}', name.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(: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 => 'DisableHeartbeatResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#disable_heartbeat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_heartbeat(name, opts = {}) ⇒ EnableHeartbeatResponse

Enable Heartbeat Enable heartbeat request with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:



183
184
185
186
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 183

def enable_heartbeat(name, opts = {})
  data, _status_code, _headers = enable_heartbeat_with_http_info(name, opts)
  data
end

#enable_heartbeat_with_http_info(name, opts = {}) ⇒ Array<(EnableHeartbeatResponse, Fixnum, Hash)>

Enable Heartbeat Enable heartbeat request with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:

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

    EnableHeartbeatResponse data, response status code and response headers



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
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 193

def enable_heartbeat_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.enable_heartbeat ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HeartbeatApi.enable_heartbeat"
  end
  # resource path
  local_var_path = '/v2/heartbeats/{name}/enable'.sub('{' + 'name' + '}', name.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(: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 => 'EnableHeartbeatResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#enable_heartbeat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_heartbeat(name, opts = {}) ⇒ GetHeartbeatResponse

Get Heartbeat Returns heartbeat with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:



235
236
237
238
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 235

def get_heartbeat(name, opts = {})
  data, _status_code, _headers = get_heartbeat_with_http_info(name, opts)
  data
end

#get_heartbeat_with_http_info(name, opts = {}) ⇒ Array<(GetHeartbeatResponse, Fixnum, Hash)>

Get Heartbeat Returns heartbeat with given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:

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

    GetHeartbeatResponse data, response status code and response headers



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
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 245

def get_heartbeat_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.get_heartbeat ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HeartbeatApi.get_heartbeat"
  end
  # resource path
  local_var_path = '/v2/heartbeats/{name}'.sub('{' + 'name' + '}', name.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 => 'GetHeartbeatResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#get_heartbeat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_heart_beats(opts = {}) ⇒ ListHeartbeatResponse

List Heartbeats Returns list of Heartbeats

Parameters:

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

    the optional parameters

Returns:



286
287
288
289
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 286

def list_heart_beats(opts = {})
  data, _status_code, _headers = list_heart_beats_with_http_info(opts)
  data
end

#list_heart_beats_with_http_info(opts = {}) ⇒ Array<(ListHeartbeatResponse, Fixnum, Hash)>

List Heartbeats Returns list of Heartbeats

Parameters:

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

    the optional parameters

Returns:

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

    ListHeartbeatResponse data, response status code and response headers



295
296
297
298
299
300
301
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
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 295

def list_heart_beats_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.list_heart_beats ...'
  end
  # resource path
  local_var_path = '/v2/heartbeats'

  # 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 => 'ListHeartbeatResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#list_heart_beats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ping(name, opts = {}) ⇒ SuccessResponse

Ping Heartbeat Ping Heartbeat for given heartbeat name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:



333
334
335
336
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 333

def ping(name, opts = {})
  data, _status_code, _headers = ping_with_http_info(name, opts)
  data
end

#ping_with_http_info(name, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Ping Heartbeat Ping Heartbeat for given heartbeat name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 343

def ping_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.ping ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HeartbeatApi.ping"
  end
  # resource path
  local_var_path = '/v2/heartbeats/{name}/ping'.sub('{' + 'name' + '}', name.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 => 'SuccessResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#ping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_heartbeat(name, opts = {}) ⇒ UpdateHeartbeatResponse

Update Heartbeat (Partial) Update Heartbeatwith given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Options Hash (opts):

Returns:



386
387
388
389
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 386

def update_heartbeat(name, opts = {})
  data, _status_code, _headers = update_heartbeat_with_http_info(name, opts)
  data
end

#update_heartbeat_with_http_info(name, opts = {}) ⇒ Array<(UpdateHeartbeatResponse, Fixnum, Hash)>

Update Heartbeat (Partial) Update Heartbeatwith given name

Parameters:

  • name

    Name of the heartbeat

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

    the optional parameters

Options Hash (opts):

Returns:

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

    UpdateHeartbeatResponse data, response status code and response headers



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/opsgenie_sdk/api/heartbeat_api.rb', line 397

def update_heartbeat_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HeartbeatApi.update_heartbeat ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling HeartbeatApi.update_heartbeat"
  end
  # resource path
  local_var_path = '/v2/heartbeats/{name}'.sub('{' + 'name' + '}', name.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 = @api_client.object_to_http_body(opts[:'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 => 'UpdateHeartbeatResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HeartbeatApi#update_heartbeat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end