-
Notifications
You must be signed in to change notification settings - Fork 9
/
IronBoxGetContextSetting.py
49 lines (43 loc) · 1.71 KB
/
IronBoxGetContextSetting.py
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
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
#---------------------------------------------------
#
# Demonstrates how to retrieve a setting for an
# IronBox context or instance. This will be useful
# when you want get information about a context
# like secure.goironcloud.com such as company name,
# the URL to the logo, etc.
#
# Important, the entity making this call must
# already be a member of the context.
#
# Written by [email protected]
# Website: www.goironbox.com
#
#---------------------------------------------------
from IronBoxREST import IronBoxRESTClient
#---------------------------------------------------
# Your IronBox authentication parameters, you could
# also pass these in as command arguments
#---------------------------------------------------
IronBoxEmail = "[email protected]"
IronBoxPassword = "password123"
IronBoxAPIServerURL = "https://api.goironcloud.com/latest/"
IronBoxAPIVersion = "latest"
Context = "secure.goironcloud.com"
#---------------------------------------------------
# Main
#---------------------------------------------------
def main():
#----------------------------
# Create an instance of the IronBox REST class
#----------------------------
IronBoxRESTObj = IronBoxRESTClient(IronBoxEmail, IronBoxPassword, version=IronBoxAPIVersion, verbose=True)
#----------------------------
# Get some public information about the context
#----------------------------
print "Company Name: %s" % IronBoxRESTObj.GetContextSetting(Context, "CompanyName")
print "Company Logo URL: %s" % IronBoxRESTObj.GetContextSetting(Context, "CompanyLogoUrl")
#---------------------------------------------------
import string, datetime
if __name__ == "__main__":
main()