Compare commits
10 Commits
8785c3bd59
...
9a8e3a2032
| Author | SHA1 | Date |
|---|---|---|
|
|
9a8e3a2032 | |
|
|
324522e35d | |
|
|
8aa612efaa | |
|
|
54702310dc | |
|
|
edb38e9a80 | |
|
|
1f4c9b7ed5 | |
|
|
99a9785c9b | |
|
|
341b3fd729 | |
|
|
ca9ac774f6 | |
|
|
bd24c94834 |
|
|
@ -34,7 +34,9 @@
|
|||
//cron('0 8 * * *')
|
||||
|
||||
//every monday at 08:00
|
||||
cron('0 8 * * MON')
|
||||
//cron('0 8 * * 1')
|
||||
//Branch related
|
||||
cron(env.BRANCH_NAME == 'master' ? '0 8 * * 1' : '')
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -85,8 +87,8 @@
|
|||
try {
|
||||
emailext subject: env.JOB_NAME,
|
||||
body: 'Please find the output of your reports attached',
|
||||
to: 'patryk.gudalewicz.bp@nttdata.com',
|
||||
replyTo: 'patryk.gudalewicz.bp@nttdata.com',
|
||||
to: 'peter.hh.huber@bmw.de, patryk.gudalewicz.bp@nttdata.com',
|
||||
replyTo: 'coco-apm@bmw.de',
|
||||
attachmentsPattern: '*.csv'
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
from html import entities
|
||||
from decouple import config
|
||||
import yaml
|
||||
import requests
|
||||
|
|
@ -56,12 +55,31 @@ def GatherReportingInfo(DTAPIToken, DTENV,friendlyName):
|
|||
strnow = now.strftime("%Y%m%d_%H%M")
|
||||
for entity in entityList:
|
||||
if any(tag["stringRepresentation"].startswith('[Kubernetes]app.bmwgroup.com/') for tag in entity["tags"]):
|
||||
kubernetesttagval = next((tag for tag in entity["tags"] if tag["stringRepresentation"].startswith('[Kubernetes]app.bmwgroup.com/')), None)
|
||||
appidtagval = next((tag for tag in entity["tags"] if tag["stringRepresentation"].startswith('[Kubernetes]app-id')), None)
|
||||
appnametagval = next((tag for tag in entity["tags"] if tag["stringRepresentation"].startswith('app-name')), None)
|
||||
compassidtagval = next((tag for tag in entity["tags"] if tag["stringRepresentation"].startswith('compass-id')), None)
|
||||
msidtagval = next((tag for tag in entity["tags"] if tag["stringRepresentation"].startswith('[Kubernetes]ms-id')), None)
|
||||
row={'Kubernetes Tag':kubernetesttagval["stringRepresentation"],'AppId':appidtagval["value"],'AppName':appnametagval["value"],'CompassId':compassidtagval["value"],'MsId':msidtagval["value"],'ServiceName':entity['displayName'],'ServiceId':entity['entityId']}
|
||||
row={'ServiceName':entity['displayName'],'ServiceId':entity['entityId']}
|
||||
if appidtagval:
|
||||
row.update({'AppId':appidtagval["value"]})
|
||||
else:
|
||||
row.update({'AppId':''})
|
||||
if appnametagval:
|
||||
row.update({'AppName':appnametagval["value"]})
|
||||
else:
|
||||
row.update({'AppName':''})
|
||||
if compassidtagval:
|
||||
row.update({'CompassId':compassidtagval["value"]})
|
||||
else:
|
||||
row.update({'CompassId':''})
|
||||
if msidtagval:
|
||||
row.update({'MsId':msidtagval["value"]})
|
||||
else:
|
||||
row.update({'MsId':''})
|
||||
|
||||
for kubetag in entity["tags"]:
|
||||
if(kubetag["key"].startswith("app.bmwgroup.com/")):
|
||||
row.update({kubetag["key"]:kubetag["value"]})
|
||||
mgmt = mgmt.append(row,ignore_index=True)
|
||||
mgmt.to_csv(friendlyName + '_TaggedEntities_' + strnow +'.csv',encoding='utf-8')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue