Skip to content

Commit

Permalink
Added utility to update dashboard with required details
Browse files Browse the repository at this point in the history
tendrl-bug-id: Tendrl/gluster-integration#385
Signed-off-by: Shubhendu <[email protected]>
  • Loading branch information
Shubhendu committed Aug 31, 2017
1 parent e04926c commit 6187c40
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tendrl/commons/utils/monitoring_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import uuid

from tendrl.commons.objects.job import Job


def update_dashboard(res_name, res_type, integration_id, action):
_job_id = str(uuid.uuid4())
_params = {
"TendrlContext.integration_id": NS.tendrl_context.integration_id,
"Trigger.resource_name": res_name,
"Trigger.resource_type": res_type,
"Trigger.action": action
}
_job_payload = {
"tags": ["tendrl/integration/monitoring"],
"run": "monitoring.flows.UpdateDashboard",
"status": "new",
"parameters": _params,
"type": "monitoring"
}
Job(
job_id=_job_id,
status="new",
payload=_job_payload
).save()

return _job_id

0 comments on commit 6187c40

Please sign in to comment.