Class: Falcon::ContainerPackagesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ContainerPackagesApi

Returns a new instance of ContainerPackagesApi.



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

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 filters: 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.

  • :offset (Integer)

    The offset from where to begin.

Returns:



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

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 filters: 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.

  • :offset (Integer)

    The offset from where to begin.

Returns:



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

def read_packages_by_fixable_vuln_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackagesApi.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 => :"ContainerPackagesApi.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: ContainerPackagesApi#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_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 filters: 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.

  • :offset (Integer)

    The offset from where to begin.

Returns:



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

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 filters: 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.

  • :offset (Integer)

    The offset from where to begin.

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

def read_packages_by_vuln_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackagesApi.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 => :"ContainerPackagesApi.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: ContainerPackagesApi#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 filters: cid,container_id,cveid,fix_status,image_digest,license,package_name_version,severity,type,vulnerability_count

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

    load zero day affected packages, default is false

  • :limit (Integer)

    The upper-bound on the number of records to retrieve.

  • :offset (Integer)

    The offset from where to begin.

  • :sort (String)

    The fields to sort the records on. Supported columns: [license package_name_version type]

Returns:



175
176
177
178
# File 'lib/crimson-falcon/api/container_packages_api.rb', line 175

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

#read_packages_combined_export(opts = {}) ⇒ PackagesApiCombinedPackageExport

Retrieve packages identified by the provided filter criteria for the purpose of export

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filters: cid,container_id,cveid,fix_status,image_digest,license,package_name_version,severity,type,vulnerability_count

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

    load zero day affected packages, default is false

  • :limit (Integer)

    The upper-bound on the number of records to retrieve.

  • :offset (Integer)

    The offset from where to begin.

  • :sort (String)

    The fields to sort the records on. Supported columns: [license package_name_version type]

Returns:



245
246
247
248
# File 'lib/crimson-falcon/api/container_packages_api.rb', line 245

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)>

Retrieve packages identified by the provided filter criteria for the purpose of export

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :filter (String)

    Filter packages using a query in Falcon Query Language (FQL). Supported filters: cid,container_id,cveid,fix_status,image_digest,license,package_name_version,severity,type,vulnerability_count

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

    load zero day affected packages, default is false

  • :limit (Integer)

    The upper-bound on the number of records to retrieve.

  • :offset (Integer)

    The offset from where to begin.

  • :sort (String)

    The fields to sort the records on. Supported columns: [license package_name_version type]

Returns:



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
304
305
# File 'lib/crimson-falcon/api/container_packages_api.rb', line 258

def read_packages_combined_export_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackagesApi.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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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 => :"ContainerPackagesApi.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: ContainerPackagesApi#read_packages_combined_export\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 filters: cid,container_id,cveid,fix_status,image_digest,license,package_name_version,severity,type,vulnerability_count

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

    load zero day affected packages, default is false

  • :limit (Integer)

    The upper-bound on the number of records to retrieve.

  • :offset (Integer)

    The offset from where to begin.

  • :sort (String)

    The fields to sort the records on. Supported columns: [license package_name_version type]

Returns:

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

    PackagesApiCombinedPackage data, response status code and response headers



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
234
235
# File 'lib/crimson-falcon/api/container_packages_api.rb', line 188

def read_packages_combined_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackagesApi.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[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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 => :"ContainerPackagesApi.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: ContainerPackagesApi#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 filters: cid

Returns:



311
312
313
314
# File 'lib/crimson-falcon/api/container_packages_api.rb', line 311

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 filters: cid

Returns:

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

    CommonCountResponse data, response status code and response headers



320
321
322
323
324
325
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
# File 'lib/crimson-falcon/api/container_packages_api.rb', line 320

def read_packages_count_by_zero_day_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContainerPackagesApi.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 => :"ContainerPackagesApi.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: ContainerPackagesApi#read_packages_count_by_zero_day\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end