Class: Falcon::DeviceContent

Inherits:
Object
  • Object
show all
Defined in:
lib/crimson-falcon/api/device_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DeviceContent

Returns a new instance of DeviceContent.



36
37
38
# File 'lib/crimson-falcon/api/device_content.rb', line 36

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



34
35
36
# File 'lib/crimson-falcon/api/device_content.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#entities_states_v1(ids, opts = {}) ⇒ DevicecontentapiEntitiesResponseV1

Retrieve the host content state for a number of ids between 1 and 100.

Parameters:

  • ids (Array<String>)

    The ids of the devices to fetch the content state of.

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

    the optional parameters

Returns:



43
44
45
46
# File 'lib/crimson-falcon/api/device_content.rb', line 43

def entities_states_v1(ids, opts = {})
  data, _status_code, _headers = entities_states_v1_with_http_info(ids, opts)
  data
end

#entities_states_v1_with_http_info(ids, opts = {}) ⇒ Array<(DevicecontentapiEntitiesResponseV1, Integer, Hash)>

Retrieve the host content state for a number of ids between 1 and 100.

Parameters:

  • ids (Array<String>)

    The ids of the devices to fetch the content state of.

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

    the optional parameters

Returns:



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
91
92
93
94
95
96
97
98
99
# File 'lib/crimson-falcon/api/device_content.rb', line 52

def entities_states_v1_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeviceContent.entities_states_v1 ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling DeviceContent.entities_states_v1"
  end
  # resource path
  local_var_path = '/device-content/entities/states/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['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] || 'DevicecontentapiEntitiesResponseV1'

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

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

#queries_states_v1(opts = {}) ⇒ DevicecontentapiQueryResponseV1

Query for the content state of the host.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The max number of resource ids to return. (default to 100)

  • :sort (String)

    What field to sort the results on. (default to ‘last_seen.desc’)

  • :offset (Integer)

    The offset token returned from the previous query. If none was returned, there are no more pages to the result set.

  • :filter (String)

    The FQL search filter

Returns:



108
109
110
111
# File 'lib/crimson-falcon/api/device_content.rb', line 108

def queries_states_v1(opts = {})
  data, _status_code, _headers = queries_states_v1_with_http_info(opts)
  data
end

#queries_states_v1_with_http_info(opts = {}) ⇒ Array<(DevicecontentapiQueryResponseV1, Integer, Hash)>

Query for the content state of the host.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The max number of resource ids to return. (default to 100)

  • :sort (String)

    What field to sort the results on. (default to ‘last_seen.desc’)

  • :offset (Integer)

    The offset token returned from the previous query. If none was returned, there are no more pages to the result set.

  • :filter (String)

    The FQL search filter

Returns:



120
121
122
123
124
125
126
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
174
# File 'lib/crimson-falcon/api/device_content.rb', line 120

def queries_states_v1_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeviceContent.queries_states_v1 ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DeviceContent.queries_states_v1, must be smaller than or equal to 10000.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DeviceContent.queries_states_v1, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/device-content/queries/states/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['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] || 'DevicecontentapiQueryResponseV1'

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

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