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

Update gem to support XML API adding of schedules to adhoc scans #142

Merged
merged 24 commits into from
Mar 25, 2015

Conversation

mhughes-r7
Copy link
Contributor

Adding support in to the gem for new feature allowing users to add schedules to adhoc scans.

NEX-40391

Fix some issues with site loading

NEX-40391
Fix param name for adhocschedule class

NEX-40391
Fix scan_device(s)_with schedule to work properly as I'd moved a line of code I shouldn't have

NEX-40391
Fix some issues with site loading

NEX-40391
Fix param name for adhocschedule class

NEX-40391
Fix scan_device(s)_with schedule to work properly as I'd moved a line of code I shouldn't have

NEX-40391
Remove some unnecessary changes to site.rb

NEX-40391
Remove some unnecessary changes to site.rb

NEX-40391
Force parameter added to allow scheduling of adhoc scans in blackout periods.

NEX-40391
Fix some issues with site loading

NEX-40391
Fix param name for adhocschedule class

NEX-40391
Fix scan_device(s)_with schedule to work properly as I'd moved a line of code I shouldn't have

NEX-40391
Remove some unnecessary changes to site.rb

NEX-40391
Force parameter added to allow scheduling of adhoc scans in blackout periods.

NEX-40391
# @param [Array[adhoc_schedules]] list of scheduled times at which to run
# @return [Status] whether the request was successful
#
def scan_devices_with_schedule(devices, schedules)

Choose a reason for hiding this comment

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

Assignment Branch Condition size for scan_devices_with_schedule is too high. [16.49/15]

elem = REXML::Element.new('Devices')
devices.each do |device|
elem.add_element('device', { 'id' => "#{device.id}" })
elem.add_element('device', {'id' => "#{device.id}"})

Choose a reason for hiding this comment

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

Redundant curly braces around a hash parameter.
Space inside { missing.
Space inside } missing.

# @param [Array[adhoc_schedules]] list of scheduled times at which to run
# @return [Status] whether the request was successful
#
def scan_devices_with_schedule(devices, schedules)

Choose a reason for hiding this comment

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

Assignment Branch Condition size for scan_devices_with_schedule is too high. [15.52/15]

@gschneider-r7
Copy link
Contributor

It might be worth squashing commits on this branch since there are so many with the same comment, but not a big deal.

@@ -107,7 +142,7 @@ class Schedule < APIObject
# The date after which the schedule is disabled, in ISO 8601 format.
attr_accessor :not_valid_after

#TODO Remove this unused attribute
# TODO: Remove this unused attribute
Copy link
Contributor

Choose a reason for hiding this comment

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

When is this supposed to be removed? What depends on it currently?

Copy link
Contributor

Choose a reason for hiding this comment

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

The XML API supports this optional field. The backend code reads it but it doesn't do anything special.

@mhughes-r7
Copy link
Contributor Author

Are we ok to merge this in please? This functionality is going with nightcrawler

gschneider-r7 added a commit that referenced this pull request Mar 25, 2015
Update gem to support XML API adding of schedules to adhoc scans
@gschneider-r7 gschneider-r7 merged commit 54ed13f into site-api Mar 25, 2015
@gschneider-r7 gschneider-r7 deleted the site-api-adhoc-schedule branch March 27, 2015 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants