Class: Falcon::HostsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ HostsApi

Returns a new instance of HostsApi.



36
37
38
# File 'lib/crimson-falcon/api/hosts_api.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/hosts_api.rb', line 34

def api_client
  @api_client
end

Instance Method Details

#entities_perform_action(ids, action_name, body, opts = {}) ⇒ DeviceapiGroupsResponseV1

Performs the specified action on the provided group IDs.

Parameters:

  • ids (Array<String>)

    The group ids to act on

  • action_name (String)

    The action to perform.

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

    the optional parameters

Options Hash (opts):

  • :disable_hostname_check (Boolean)

    Bool to disable hostname check on add-member (default to false)

Returns:



46
47
48
49
# File 'lib/crimson-falcon/api/hosts_api.rb', line 46

def entities_perform_action(ids, action_name, body, opts = {})
  data, _status_code, _headers = entities_perform_action_with_http_info(ids, action_name, body, opts)
  data
end

#entities_perform_action_with_http_info(ids, action_name, body, opts = {}) ⇒ Array<(DeviceapiGroupsResponseV1, Integer, Hash)>

Performs the specified action on the provided group IDs.

Parameters:

  • ids (Array<String>)

    The group ids to act on

  • action_name (String)

    The action to perform.

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

    the optional parameters

Options Hash (opts):

  • :disable_hostname_check (Boolean)

    Bool to disable hostname check on add-member (default to false)

Returns:

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

    DeviceapiGroupsResponseV1 data, response status code and response headers



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
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
# File 'lib/crimson-falcon/api/hosts_api.rb', line 58

def entities_perform_action_with_http_info(ids, action_name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.entities_perform_action ...'
  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 HostsApi.entities_perform_action"
  end
  # verify the required parameter 'action_name' is set
  if @api_client.config.client_side_validation && action_name.nil?
    fail ArgumentError, "Missing the required parameter 'action_name' when calling HostsApi.entities_perform_action"
  end
  # verify enum value
  allowable_values = ["add_group_member", "remove_all", "remove_group_member"]
  if @api_client.config.client_side_validation && !allowable_values.include?(action_name)
    fail ArgumentError, "invalid value for \"action_name\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.entities_perform_action"
  end
  # resource path
  local_var_path = '/devices/entities/group-actions/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = @api_client.build_collection_param(ids, :multi)
  query_params[:'action_name'] = action_name
  query_params[:'disable_hostname_check'] = opts[:'disable_hostname_check'] if !opts[:'disable_hostname_check'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.entities_perform_action",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#entities_perform_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_device_details_v2(ids, opts = {}) ⇒ DeviceapiDeviceDetailsResponseSwagger

Get details on one or more hosts by providing host IDs as a query parameter. Supports up to a maximum 100 IDs.

Parameters:

  • ids (Array<String>)

    The host agentIDs used to get details on

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

    the optional parameters

Returns:



131
132
133
134
# File 'lib/crimson-falcon/api/hosts_api.rb', line 131

def get_device_details_v2(ids, opts = {})
  data, _status_code, _headers = get_device_details_v2_with_http_info(ids, opts)
  data
end

#get_device_details_v2_with_http_info(ids, opts = {}) ⇒ Array<(DeviceapiDeviceDetailsResponseSwagger, Integer, Hash)>

Get details on one or more hosts by providing host IDs as a query parameter. Supports up to a maximum 100 IDs.

Parameters:

  • ids (Array<String>)

    The host agentIDs used to get details on

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

    the optional parameters

Returns:



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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/crimson-falcon/api/hosts_api.rb', line 140

def get_device_details_v2_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.get_device_details_v2 ...'
  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 HostsApi.get_device_details_v2"
  end
  if @api_client.config.client_side_validation && ids.length > 100
    fail ArgumentError, 'invalid value for "ids" when calling HostsApi.get_device_details_v2, number of items must be less than or equal to 100.'
  end

  # resource path
  local_var_path = '/devices/entities/devices/v2'

  # 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] || 'DeviceapiDeviceDetailsResponseSwagger'

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

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

#get_online_state_v1(ids, opts = {}) ⇒ StateOnlineStateRespV1

Get the online status for one or more hosts by specifying each host’s unique ID. Successful requests return an HTTP 200 response and the status for each host identified by a ‘state` of `online`, `offline`, or `unknown` for each host, identified by host `id`. Make a `GET` request to `/devices/queries/devices/v1` to get a list of host IDs.

Parameters:

  • ids (Array<String>)

    The unique ID of the host to get the online status of.

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

    the optional parameters

Returns:



197
198
199
200
# File 'lib/crimson-falcon/api/hosts_api.rb', line 197

def get_online_state_v1(ids, opts = {})
  data, _status_code, _headers = get_online_state_v1_with_http_info(ids, opts)
  data
end

#get_online_state_v1_with_http_info(ids, opts = {}) ⇒ Array<(StateOnlineStateRespV1, Integer, Hash)>

Get the online status for one or more hosts by specifying each host’s unique ID. Successful requests return an HTTP 200 response and the status for each host identified by a &#x60;state&#x60; of &#x60;online&#x60;, &#x60;offline&#x60;, or &#x60;unknown&#x60; for each host, identified by host &#x60;id&#x60;. Make a &#x60;GET&#x60; request to &#x60;/devices/queries/devices/v1&#x60; to get a list of host IDs.

Parameters:

  • ids (Array<String>)

    The unique ID of the host to get the online status of.

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

    the optional parameters

Returns:

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

    StateOnlineStateRespV1 data, response status code and response headers



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/crimson-falcon/api/hosts_api.rb', line 206

def get_online_state_v1_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.get_online_state_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 HostsApi.get_online_state_v1"
  end
  # resource path
  local_var_path = '/devices/entities/online-state/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] || 'StateOnlineStateRespV1'

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

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

#perform_action_v2(action_name, body, opts = {}) ⇒ MsaReplyAffectedEntities

Take various actions on the hosts in your environment. Contain or lift containment on a host. Delete or restore a host.

Parameters:

  • action_name (String)

    Specify one of these actions: - &#x60;contain&#x60; - This action contains the host, which stops any network communications to locations other than the CrowdStrike cloud and IPs specified in your [containment policy](falcon.crowdstrike.com/support/documentation/11/getting-started-guide#containmentpolicy) - &#x60;lift_containment&#x60;: This action lifts containment on the host, which returns its network communications to normal - &#x60;hide_host&#x60;: This action will delete a host. After the host is deleted, no new detections for that host will be reported via UI or APIs - &#x60;unhide_host&#x60;: This action will restore a host. Detection reporting will resume after the host is restored

  • body (MsaEntityActionRequestV2)

    The host agent ID (AID) of the host you want to contain. Get an agent ID from a detection, the Falcon console, or the Streaming API. Provide the ID in JSON format with the key &#x60;ids&#x60; and the value in square brackets, such as: &#x60;&quot;ids&quot;: [&quot;123456789&quot;]&#x60;

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

    the optional parameters

Returns:



260
261
262
263
# File 'lib/crimson-falcon/api/hosts_api.rb', line 260

def perform_action_v2(action_name, body, opts = {})
  data, _status_code, _headers = perform_action_v2_with_http_info(action_name, body, opts)
  data
end

#perform_action_v2_with_http_info(action_name, body, opts = {}) ⇒ Array<(MsaReplyAffectedEntities, Integer, Hash)>

Take various actions on the hosts in your environment. Contain or lift containment on a host. Delete or restore a host.

Parameters:

  • action_name (String)

    Specify one of these actions: - &#x60;contain&#x60; - This action contains the host, which stops any network communications to locations other than the CrowdStrike cloud and IPs specified in your [containment policy](falcon.crowdstrike.com/support/documentation/11/getting-started-guide#containmentpolicy) - &#x60;lift_containment&#x60;: This action lifts containment on the host, which returns its network communications to normal - &#x60;hide_host&#x60;: This action will delete a host. After the host is deleted, no new detections for that host will be reported via UI or APIs - &#x60;unhide_host&#x60;: This action will restore a host. Detection reporting will resume after the host is restored

  • body (MsaEntityActionRequestV2)

    The host agent ID (AID) of the host you want to contain. Get an agent ID from a detection, the Falcon console, or the Streaming API. Provide the ID in JSON format with the key &#x60;ids&#x60; and the value in square brackets, such as: &#x60;&quot;ids&quot;: [&quot;123456789&quot;]&#x60;

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

    the optional parameters

Returns:

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

    MsaReplyAffectedEntities data, response status code and response headers



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/crimson-falcon/api/hosts_api.rb', line 270

def perform_action_v2_with_http_info(action_name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.perform_action_v2 ...'
  end
  # verify the required parameter 'action_name' is set
  if @api_client.config.client_side_validation && action_name.nil?
    fail ArgumentError, "Missing the required parameter 'action_name' when calling HostsApi.perform_action_v2"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.perform_action_v2"
  end
  # resource path
  local_var_path = '/devices/entities/devices-actions/v2'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'action_name'] = action_name

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.perform_action_v2",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#perform_action_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_device_details_v2(body, opts = {}) ⇒ DeviceapiDeviceDetailsResponseSwagger

Get details on one or more hosts by providing host IDs in a POST body. Supports up to a maximum 5000 IDs.

Parameters:

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

    the optional parameters

Returns:



332
333
334
335
# File 'lib/crimson-falcon/api/hosts_api.rb', line 332

def post_device_details_v2(body, opts = {})
  data, _status_code, _headers = post_device_details_v2_with_http_info(body, opts)
  data
end

#post_device_details_v2_with_http_info(body, opts = {}) ⇒ Array<(DeviceapiDeviceDetailsResponseSwagger, Integer, Hash)>

Get details on one or more hosts by providing host IDs in a POST body. Supports up to a maximum 5000 IDs.

Parameters:

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

    the optional parameters

Returns:



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'lib/crimson-falcon/api/hosts_api.rb', line 341

def post_device_details_v2_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.post_device_details_v2 ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.post_device_details_v2"
  end
  # resource path
  local_var_path = '/devices/entities/devices/v2'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.post_device_details_v2",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#post_device_details_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_device_login_history(body, opts = {}) ⇒ DeviceapiLoginHistoryResponseV1

Retrieve details about recent login sessions for a set of devices.

Parameters:

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

    the optional parameters

Returns:



398
399
400
401
# File 'lib/crimson-falcon/api/hosts_api.rb', line 398

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

#query_device_login_history_v2(body, opts = {}) ⇒ DeviceapiLoginHistoryResponseV1

Retrieve details about recent interactive login sessions for a set of devices powered by the Host Timeline. A max of 10 device ids can be specified

Parameters:

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

    the optional parameters

Returns:



464
465
466
467
# File 'lib/crimson-falcon/api/hosts_api.rb', line 464

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

#query_device_login_history_v2_with_http_info(body, opts = {}) ⇒ Array<(DeviceapiLoginHistoryResponseV1, Integer, Hash)>

Retrieve details about recent interactive login sessions for a set of devices powered by the Host Timeline. A max of 10 device ids can be specified

Parameters:

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

    the optional parameters

Returns:



473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/crimson-falcon/api/hosts_api.rb', line 473

def (body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.query_device_login_history_v2 ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.query_device_login_history_v2"
  end
  # resource path
  local_var_path = '/devices/combined/devices/login-history/v2'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.query_device_login_history_v2",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#query_device_login_history_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_device_login_history_with_http_info(body, opts = {}) ⇒ Array<(DeviceapiLoginHistoryResponseV1, Integer, Hash)>

Retrieve details about recent login sessions for a set of devices.

Parameters:

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

    the optional parameters

Returns:



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/crimson-falcon/api/hosts_api.rb', line 407

def (body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.query_device_login_history ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.query_device_login_history"
  end
  # resource path
  local_var_path = '/devices/combined/devices/login-history/v1'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.query_device_login_history",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#query_device_login_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_devices_by_filter(opts = {}) ⇒ MsaQueryResponse

Search for hosts in your environment by platform, hostname, IP, and other criteria.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by (e.g. status.desc or hostname.asc)

  • :filter (String)

    The filter expression that should be used to limit the results

Returns:



533
534
535
536
# File 'lib/crimson-falcon/api/hosts_api.rb', line 533

def query_devices_by_filter(opts = {})
  data, _status_code, _headers = query_devices_by_filter_with_http_info(opts)
  data
end

#query_devices_by_filter_scroll(opts = {}) ⇒ DeviceapiDeviceResponse

Search for hosts in your environment by platform, hostname, IP, and other criteria with continuous pagination capability (based on offset pointer which expires after 2 minutes with no maximum limit)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (String)

    The offset to page from, for the next result set

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by (e.g. status.desc or hostname.asc)

  • :filter (String)

    The filter expression that should be used to limit the results

Returns:



600
601
602
603
# File 'lib/crimson-falcon/api/hosts_api.rb', line 600

def query_devices_by_filter_scroll(opts = {})
  data, _status_code, _headers = query_devices_by_filter_scroll_with_http_info(opts)
  data
end

#query_devices_by_filter_scroll_with_http_info(opts = {}) ⇒ Array<(DeviceapiDeviceResponse, Integer, Hash)>

Search for hosts in your environment by platform, hostname, IP, and other criteria with continuous pagination capability (based on offset pointer which expires after 2 minutes with no maximum limit)

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (String)

    The offset to page from, for the next result set

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by (e.g. status.desc or hostname.asc)

  • :filter (String)

    The filter expression that should be used to limit the results

Returns:

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

    DeviceapiDeviceResponse data, response status code and response headers



612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
# File 'lib/crimson-falcon/api/hosts_api.rb', line 612

def query_devices_by_filter_scroll_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.query_devices_by_filter_scroll ...'
  end
  # resource path
  local_var_path = '/devices/queries/devices-scroll/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'DeviceapiDeviceResponse'

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

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

#query_devices_by_filter_with_http_info(opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Search for hosts in your environment by platform, hostname, IP, and other criteria.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by (e.g. status.desc or hostname.asc)

  • :filter (String)

    The filter expression that should be used to limit the results

Returns:

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

    MsaQueryResponse data, response status code and response headers



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/crimson-falcon/api/hosts_api.rb', line 545

def query_devices_by_filter_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.query_devices_by_filter ...'
  end
  # resource path
  local_var_path = '/devices/queries/devices/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'MsaQueryResponse'

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

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

#query_get_network_address_history_v1(body, opts = {}) ⇒ DeviceapiNetworkAddressHistoryResponseV1

Retrieve history of IP and MAC addresses of devices.

Parameters:

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

    the optional parameters

Returns:



664
665
666
667
# File 'lib/crimson-falcon/api/hosts_api.rb', line 664

def query_get_network_address_history_v1(body, opts = {})
  data, _status_code, _headers = query_get_network_address_history_v1_with_http_info(body, opts)
  data
end

#query_get_network_address_history_v1_with_http_info(body, opts = {}) ⇒ Array<(DeviceapiNetworkAddressHistoryResponseV1, Integer, Hash)>

Retrieve history of IP and MAC addresses of devices.

Parameters:

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

    the optional parameters

Returns:



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
# File 'lib/crimson-falcon/api/hosts_api.rb', line 673

def query_get_network_address_history_v1_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.query_get_network_address_history_v1 ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.query_get_network_address_history_v1"
  end
  # resource path
  local_var_path = '/devices/combined/devices/network-address-history/v1'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.query_get_network_address_history_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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#query_get_network_address_history_v1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_hidden_devices(opts = {}) ⇒ MsaQueryResponse

Retrieve hidden hosts that match the provided filter criteria.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by (e.g. status.desc or hostname.asc)

  • :filter (String)

    The filter expression that should be used to limit the results

Returns:



733
734
735
736
# File 'lib/crimson-falcon/api/hosts_api.rb', line 733

def query_hidden_devices(opts = {})
  data, _status_code, _headers = query_hidden_devices_with_http_info(opts)
  data
end

#query_hidden_devices_with_http_info(opts = {}) ⇒ Array<(MsaQueryResponse, Integer, Hash)>

Retrieve hidden hosts that match the provided filter criteria.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :offset (Integer)

    The offset to start retrieving records from

  • :limit (Integer)

    The maximum records to return. [1-5000]

  • :sort (String)

    The property to sort by (e.g. status.desc or hostname.asc)

  • :filter (String)

    The filter expression that should be used to limit the results

Returns:

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

    MsaQueryResponse data, response status code and response headers



745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
# File 'lib/crimson-falcon/api/hosts_api.rb', line 745

def query_hidden_devices_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.query_hidden_devices ...'
  end
  # resource path
  local_var_path = '/devices/queries/devices-hidden/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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] || 'MsaQueryResponse'

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

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

#update_device_tags(body, opts = {}) ⇒ DeviceapiUpdateDeviceTagsSwaggerV1

Append or remove one or more Falcon Grouping Tags on one or more hosts. Tags must be of the form FalconGroupingTags/

Parameters:

Returns:



797
798
799
800
# File 'lib/crimson-falcon/api/hosts_api.rb', line 797

def update_device_tags(body, opts = {})
  data, _status_code, _headers = update_device_tags_with_http_info(body, opts)
  data
end

#update_device_tags_with_http_info(body, opts = {}) ⇒ Array<(DeviceapiUpdateDeviceTagsSwaggerV1, Integer, Hash)>

Append or remove one or more Falcon Grouping Tags on one or more hosts. Tags must be of the form FalconGroupingTags/

Parameters:

Returns:



806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# File 'lib/crimson-falcon/api/hosts_api.rb', line 806

def update_device_tags_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: HostsApi.update_device_tags ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling HostsApi.update_device_tags"
  end
  # resource path
  local_var_path = '/devices/entities/devices/tags/v1'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

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

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

  new_options = opts.merge(
    :operation => :"HostsApi.update_device_tags",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: HostsApi#update_device_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end