Module: Resource::Tokens

Included in:
NessusClient
Defined in:
lib/modules/tokens.rb

Overview

Namespace for tokens resource.

Instance Method Summary collapse

Instance Method Details

#token_download(export_uuid) ⇒ JSON

Check the download of a export request

Examples:

Download a ready export.

export = nc.export_download( '73376c41-1508-46b7-8587-483d159cd956')
open("scan_report", "wb") do |file|
  file.write( export )
end

Parameters:

  • export_uuid (String)

    The export uuid string.

Returns:

  • (JSON)

    (@see #format)



23
24
25
# File 'lib/modules/tokens.rb', line 23

def token_download(export_uuid)
  request.get({ path: "/tokens/#{export_uuid}/download", headers: headers })
end

#token_status(export_uuid) ⇒ JSON

Check the status of a export request

Examples:

Checking the status of a export.

export_status = nc.export_status( "73376c41-1508-46b7-8587-483d159cd956" )
return true if export_status["status"] == "ready"

Parameters:

  • export_uuid (String)

    The export uuid string.

Returns:

  • (JSON)


11
12
13
# File 'lib/modules/tokens.rb', line 11

def token_status(export_uuid)
  request.get({ path: "/tokens/#{export_uuid}/status", headers: headers })
end