Class: Falcon::ContainerPackages

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ContainerPackages

Returns a new instance of ContainerPackages.



35
36
37
# File 'lib/crimson-falcon/api/container_packages.rb', line 35

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



33
34
35
# File 'lib/crimson-falcon/api/container_packages.rb', line 33

def api_client
  @api_client
end

Instance Method Details

#read_packages_by_fixable_vuln_count(opts = {}) ⇒ PackagesApiPackagesByVulnCount

Retrieve top x app packages with the most fixable vulnerabilities

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - `ai_related` - `cid` - `container_id` - `cveid` - `fix_status` - `image_digest` - `license` - `package_name_version` - `severity` - `type` - `vulnerability_count`

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset = 10000 - limit.

Returns:



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

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

#read_packages_by_fixable_vuln_count_with_http_info(opts = {}) ⇒ Array<(PackagesApiPackagesByVulnCount, Integer, Hash)>

Retrieve top x app packages with the most fixable vulnerabilities

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



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

def read_packages_by_fixable_vuln_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackages.read_packages_by_fixable_vuln_count ...'
  end
  # resource path
  local_var_path = '/container-security/combined/packages/app-by-fixable-vulnerability-count/v1'

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

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

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

#read_packages_by_image_count(opts = {}) ⇒ PackagesApiPackagesByImageCount

Retrieves the N most frequently used packages across images

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cveid&#x60; - &#x60;running_images&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    Maximum number of package results to return (default to 5)

Returns:



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

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

#read_packages_by_image_count_with_http_info(opts = {}) ⇒ Array<(PackagesApiPackagesByImageCount, Integer, Hash)>

Retrieves the N most frequently used packages across images

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cveid&#x60; - &#x60;running_images&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    Maximum number of package results to return (default to 5)

Returns:



117
118
119
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
# File 'lib/crimson-falcon/api/container_packages.rb', line 117

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

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

  # resource path
  local_var_path = '/container-security/aggregates/packages/by-image-count/v1'

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

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

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

#read_packages_by_vuln_count(opts = {}) ⇒ PackagesApiPackagesByVulnCount

Retrieve top x packages with the most vulnerabilities

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



177
178
179
180
# File 'lib/crimson-falcon/api/container_packages.rb', line 177

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

#read_packages_by_vuln_count_with_http_info(opts = {}) ⇒ Array<(PackagesApiPackagesByVulnCount, Integer, Hash)>

Retrieve top x packages with the most vulnerabilities

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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
# File 'lib/crimson-falcon/api/container_packages.rb', line 188

def read_packages_by_vuln_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackages.read_packages_by_vuln_count ...'
  end
  # resource path
  local_var_path = '/container-security/combined/packages/by-vulnerability-count/v1'

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

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

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

#read_packages_combined(opts = {}) ⇒ PackagesApiCombinedPackage

Retrieve packages identified by the provided filter criteria

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :only_zero_day_affected (Boolean) — default: true/false

    load zero day affected packages (default to false)

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



243
244
245
246
# File 'lib/crimson-falcon/api/container_packages.rb', line 243

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

#read_packages_combined_export(opts = {}) ⇒ PackagesApiCombinedPackageExport

Retrieves a paginated list of packages identified by the provided filter criteria,used for export.Maximum page size: 100. Maximum available packages: 10,000

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :only_zero_day_affected (Boolean) — default: true/false

    load zero day affected packages (default to false)

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



313
314
315
316
# File 'lib/crimson-falcon/api/container_packages.rb', line 313

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

#read_packages_combined_export_with_http_info(opts = {}) ⇒ Array<(PackagesApiCombinedPackageExport, Integer, Hash)>

Retrieves a paginated list of packages identified by the provided filter criteria,used for export.Maximum page size: 100. Maximum available packages: 10,000

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :only_zero_day_affected (Boolean) — default: true/false

    load zero day affected packages (default to false)

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
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
# File 'lib/crimson-falcon/api/container_packages.rb', line 326

def read_packages_combined_export_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackages.read_packages_combined_export ...'
  end
  # resource path
  local_var_path = '/container-security/combined/packages/export/v1'

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

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

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

#read_packages_combined_v2(opts = {}) ⇒ PackagesApiCombinedPackageV2

Retrieve packages identified by the provided filter criteria

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :only_zero_day_affected (Boolean) — default: true/false

    load zero day affected packages (default to false)

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



383
384
385
386
# File 'lib/crimson-falcon/api/container_packages.rb', line 383

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

#read_packages_combined_v2_with_http_info(opts = {}) ⇒ Array<(PackagesApiCombinedPackageV2, Integer, Hash)>

Retrieve packages identified by the provided filter criteria

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :only_zero_day_affected (Boolean) — default: true/false

    load zero day affected packages (default to false)

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:



396
397
398
399
400
401
402
403
404
405
406
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
# File 'lib/crimson-falcon/api/container_packages.rb', line 396

def read_packages_combined_v2_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackages.read_packages_combined_v2 ...'
  end
  # resource path
  local_var_path = '/container-security/combined/packages/v2'

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

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

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

#read_packages_combined_with_http_info(opts = {}) ⇒ Array<(PackagesApiCombinedPackage, Integer, Hash)>

Retrieve packages identified by the provided filter criteria

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;ai_related&#x60; - &#x60;cid&#x60; - &#x60;container_id&#x60; - &#x60;cveid&#x60; - &#x60;fix_status&#x60; - &#x60;image_digest&#x60; - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;severity&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :only_zero_day_affected (Boolean) — default: true/false

    load zero day affected packages (default to false)

  • :sort (String)

    The fields to sort the records on. Supported columns: - &#x60;license&#x60; - &#x60;package_name_version&#x60; - &#x60;type&#x60; - &#x60;vulnerability_count&#x60;

  • :limit (Integer)

    The upper-bound on the number of records to retrieve. Maximum limit: 100. (default to 100)

  • :offset (Integer)

    The offset from where to begin. Maximum offset &#x3D; 10000 - limit.

Returns:

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

    PackagesApiCombinedPackage data, response status code and response headers



256
257
258
259
260
261
262
263
264
265
266
267
268
269
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
# File 'lib/crimson-falcon/api/container_packages.rb', line 256

def read_packages_combined_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackages.read_packages_combined ...'
  end
  # resource path
  local_var_path = '/container-security/combined/packages/v1'

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

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

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

#read_packages_count_by_zero_day(opts = {}) ⇒ CommonCountResponse

Retrieve packages count affected by zero day vulnerabilities

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60;

Returns:



449
450
451
452
# File 'lib/crimson-falcon/api/container_packages.rb', line 449

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

#read_packages_count_by_zero_day_with_http_info(opts = {}) ⇒ Array<(CommonCountResponse, Integer, Hash)>

Retrieve packages count affected by zero day vulnerabilities

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filter fields: - &#x60;cid&#x60;

Returns:

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

    CommonCountResponse data, response status code and response headers



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
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
# File 'lib/crimson-falcon/api/container_packages.rb', line 458

def read_packages_count_by_zero_day_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackages.read_packages_count_by_zero_day ...'
  end
  # resource path
  local_var_path = '/container-security/aggregates/packages/count-by-zero-day/v1'

  # query parameters
  query_params = opts[:query_params] || {}
  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] || 'CommonCountResponse'

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

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