Last active
August 2, 2023 16:19
-
-
Save mirceaulinic/99be5bf05abb3efcfbb202c0cc3bf2c2 to your computer and use it in GitHub Desktop.
salt-sproxy Python client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@salt:/# isalt --master | |
__ _______. ___ __ .___________. | |
| | / | / \ | | | | | |
| | | (----` / ^ \ | | `---| |----` | |
| | \ \ / /_\ \ | | | | | |
| | .----) | / _____ \ | `----. | | | |
|__| |_______/ /__/ \__\ |_______| |__| | |
Role: Master | |
Salt version: 3006.1 | |
IPython version: 8.12.0 | |
In [1]: import salt.runner | |
In [2]: r = salt.runner.RunnerClient(__opts__) | |
In [3]: r.cmd("proxy.execute", arg=("tst1",), kwarg={"salt_function": "test.ping", "static": True}) | |
tst1: | |
True | |
Out[3]: {'tst1': True} | |
In [4]: r.cmd("proxy.execute", arg=("tst1,), kwarg={"salt_function": "test.arg", "static": True, "args": ("a", "b"), "some_extr_arg": True}) | |
tst1: | |
---------- | |
args: | |
- a | |
- b | |
kwargs: | |
---------- | |
some_extr_arg: | |
True | |
Out[4]: {'tst1': {'args': ['a', 'b'], 'kwargs': {'some_extr_arg': True}}} | |
In [5]: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment