swat.CAS.invoke

CAS.invoke(_name_, **kwargs)

Call an action on the server

The invoke() method only calls the action on the server. It does not retrieve the responses. To get the responses, you iterate over the connection object.

Parameters:
_name_ : string

Name of the action

**kwargs : any, optional

Arbitrary keyword arguments

Returns:
self

See also

retrieve()
Calls action and retrieves results
__iter__()
Iterates over responses

Examples

The code below demonstrates how you invoke an action on the server and iterate through the results.

>>> s.invoke('help')
<swat.CAS object at 0x7fab0a9031d0>
>>> for response in s:
...     for key, value in response:
...         print(key)
...         print(value)
builtins
              name                                        description
0          addnode                           Add a node to the server
1             help                        Lists the available actions
.
.
.