class IbmCloudPower::PCloudEventsApi
Attributes
Public Class Methods
# File lib/ibm_cloud_power/api/p_cloud_events_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Get a single event @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param event_id [String] Event
ID @param [Hash] opts the optional parameters @option opts [String] :accept_language The language requested for the return document @return [Event]
# File lib/ibm_cloud_power/api/p_cloud_events_api.rb, line 28 def pcloud_events_get(cloud_instance_id, event_id, opts = {}) data, _status_code, _headers = pcloud_events_get_with_http_info(cloud_instance_id, event_id, opts) data end
Get a single event @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param event_id [String] Event
ID @param [Hash] opts the optional parameters @option opts [String] :accept_language The language requested for the return document @return [Array<(Event
, Integer, Hash)>] Event
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_events_api.rb, line 39 def pcloud_events_get_with_http_info(cloud_instance_id, event_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudEventsApi.pcloud_events_get ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudEventsApi.pcloud_events_get" end # verify the required parameter 'event_id' is set if @api_client.config.client_side_validation && event_id.nil? fail ArgumentError, "Missing the required parameter 'event_id' when calling PCloudEventsApi.pcloud_events_get" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'event_id' + '}', CGI.escape(event_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Event' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PCloudEventsApi#pcloud_events_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get events from this cloud instance since a specific timestamp You must append the '?time=' query parameter to the cURL URL to get a list of events. @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param time [String] (deprecated - use from_time) A time in either ISO 8601 or unix epoch format @param [Hash] opts the optional parameters @option opts [String] :accept_language The language requested for the return document @return [Events]
# File lib/ibm_cloud_power/api/p_cloud_events_api.rb, line 98 def pcloud_events_getsince(cloud_instance_id, time, opts = {}) data, _status_code, _headers = pcloud_events_getsince_with_http_info(cloud_instance_id, time, opts) data end
Get events from this cloud instance since a specific timestamp You must append the '?time=' query parameter to the cURL URL to get a list of events. @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param time [String] (deprecated - use from_time) A time in either ISO 8601 or unix epoch format @param [Hash] opts the optional parameters @option opts [String] :accept_language The language requested for the return document @return [Array<(Events
, Integer, Hash)>] Events
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_events_api.rb, line 110 def pcloud_events_getsince_with_http_info(cloud_instance_id, time, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudEventsApi.pcloud_events_getsince ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudEventsApi.pcloud_events_getsince" end # verify the required parameter 'time' is set if @api_client.config.client_side_validation && time.nil? fail ArgumentError, "Missing the required parameter 'time' when calling PCloudEventsApi.pcloud_events_getsince" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/events'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'time'] = time # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Events' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PCloudEventsApi#pcloud_events_getsince\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end