From 263f07fe3012b7b899d7820c339676774d3b6592 Mon Sep 17 00:00:00 2001 From: LiHui Date: Thu, 11 Mar 2021 17:41:23 +0800 Subject: [PATCH] Fix: add router Signed-off-by: LiHui --- pkg/kapis/openpitrix/v1/register.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pkg/kapis/openpitrix/v1/register.go b/pkg/kapis/openpitrix/v1/register.go index 2c15a39db..80ddc5e9e 100644 --- a/pkg/kapis/openpitrix/v1/register.go +++ b/pkg/kapis/openpitrix/v1/register.go @@ -455,6 +455,21 @@ func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, DataFormat("limit=%d,page=%d"). DefaultValue("limit=10,page=1"))) + webservice.Route(webservice.GET("/workspaces/{workspace}/applications"). + To(handler.ListApplications). + Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}). + Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). + Doc("List all applications within the specified workspace"). + Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a"). + Required(false). + DataFormat("key=value,key~value"). + DefaultValue("")). + Param(webservice.PathParameter("workspace", "the workspace of the project.").Required(true)). + Param(webservice.QueryParameter(params.PagingParam, "paging query, e.g. limit=100,page=1"). + Required(false). + DataFormat("limit=%d,page=%d"). + DefaultValue("limit=10,page=1"))) + webservice.Route(webservice.GET("/workspaces/{workspace}/clusters/{cluster}/applications"). To(handler.ListApplications). Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}). @@ -464,7 +479,8 @@ func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, Required(false). DataFormat("key=value,key~value"). DefaultValue("")). - Param(webservice.PathParameter("namespace", "the name of the project.").Required(true)). + Param(webservice.PathParameter("workspace", "the workspace of the project.").Required(true)). + Param(webservice.PathParameter("cluster", "the cluster of the project.").Required(true)). Param(webservice.QueryParameter(params.PagingParam, "paging query, e.g. limit=100,page=1"). Required(false). DataFormat("limit=%d,page=%d"). @@ -479,7 +495,7 @@ func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, Required(false). DataFormat("key=value,key~value"). DefaultValue("")). - Param(webservice.PathParameter("namespace", "the name of the project.").Required(true)). + Param(webservice.PathParameter("cluster", "the cluster of the project.").Required(true)). Param(webservice.QueryParameter(params.PagingParam, "paging query, e.g. limit=100,page=1"). Required(false). DataFormat("limit=%d,page=%d"). @@ -494,6 +510,7 @@ func AddToContainer(c *restful.Container, ksInfomrers informers.InformerFactory, Required(false). DataFormat("key=value,key~value"). DefaultValue("")). + Param(webservice.PathParameter("workspace", "the workspace of the project.").Required(true)). Param(webservice.PathParameter("cluster", "the name of the cluster.").Required(true)). Param(webservice.PathParameter("namespace", "the name of the project").Required(true)). Param(webservice.QueryParameter(params.PagingParam, "paging query, e.g. limit=100,page=1").