update api docs (#490)

* update api docs

Signed-off-by: hongming <talonwan@yunify.com>

* fix: kube-apiserver host in kubeconfig

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-06-21 11:47:29 +08:00
committed by GitHub
parent be61ed065b
commit 24d13e44f7
15 changed files with 98 additions and 87 deletions

View File

@@ -19,7 +19,6 @@ package v1alpha2
import (
"github.com/emicklei/go-restful"
"github.com/emicklei/go-restful-openapi"
"k8s.io/apimachinery/pkg/runtime/schema"
"kubesphere.io/kubesphere/pkg/apiserver/operations"
"kubesphere.io/kubesphere/pkg/apiserver/runtime"
@@ -38,20 +37,17 @@ var (
func addWebService(c *restful.Container) error {
tags := []string{"Operations"}
ok := "ok"
webservice := runtime.NewWebService(GroupVersion)
webservice.Route(webservice.POST("/nodes/{node}/drainage").
To(operations.DrainNode).
Metadata(restfulspec.KeyOpenAPITags, tags).
Doc("Drain node").
Param(webservice.PathParameter("node", "node name")).
Returns(http.StatusOK, ok, errors.Error{}))
webservice.Route(webservice.POST("/namespaces/{namespace}/jobs/{job}").
To(operations.RerunJob).
Metadata(restfulspec.KeyOpenAPITags, tags).
Doc("Job rerun").
Param(webservice.PathParameter("job", "job name")).
Param(webservice.PathParameter("namespace", "job's namespace")).