File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 14
14
print ("---- SESSIONLESS COMMUNICATION ----" )
15
15
cl = AC ()
16
16
cl .useOTESystem ()
17
- cl .setCredentials (' test.user' , ' test.passw0rd' )
17
+ cl .setCredentials (" test.user" , " test.passw0rd" )
18
18
# use the below method in case you have an active
19
19
# ip filter setting
20
- cl .setRemoteIPAddress (' 1.2.3.4' )
20
+ cl .setRemoteIPAddress (" 1.2.3.4" )
21
21
22
22
# Call a command
23
- r = cl .request ({
24
- 'Command' : "QueryDomainList" , 'limit' : 5
25
- })
23
+ r = cl .request ({"Command" : "QueryDomainList" , "limit" : 5 })
26
24
27
25
# Get the result in the format you want
28
26
rlist = r .getListHash ()
49
47
print ("---- SESSION-BASED COMMUNICATION ----" )
50
48
cl = AC ()
51
49
cl .useOTESystem ()
52
- cl .setCredentials (' test.user' , ' test.passw0rd' )
53
- cl .setRemoteIPAddress (' 1.2.3.4' )
50
+ cl .setCredentials (" test.user" , " test.passw0rd" )
51
+ cl .setRemoteIPAddress (" 1.2.3.4" )
54
52
55
53
# Call a command
56
54
r = cl .login ()
57
55
# cl.login('12345678'); -> 2FA: one time password
58
56
59
- if ( r .isSuccess () ):
57
+ if r .isSuccess ():
60
58
print ("LOGIN SUCCEEDED!" )
61
- r = cl .request ({
62
- 'Command' : "QueryDomainList" , 'limit' : 5
63
- })
59
+ r = cl .request ({"Command" : "QueryDomainList" , "limit" : 5 })
64
60
rplain = r .getPlain ()
65
61
code = r .getCode ()
66
62
description = r .getDescription ()
67
63
print (str (code ) + " " + description )
68
64
# ... further commands ...
69
65
r = cl .logout ()
70
- if ( r .isSuccess () ):
66
+ if r .isSuccess ():
71
67
print ("LOGOUT SUCCEEDED!" )
You can’t perform that action at this time.
0 commit comments