SAS Viya. Kevin D. Smith
be in the form 'actionSetName.actionName' or just 'actionName.
actionset : string, optional
specifies the name of the action set for which you want help. This
parameter is ignored if the action parameter is specified.
verbose : boolean, optional
when set to True, provides more detail for each parameter.
Default: True
Returns
-------
Help object
... truncated ...
These methods of getting help work both on actions and action sets. For example, we know that there is a builtins action set that the help action belongs to. The CAS object has an attribute that maps to the builtins action set just like the help action. We can display the help for the builtins action set as follows:
In [10]: conn.builtins?
Type: Builtins
String form: <swat.cas.actions.Builtins object at 0x7f7ad35b9048>
File: swat/cas/actions.py
Docstring:
System
Actions
-------
builtins.about : Shows the status of the server
builtins.actionsetinfo : Shows the build information from loaded
action sets
builtins.addnode : Adds a machine to the server
builtins.cascommon : Provides parameters that are common to
many actions
builtins.echo : Prints the supplied parameters to the
client log
builtins.getgroups : Shows the groups from the authentication
provider
builtins.getlicenseinfo : Shows the license information for a SAS
product
builtins.getusers : Shows the users from the authentication
provider
builtins.help : Shows the parameters for an action or
lists all available actions
builtins.history : Shows the actions that were run in this
session
builtins.httpaddress : Shows the HTTP address for the server
monitor
builtins.installactionset : Loads an action set in new sessions
automatically
builtins.listactions : Shows the parameters for an action or
lists all available actions
builtins.listnodes : Shows the host names used by the server
builtins.loadactionset : Loads an action set for use in this
session
builtins.log : Shows and modifies logging levels
builtins.modifyqueue : Modifies the action response queue
settings
builtins.ping : Sends a single request to the server to
confirm that the connection is working
builtins.queryactionset : Shows whether an action set is loaded
builtins.queryname : Checks whether a name is an action or
action set name
builtins.reflect : Shows detailed parameter information for
an action or all actions in an action set
builtins.refreshlicense : Refresh SAS license information from a
file
builtins.refreshtoken : Refreshes an authentication token for this
session
builtins.removenode : Remove one or more machines from the
server
builtins.serverstatus : Shows the status of the server
builtins.setlicenseinfo : Sets the license information for a SAS
product
builtins.shutdown : Shuts down the server
builtins.userinfo : Shows the user information for your
connection
Each time that an action set is loaded into the server, the information about the action set and its actions are reflected back to SWAT. SWAT then creates attributes on the CAS object that map to the new action sets and actions, including all of the documentation and Help system hooks. The advantage is that the documentation about actions can never get out of date in the Python client.
In addition to the documentation, since the action sets and actions appear as attributes on the CAS object, you can also use tab completion to display what is in an action set.
In [11]: conn.builtins.<tab>
conn.builtins.about conn.builtins.loadactionset
conn.builtins.actionsetinfo conn.builtins.log
conn.builtins.addnode conn.builtins.modifyqueue
conn.builtins.cascommon conn.builtins.ping
conn.builtins.echo conn.builtins.queryactionset
conn.builtins.getgroups conn.builtins.queryname
conn.builtins.getlicenseinfo conn.builtins.reflect
conn.builtins.getusers conn.builtins.refreshlicense
conn.builtins.help conn.builtins.refreshtoken
conn.builtins.history conn.builtins.removenode
conn.builtins.httpaddress conn.builtins.serverstatus
conn.builtins.installactionset conn.builtins.setlicenseinfo
conn.builtins.listactions conn.builtins.shutdown
conn.builtins.listnodes conn.builtins.userinfo
Now that we have seen how to query the server for available action sets and actions, and we know how to get help for the actions, we can move on to some more advanced action calls.
Specifying Action Parameters
We have already seen a few action parameters being used on the help action (action, actionset, and verbose). When a CAS action is added to the CAS object, all action parameters are mapped to Python keyword parameters. Let’s look at the function signature of help to see the supported action parameters.
In [12]: conn.help?
Type: builtins.Help
String form: ?.builtins.Help()
File: swat/cas/actions.py
Definition: ?.help(_self_, action=None,
actionset=None,
verbose=True, **kwargs)
... truncated ...
You see that there is one positional argument (_self_2). It is simply the Python object that help is being called on. The