Class: NexposeSCCM::SoftwareUpdateGroup
- Inherits:
-
Object
- Object
- NexposeSCCM::SoftwareUpdateGroup
- Defined in:
- lib/nexpose_sccm/software_update_group.rb
Overview
Configuration settings for creating a Software Update Group
-
Args :
-
name
- A String identifying the display name of the Software Update Group -
description
- A String identifying the description of the Software Update Group -
ci_ids
- An Array identifying the list of ci_ids to add to a Software Update Group
-
Instance Attribute Summary collapse
-
#ci_ids ⇒ Object
Returns the value of attribute ci_ids.
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, description, ci_ids, ci_id = nil) ⇒ SoftwareUpdateGroup
constructor
A new instance of SoftwareUpdateGroup.
- #save(conn) ⇒ Object
Constructor Details
#initialize(name, description, ci_ids, ci_id = nil) ⇒ SoftwareUpdateGroup
Returns a new instance of SoftwareUpdateGroup.
15 16 17 18 19 20 |
# File 'lib/nexpose_sccm/software_update_group.rb', line 15 def initialize(name, description, ci_ids, ci_id=nil) @name = name @description = description @ci_ids = ci_ids @ci_id = ci_id end |
Instance Attribute Details
#ci_ids ⇒ Object
Returns the value of attribute ci_ids.
13 14 15 |
# File 'lib/nexpose_sccm/software_update_group.rb', line 13 def ci_ids @ci_ids end |
#description ⇒ Object
Returns the value of attribute description.
13 14 15 |
# File 'lib/nexpose_sccm/software_update_group.rb', line 13 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/nexpose_sccm/software_update_group.rb', line 13 def name @name end |
Instance Method Details
#save(conn) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/nexpose_sccm/software_update_group.rb', line 22 def save(conn) if @ci_id.nil? if @ci_ids.length > 0 Powershell.run(conn.conn, :create_software_update_group, conn.namespace, conn.host, @name, @description, @ci_ids.join(',')) else NexposeSCCM.logger.debug('No CI_IDs to add to Software Update Group, going to next...') return false end else if @ci_ids.length > 0 Powershell.run(conn.conn, :update_software_update_group, conn.namespace, conn.host, @ci_id, @ci_ids.join(',')) else Powershell.run(conn.conn, :update_software_update_group_empty, conn.namespace, conn.host, @ci_id) end end end |