Class: Tenable::Models::Export

Inherits:
Data
  • Object
show all
Defined in:
lib/tenable/models/export.rb

Overview

Represents the status of a vulnerability export job.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#chunks_availableObject (readonly)

Returns the value of attribute chunks_available

Returns:

  • the current value of chunks_available



6
7
8
# File 'lib/tenable/models/export.rb', line 6

def chunks_available
  @chunks_available
end

#chunks_cancelledObject (readonly)

Returns the value of attribute chunks_cancelled

Returns:

  • the current value of chunks_cancelled



6
7
8
# File 'lib/tenable/models/export.rb', line 6

def chunks_cancelled
  @chunks_cancelled
end

#chunks_failedObject (readonly)

Returns the value of attribute chunks_failed

Returns:

  • the current value of chunks_failed



6
7
8
# File 'lib/tenable/models/export.rb', line 6

def chunks_failed
  @chunks_failed
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • the current value of status



6
7
8
# File 'lib/tenable/models/export.rb', line 6

def status
  @status
end

#uuidObject (readonly)

Returns the value of attribute uuid

Returns:

  • the current value of 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.

Parameters:

  • raw API response hash with string keys

Returns:



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.

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.

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.

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.

Returns:

  • true if the export is queued



38
39
40
# File 'lib/tenable/models/export.rb', line 38

def queued?
  status == 'QUEUED'
end