class OpsgenieSdk::DeprecatedPolicyApi
Attributes
Public Class Methods
# 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 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 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
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
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
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
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
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
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
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
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
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
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 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 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
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
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