{"id":13787414,"url":"https://github.com/cisco-en-programmability/dnacenter_reports_operations","last_synced_at":"2026-01-16T16:49:51.392Z","repository":{"id":98765175,"uuid":"373690761","full_name":"cisco-en-programmability/dnacenter_reports_operations","owner":"cisco-en-programmability","description":"Cisco DNA Center report operations - create and run a new client detail report, receive the webhooks status notifications and download the report when completed.","archived":false,"fork":false,"pushed_at":"2021-06-15T03:03:09.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T00:37:26.243Z","etag":null,"topics":["cisco","cisco-dna-center","flask","python","reports","rest-apis","webhook"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cisco-en-programmability.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-04T01:49:40.000Z","updated_at":"2023-11-11T01:55:27.000Z","dependencies_parsed_at":"2023-05-25T19:17:25.882Z","dependency_job_id":null,"html_url":"https://github.com/cisco-en-programmability/dnacenter_reports_operations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-en-programmability%2Fdnacenter_reports_operations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-en-programmability%2Fdnacenter_reports_operations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-en-programmability%2Fdnacenter_reports_operations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-en-programmability%2Fdnacenter_reports_operations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cisco-en-programmability","download_url":"https://codeload.github.com/cisco-en-programmability/dnacenter_reports_operations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253655801,"owners_count":21943068,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cisco","cisco-dna-center","flask","python","reports","rest-apis","webhook"],"created_at":"2024-08-03T20:00:34.114Z","updated_at":"2026-01-16T16:49:51.367Z","avatar_url":"https://github.com/cisco-en-programmability.png","language":"Python","funding_links":[],"categories":["Reports"],"sub_categories":[],"readme":"\n# Cisco DNA Center Report Operations\n\n\nThis repo is for an application that will create a new Cisco DNA Center Client Detail report, receive notifications when the report is in progress and completed. \nIt will download the report file from Cisco DNA Center using APIs.\n \nThis app is to be used only for demos or lab environments, it is not written for production. \n\nPlease follow these recommendations for production Flask deployments: https://flask.palletsprojects.com/en/1.1.x/deploying/.\n\n\n\n**Cisco Products \u0026 Services:**\n\n- Cisco DNA Center\n\n**Tools \u0026 Frameworks:**\n\n- Python environment to run the Flask App as a Webhook Receiver - \"report_receiver.py\"\n- Python environment to execute the application that will create and run the report - \"dnacenter_create_report.py\"\n\n**Usage**\n\nThe application \"dnacenter_create_report_download.py\" will identify:\n - report group id for the report category \"Client\"\n - report view id for the report \"Client Detail\"\n - the configured webhook id where to send the report status notifications\n - construct the payload required to create the new report\n - create a new report\n - identify when the report is starting execution\n - check when the execution completed successfully\n - download the report file and save to a file\n\nSample Output:\n```\n/Users/gzapodea/PythonCode/dnacenter_reports_operations/venv/bin/python /Users/gzapodea/PythonCode/dnacenter_reports_operations/dnacenter_create_report_download.py\n\nCreate Report App Run Start,  2021-06-14 19:54:50\n\nReport Category: Client\nReport View Group Id is: d7afe5c9-4941-4251-8bf5-0fb643e90847\nReport View Name: Client Detail\nReport View Id is: e8e66b17-4aeb-4857-af81-f472023bb05e\n\nClient Report Detail \n\n{\n    \"viewId\": \"e8e66b17-4aeb-4857-af81-f472023bb05e\", \n    \"viewName\": \"Client Detail\", \n    \"description\": \"This client report view provides detailed information about the list of clients that are seen in the network\", \n    \"viewInfo\": null, \n    \"schedules\": [\n        {\n            \"type\": \"SCHEDULE_NOW\", \n            \"default\": true\n        }, \n        {\n            \"type\": \"SCHEDULE_LATER\", \n            \"default\": false\n        }, \n        {\n            \"type\": \"SCHEDULE_RECURRENCE\", \n            \"default\": false\n        }\n    ], \n    \"deliveries\": [\n        {\n            \"type\": \"DOWNLOAD\", \n            \"default\": true\n        }, \n        {\n            \"type\": \"EMAIL\", \n            \"default\": false\n        }, \n        {\n            \"type\": \"WEBHOOK\", \n            \"default\": false\n        }\n    ], \n    \"formats\": [\n        {\n            \"name\": \"CSV\", \n            \"format\": \"CSV\", \n            \"template\": {\n                \"jsTemplateId\": \"BJYghfA3z\"\n            }, \n            \"default\": true\n        }, \n        {\n            \"name\": \"Tableau Data Extract\", \n            \"format\": \"TDE\", \n            \"template\": null, \n            \"default\": false\n        }, \n        {\n            \"name\": \"JSON\", \n            \"format\": \"JSON\", \n            \"template\": null, \n            \"default\": false\n        }\n    ], \n    ...\n}\n\nReport submitted\nReport id:  8ba4c05e-3d07-47d6-8761-0761783b30f9\n\nWait for report execution to start\n!!!!!!!!!!!!!!!\n\nReport execution started, wait for process to complete\n!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nReport execution completed\nReport execution id:  a9a82752-8b0c-451c-a03d-aec7c757b25f\n\nReport content:\n {'client_details': [], 'filters': [{'name': 'Location', 'displayName': 'Location', 'values': []}, {'name': 'DeviceType', 'displayName': 'Device Type', 'values': ['']}, {'name': 'SSID', 'displayName': 'SSID', 'values': []}, {'name': 'Band', 'displayName': 'Band', 'values': []}, {'name': 'startTime', 'displayName': 'Start Time', 'values': ['2021-06-14 02:55:17.581 AM UTC']}, {'name': 'endTime', 'displayName': 'End Time', 'values': ['2021-06-15 02:55:17.581 AM UTC']}]}\nClient report file saved\n\nCreate Report App Run End,  2021-06-14 19:55:48\n\nProcess finished with exit code 0\n\n```\n\n\nThe application \"dnacenter_create_report_webhook.py\" will identify:\n - report group id for the report category \"Client\"\n - report view id for the report \"Client Detail\"\n - the configured webhook id where to send the report status notifications\n - construct the payload required to create the new report\n - create a new report\n\nSample Output:\n```\n/Users/gzapodea/PythonCode/dnacenter_reports_operations/venv/bin/python /Users/gzapodea/PythonCode/dnacenter_reports_operations/dnacenter_create_report.py\n\nCreate Report App Run Start,  2021-06-03 17:58:25\n\nReport Category: Client\nReport View Group Id is: d7afe5c9-4941-4251-8bf5-0fb643e90847\nReport View Name: Client Detail\nReport View Id is: e8e66b17-4aeb-4857-af81-f472023bb05e\nWebhook Name: LinuxMint_Report\nWebhook Id: 8dcbeb87-420b-49f1-b813-a0c0046e3672 \n\n\nClient Report Detail \n\n{\n    \"viewId\": \"e8e66b17-4aeb-4857-af81-f472023bb05e\", \n    \"viewName\": \"Client Detail\", \n    \"description\": \"This client report view provides detailed information about the list of clients that are seen in the network\", \n    \"viewInfo\": null, \n    \"schedules\": [\n        {\n            \"type\": \"SCHEDULE_NOW\", \n            \"default\": true\n        }, \n        {\n            \"type\": \"SCHEDULE_LATER\", \n            \"default\": false\n        }, \n        {\n            \"type\": \"SCHEDULE_RECURRENCE\", \n            \"default\": false\n        }\n    ], \n    \"deliveries\": [\n        {\n            \"type\": \"DOWNLOAD\", \n            \"default\": true\n        }, \n        {\n            \"type\": \"EMAIL\", \n            \"default\": false\n        }, \n        {\n            \"type\": \"WEBHOOK\", \n            \"default\": false\n        }\n    ], \n    \"formats\": [\n        {\n            \"name\": \"CSV\", \n            \"format\": \"CSV\", \n            \"template\": {\n                \"jsTemplateId\": \"BJYghfA3z\"\n            }, \n            \"default\": true\n        }, \n        {\n            \"name\": \"Tableau Data Extract\", \n            \"format\": \"TDE\", \n            \"template\": null, \n            \"default\": false\n        }, \n        {\n            \"name\": \"JSON\", \n            \"format\": \"JSON\", \n            \"template\": null, \n            \"default\": false\n        }\n        ...\n    ]\n}\n\nReport submitted\n\nCreate Report App Run End,  2021-06-03 17:58:28\n\n```\n\nThe \"report_receiver.py\" will receive the Cisco DNA Center report notifications, download and save the report file when completed.\n\nSample Output:\n```\n\nWebhook Received\nPayload: \n{'Event Id': '7332787b-d727-48a1-baba-288385bdf6df', 'Event Timestamp': 1622765873532, 'Event Name': 'Report [Client Report Detail 24h] - In Progress', 'Event Type': 'APP', 'Cisco DNA Center Event Context link. **This link is active only in the context of Cisco DNA Center. You must have necessary permissions to login': 'https://10.93.141.35/data-sets-reports?report-tab=list\u0026list-tab=my-reports\u0026data-set-id=f8a68f72-aeaf-42ab-b665-f142a9335816', 'Event Details': {'name': 'Report [Client Report Detail 24h]', 'status': 'In Progress', 'status update @': 'Fri Jun 04 00:17:53 UTC 2021'}} \n\n173.36.240.173 - - [03/Jun/2021 17:17:56] \"POST /dnacenter_report HTTP/1.1\" 202 -\nWebhook Received\nPayload: \n{'Event Id': 'd717cec1-0b12-4c37-95fb-efb4603dfe27', 'Event Timestamp': 1622765900832, 'Event Name': 'Report [Client Report Detail 24h] - Success', 'Event Type': 'APP', 'Cisco DNA Center Event Context link. **This link is active only in the context of Cisco DNA Center. You must have necessary permissions to login': 'https://10.93.141.35/data-sets-reports?report-tab=list\u0026list-tab=my-reports\u0026data-set-id=f8a68f72-aeaf-42ab-b665-f142a9335816\u0026execution-id=f2ce8bed-1734-4652-9150-ab3aa013fae8', 'Event Details': {'name': 'Report [Client Report Detail 24h]', 'status': 'Success', 'status update @': 'Fri Jun 04 00:18:20 UTC 2021'}} \n\n\nReport Id:  f8a68f72-aeaf-42ab-b665-f142a9335816 \nExecution Id:  f2ce8bed-1734-4652-9150-ab3aa013fae8\n\nReport content:\n {'client_details': [], 'filters': [{'name': 'Location', 'displayName': 'Location', 'values': []}, {'name': 'DeviceType', 'displayName': 'Device Type', 'values': ['']}, {'name': 'SSID', 'displayName': 'SSID', 'values': []}, {'name': 'Band', 'displayName': 'Band', 'values': []}, {'name': 'startTime', 'displayName': 'Start Time', 'values': ['2021-06-03 00:17:54.022 AM UTC']}, {'name': 'endTime', 'displayName': 'End Time', 'values': ['2021-06-04 00:17:54.022 AM UTC']}]}\nClient report file saved\n```\n \nThis sample code is for proof of concepts and labs\n\n**License**\n\nThis project is licensed to you under the terms of the [Cisco Sample Code License](./LICENSE).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-en-programmability%2Fdnacenter_reports_operations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcisco-en-programmability%2Fdnacenter_reports_operations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-en-programmability%2Fdnacenter_reports_operations/lists"}