get_vars()

Return the list of variables for a PSL object.

Syntax

get_vars([object],[keyword])

Parameter

ParameterDefinition

object

optional name of object whose variables are to be listed*Default*
current object

keyword

optional keyword that specifies information that is to be returned for object*Valid Values*

  • nodes --print nodes only; instances currently created for the class, including "." and ".." within the hierarchical tree structure of the object; displays the branches, plus defines the current and prior location within the tree structure
  • subnodes --return subnodes; only displays branches off of the hierarchical tree structure For example: get_vars ("/CPU/CPU","subnodes"); produces a list of all parameters defined under the instance object; get_vars ("/CPU","subnodes"); produces a list of all instances defined for this class
  • leaves or "" --return leaves only (equivalent to the PATROL 3.0 function get_vars(object); ) displays the endpoints of the branches For example: get_vars ("/FILESYSTEM", "leaves"); displays the namespace variables for the class;get_vars ("/FILESYSTEM/[filesystem name]", "leaves"); displays the namespace variables for /class/instance; get_vars ("FILESYSTEM/[filesystem name]/ FSAvailableSpace", "leaves"); displays the namespace variables for /class/instance/parameter
  • all or 1 --return all children (equivalent to the PATROL 3.0 function get_vars(object,1); )

Description

The get_vars() function returns a list of the variables of object or for the current object if object is omitted. Theget_vars() function returns the NULL string if object does not exist. 

The list of object variables is sorted in ascending ASCII order.

Example

The following get_vars() function call returns a list of variables for a PSL object and all its children:

#print the variables for the MEMORY object and all its children
print(get_vars("MEMORY","all"));


Sample output for this example might be:

MEMORY
.
..
__name__
__self__
__type__
active
environment
instances
lastDiscoveryTime
name
numInstances
osUsername
propagateState
status
username

Was this page helpful? Yes No Submitting... Thank you

Comments