class OpsgenieSdk::AlertApi
Attributes
Public Class Methods
# File lib/opsgenie_sdk/api/alert_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Acknowledge Alert
Acknowledges alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [AcknowledgeAlertPayload] :body Request payload of acknowledging alert action @return [SuccessResponse]
# 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
Acknowledges alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [AcknowledgeAlertPayload] :body Request payload of acknowledging alert action @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Alert
Attachment Add Alert
Attachment to related alert @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param file Attachment file to be uploaded @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [String] :user Display name of the request owner @option opts [String] :index_file Name of html file which will be shown when attachment clicked on UI @return [SuccessResponse]
# 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 Alert
Attachment Add Alert
Attachment to related alert @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param file Attachment file to be uploaded @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [String] :user Display name of the request owner @option opts [String] :index_file Name of html file which will be shown when attachment clicked on UI @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Add details to the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding alert details action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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 Add details to the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding alert details action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Adds note to alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding note to alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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 Adds note to alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding note to alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Add responder to alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding responder to alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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
Add responder to alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding responder to alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Team
Add team to alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding team to alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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
Add team to alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of adding team to alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Assign alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of assigning alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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
Assign alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of assigning alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Closes alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [CloseAlertPayload] :body Request payload of closing alert action @return [SuccessResponse]
# 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
Closes alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [CloseAlertPayload] :body Request payload of closing alert action @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Count alerts in Opsgenie @param [Hash] opts the optional parameters @option opts [String] :query Search query to apply while filtering the alerts @option opts [String] :search_identifier Identifier of the saved search query to apply while filtering the alerts @option opts [String] :search_identifier_type 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) @return [GetCountAlertsResponse]
# 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 Count alerts in Opsgenie @param [Hash] opts the optional parameters @option opts [String] :query Search query to apply while filtering the alerts @option opts [String] :search_identifier Identifier of the saved search query to apply while filtering the alerts @option opts [String] :search_identifier_type 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. @return [Array<(GetCountAlertsResponse
, Fixnum, Hash)>] GetCountAlertsResponse
data, response status code and response headers
# 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
Creates a new alert @param body Request payload of created alert @param [Hash] opts the optional parameters @return [SuccessResponse]
# 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
Creates a new alert @param body Request payload of created alert @param [Hash] opts the optional parameters @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Search Create saved search with given fields @param body Request payload of creating saved search @param [Hash] opts the optional parameters @return [CreateSavedSearchResponse]
# 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 Search Create saved search with given fields @param body Request payload of creating saved search @param [Hash] opts the optional parameters @return [Array<(CreateSavedSearchResponse
, Fixnum, Hash)>] CreateSavedSearchResponse
data, response status code and response headers
# 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
Deletes an alert using alert id, tiny id or alias @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [String] :user Display name of the request owner @option opts [String] :source Display name of the request source @return [SuccessResponse]
# 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
Deletes an alert using alert id, tiny id or alias @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [String] :user Display name of the request owner @option opts [String] :source Display name of the request source @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Deletes saved search using given search identifier @param identifier Identifier of the saved search which could be 'id' or 'name' @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', or 'name' (default to id) @return [SuccessResponse]
# 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 Deletes saved search using given search identifier @param identifier Identifier of the saved search which could be 'id' or 'name' @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', or 'name' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Escalate alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of escalating alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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
Escalate alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of escalating alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Custom Alert
Action Custom actions for the alert @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param action_name Name of the action to execute @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [ExecuteCustomAlertActionPayload] :body Request payload of executing custom alert action @return [SuccessResponse]
# 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
Custom Alert
Action Custom actions for the alert @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param action_name Name of the action to execute @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [ExecuteCustomAlertActionPayload] :body Request payload of executing custom alert action @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Returns alert with given id, tiny id or alias @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [GetAlertResponse]
# 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
Returns alert with given id, tiny id or alias @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(GetAlertResponse
, Fixnum, Hash)>] GetAlertResponse
data, response status code and response headers
# 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 Alert
Attachment Get alert attachment name and url for the given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param attachment_id Identifier of alert attachment @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [GetAlertAttachmentResponse]
# 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 Alert
Attachment Get alert attachment name and url for the given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param attachment_id Identifier of alert attachment @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(GetAlertAttachmentResponse
, Fixnum, Hash)>] GetAlertAttachmentResponse
data, response status code and response headers
# 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 of Alert
Used to track the status and alert details (if any) of the request whose identifier is given @param request_id Universally unique identifier of the questioned request @param [Hash] opts the optional parameters @return [GetRequestStatusResponse]
# 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 of Alert
Used to track the status and alert details (if any) of the request whose identifier is given @param request_id Universally unique identifier of the questioned request @param [Hash] opts the optional parameters @return [Array<(GetRequestStatusResponse
, Fixnum, Hash)>] GetRequestStatusResponse
data, response status code and response headers
# 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 Get saved search for the given search identifier @param identifier Identifier of the saved search which could be 'id' or 'name' @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', or 'name' (default to id) @return [GetSavedSearchResponse]
# 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 Get saved search for the given search identifier @param identifier Identifier of the saved search which could be 'id' or 'name' @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', or 'name' @return [Array<(GetSavedSearchResponse
, Fixnum, Hash)>] GetSavedSearchResponse
data, response status code and response headers
# 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 Returns list of alerts @param [Hash] opts the optional parameters @option opts [String] :query Search query to apply while filtering the alerts @option opts [String] :search_identifier Identifier of the saved search query to apply while filtering the alerts @option opts [String] :search_identifier_type Identifier type of the saved search query. Possible values are 'id', or 'name' (default to id) @option opts [Integer] :offset Start index of the result set (to apply pagination). Minimum value (and also default value) is 0 @option opts [Integer] :limit Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 @option opts [String] :sort Name of the field that result set will be sorted by (default to createdAt) @option opts [String] :order Sorting order of the result set (default to desc) @return [ListAlertsResponse]
# 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 Returns list of alerts @param [Hash] opts the optional parameters @option opts [String] :query Search query to apply while filtering the alerts @option opts [String] :search_identifier Identifier of the saved search query to apply while filtering the alerts @option opts [String] :search_identifier_type Identifier type of the saved search query. Possible values are 'id', or 'name' @option opts [Integer] :offset Start index of the result set (to apply pagination). Minimum value (and also default value) is 0 @option opts [Integer] :limit Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 @option opts [String] :sort Name of the field that result set will be sorted by @option opts [String] :order Sorting order of the result set @return [Array<(ListAlertsResponse
, Fixnum, Hash)>] ListAlertsResponse
data, response status code and response headers
# 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 Alert
Attachments List alert attachment names and urls for related alert @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [ListAlertAttachmentsResponse]
# 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 Alert
Attachments List alert attachment names and urls for related alert @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(ListAlertAttachmentsResponse
, Fixnum, Hash)>] ListAlertAttachmentsResponse
data, response status code and response headers
# 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 Alert
Logs List alert logs for the given alert identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [String] :offset Starting value of the offset property @option opts [String] :direction Page direction to apply for the given offset with 'next' and 'prev' (default to next) @option opts [Integer] :limit Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 @option opts [String] :order Sorting order of the result set (default to desc) @return [ListAlertLogsResponse]
# 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 Alert
Logs List alert logs for the given alert identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [String] :offset Starting value of the offset property @option opts [String] :direction Page direction to apply for the given offset with 'next' and 'prev' @option opts [Integer] :limit Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 @option opts [String] :order Sorting order of the result set @return [Array<(ListAlertLogsResponse
, Fixnum, Hash)>] ListAlertLogsResponse
data, response status code and response headers
# 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 Alert
Notes List alert notes for the given alert identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [String] :offset Starting value of the offset property @option opts [String] :direction Page direction to apply for the given offset with 'next' and 'prev' (default to next) @option opts [Integer] :limit Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 @option opts [String] :order Sorting order of the result set (default to desc) @return [ListAlertNotesResponse]
# 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 Alert
Notes List alert notes for the given alert identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [String] :offset Starting value of the offset property @option opts [String] :direction Page direction to apply for the given offset with 'next' and 'prev' @option opts [Integer] :limit Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 @option opts [String] :order Sorting order of the result set @return [Array<(ListAlertNotesResponse
, Fixnum, Hash)>] ListAlertNotesResponse
data, response status code and response headers
# 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 Alert
Recipients List alert recipients for the given alert identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [ListAlertRecipientsResponse]
# 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 Alert
Recipients List alert recipients for the given alert identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(ListAlertRecipientsResponse
, Fixnum, Hash)>] ListAlertRecipientsResponse
data, response status code and response headers
# 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
Lists Saved Searches List all saved searches @param [Hash] opts the optional parameters @return [ListSavedSearchesResponse]
# 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
Lists Saved Searches List all saved searches @param [Hash] opts the optional parameters @return [Array<(ListSavedSearchesResponse
, Fixnum, Hash)>] ListSavedSearchesResponse
data, response status code and response headers
# 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 Alert
Attachment Remove alert attachment for the given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param attachment_id Identifier of alert attachment @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [String] :user Display name of the request owner @return [SuccessResponse]
# 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 Alert
Attachment Remove alert attachment for the given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param attachment_id Identifier of alert attachment @param [Hash] opts the optional parameters @option opts [String] :alert_identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [String] :user Display name of the request owner @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Remove details of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param keys Comma separated list of keys to remove from the custom properties of the alert (e.g. 'key1,key2') @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [String] :user Display name of the request owner @option opts [String] :note Additional alert note to add @option opts [String] :source Display name of the request source @return [SuccessResponse]
# 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 Remove details of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param keys Comma separated list of keys to remove from the custom properties of the alert (e.g. 'key1,key2') @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [String] :user Display name of the request owner @option opts [String] :note Additional alert note to add @option opts [String] :source Display name of the request source @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
Snooze Alert
Snooze alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of snoozing alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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
Snooze alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of snoozing alert action @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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
UnAcknowledge Alert
UnAcknowledge alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @option opts [UnAcknowledgeAlertPayload] :body Request payload of unacknowledging alert action @return [SuccessResponse]
# 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
UnAcknowledge Alert
UnAcknowledge alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @option opts [UnAcknowledgeAlertPayload] :body Request payload of unacknowledging alert action @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Update the description of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of update alert description @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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 Update the description of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of update alert description @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Update the message of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of update alert message @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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 Update the message of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of update alert message @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Update the priority of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of update alert priority @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' (default to id) @return [SuccessResponse]
# 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 Update the priority of the alert with given identifier @param identifier Identifier of alert which could be alert id, tiny id or alert alias @param body Request payload of update alert priority @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny' @return [Array<(SuccessResponse
, Fixnum, Hash)>] SuccessResponse
data, response status code and response headers
# 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 Update saved search for the given search identifier @param identifier Identifier of the saved search which could be 'id' or 'name' @param body Request payload of updating saved search @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', or 'name' (default to id) @return [GetSavedSearchResponse]
# 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 Update saved search for the given search identifier @param identifier Identifier of the saved search which could be 'id' or 'name' @param body Request payload of updating saved search @param [Hash] opts the optional parameters @option opts [String] :identifier_type Type of the identifier that is provided as an in-line parameter. Possible values are 'id', or 'name' @return [Array<(GetSavedSearchResponse
, Fixnum, Hash)>] GetSavedSearchResponse
data, response status code and response headers
# 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