Class: NexposeSCCM::DeploymentPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose_sccm/deployment_package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, sug_name, path, id = nil, collection_name = nil, deployment_type = 'Available') ⇒ DeploymentPackage

Returns a new instance of DeploymentPackage.



6
7
8
9
10
11
12
13
# File 'lib/nexpose_sccm/deployment_package.rb', line 6

def initialize(name,sug_name,path,id=nil,collection_name=nil,deployment_type='Available')
  @name = name
  @id = id
  @sug_name = sug_name
  @path = path
  @collection_name = collection_name
  @deployment_type = deployment_type
end

Instance Attribute Details

#collection_nameObject

Returns the value of attribute collection_name.



4
5
6
# File 'lib/nexpose_sccm/deployment_package.rb', line 4

def collection_name
  @collection_name
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/nexpose_sccm/deployment_package.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/nexpose_sccm/deployment_package.rb', line 3

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/nexpose_sccm/deployment_package.rb', line 3

def path
  @path
end

#sug_nameObject (readonly)

Returns the value of attribute sug_name.



3
4
5
# File 'lib/nexpose_sccm/deployment_package.rb', line 3

def sug_name
  @sug_name
end

Instance Method Details

#download_updates(conn) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/nexpose_sccm/deployment_package.rb', line 27

def download_updates(conn)
  NexposeSCCM.logger.debug("Downloading updates for #{sug_name}")
  Powershell.run(conn.conn,
                 :download_software_updates,
                 conn.location,
                 @name,
                 @sug_name,
                 @path)
end

#save(conn) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/nexpose_sccm/deployment_package.rb', line 15

def save(conn)
  NexposeSCCM.logger.info("Created Deployment Package: #{@name}")
  NexposeSCCM.logger.debug("Deployment package has path [#{@path}]")
  Powershell.run(conn.conn,
                 :create_deployment_package,
                 conn.namespace,
                 conn.host,
                 @name,
                 @name,
                 @path)
end