fix tenant resource list API

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-07-30 11:48:55 +08:00
parent b71ce47788
commit 13ffbe8968
2 changed files with 52 additions and 24 deletions

View File

@@ -130,6 +130,14 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
Doc("List the devops projects of the specified workspace for the current user").
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers/{workspacemember}/devops").
To(handler.ListDevOpsProjects).
Param(ws.PathParameter("workspace", "workspace name")).
Param(ws.PathParameter("workspacemember", "workspacemember username")).
Doc("List the devops projects of specified workspace for the workspace member").
Reads(corev1.Namespace{}).
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
ws.Route(ws.GET("/workspaces/{workspace}/namespaces/{namespace}").
To(handler.DescribeNamespace).
Param(ws.PathParameter("workspace", "workspace name")).
@@ -149,6 +157,14 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
Reads(corev1.Namespace{}).
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers/{workspacemember}/namespaces").
To(handler.ListNamespaces).
Param(ws.PathParameter("workspace", "workspace name")).
Param(ws.PathParameter("workspacemember", "workspacemember username")).
Doc("List the namespaces of the specified workspace for the workspace member").
Reads(corev1.Namespace{}).
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
ws.Route(ws.PUT("/workspaces/{workspace}/namespaces/{namespace}").
To(handler.UpdateNamespace).
Param(ws.PathParameter("workspace", "workspace name")).