class OpsgenieSdk::DeprecatedPolicyApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/opsgenie_sdk/api/deprecated_policy_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

change_alert_policy_order(policy_id, body, opts = {}) click to toggle source

Change Alert Policy Order Change execution order of the alert policy with given id @param policy_id Id of the requested policy @param body Change order payload @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Change Alert Policy Order Change execution order of the alert policy with given id @param policy_id Id of the requested policy @param body Change order payload @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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 = {}) click to toggle source

Create Alert Policy Creates a new alert policy @param body Payload of created alert policy @param [Hash] opts the optional parameters @return [DeprecatedCreateAlertPolicyResponse]

# 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 = {}) click to toggle source

Create Alert Policy Creates a new alert policy @param body Payload of created alert policy @param [Hash] opts the optional parameters @return [Array<(DeprecatedCreateAlertPolicyResponse, Fixnum, Hash)>] DeprecatedCreateAlertPolicyResponse data, response status code and response headers

# 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 = {}) click to toggle source

Delete Alert Policy Delete alert policy with given id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Delete Alert Policy Delete alert policy with given id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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 = {}) click to toggle source

Disable Alert Policy Disable the alert policy with given id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Disable Alert Policy Disable the alert policy with given id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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 = {}) click to toggle source

Enable Alert Policy Enable the alert policy with given id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Enable Alert Policy Enable the alert policy with given id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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 = {}) click to toggle source

Get Alert Policy Used to get details of a single policy with id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [DeprecatedGetAlertPolicyResponse]

# 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 = {}) click to toggle source

Get Alert Policy Used to get details of a single policy with id @param policy_id Id of the requested policy @param [Hash] opts the optional parameters @return [Array<(DeprecatedGetAlertPolicyResponse, Fixnum, Hash)>] DeprecatedGetAlertPolicyResponse data, response status code and response headers

# 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 = {}) click to toggle source

List Alert Policies Returns list alert policies @param [Hash] opts the optional parameters @return [DeprecatedListAlertPoliciesResponse]

# 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 = {}) click to toggle source

List Alert Policies Returns list alert policies @param [Hash] opts the optional parameters @return [Array<(DeprecatedListAlertPoliciesResponse, Fixnum, Hash)>] DeprecatedListAlertPoliciesResponse data, response status code and response headers

# 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 = {}) click to toggle source

Update Alert Policy Update alert policy with given id @param policy_id Id of the requested policy @param body Payload of updated alert policy @param [Hash] opts the optional parameters @return [SuccessResponse]

# 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 = {}) click to toggle source

Update Alert Policy Update alert policy with given id @param policy_id Id of the requested policy @param body Payload of updated alert policy @param [Hash] opts the optional parameters @return [Array<(SuccessResponse, Fixnum, Hash)>] SuccessResponse data, response status code and response headers

# 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