Skip to content

Commit

Permalink
api support lising resources for all namespaces
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
vladikr committed Jul 6, 2017
1 parent d1fb738 commit a096588
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/virt-api/rest/kubeproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ func GenericResourceProxy(ws *restful.WebService, ctx context.Context, gvr schem
To(endpoints.MakeGoRestfulWrapper(get)).Writes(objExample).Doc("test4"), ws,
))

ws.Route(addGetAllNamespacesListParams(
ws.GET(gvr.Resource).
Produces(mime.MIME_JSON, mime.MIME_YAML).
To(endpoints.MakeGoRestfulWrapper(getList)).Writes(listExample).Doc("test4"), ws,
))

ws.Route(
ws.PATCH(ResourcePath(gvr)).
Produces(mime.MIME_JSON_PATCH).
Expand Down Expand Up @@ -162,6 +168,12 @@ func addWatchGetListParams(builder *restful.RouteBuilder, ws *restful.WebService
Param(ws.QueryParameter("timeoutSeconds", "TimeoutSeconds for the list/watch call.").DataType("int"))
}

func addGetAllNamespacesListParams(builder *restful.RouteBuilder, ws *restful.WebService) *restful.RouteBuilder {
return builder.Param(fieldSelectorParam(ws)).Param(labelSelectorParam(ws)).
Param(ws.QueryParameter("resourceVersion", "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history.")).
Param(ws.QueryParameter("timeoutSeconds", "TimeoutSeconds for the list/watch call.").DataType("int"))
}

func addDeleteListParams(builder *restful.RouteBuilder, ws *restful.WebService) *restful.RouteBuilder {
return builder.Param(NameParam(ws)).Param(fieldSelectorParam(ws)).Param(labelSelectorParam(ws))
}
Expand Down

0 comments on commit a096588

Please sign in to comment.