From f328e909d7759f44bb6c14c0727363f636888499 Mon Sep 17 00:00:00 2001 From: zhu733756 Date: Thu, 2 Sep 2021 10:48:52 +0800 Subject: [PATCH] convert clusterdashboard to clusterdashboards. Signed-off-by: zhu733756 --- pkg/kapis/monitoring/v1alpha3/dashboard_template_test.sh | 2 +- pkg/kapis/monitoring/v1alpha3/register.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kapis/monitoring/v1alpha3/dashboard_template_test.sh b/pkg/kapis/monitoring/v1alpha3/dashboard_template_test.sh index 714d6b598..a144c21ab 100644 --- a/pkg/kapis/monitoring/v1alpha3/dashboard_template_test.sh +++ b/pkg/kapis/monitoring/v1alpha3/dashboard_template_test.sh @@ -1,3 +1,3 @@ #! /bin/bash -curl -d '{"grafanaDashboardUrl":"https://grafana.com/api/dashboards/7362/revisions/5/download", "description":"this is a test dashboard."}' -H "Content-Type: application/json" localhost:9090/kapis/monitoring.kubesphere.io/v1alpha3/clusterdashboard/test1/template \ No newline at end of file +curl -d '{"grafanaDashboardUrl":"https://grafana.com/api/dashboards/7362/revisions/5/download", "description":"this is a test dashboard."}' -H "Content-Type: application/json" localhost:9090/kapis/monitoring.kubesphere.io/v1alpha3/clusterdashboards/test1/template \ No newline at end of file diff --git a/pkg/kapis/monitoring/v1alpha3/register.go b/pkg/kapis/monitoring/v1alpha3/register.go index eeddf8664..4858ddb73 100644 --- a/pkg/kapis/monitoring/v1alpha3/register.go +++ b/pkg/kapis/monitoring/v1alpha3/register.go @@ -506,7 +506,7 @@ func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, monito Returns(http.StatusOK, respOK, monitoring.Metric{})). Produces(restful.MIME_JSON) - ws.Route(ws.POST("/clusterdashboard/{grafanaDashboardName}/template"). + ws.Route(ws.POST("/clusterdashboards/{grafanaDashboardName}/template"). To(h.handleGrafanaDashboardImport). Doc("Convert Grafana templates to KubeSphere clusterdashboards."). Param(ws.PathParameter("grafanaDashboardName", "The name of the Grafana template to be converted").DataType("string").Required(true)).