Class: Apcera::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/apcera/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ DefaultApi

Returns a new instance of DefaultApi.



7
8
9
# File 'lib/apcera/api/default_api.rb', line 7

def initialize(api_client = nil)
  @api_client = api_client || Configuration.api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/apcera/api/default_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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_time (Float)

    UNIX timestamp. If specified, only events that occurred on or after the specified time are returned in the response.

  • :end_time (Float)

    UNIX timestamp. If specified, only events that occurred on or before the specified time are returned in the response.

  • :fqn (String)

    If specified, only events on the resource specified by ‘fqn` are returned in the response. You can also specify an FQN segment, which may include wildcards for the resource type. For example:n * `*::/` returns all audit logs for all resource types.n * `job::/` returns all audit logs for Job resource types. n * `job::/apcera` returns all audit logs for Job resource types in the `/apcera` namespace and its sub-namespaces. n * `*::/apcera` returns all audit logs for all resource types in the `/apcera` namespace its sub-namespaces.

  • :event_type (String)

    If specified, only events of the specified type are returned in the response.

  • :authorization (String)

Returns:



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/default_api.rb', line 20

def audit_get(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: DefaultApi#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: DefaultApi#audit_get. Result: #{result.inspect}"
  end
  return result
end

#tasks_uuid_delete(uuid, opts = {}) ⇒ nil

Deletes a task. Cancels the specified task.

Parameters:

  • uuid

    UUID of the task delete.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


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
120
121
122
# File 'lib/apcera/api/default_api.rb', line 76

def tasks_uuid_delete(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: DefaultApi#tasks_uuid_delete ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling tasks_uuid_delete" if uuid.nil?
  
  # resource path
  path = "/tasks/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.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(:DELETE, 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: DefaultApi#tasks_uuid_delete"
  end
  return nil
end