Class: Tenable::Models::Export
- Inherits:
-
Data
- Object
- Data
- Tenable::Models::Export
- Defined in:
- lib/tenable/models/export.rb
Overview
Represents the status of a vulnerability export job.
Instance Attribute Summary collapse
-
#chunks_available ⇒ Object
readonly
Returns the value of attribute chunks_available.
-
#chunks_cancelled ⇒ Object
readonly
Returns the value of attribute chunks_cancelled.
-
#chunks_failed ⇒ Object
readonly
Returns the value of attribute chunks_failed.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Class Method Summary collapse
-
.from_api(data) ⇒ Export
Builds an Export from a raw API response hash.
Instance Method Summary collapse
-
#error? ⇒ Boolean
True if the export encountered an error.
-
#finished? ⇒ Boolean
True if the export has completed successfully.
-
#processing? ⇒ Boolean
True if the export is still processing.
-
#queued? ⇒ Boolean
True if the export is queued.
Instance Attribute Details
#chunks_available ⇒ Object (readonly)
Returns the value of attribute chunks_available
6 7 8 |
# File 'lib/tenable/models/export.rb', line 6 def chunks_available @chunks_available end |
#chunks_cancelled ⇒ Object (readonly)
Returns the value of attribute chunks_cancelled
6 7 8 |
# File 'lib/tenable/models/export.rb', line 6 def chunks_cancelled @chunks_cancelled end |
#chunks_failed ⇒ Object (readonly)
Returns the value of attribute chunks_failed
6 7 8 |
# File 'lib/tenable/models/export.rb', line 6 def chunks_failed @chunks_failed end |
#status ⇒ Object (readonly)
Returns the value of attribute status
6 7 8 |
# File 'lib/tenable/models/export.rb', line 6 def status @status end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid
6 7 8 |
# File 'lib/tenable/models/export.rb', line 6 def uuid @uuid end |
Class Method Details
.from_api(data) ⇒ Export
Builds an Export from a raw API response hash.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tenable/models/export.rb', line 11 def self.from_api(data) data = data.transform_keys(&:to_sym) new( uuid: data[:uuid], status: data[:status], chunks_available: data[:chunks_available] || [], chunks_failed: data[:chunks_failed] || [], chunks_cancelled: data[:chunks_cancelled] || [] ) end |
Instance Method Details
#error? ⇒ Boolean
Returns true if the export encountered an error.
33 34 35 |
# File 'lib/tenable/models/export.rb', line 33 def error? status == 'ERROR' end |
#finished? ⇒ Boolean
Returns true if the export has completed successfully.
23 24 25 |
# File 'lib/tenable/models/export.rb', line 23 def finished? status == 'FINISHED' end |
#processing? ⇒ Boolean
Returns true if the export is still processing.
28 29 30 |
# File 'lib/tenable/models/export.rb', line 28 def processing? status == 'PROCESSING' end |
#queued? ⇒ Boolean
Returns true if the export is queued.
38 39 40 |
# File 'lib/tenable/models/export.rb', line 38 def queued? status == 'QUEUED' end |