From 6b3b0aa4f184865a0f6a8fe03d40647bb70606f7 Mon Sep 17 00:00:00 2001 From: soulseen Date: Wed, 15 May 2019 15:52:34 +0800 Subject: [PATCH 1/6] update jenkins log Signed-off-by: soulseen --- pkg/models/devops/devops.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/models/devops/devops.go b/pkg/models/devops/devops.go index 461d469a7..f91c5ef10 100644 --- a/pkg/models/devops/devops.go +++ b/pkg/models/devops/devops.go @@ -683,7 +683,6 @@ func sendJenkinsRequest(baseUrl string, req *http.Request) ([]byte, error) { defer resp.Body.Close() resBody, _ := getRespBody(resp) - log.Info(string(resBody)) if resp.StatusCode >= http.StatusBadRequest { jkerr := new(JkError) jkerr.Code = resp.StatusCode From d9cce21f051800bdcd7a70fc679bd0e69ad11a92 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 15 May 2019 15:53:28 +0800 Subject: [PATCH 2/6] add quota left to namespace quota --- pkg/apis/resources/v1alpha2/register.go | 1 + pkg/models/quotas/quotas.go | 83 ++++++++++++++++++------- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index 729fc2a42..0f0445917 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -180,6 +180,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/quotas"). To(quotas.GetClusterQuotas). + Deprecate(). Doc("get whole cluster's resource usage"). Writes(models.ResourceQuota{}). Metadata(restfulspec.KeyOpenAPITags, tags)) diff --git a/pkg/models/quotas/quotas.go b/pkg/models/quotas/quotas.go index b1cc20087..d85686a33 100644 --- a/pkg/models/quotas/quotas.go +++ b/pkg/models/quotas/quotas.go @@ -37,18 +37,33 @@ const ( servicesKey = "count/services" statefulsetsKey = "count/statefulsets.apps" persistentvolumeclaimsKey = "persistentvolumeclaims" - storageClassesKey = "count/storageClass" - namespaceKey = "count/namespace" jobsKey = "count/jobs.batch" cronJobsKey = "count/cronjobs.batch" ) +type NamespacedResourceQuota struct { + Namespace string `json:"namespace,omitempty"` + + Data struct { + v1.ResourceQuotaStatus + + // quota left status, do the math on the side, cause it's + // a lot easier with go-client library + Left v1.ResourceList `json:"left,omitempty"` + } `json:"data,omitempty"` +} + var ( - resourceMap = map[string]string{daemonsetsKey: resources.DaemonSets, deploymentsKey: resources.Deployments, - ingressKey: resources.Ingresses, servicesKey: resources.Services, - statefulsetsKey: resources.StatefulSets, persistentvolumeclaimsKey: resources.PersistentVolumeClaims, podsKey: resources.Pods, - namespaceKey: resources.Namespaces, storageClassesKey: resources.StorageClasses, - jobsKey: resources.Jobs, cronJobsKey: resources.CronJobs} + resourceMap = map[string]string{ + daemonsetsKey: resources.DaemonSets, + deploymentsKey: resources.Deployments, + ingressKey: resources.Ingresses, + servicesKey: resources.Services, + statefulsetsKey: resources.StatefulSets, + persistentvolumeclaimsKey: resources.PersistentVolumeClaims, + podsKey: resources.Pods, + jobsKey: resources.Jobs, + cronJobsKey: resources.CronJobs} ) func getUsage(namespace, resource string) (int, error) { @@ -61,12 +76,14 @@ func getUsage(namespace, resource string) (int, error) { } if err != nil { + glog.Error(err) return 0, err } return result.TotalCount, nil } +// no one use this api anymore, marked as deprecated func GetClusterQuotas() (*models.ResourceQuota, error) { quota := v1.ResourceQuotaStatus{Hard: make(v1.ResourceList), Used: make(v1.ResourceList)} @@ -85,7 +102,7 @@ func GetClusterQuotas() (*models.ResourceQuota, error) { } -func GetNamespaceQuotas(namespace string) (*models.ResourceQuota, error) { +func GetNamespaceQuotas(namespace string) (*NamespacedResourceQuota, error) { quota, err := getNamespaceResourceQuota(namespace) if err != nil { glog.Error(err) @@ -95,23 +112,43 @@ func GetNamespaceQuotas(namespace string) (*models.ResourceQuota, error) { quota = &v1.ResourceQuotaStatus{Hard: make(v1.ResourceList), Used: make(v1.ResourceList)} } - for k, v := range resourceMap { - if _, exist := quota.Used[v1.ResourceName(k)]; !exist { - if k == namespaceKey || k == storageClassesKey { - continue + var resourceQuotaLeft = v1.ResourceList{} + + for key, hardLimit := range quota.Hard { + if used, ok := quota.Used[key]; ok { + left := hardLimit.DeepCopy() + left.Sub(used) + if hardLimit.Cmp(used) < 0 { + left = resource.MustParse("0") } - used, err := getUsage(namespace, v) - if err != nil { - return nil, err - } - var quantity resource.Quantity - quantity.Set(int64(used)) - quota.Used[v1.ResourceName(k)] = quantity + resourceQuotaLeft[key] = left } } - return &models.ResourceQuota{Namespace: namespace, Data: *quota}, nil + // add extra quota usage, cause user may not specify them + for key, val := range resourceMap { + // only add them when they don't exist in quotastatus + if _, ok := quota.Used[v1.ResourceName(key)]; !ok { + used, err := getUsage(namespace, val) + if err != nil { + glog.Error(err) + return nil, err + } + + quota.Used[v1.ResourceName(key)] = *(resource.NewQuantity(int64(used), resource.DecimalSI)) + } + } + + var result = NamespacedResourceQuota{ + Namespace: namespace, + } + result.Data.Hard = quota.Hard + result.Data.Used = quota.Used + result.Data.Left = resourceQuotaLeft + + return &result, nil + } func updateNamespaceQuota(tmpResourceList, resourceList v1.ResourceList) { @@ -127,14 +164,16 @@ func updateNamespaceQuota(tmpResourceList, resourceList v1.ResourceList) { tmpResourceList[res] = usage } } - } func getNamespaceResourceQuota(namespace string) (*v1.ResourceQuotaStatus, error) { resourceQuotaLister := informers.SharedInformerFactory().Core().V1().ResourceQuotas().Lister() quotaList, err := resourceQuotaLister.ResourceQuotas(namespace).List(labels.Everything()) - if err != nil || len(quotaList) == 0 { + if err != nil { + glog.Error(err) return nil, err + } else if len(quotaList) == 0 { + return nil, nil } quotaStatus := v1.ResourceQuotaStatus{Hard: make(v1.ResourceList), Used: make(v1.ResourceList)} From 2259924e17c0eb6ca78dbf5008ce28ad84c9ed36 Mon Sep 17 00:00:00 2001 From: runzexia Date: Mon, 13 May 2019 17:56:39 +0800 Subject: [PATCH 3/6] delete all devops project when delete ws Signed-off-by: runzexia --- .../workspace/workspace_controller.go | 39 ++++++++++ pkg/models/devops/project.go | 5 ++ .../client/kubesphere/kubesphereclient.go | 72 ++++++++++++++++++- 3 files changed, 115 insertions(+), 1 deletion(-) diff --git a/pkg/controller/workspace/workspace_controller.go b/pkg/controller/workspace/workspace_controller.go index 72d3a5ee0..b1f6dff19 100644 --- a/pkg/controller/workspace/workspace_controller.go +++ b/pkg/controller/workspace/workspace_controller.go @@ -43,6 +43,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" "sigs.k8s.io/controller-runtime/pkg/source" + "sync" ) const ( @@ -137,6 +138,10 @@ func (r *ReconcileWorkspace) Reconcile(request reconcile.Request) (reconcile.Res return reconcile.Result{}, err } + if err := r.deleteDevOpsProjects(instance); err != nil { + return reconcile.Result{}, err + } + // remove our finalizer from the list and update it. instance.ObjectMeta.Finalizers = sliceutil.RemoveString(instance.ObjectMeta.Finalizers, func(item string) bool { return item == finalizer @@ -327,6 +332,40 @@ func (r *ReconcileWorkspace) deleteGroup(instance *tenantv1alpha1.Workspace) err return nil } +func (r *ReconcileWorkspace) deleteDevOpsProjects(instance *tenantv1alpha1.Workspace) error { + var wg sync.WaitGroup + + log.Info("Delete DevOps Projects") + for { + errChan := make(chan error, 10) + projects, err := r.ksclient.ListWorkspaceDevOpsProjects(instance.Name) + if err != nil { + log.Error(err, "Failed to Get Workspace's DevOps Projects", "ws", instance.Name) + return err + } + if projects.TotalCount == 0 { + return nil + } + for _, project := range projects.Items { + wg.Add(1) + go func(workspace, devops string) { + err := r.ksclient.DeleteWorkspaceDevOpsProjects(workspace, devops) + errChan <- err + wg.Done() + }(instance.Name, project.ProjectId) + } + wg.Wait() + close(errChan) + for err := range errChan { + if err != nil { + log.Error(err, "delete devops project error") + return err + } + } + + } +} + func (r *ReconcileWorkspace) createWorkspaceRoleBindings(instance *tenantv1alpha1.Workspace) error { adminRoleBinding := &rbac.ClusterRoleBinding{} diff --git a/pkg/models/devops/project.go b/pkg/models/devops/project.go index e62271499..37111f3e5 100644 --- a/pkg/models/devops/project.go +++ b/pkg/models/devops/project.go @@ -31,6 +31,11 @@ const ( DevOpsProjectCreateTimeColumn = "project.create_time" ) +type PageableDevOpsProject struct { + Items []*DevOpsProject `json:"items"` + TotalCount int `json:"total_count"` +} + type DevOpsProject struct { ProjectId string `json:"project_id" db:"project_id"` Name string `json:"name"` diff --git a/pkg/simple/client/kubesphere/kubesphereclient.go b/pkg/simple/client/kubesphere/kubesphereclient.go index f7040e2da..f5880525a 100644 --- a/pkg/simple/client/kubesphere/kubesphereclient.go +++ b/pkg/simple/client/kubesphere/kubesphereclient.go @@ -23,7 +23,9 @@ import ( "flag" "fmt" "io/ioutil" + "kubesphere.io/kubesphere/pkg/constants" "kubesphere.io/kubesphere/pkg/models" + "kubesphere.io/kubesphere/pkg/models/devops" "log" "net/http" "strings" @@ -32,7 +34,7 @@ import ( var ( accountAPIServer string - devopsAPIServer string + ksAPIServer string once sync.Once c client ) @@ -43,6 +45,8 @@ type Interface interface { DescribeGroup(name string) (*models.Group, error) DeleteGroup(name string) error ListUsers() (*models.PageableResponse, error) + ListWorkspaceDevOpsProjects(workspace string) (*devops.PageableDevOpsProject, error) + DeleteWorkspaceDevOpsProjects(workspace, devops string) error } type client struct { @@ -51,6 +55,7 @@ type client struct { func init() { flag.StringVar(&accountAPIServer, "ks-account-api-server", "http://ks-account.kubesphere-system.svc", "kubesphere account api server") + flag.StringVar(&ksAPIServer, "ks-api-server", "http://ks-apiserver.kubesphere-system.svc", "kubesphere api server") } func Client() Interface { @@ -248,6 +253,71 @@ func (c client) ListUsers() (*models.PageableResponse, error) { return &result, nil } +func (c client) ListWorkspaceDevOpsProjects(workspace string) (*devops.PageableDevOpsProject, error) { + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/kapis/tenant.kubesphere.io/v1alpha2/workspaces/%s/devops", ksAPIServer, workspace), nil) + + if err != nil { + return nil, err + } + req.Header.Add(constants.UserNameHeader, constants.AdminUserName) + if err != nil { + return nil, err + } + log.Println(req.Method, req.URL) + resp, err := c.client.Do(req) + + if err != nil { + return nil, err + } + defer resp.Body.Close() + data, err := ioutil.ReadAll(resp.Body) + + if err != nil { + return nil, err + } + if resp.StatusCode > http.StatusOK { + return nil, Error{resp.StatusCode, string(data)} + } + + var result devops.PageableDevOpsProject + err = json.Unmarshal(data, &result) + + if err != nil { + return nil, err + } + return &result, nil + +} + +func (c client) DeleteWorkspaceDevOpsProjects(workspace, devops string) error { + req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("%s/kapis/tenant.kubesphere.io/v1alpha2/workspaces/%s/devops/%s", ksAPIServer, workspace, devops), nil) + + if err != nil { + return err + } + req.Header.Add(constants.UserNameHeader, constants.AdminUserName) + if err != nil { + return err + } + log.Println(req.Method, req.URL) + resp, err := c.client.Do(req) + + if err != nil { + return err + } + defer resp.Body.Close() + data, err := ioutil.ReadAll(resp.Body) + + if err != nil { + return err + } + if resp.StatusCode > http.StatusOK { + return Error{resp.StatusCode, string(data)} + } + + return nil +} + func IsNotFound(err error) bool { if e, ok := err.(Error); ok { if e.status == http.StatusNotFound { From dae04e2ad34ac4869f08d2902103f9a67c8ba307 Mon Sep 17 00:00:00 2001 From: runzexia Date: Wed, 15 May 2019 17:09:07 +0800 Subject: [PATCH 4/6] update Signed-off-by: runzexia --- .../client/kubesphere/kubesphereclient.go | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkg/simple/client/kubesphere/kubesphereclient.go b/pkg/simple/client/kubesphere/kubesphereclient.go index f5880525a..e5e6c9867 100644 --- a/pkg/simple/client/kubesphere/kubesphereclient.go +++ b/pkg/simple/client/kubesphere/kubesphereclient.go @@ -22,6 +22,7 @@ import ( "encoding/json" "flag" "fmt" + "github.com/golang/glog" "io/ioutil" "kubesphere.io/kubesphere/pkg/constants" "kubesphere.io/kubesphere/pkg/models" @@ -257,25 +258,28 @@ func (c client) ListWorkspaceDevOpsProjects(workspace string) (*devops.PageableD req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/kapis/tenant.kubesphere.io/v1alpha2/workspaces/%s/devops", ksAPIServer, workspace), nil) if err != nil { + glog.Error(err) return nil, err } + req.Header.Add(constants.UserNameHeader, constants.AdminUserName) - if err != nil { - return nil, err - } - log.Println(req.Method, req.URL) + + glog.Info(req.Method, req.URL) resp, err := c.client.Do(req) if err != nil { + glog.Error(err) return nil, err } defer resp.Body.Close() data, err := ioutil.ReadAll(resp.Body) if err != nil { + glog.Error(err) return nil, err } if resp.StatusCode > http.StatusOK { + glog.Error(req.Method, req.URL, resp.StatusCode, string(data)) return nil, Error{resp.StatusCode, string(data)} } @@ -283,6 +287,7 @@ func (c client) ListWorkspaceDevOpsProjects(workspace string) (*devops.PageableD err = json.Unmarshal(data, &result) if err != nil { + glog.Error(err) return nil, err } return &result, nil @@ -293,25 +298,27 @@ func (c client) DeleteWorkspaceDevOpsProjects(workspace, devops string) error { req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("%s/kapis/tenant.kubesphere.io/v1alpha2/workspaces/%s/devops/%s", ksAPIServer, workspace, devops), nil) if err != nil { + glog.Error(err) return err } req.Header.Add(constants.UserNameHeader, constants.AdminUserName) - if err != nil { - return err - } - log.Println(req.Method, req.URL) + + glog.Info(req.Method, req.URL) resp, err := c.client.Do(req) if err != nil { + glog.Error(err) return err } defer resp.Body.Close() data, err := ioutil.ReadAll(resp.Body) if err != nil { + glog.Error(err) return err } if resp.StatusCode > http.StatusOK { + glog.Error(req.Method, req.URL, resp.StatusCode, string(data)) return Error{resp.StatusCode, string(data)} } From 2b427b8e685222994b25598f2892936b0535ce94 Mon Sep 17 00:00:00 2001 From: soulseen Date: Wed, 15 May 2019 20:49:10 +0800 Subject: [PATCH 5/6] update jenkins api doc Signed-off-by: soulseen --- pkg/apis/devops/v1alpha2/register.go | 322 +++++++++++++-------------- 1 file changed, 161 insertions(+), 161 deletions(-) diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index 3d00249e7..e9db0ce7c 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -134,7 +134,7 @@ func addWebService(c *restful.Container) error { To(devopsapi.UpdateDevOpsProjectPipelineHandler). Doc("update devops project pipeline"). Param(webservice.PathParameter("devops", "devops project's Id")). - Param(webservice.PathParameter("pipelines", "pipeline name")). + Param(webservice.PathParameter("pipelines", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Metadata(restfulspec.KeyOpenAPITags, tags). Returns(http.StatusOK, RespOK, devops.ProjectPipeline{}). Writes(devops.ProjectPipeline{}). @@ -145,7 +145,7 @@ func addWebService(c *restful.Container) error { Doc("get devops project pipeline config"). Metadata(restfulspec.KeyOpenAPITags, tags). Param(webservice.PathParameter("devops", "devops project's Id")). - Param(webservice.PathParameter("pipelines", "pipeline name")). + Param(webservice.PathParameter("pipelines", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Returns(http.StatusOK, RespOK, devops.ProjectPipeline{}). Writes(devops.ProjectPipeline{})) @@ -154,7 +154,7 @@ func addWebService(c *restful.Container) error { Doc("get devops project pipeline sonarStatus"). Metadata(restfulspec.KeyOpenAPITags, tags). Param(webservice.PathParameter("devops", "devops project's Id")). - Param(webservice.PathParameter("pipelines", "pipeline name")). + Param(webservice.PathParameter("pipelines", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Returns(http.StatusOK, RespOK, []devops.SonarStatus{}). Writes([]devops.SonarStatus{})) @@ -163,7 +163,7 @@ func addWebService(c *restful.Container) error { Doc("get devops project pipeline sonarStatus"). Metadata(restfulspec.KeyOpenAPITags, tags). Param(webservice.PathParameter("devops", "devops project's Id")). - Param(webservice.PathParameter("pipelines", "pipeline name")). + Param(webservice.PathParameter("pipelines", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branches", "branch name")). Returns(http.StatusOK, RespOK, []devops.SonarStatus{}). Writes([]devops.SonarStatus{})) @@ -173,7 +173,7 @@ func addWebService(c *restful.Container) error { Doc("delete devops project pipeline"). Metadata(restfulspec.KeyOpenAPITags, tags). Param(webservice.PathParameter("devops", "devops project's Id")). - Param(webservice.PathParameter("pipelines", "pipeline name"))) + Param(webservice.PathParameter("pipelines", "the name of pipeline, which helps to deliver continuous integration continuous deployment."))) webservice.Route(webservice.POST("/devops/{devops}/credentials"). To(devopsapi.CreateDevOpsProjectCredentialHandler). @@ -223,8 +223,8 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get DevOps Pipelines."). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("projectName", "devops project name")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). Returns(http.StatusOK, RespOK, devops.Pipeline{}). Writes(devops.Pipeline{})) @@ -233,16 +233,16 @@ func addWebService(c *restful.Container) error { To(devopsapi.SearchPipelines). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Search DevOps resource."). - Param(webservice.QueryParameter("q", "query pipelines"). + Param(webservice.QueryParameter("q", "query pipelines, condition for filtering."). Required(false). DataFormat("q=%s")). - Param(webservice.QueryParameter("filter", "filter resource"). + Param(webservice.QueryParameter("filter", "Condition for filteringfilter folders or not.."). Required(false). DataFormat("filter=%s")). - Param(webservice.QueryParameter("start", "start page"). + Param(webservice.QueryParameter("start", "the count of item start."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.Pipeline{}). @@ -253,15 +253,15 @@ func addWebService(c *restful.Container) error { To(devopsapi.SearchPipelineRuns). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Search DevOps Pipelines runs in branch."). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.QueryParameter("start", "start page"). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d")). - Param(webservice.QueryParameter("branch", "branch "). + Param(webservice.QueryParameter("branch", "the name of branch, same as repository brnach, will be filter by branch."). Required(false). DataFormat("branch=%s")). Returns(http.StatusOK, RespOK, []devops.BranchPipelineRun{}). @@ -272,11 +272,11 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetBranchPipelineRun). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get DevOps Pipelines run in branch."). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("start", "start"). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(false). DataFormat("start=%d")). Returns(http.StatusOK, RespOK, devops.BranchPipelineRun{}). @@ -287,11 +287,11 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetPipelineRunNodesbyBranch). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get node on DevOps Pipelines run."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("limit", "limit"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d"). DefaultValue("limit=10000")). @@ -304,13 +304,13 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipelines step log."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.PathParameter("nodeId", "pipeline runs node id")). - Param(webservice.PathParameter("stepId", "pipeline runs step id")). - Param(webservice.QueryParameter("start", "start"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.PathParameter("stepId", "pipeline step id, the one step in pipeline.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -321,12 +321,12 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipelines step log."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.PathParameter("nodeId", "pipeline runs node id")). - Param(webservice.PathParameter("stepId", "pipeline runs step id")). - Param(webservice.QueryParameter("start", "start"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.PathParameter("stepId", "pipeline step id, the one step in pipeline.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -336,7 +336,7 @@ func addWebService(c *restful.Container) error { To(devopsapi.Validate). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Validate Github personal access token."). - Param(webservice.PathParameter("scmId", "SCM id")). + Param(webservice.PathParameter("scmId", "the id of SCM.")). Returns(http.StatusOK, RespOK, devops.Validates{}). Writes(devops.Validates{})) @@ -345,8 +345,8 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetSCMOrg). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("List organizations of SCM"). - Param(webservice.PathParameter("scmId", "SCM id")). - Param(webservice.QueryParameter("credentialId", "credential id for SCM"). + Param(webservice.PathParameter("scmId", "the id of SCM.")). + Param(webservice.QueryParameter("credentialId", "credential id for SCM."). Required(true). DataFormat("credentialId=%s")). Returns(http.StatusOK, RespOK, []devops.SCMOrg{}). @@ -358,14 +358,14 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get SCM repositories in an organization"). Param(webservice.PathParameter("scmId", "SCM id")). - Param(webservice.PathParameter("organizationId", "organization Id, such as github username")). - Param(webservice.QueryParameter("credentialId", "credential id for SCM"). + Param(webservice.PathParameter("organizationId", "organization Id, such as github username.")). + Param(webservice.QueryParameter("credentialId", "credential id for SCM."). Required(true). DataFormat("credentialId=%s")). - Param(webservice.QueryParameter("pageNumber", "page number"). + Param(webservice.QueryParameter("pageNumber", "the number of page."). Required(true). DataFormat("pageNumber=%d")). - Param(webservice.QueryParameter("pageSize", "page size"). + Param(webservice.QueryParameter("pageSize", "the size of page."). Required(true). DataFormat("pageSize=%d")). Returns(http.StatusOK, RespOK, []devops.OrgRepo{}). @@ -376,15 +376,15 @@ func addWebService(c *restful.Container) error { To(devopsapi.StopBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Stop pipeline in running"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("blocking", "stop and between each retries will sleep"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("blocking", "stop and between each retries will sleep."). Required(false). DataFormat("blocking=%t"). DefaultValue("blocking=false")). - Param(webservice.QueryParameter("timeOutInSecs", "the time of stop and between each retries sleep"). + Param(webservice.QueryParameter("timeOutInSecs", "the time of stop and between each retries sleep."). Required(false). DataFormat("timeOutInSecs=%d"). DefaultValue("timeOutInSecs=10")). @@ -396,14 +396,14 @@ func addWebService(c *restful.Container) error { To(devopsapi.StopPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Stop pipeline in running"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("blocking", "stop and between each retries will sleep"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("blocking", "stop and between each retries will sleep."). Required(false). DataFormat("blocking=%t"). DefaultValue("blocking=false")). - Param(webservice.QueryParameter("timeOutInSecs", "the time of stop and between each retries sleep"). + Param(webservice.QueryParameter("timeOutInSecs", "the time of stop and between each retries sleep."). Required(false). DataFormat("timeOutInSecs=%d"). DefaultValue("timeOutInSecs=10")). @@ -415,10 +415,10 @@ func addWebService(c *restful.Container) error { To(devopsapi.ReplayBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Replay pipeline"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). Returns(http.StatusOK, RespOK, devops.ReplayPipe{}). Writes(devops.ReplayPipe{})) @@ -427,9 +427,9 @@ func addWebService(c *restful.Container) error { To(devopsapi.ReplayPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Replay pipeline"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). Returns(http.StatusOK, RespOK, devops.ReplayPipe{}). Writes(devops.ReplayPipe{})) @@ -439,11 +439,11 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get Pipelines run log."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("start", "start"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -454,10 +454,10 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get Pipelines run log."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("start", "start"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -467,14 +467,14 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetBranchArtifacts). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipeline artifacts."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("start", "start page"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, "The filed of \"Url\" in response can download artifacts", []devops.Artifacts{}). @@ -485,13 +485,13 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetArtifacts). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipeline artifacts."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("start", "start page"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("start", "the count of item start."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, "The filed of \"Url\" in response can download artifacts", []devops.Artifacts{}). @@ -502,15 +502,15 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetPipeBranch). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipeline of branch."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.QueryParameter("filter", "filter remote"). Required(true). DataFormat("filter=%s")). - Param(webservice.QueryParameter("start", "start"). + Param(webservice.QueryParameter("start", "the count of item start."). Required(true). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.PipeBranch{}). @@ -523,12 +523,12 @@ func addWebService(c *restful.Container) error { Doc("Pauses pipeline execution and allows the user to interact and control the flow of the build."). Reads(devops.CheckPlayload{}). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.PathParameter("nodeId", "pipeline node id")). - Param(webservice.PathParameter("stepId", "pipeline step id"))) + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.PathParameter("stepId", "pipeline step id, the one step in pipeline."))) // match /blue/rest/organizations/jenkins/pipelines/{projectName}/pipelines/{pipelineName}/runs/{runId}/nodes/{nodeId}/steps/{stepId} webservice.Route(webservice.POST("/devops/{projectName}/pipelines/{pipelineName}/runs/{runId}/nodes/{nodeId}/steps/{stepId}"). @@ -537,10 +537,10 @@ func addWebService(c *restful.Container) error { Doc("Pauses pipeline execution and allows the user to interact and control the flow of the build."). Reads(devops.CheckPlayload{}). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.PathParameter("nodeId", "pipeline node id")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). Param(webservice.PathParameter("stepId", "pipeline step id"))) // match /job/project-8QnvykoJw4wZ/job/test-1/indexing/consoleText @@ -549,8 +549,8 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get index console log."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name"))) + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment."))) // match /job/{projectName}/job/{pipelineName}/build?delay=0 webservice.Route(webservice.POST("/devops/{projectName}/pipelines/{pipelineName}/scan"). @@ -558,10 +558,10 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Start a build."). Produces("text/html; charset=utf-8"). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.QueryParameter("delay", "delay time"). - Required(true). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.QueryParameter("delay", "will be delay time to scan."). + Required(false). DataFormat("delay=%d"))) // match /blue/rest/organizations/jenkins/pipelines/{projectName}/{pipelineName}/branches/{}/runs/ @@ -570,9 +570,9 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Run pipeline."). Reads(devops.RunPayload{}). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). Returns(http.StatusOK, RespOK, devops.QueuedBlueRun{}). Writes(devops.QueuedBlueRun{})) @@ -582,8 +582,8 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Run pipeline."). Reads(devops.RunPayload{}). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Returns(http.StatusOK, RespOK, devops.QueuedBlueRun{}). Writes(devops.QueuedBlueRun{})) @@ -592,12 +592,12 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetBranchStepsStatus). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipeline steps status."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline run name")). - Param(webservice.PathParameter("nodeId", "pipeline node id")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.QueuedBlueRun{}). @@ -608,11 +608,11 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetStepsStatus). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get pipeline steps status."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline run name")). - Param(webservice.PathParameter("nodeId", "pipeline node id")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.QueuedBlueRun{}). @@ -622,7 +622,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/crumbissuer"). To(devopsapi.GetCrumb). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get crumb"). + Doc("Get crumb issuer."). Returns(http.StatusOK, RespOK, devops.Crumb{}). Writes(devops.Crumb{})) @@ -643,7 +643,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Produces("application/json", "charset=utf-8"). Doc("Check cron script compile."). - Param(webservice.QueryParameter("value", "cpec value"). + Param(webservice.QueryParameter("value", "string of cron script."). Required(true). DataFormat("value=%s")). Returns(http.StatusOK, RespOK, []devops.QueuedBlueRun{}). @@ -655,9 +655,9 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetPipelineRun). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get run pipeline in project."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline run id")). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). Returns(http.StatusOK, RespOK, devops.PipelineRun{}). Writes(devops.PipelineRun{})) @@ -665,10 +665,10 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{projectName}/pipelines/{pipelineName}/branches/{branchName}"). To(devopsapi.GetBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get Pipeline run in branch."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). + Doc("Get Pipeline run by branch."). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach")). Returns(http.StatusOK, RespOK, devops.BranchPipeline{}). Writes(devops.BranchPipeline{})) @@ -677,10 +677,10 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetPipelineRunNodes). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get Pipeline run nodes."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline run id")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build")). + Param(webservice.QueryParameter("limit", "the count of item limit"). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.PipelineRunNodes{}). @@ -690,13 +690,13 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{projectName}/pipelines/{pipelineName}/branches/{branchName}/runs/{runId}/nodes/{nodeId}/steps"). To(devopsapi.GetBranchNodeSteps). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get steps in node."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline run id")). - Param(webservice.PathParameter("nodeId", "pipeline node id")). - Param(webservice.QueryParameter("limit", "limit count"). + Doc("Get steps in node by branch."). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodeSteps{}). @@ -707,11 +707,11 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetNodeSteps). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get steps in node."). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("runId", "pipeline run id")). - Param(webservice.PathParameter("nodeId", "pipeline node id")). - Param(webservice.QueryParameter("limit", "limit count"). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build")). + Param(webservice.PathParameter("nodeId", "pipeline node id, the one node in pipeline.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodeSteps{}). @@ -723,7 +723,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Consumes("application/x-www-form-urlencoded"). Produces("application/json", "charset=utf-8"). - Doc("Json to Jenkinsfile."). + Doc("Convert json to jenkinsfile format."). Reads(devops.ReqJson{}). Returns(http.StatusOK, RespOK, devops.NodeSteps{}). Writes(devops.ResJenkinsfile{})) @@ -734,7 +734,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Consumes("application/x-www-form-urlencoded"). Produces("application/json", "charset=utf-8"). - Doc("Jenkinsfile to Json."). + Doc("Convert jenkinsfile to json format."). Reads(devops.ReqJenkinsfile{}). Returns(http.StatusOK, RespOK, devops.ResJson{}). Writes(devops.ResJson{})) @@ -743,7 +743,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/notifycommit"). To(devopsapi.GetNotifyCommit). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get Notify Commit by GET HTTP method."). + Doc("Get notify commit by GET HTTP method."). Produces("text/plain; charset=utf-8"). Param(webservice.QueryParameter("url", "the url for webhook to push."). Required(true). @@ -753,7 +753,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/notifycommit"). To(devopsapi.GetNotifyCommit). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get Notify Commit by POST HTTP method."). + Doc("Get notify commit by POST HTTP method."). Consumes("application/json"). Produces("text/plain; charset=utf-8"). Param(webservice.QueryParameter("url", "the url for webhook to push."). @@ -769,12 +769,12 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{projectName}/pipelines/{pipelineName}/branches/{branchName}/runs/{runId}/nodesdetail"). To(devopsapi.GetBranchNodesDetail). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get pipeline nodes stages detail"). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("limit", "limit count"). + Doc("Gives steps details inside a pipeline node by branch. For a Stage, the steps will include all the steps defined inside the stage."). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodesDetail{}). @@ -784,12 +784,12 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{projectName}/pipelines/{pipelineName}/runs/{runId}/nodesdetail"). To(devopsapi.GetNodesDetail). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get pipeline nodes stages detail"). - Param(webservice.PathParameter("pipelineName", "pipeline name")). - Param(webservice.PathParameter("projectName", "devops project name")). - Param(webservice.PathParameter("branchName", "pipeline branch name")). - Param(webservice.PathParameter("runId", "pipeline runs id")). - Param(webservice.QueryParameter("limit", "limit count"). + Doc("Gives steps details inside a pipeline node. For a Stage, the steps will include all the steps defined inside the stage."). + Param(webservice.PathParameter("projectName", "the name of devops project, the project set of software development practices that combines software development (Dev) and information technology operations (Ops) to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.")). + Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("branchName", "the name of branch, same as repository brnach.")). + Param(webservice.PathParameter("runId", "pipeline run id, the unique id for a pipeline once build.")). + Param(webservice.QueryParameter("limit", "the count of item limit."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodesDetail{}). From 8fe88f23b7f30d3d1ec5a7f091333d567a0cb255 Mon Sep 17 00:00:00 2001 From: soulseen Date: Wed, 5 Jun 2019 21:55:59 +0800 Subject: [PATCH 6/6] update devops api doc Signed-off-by: soulseen --- pkg/models/devops/json.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/models/devops/json.go b/pkg/models/devops/json.go index 8c14c3313..6c6c72bce 100644 --- a/pkg/models/devops/json.go +++ b/pkg/models/devops/json.go @@ -226,7 +226,7 @@ type BranchPipelineRunNodes struct { URLName string `json:"urlName,omitempty"` } `json:"actions,omitempty" description:"references the reachable path to this resource"` DisplayDescription interface{} `json:"displayDescription,omitempty" description:"display description"` - DisplayName string `json:"displayName,omitempty",description:"display name"` + DisplayName string `json:"displayName,omitempty" description:"display name"` DurationInMillis int `json:"durationInMillis,omitempty" description:"duration time in millis"` ID string `json:"id,omitempty" description:"id"` Input interface{} `json:"input,omitempty" description:"input"`