Class: Fastly::LoggingEndpointErrorsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/api/logging_endpoint_errors_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LoggingEndpointErrorsApi

Returns a new instance of LoggingEndpointErrorsApi.



17
18
19
# File 'lib/fastly/api/logging_endpoint_errors_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/fastly/api/logging_endpoint_errors_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#get_log_endpoint_errors(opts = {}) ⇒ String

Stream Log Endpoint Errors Provides a near real-time stream of log errors through a hybrid short-polling model. A client should make an initial request using the from parameter to specify a start time. The to parameter should be used alongside the from parameter since the default bucket is 10 seconds. For pagination, use the URLs provided in the Link header of the response. These contain updated from timestamps for retrieving the next or previous page of logs. Defaults to application/x-ndjson format. Use Accept: application/json header to request standard JSON array format instead.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String) — default: required
  • :from (Integer)
  • :to (Integer)
  • :filter_endpoint (String)

Returns:

  • (String)


27
28
29
30
# File 'lib/fastly/api/logging_endpoint_errors_api.rb', line 27

def get_log_endpoint_errors(opts = {})
  data, _status_code, _headers = get_log_endpoint_errors_with_http_info(opts)
  data
end

#get_log_endpoint_errors_with_http_info(opts = {}) ⇒ Array<(String, Integer, Hash)>

Stream Log Endpoint Errors Provides a near real-time stream of log errors through a hybrid short-polling model. A client should make an initial request using the `from` parameter to specify a start time. The `to` parameter should be used alongside the `from` parameter since the default bucket is 10 seconds. For pagination, use the URLs provided in the Link header of the response. These contain updated `from` timestamps for retrieving the next or previous page of logs. Defaults to `application/x-ndjson` format. Use `Accept: application/json` header to request standard JSON array format instead.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String) — default: required
  • :from (Integer)
  • :to (Integer)
  • :filter_endpoint (String)

Returns:

  • (Array<(String, Integer, Hash)>)

    String data, response status code and response headers



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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/fastly/api/logging_endpoint_errors_api.rb', line 39

def get_log_endpoint_errors_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LoggingEndpointErrorsApi.get_log_endpoint_errors ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LoggingEndpointErrorsApi.get_log_endpoint_errors"
  end
  # resource path
  local_var_path = '/observability/service/{service_id}/logging/errors'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  query_params[:'filter[endpoint]'] = opts[:'filter_endpoint'] if !opts[:'filter_endpoint'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/x-ndjson', 'application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'String'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LoggingEndpointErrorsApi.get_log_endpoint_errors",
    :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: LoggingEndpointErrorsApi#get_log_endpoint_errors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end