Class: Apcera::LogsApi
- Inherits:
-
Object
- Object
- Apcera::LogsApi
- Defined in:
- lib/apcera/api/logs_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#audit_get(opts = {}) ⇒ Array<AuditLogItem>
Returns audit log items for the cluster.
-
#audit_logs_get(opts = {}) ⇒ Array<AuditLogItemOld>
Returns audit log items for the cluster.
-
#initialize(api_client = nil) ⇒ LogsApi
constructor
A new instance of LogsApi.
-
#logs_channel_get(channel, opts = {}) ⇒ nil
Streams logs for the specified channel.
Constructor Details
#initialize(api_client = nil) ⇒ LogsApi
Returns a new instance of LogsApi.
7 8 9 |
# File 'lib/apcera/api/logs_api.rb', line 7 def initialize(api_client = nil) @api_client = api_client || Configuration.api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/apcera/api/logs_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#audit_get(opts = {}) ⇒ Array<AuditLogItem>
Returns audit log items for the cluster. Returns a list audit log items. You can optionally filter the list by start time, end time, FQN, or event type.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/apcera/api/logs_api.rb', line 20 def audit_get(opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: LogsApi#audit_get ..." end # resource path path = "/audit".sub('{format}','json') # query parameters query_params = {} query_params[:'start_time'] = opts[:'start_time'] if opts[:'start_time'] query_params[:'end_time'] = opts[:'end_time'] if opts[:'end_time'] query_params[:'fqn'] = opts[:'fqn'] if opts[:'fqn'] query_params[:'event_type'] = opts[:'event_type'] if opts[:'event_type'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['authorization'] result = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AuditLogItem>') if Configuration.debugging Configuration.logger.debug "API called: LogsApi#audit_get. Result: #{result.inspect}" end return result end |
#audit_logs_get(opts = {}) ⇒ Array<AuditLogItemOld>
Returns audit log items for the cluster. Returns a list of audit log items.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/apcera/api/logs_api.rb', line 75 def audit_logs_get(opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: LogsApi#audit_logs_get ..." end # resource path path = "/audit_logs".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['authorization'] result = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AuditLogItemOld>') if Configuration.debugging Configuration.logger.debug "API called: LogsApi#audit_logs_get. Result: #{result.inspect}" end return result end |
#logs_channel_get(channel, opts = {}) ⇒ nil
Streams logs for the specified channel.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/apcera/api/logs_api.rb', line 127 def logs_channel_get(channel, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: LogsApi#logs_channel_get ..." end # verify the required parameter 'channel' is set fail "Missing the required parameter 'channel' when calling logs_channel_get" if channel.nil? # resource path path = "/logs/{channel}".sub('{format}','json').sub('{' + 'channel' + '}', channel.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization'] # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['authorization'] @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if Configuration.debugging Configuration.logger.debug "API called: LogsApi#logs_channel_get" end return nil end |