tenable-ruby 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tenable-ruby.rb +4 -27
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad9396c3090a68e4d42a7ccdf2200955ed4d4e41d795fc2c2ae147a0b29b0d75
4
- data.tar.gz: 9080fad783c03f4615be2d60df3631cbc563478d01563321ae5d9946dff01867
3
+ metadata.gz: a0ad4945418eed9203a963b29176367b98faa3edd12883d97cc49d8cdc893fba
4
+ data.tar.gz: 24c17741e683b65c0c3c2362d7414f099153a7222bad4af37b2f3cb54b99523c
5
5
  SHA512:
6
- metadata.gz: 20aed9477d92e9a88e84cf2243abb189b3aafd8378ce2c38342811078f04ca3902a47cddfb7d20ee287cb13d2046ebf7d1ee29e9912b136abbad27ab383b0eb3
7
- data.tar.gz: 385554e3f46578fc8dcf8e3f9de4e97afca808dd39032da1f651005dc63ca9dbc6c5605deb143b280fdaa0c780a478c88d97010fb29ad4f7900cbe1aad61e5ce
6
+ metadata.gz: 4f1a50612125ce469b30e90ec69bc88b307646a1765841564fd127a539dfd8e1c8004fd82ff9a6d6dec0832e298c756edaa4dc67abd85db54039df0d0ddb627e
7
+ data.tar.gz: 9cd6b2b9b3462a0750104aded927326facfe1efe097ac0520a3118baf3b836803c69145600bac9395145f10f5aa70f463170cb43f59d7afd2278fe7edea70bc8
@@ -566,34 +566,11 @@ module TenableRuby
566
566
  scan_create(template_uuid, settings)
567
567
  end
568
568
 
569
- # Returns scan status by performing a 'scan_details' API call
569
+ # Returns the latest status for a scan.
570
+ #
571
+ # Reference: https://developer.tenable.com/reference#scans-get-latest-status
570
572
  def scan_status(scan_id)
571
- details = scan_details(scan_id)
572
- if details.nil?
573
- raise TenableRuby::Error::TenableError, "Get scan_details returned nil"
574
- end
575
- if not details['error'].nil?
576
- raise TenableRuby::Error::TenableError, "Get scan_details returned the following error: #{details['error']}"
577
- end
578
- details['info']['status']
579
- end
580
-
581
- # Returns the status of the latest history object of a scan by performing a 'scan_details' API call.
582
- # Note this is currently updated more frequently than the scan status in the tenable.io API
583
- def scan_latest_history_status(scan_id)
584
- details = scan_details(scan_id)
585
- if details.nil?
586
- raise TenableRuby::Error::TenableError, "Get scan_details returned nil"
587
- end
588
- if not details['error'].nil?
589
- raise TenableRuby::Error::TenableError, "Get scan_details returned the following error: #{details['error']}"
590
- end
591
- history = details['history']
592
- if history.nil? or history.length == 0
593
- raise TenableRuby::Error::TenableError, "Get scan_details returned empty history object"
594
- else
595
- details['history'].last['status']
596
- end
573
+ http_get(:uri => "/scans/#{scan_id}/latest-status", :fields => header)['status']
597
574
  end
598
575
 
599
576
  # Parse the scan status command to determine if a scan has finished
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tenable-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Craston
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-07 00:00:00.000000000 Z
11
+ date: 2020-04-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  Ruby library for communicating with the tenable.io API.