diff --git a/applications/python3/cgi-bin/getSystemPackageRecord.py b/applications/python3/cgi-bin/getSystemPackageRecord.py index 8f7540e..f0387aa 100755 --- a/applications/python3/cgi-bin/getSystemPackageRecord.py +++ b/applications/python3/cgi-bin/getSystemPackageRecord.py @@ -34,7 +34,8 @@ # make the URL strings an actual URL htmlCode = html.unescape(htmlCode) # make the links off the system package record here from the systemKey in the JSON object above -htmlMenu = "

List Checklists
" +htmlMenu = "

Patch Score Listing
" +htmlMenu += "List Checklists
" htmlMenu += "List Hardware
" htmlMenu += "List Software
" htmlMenu += "List Ports/Protocols/Services
" diff --git a/applications/python3/cgi-bin/listSystemPackageHardware.py b/applications/python3/cgi-bin/listSystemPackageHardware.py index 63e74ea..e12039a 100755 --- a/applications/python3/cgi-bin/listSystemPackageHardware.py +++ b/applications/python3/cgi-bin/listSystemPackageHardware.py @@ -28,7 +28,7 @@ hardwareTable = PrettyTable(["HostName", "Operating System"]) # Just get the fields want for element in json_object: # iterate on each element of the list - hardwareTable.add_row([element['hostname'], "" + str(element['operatingSystem']) + ""]) + hardwareTable.add_row(["" + str(element['hostname']) + "", str(element['operatingSystem'])]) # call to make this an HTML table and put into a new variable htmlCode = hardwareTable.get_html_string(attributes={"class":"table"}, format=True) # make the URL strings an actual URL diff --git a/applications/python3/cgi-bin/listTeamSubpackages.py b/applications/python3/cgi-bin/listTeamSubpackages.py index 8a6a78e..99f426d 100755 --- a/applications/python3/cgi-bin/listTeamSubpackages.py +++ b/applications/python3/cgi-bin/listTeamSubpackages.py @@ -30,7 +30,7 @@ systemPackageTable = PrettyTable(["Team Package", "Team Key", "Checklists", "Devices", "Last Updated"]) # Just get the fields we want for element in json_object: # iterate on each element of the list - systemPackageTable.add_row([element['title'], "" + element['teamKey'] + "", element['numberOfChecklists'], element['numberOfDevices'], element['updatedDateString']]) + systemPackageTable.add_row([element['title'], element['teamKey'], element['numberOfChecklists'], element['numberOfDevices'], element['updatedDateString']]) # call to make this an HTML table and put into a new variable htmlCode = systemPackageTable.get_html_string(attributes={"class":"table"}, format=True) # make the URL strings an actual URL diff --git a/applications/python3/cgi-bin/listTemplates.py b/applications/python3/cgi-bin/listTemplates.py index 06c4787..76b5bd9 100755 --- a/applications/python3/cgi-bin/listTemplates.py +++ b/applications/python3/cgi-bin/listTemplates.py @@ -11,7 +11,7 @@ headers = CaseInsensitiveDict() headers["Accept"] = "application/json" -headers["Authorization"] = "Bearer" + myVariables.bearerToken +headers["Authorization"] = "Bearer " + myVariables.bearerToken resp = requests.get(url, headers=headers) json_object = json.loads(resp.text) diff --git a/applications/python3/index.html b/applications/python3/index.html new file mode 100644 index 0000000..e8513ad --- /dev/null +++ b/applications/python3/index.html @@ -0,0 +1,28 @@ + + + + Soteria Software | OpenRMF Professional Python API Application + + + +

Python3 example application using simple cgi-bin

+To launch the application, from the ./applications/python/ folder run the below command. And access with a browser to http://localhost:8000/cgi-bin/listTemplates.py for example. + +
python3 -m http.server --cgi
+ +This includes a myVariables.py file that has the 3 below variables in it for the root URL, application key, and bearer token generated. This is in place of ENVIRONMENT variables in a framework or however you wish to pass and use the information securely. + +
+rootURL = "http://openrmfpro.mycompany.com:8080"
+applicationKey = "myApplicationKey"
+bearerToken = "hvs.CAESIBP1QjNLqckAk1PlNyMqqJTlxxxxxxxxxxqTDV6Y05uOVhkTXREdlZlSHpjOUt0Q0U"
+
+
+

Start Here

+

List System Packages

+

List Team Subpackages

+

List Templates

+ +
+Reference: OpenRMF® Professional Automation Repo + \ No newline at end of file