From 8970fffedfcb9d8b6df751a37bee3355a136c32b Mon Sep 17 00:00:00 2001 From: pengcong06 <924550750@qq.com> Date: Fri, 19 Jun 2020 14:33:35 +0800 Subject: [PATCH] feat: add api list application --- pkg/kapis/openpitrix/v1/register.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/kapis/openpitrix/v1/register.go b/pkg/kapis/openpitrix/v1/register.go index 107288129..3aeb3d2ce 100644 --- a/pkg/kapis/openpitrix/v1/register.go +++ b/pkg/kapis/openpitrix/v1/register.go @@ -57,6 +57,21 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op DataFormat("limit=%d,page=%d"). DefaultValue("limit=10,page=1"))) + webservice.Route(webservice.GET("/namespaces/{namespace}/applications"). + To(handler.ListApplications). + Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}). + Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). + Doc("List all applications within the specified namespace"). + 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("namespace", "the name 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("/clusters/{cluster}/applications"). To(handler.ListApplications). Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).