Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Connection:update_engine #227

Merged
merged 3 commits into from
Oct 24, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/nexpose/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ def reverse_engine_connection(engine_id)
response.eql?("true")
end

# Kicks off an update on a single engine.
# A return result of true should be taken only to mean that the update
# was sent, not that it correctly applied.
#
# Nexpose::APIError will be raised if the engine is already updating,
# or if the engine is offline or unresponsive.
#
# @param [Fixnum] engine_id Unique ID of the engine.
# @return [Boolean] true if the update was sent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

# or if engine is already up to date.
#
def update_engine(engine_id)
uri = "/data/engine/#{engine_id}/update"
AJAX.post(self, uri)
end

# Provide a list of current scan activities for a specific Scan Engine.
#
# @return [Array[ScanSummary]] Array of ScanSummary objects associated with
Expand Down