Class: TaskRole

Inherits:
Object
  • Object
show all
Defined in:
lib/HMC/TaskRole.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ TaskRole

Returns a new instance of TaskRole.



16
17
18
19
# File 'lib/HMC/TaskRole.rb', line 16

def initialize(string)

  parse(string) unless string.empty?
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/HMC/TaskRole.rb', line 9

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



10
11
12
# File 'lib/HMC/TaskRole.rb', line 10

def parent
  @parent
end

#resources_cecObject (readonly)

Returns the value of attribute resources_cec.



13
14
15
# File 'lib/HMC/TaskRole.rb', line 13

def resources_cec
  @resources_cec
end

#resources_frameObject (readonly)

Returns the value of attribute resources_frame.



12
13
14
# File 'lib/HMC/TaskRole.rb', line 12

def resources_frame
  @resources_frame
end

#resources_HMCConsoleObject (readonly)

Returns the value of attribute resources_HMCConsole.



14
15
16
# File 'lib/HMC/TaskRole.rb', line 14

def resources_HMCConsole
  @resources_HMCConsole
end

#resources_rawObject (readonly)

Returns the value of attribute resources_raw.



11
12
13
# File 'lib/HMC/TaskRole.rb', line 11

def resources_raw
  @resources_raw
end

Instance Method Details

#parse(string) ⇒ Object

name=hmcservicerep,parent=Predefined,“resources=”“frame:CheckPSN+DeactivateFrameIO+FrameInitialize+LaunchFrameAsm+ListFrameProperty+ManageFrameServEvents+ManagePSN+RefreshFrame,cec:ActivateSystemProfile+BackupProfileData+CECPowerOff+CECPowerOn+CaptureSystemTemplate+CollectCECVPDInfo+DeployPartitionTemplate+DeviceMaintenance+LSProfileSpace+LaunchAsm+ListCECProperty+ListCoDInformation+ListNPortLogin+ListPCIeTopology+ListRioTopology+ListSSP+ListSystemProfileProperty+ListUtilizationData+ListVETInfo+ManageCECServEvents+ManageDumps+ManageSPP+ManageSysProfile+ManageUtilizationData+RebuildCEC+UpdateLIC+ValidateSystemProfile+ViewDumps+ViewPowerManagement+ViewSPP,lpar:ActivateLPAR+CapturePartitionTemplate+ChangeNPortLogin+CloseVTerm+Connect5250VTerm+DlparOperation+ListLPARProperty+ListProfileProperty+ManageLPARServEvents+ManageProfile+Open5250VTerm+OpenVTerm+RebootLPAR+ShutdownLPAR+VirtualIOServerCommand,HMCConsole:5250Task+BackupHMCData+ChangeHMCConfiguration+ChangeLocale+ChangeUserPasswords+CollectVPDInfo+CustServiceSettings+FormatMedia+GetUpgradeFiles+GroupingApp+ListConnections+ListHMCConfiguration+ListSNMPServiceSettings+ListServiceableEvents+ListStorageMedia+ManageConsoleDumps+ManageSNMPServiceSettings+ManageServEvents+RepairServEvent+RestoreUpgradeData+SaveUpgradeData+ShutdownHMC+TemplateLibrary+TipOfTheDay+UpdateHMC+UserSettings+ViewConsoleEvents+ViewHMCFileSystems”“”



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/HMC/TaskRole.rb', line 22

def parse(string)

  hash = HmcString.parse(string)

  @name = hash['name']
  @parent = hash['parent']
  @resources_raw = hash['resources']

  parseResorces(@resources_raw)

end

#parseResorces(string) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/HMC/TaskRole.rb', line 34

def parseResorces(string)
  regexp = /frame:(.*),cec:(.*),HMCConsole:(.*)/
  match = regexp.match(string)
  if (match)
    resources_frame = match[1].split("+")
  else
    raise "can't find regexp"
  end

end