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)).