summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/booking_communication_agent.py
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2017-09-22 11:48:38 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-09-22 11:48:38 -0700
commitaeb2791f4d3a5e23090e56c330436205a61629d7 (patch)
tree7b4918aba2421f2dc8cdac72f134e74acec92bee /tools/pharos-dashboard/booking_communication_agent.py
parent783a439ec2bd23ad969ffe7a3c6b7277f7a565c7 (diff)
Remove 'tools' Directory
All tools (and history) have been moved to the pharos-tools repository: https://git.opnfv.org/pharos-tools/ Change-Id: I84fa9b6ebd9b27f42d41f2722eb1221ec39a8c94 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'tools/pharos-dashboard/booking_communication_agent.py')
-rw-r--r--tools/pharos-dashboard/booking_communication_agent.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/tools/pharos-dashboard/booking_communication_agent.py b/tools/pharos-dashboard/booking_communication_agent.py
deleted file mode 100644
index c52e98bd..00000000
--- a/tools/pharos-dashboard/booking_communication_agent.py
+++ /dev/null
@@ -1,42 +0,0 @@
-from dashboard_notification.notification import Notification
-from dashboard_api.api import DashboardAPI
-
-CONFIG = {
- 'dashboard_ip': '127.0.0.1',
- 'dashboard_url': 'http://127.0.0.1',
- 'api_token': 'f33ff43c85ecb13f5d0632c05dbb0a7d85a5a8d1',
- 'user': 'opnfv',
- 'password': 'opnfvopnfv'
-}
-
-api = DashboardAPI(CONFIG['dashboard_url'], api_token=CONFIG['api_token'], verbose=True)
-
-
-def booking_start(message):
- content = message.content
- booking = api.get_booking(id=content['booking_id'])
-
- # do something here...
-
- # notify dashboard
- api.post_resource_status(resource_id=booking['resource_id'], type='info', title='pod setup',
- content='details')
-
-
-def booking_end(message):
- # do something here...
-
- # notify dashboard
- api.post_resource_status(resource_id=message.content['resource_id'], type='info',
- title='booking end', content='details')
-
-
-def main():
- with Notification(CONFIG['dashboard_ip'], CONFIG['user'], CONFIG['password']) as notification:
- notification.register(booking_start, 'Arm POD 2', 'booking_start')
- notification.register(booking_end, 'Arm POD 2', 'booking_end')
- notification.receive() # wait for notifications
-
-
-if __name__ == "__main__":
- main()