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 2274a84
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tendrl/commons/utils/monitoring_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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()

0 comments on commit 2274a84

Please sign in to comment.