-
Notifications
You must be signed in to change notification settings - Fork 0
/
auditApps.py
40 lines (29 loc) · 952 Bytes
/
auditApps.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
from queryAlf import runQuery
import pandas as pd, json
import os
from dotenv import load_dotenv
# Load environment variables from the .env file
load_dotenv()
BASE_URL= os.getenv("BASE_URL")
auth = os.getenv("auth")
user=os.getenv("user")
passwd=os.getenv("pass")
appID = []
cols = {0: 'appid'}
def pullAuditApps():
auditAppQuery = BASE_URL + '/alfresco/api/-default-/public/alfresco/versions/1/audit-applications'
#print ('query url is: ' + auditAppQuery) #debug
data=runQuery('get',auditAppQuery,'',user,passwd)
return data
def main():
appID = [] #clear app id now!
for entry in pullAuditApps()['list']['entries']:
print(entry['entry']['id'])
appID.append(entry['entry']['id'])
auditIDDF = pd.DataFrame([appID]).T
auditIDDF.rename(columns=cols,inplace=True)
print (auditIDDF)
auditIDDF.to_excel('auditApps.xlsx')
return auditIDDF
if __name__ == "__main__":
main()