class WPAR::WPAR
Attributes
devices[R]
general[R]
live_stream[RW]
mountpoints[R]
name[R]
networks[R]
resource_control[R]
security[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/wpars/wpar.rb, line 29 def initialize(options = {}) @command = options[:command] @name = options[:name] @general = options[:general] || General.new(name: @name) @networks = options[:networks] || Array.new([Network.new(name: @name)]) @devices = options[:devices] || Array.new([Device.new(name: @name)]) @mountpoints = options[:mountpoints] || Array.new([Mountpoint.new(name: @name)]) @resource_control = options[:resource_controls] ||ResourceControl.new(name: @name) @security = options[:securities] || Security.new(name: @name) end
Public Instance Methods
add(address: nil, interface: nil, mask_prefix: nil, broadcast: nil)
click to toggle source
# File lib/wpars/wpar.rb, line 85 def add(address: nil, interface: nil, mask_prefix: nil, broadcast: nil) params={} params[:name] = @name params[:address] = address params[:interface] = interface params[:mask_prefix] = mask_prefix params[:broadcast] = broadcast net = WPARS::Network.new(params) @nets += net end
create(options = {})
click to toggle source
# File lib/wpars/wpar.rb, line 40 def create(options = {}) MkWpar.create( name: @name, command: @command, wpar: self, start: options[:start], rootvg: options[:rootvg], wparvg: options[:wparvg], backupimage: options[:backupimage], live_stream: @live_stream) #update update(options) end
destroy(force: nil)
click to toggle source
# File lib/wpars/wpar.rb, line 53 def destroy(force: nil) RmWpar.destroy(name: @name, force: force, command: @command, live_stream: @live_stream) end
get_rootvg()
click to toggle source
# File lib/wpars/wpar.rb, line 97 def get_rootvg @devices.select { |o| o.rootvg == "yes"} end
start()
click to toggle source
# File lib/wpars/wpar.rb, line 64 def start() StartWpar.start( name: @name, command: @command, live_stream: @live_stream) #update status @general = LswparGeneral.new(command: @command).filter(@name) end
stop(force: nil)
click to toggle source
# File lib/wpars/wpar.rb, line 57 def stop(force: nil) StopWpar.stop( name: @name, force: force, command: @command, live_stream: @live_stream) #update status @general = LswparGeneral.new(command: @command).filter(@name) end
sync(directory: nil)
click to toggle source
# File lib/wpars/wpar.rb, line 71 def sync(directory: nil) SyncWpar.sync( name: @name, command: @command, directory: directory, live_stream: @live_stream) end
update(options = {})
click to toggle source
# File lib/wpars/wpar.rb, line 75 def update(options = {}) options[:command] = @command @general = LswparGeneral.new(options).filter(@name) @networks = LswparNetwork.new(options).filter(@name) @devices = LswparDevice.new(options).filter(@name) @mountpoints = LswparMountpoint.new(options).filter(@name) @resource_control = LswparResourceControl.new(options).filter(@name) @security = LswparSecurity.new(options).filter(@name) end