Class: LaunchDarklyApi::AuditLogApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/audit_log_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AuditLogApi



19
20
21
# File 'lib/launchdarkly_api/api/audit_log_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/launchdarkly_api/api/audit_log_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_audit_log_entries(opts = {}) ⇒ AuditLogEntries

Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.

Options Hash (opts):

  • :before (Integer)

    A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have before this timestamp.

  • :after (Integer)

    A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have occurred after this timestamp.

  • :q (String)

    Text to search for. You can search for the full or partial name of the resource involved or full or partial email address of the member who made the change.

  • :limit (Float)

    A limit on the number of audit log entries to be returned, between 1 and 20.

  • :spec (String)

    A resource specifier, allowing you to filter audit log listings by resource.



30
31
32
33
# File 'lib/launchdarkly_api/api/audit_log_api.rb', line 30

def get_audit_log_entries(opts = {})
  data, _status_code, _headers = get_audit_log_entries_with_http_info(opts)
  data
end

#get_audit_log_entries_with_http_info(opts = {}) ⇒ Array<(AuditLogEntries, Fixnum, Hash)>

Get a list of all audit log entries. The query parameters allow you to restrict the returned results by date ranges, resource specifiers, or a full-text search query.

Options Hash (opts):

  • :before (Integer)

    A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have before this timestamp.

  • :after (Integer)

    A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned will have occurred after this timestamp.

  • :q (String)

    Text to search for. You can search for the full or partial name of the resource involved or full or partial email address of the member who made the change.

  • :limit (Float)

    A limit on the number of audit log entries to be returned, between 1 and 20.

  • :spec (String)

    A resource specifier, allowing you to filter audit log listings by resource.



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
# File 'lib/launchdarkly_api/api/audit_log_api.rb', line 43

def get_audit_log_entries_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuditLogApi.get_audit_log_entries ...'
  end
  # resource path
  local_var_path = '/auditlog'

  # query parameters
  query_params = {}
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'spec'] = opts[:'spec'] if !opts[:'spec'].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(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  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 => 'AuditLogEntries')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuditLogApi#get_audit_log_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_audit_log_entry(resource_id, opts = {}) ⇒ AuditLogEntry

Use this endpoint to fetch a single audit log entry by its resouce ID.



87
88
89
90
# File 'lib/launchdarkly_api/api/audit_log_api.rb', line 87

def get_audit_log_entry(resource_id, opts = {})
  data, _status_code, _headers = get_audit_log_entry_with_http_info(resource_id, opts)
  data
end

#get_audit_log_entry_with_http_info(resource_id, opts = {}) ⇒ Array<(AuditLogEntry, Fixnum, Hash)>

Use this endpoint to fetch a single audit log entry by its resouce ID.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/launchdarkly_api/api/audit_log_api.rb', line 96

def get_audit_log_entry_with_http_info(resource_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AuditLogApi.get_audit_log_entry ...'
  end
  # verify the required parameter 'resource_id' is set
  if @api_client.config.client_side_validation && resource_id.nil?
    fail ArgumentError, "Missing the required parameter 'resource_id' when calling AuditLogApi.get_audit_log_entry"
  end
  # resource path
  local_var_path = '/auditlog/{resourceId}'.sub('{' + 'resourceId' + '}', resource_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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Token']
  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 => 'AuditLogEntry')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AuditLogApi#get_audit_log_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end