Welcome to mirror list, hosted at ThFree Co, Russian Federation.

jsonrpc-test.py « bin - github.com/bareos/python-bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9cd660b6be919b65abafe4cf5ad2e30eabb27d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# coding: utf-8

from   pprint import pprint
import pyjsonrpc

http_client = pyjsonrpc.HttpClient(
    url = "http://localhost:8080",
    #username = "Username",
    #password = "Password"
)

#try:
    #print http_client.call("a2")
    ## Result: 3
#except:
    #pass

# It is also possible to use the *method* name as *attribute* name.
#print http_client.add(1, 2)

# provoke an error
#print http_client.add(2,"abc")


result = http_client.execute_fullresult("list jobs last")
pprint(result)

result = http_client.execute("list jobs last")
pprint(result)

result = http_client.list("jobs last")
pprint(result)


#try:
    #pprint(result['result'])
#except:
    #pprint( result )