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

Scheduled Backup and Maintenance #211

Merged
merged 7 commits into from
Mar 31, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Update cancellation_period to cancellation_window
  • Loading branch information
dmurray-r7 committed Mar 30, 2016
commit 4708a97a50cda3d890fb000573ee84f4068c9056
10 changes: 5 additions & 5 deletions lib/nexpose/scheduled_backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class ScheduledBackup < APIObject
# Whether the backup should pause all local scans or wait for local scans to complete. Defaults to true if not set
attr_accessor :pause_local_scans
# Number of minutes to wait for running scans to pause/complete before aborting the backup task. Defaults to 0 if not set
attr_accessor :cancellation_period
attr_accessor :cancellation_window

def initialize(start:, enabled: true, type:, interval:, platform_independent: true, description: nil, pause_local_scans: true, cancellation_period: 0)
def initialize(start:, enabled: true, type:, interval:, platform_independent: true, description: nil, pause_local_scans: true, cancellation_window: 0)
@schedule_start = start
@enabled = enabled
@schedule_type = type
@schedule_interval = interval.to_i
@platform_independent = platform_independent
@description = description
@pause_local_scans = pause_local_scans
@cancellation_period = cancellation_period.to_i
@cancellation_window = cancellation_window.to_i
end

def to_json
Expand All @@ -51,7 +51,7 @@ def self.from_hash(hash)
platform_independent: hash[:platform_independent],
description: hash[:description],
pause_local_scans: hash[:pause_local_scans],
cancellation_period: hash[:cancellation_period])
cancellation_window: hash[:cancellation_window])
backup
end

Expand All @@ -62,7 +62,7 @@ def to_h
description: @description,
platform_independent: @platform_independent,
pause_local_scans: @pause_local_scans,
cancellation_period: @cancellation_period
cancellation_window: @cancellation_window
}
repeat_hash = {
type: @schedule_type,
Expand Down
10 changes: 5 additions & 5 deletions lib/nexpose/scheduled_maintenance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class ScheduledMaintenance < APIObject
# Whether the maintenance should pause all local scans or wait for local scans to complete. Defaults to true if not set
attr_accessor :pause_local_scans
# Number of minutes to wait for running scans to pause/complete before aborting the maintenance task. Defaults to 0 if not set
attr_accessor :cancellation_period
attr_accessor :cancellation_window

def initialize(start:, enabled: true, type:, interval:, reindex: false, compress: true, cleanup: true, pause_local_scans: true, cancellation_period: 0)
def initialize(start:, enabled: true, type:, interval:, reindex: false, compress: true, cleanup: true, pause_local_scans: true, cancellation_window: 0)
@schedule_start = start
@enabled = enabled
@schedule_type = type
Expand All @@ -33,7 +33,7 @@ def initialize(start:, enabled: true, type:, interval:, reindex: false, compress
@compress = compress
@cleanup = cleanup
@pause_local_scans = pause_local_scans
@cancellation_period = cancellation_period.to_i
@cancellation_window = cancellation_window.to_i
end

def to_json
Expand All @@ -55,7 +55,7 @@ def self.from_hash(hash)
compress: hash[:compression],
cleanup: hash[:cleanup],
pause_local_scans: hash[:pause_local_scans],
cancellation_period: hash[:cancellation_period])
cancellation_window: hash[:cancellation_window])
backup
end

Expand All @@ -67,7 +67,7 @@ def to_h
reindex: @reindex,
compression: @compress,
pause_local_scans: @pause_local_scans,
cancellation_period: @cancellation_period
cancellation_window: @cancellation_window
}
repeat_hash = {
type: @schedule_type,
Expand Down