Class: OpsgenieSdk::DeprecatedPolicyApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DeprecatedPolicyApi

Returns a new instance of DeprecatedPolicyApi.



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

def api_client
  @api_client
end

Instance Method Details

#change_alert_policy_order(policy_id, body, opts = {}) ⇒ SuccessResponse

Change Alert Policy Order Change execution order of the alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

  • body

    Change order payload

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 28

def change_alert_policy_order(policy_id, body, opts = {})
  data, _status_code, _headers = change_alert_policy_order_with_http_info(policy_id, body, opts)
  data
end

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

Change Alert Policy Order Change execution order of the alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

  • body

    Change order payload

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



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
74
75
76
77
78
79
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 39

def change_alert_policy_order_with_http_info(policy_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeprecatedPolicyApi.change_alert_policy_order ...'
  end
  # verify the required parameter 'policy_id' is set
  if @api_client.config.client_side_validation && policy_id.nil?
    fail ArgumentError, "Missing the required parameter 'policy_id' when calling DeprecatedPolicyApi.change_alert_policy_order"
  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 DeprecatedPolicyApi.change_alert_policy_order"
  end
  # resource path
  local_var_path = '/v1/policies/{policyId}/change-order'.sub('{' + 'policyId' + '}', policy_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 = @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: DeprecatedPolicyApi#change_alert_policy_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_alert_policy(body, opts = {}) ⇒ DeprecatedCreateAlertPolicyResponse

Create Alert Policy Creates a new alert policy

Parameters:

  • body

    Payload of created alert policy

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

    the optional parameters

Returns:



85
86
87
88
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 85

def create_alert_policy(body, opts = {})
  data, _status_code, _headers = create_alert_policy_with_http_info(body, opts)
  data
end

#create_alert_policy_with_http_info(body, opts = {}) ⇒ Array<(DeprecatedCreateAlertPolicyResponse, Fixnum, Hash)>

Create Alert Policy Creates a new alert policy

Parameters:

  • body

    Payload of created alert policy

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

    the optional parameters

Returns:



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 95

def create_alert_policy_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeprecatedPolicyApi.create_alert_policy ...'
  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 DeprecatedPolicyApi.create_alert_policy"
  end
  # resource path
  local_var_path = '/v1/policies'

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

#delete_alert_policy(policy_id, opts = {}) ⇒ SuccessResponse

Delete Alert Policy Delete alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:



137
138
139
140
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 137

def delete_alert_policy(policy_id, opts = {})
  data, _status_code, _headers = delete_alert_policy_with_http_info(policy_id, opts)
  data
end

#delete_alert_policy_with_http_info(policy_id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Delete Alert Policy Delete alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 147

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

#disable_alert_policy(policy_id, opts = {}) ⇒ SuccessResponse

Disable Alert Policy Disable the alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:



189
190
191
192
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 189

def disable_alert_policy(policy_id, opts = {})
  data, _status_code, _headers = disable_alert_policy_with_http_info(policy_id, opts)
  data
end

#disable_alert_policy_with_http_info(policy_id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Disable Alert Policy Disable the alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



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
230
231
232
233
234
235
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 199

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

#enable_alert_policy(policy_id, opts = {}) ⇒ SuccessResponse

Enable Alert Policy Enable the alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:



241
242
243
244
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 241

def enable_alert_policy(policy_id, opts = {})
  data, _status_code, _headers = enable_alert_policy_with_http_info(policy_id, opts)
  data
end

#enable_alert_policy_with_http_info(policy_id, opts = {}) ⇒ Array<(SuccessResponse, Fixnum, Hash)>

Enable Alert Policy Enable the alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



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
283
284
285
286
287
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 251

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

#get_alert_policy(policy_id, opts = {}) ⇒ DeprecatedGetAlertPolicyResponse

Get Alert Policy Used to get details of a single policy with id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:



293
294
295
296
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 293

def get_alert_policy(policy_id, opts = {})
  data, _status_code, _headers = get_alert_policy_with_http_info(policy_id, opts)
  data
end

#get_alert_policy_with_http_info(policy_id, opts = {}) ⇒ Array<(DeprecatedGetAlertPolicyResponse, Fixnum, Hash)>

Get Alert Policy Used to get details of a single policy with id

Parameters:

  • policy_id

    Id of the requested policy

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

    the optional parameters

Returns:



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

def get_alert_policy_with_http_info(policy_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeprecatedPolicyApi.get_alert_policy ...'
  end
  # verify the required parameter 'policy_id' is set
  if @api_client.config.client_side_validation && policy_id.nil?
    fail ArgumentError, "Missing the required parameter 'policy_id' when calling DeprecatedPolicyApi.get_alert_policy"
  end
  # resource path
  local_var_path = '/v1/policies/{policyId}'.sub('{' + 'policyId' + '}', policy_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 => 'DeprecatedGetAlertPolicyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeprecatedPolicyApi#get_alert_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_alert_policies(opts = {}) ⇒ DeprecatedListAlertPoliciesResponse

List Alert Policies Returns list alert policies

Parameters:

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

    the optional parameters

Returns:



344
345
346
347
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 344

def list_alert_policies(opts = {})
  data, _status_code, _headers = list_alert_policies_with_http_info(opts)
  data
end

#list_alert_policies_with_http_info(opts = {}) ⇒ Array<(DeprecatedListAlertPoliciesResponse, Fixnum, Hash)>

List Alert Policies Returns list alert policies

Parameters:

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

    the optional parameters

Returns:



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
380
381
382
383
384
385
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 353

def list_alert_policies_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeprecatedPolicyApi.list_alert_policies ...'
  end
  # resource path
  local_var_path = '/v1/policies'

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

#update_alert_policy(policy_id, body, opts = {}) ⇒ SuccessResponse

Update Alert Policy Update alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

  • body

    Payload of updated alert policy

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

    the optional parameters

Returns:



392
393
394
395
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 392

def update_alert_policy(policy_id, body, opts = {})
  data, _status_code, _headers = update_alert_policy_with_http_info(policy_id, body, opts)
  data
end

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

Update Alert Policy Update alert policy with given id

Parameters:

  • policy_id

    Id of the requested policy

  • body

    Payload of updated alert policy

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

    the optional parameters

Returns:

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

    SuccessResponse data, response status code and response headers



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
434
435
436
437
438
439
440
441
442
443
# File 'lib/opsgenie_sdk/api/deprecated_policy_api.rb', line 403

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