From 0d07e3ca6845dab57a53d8512c6903b236f248b4 Mon Sep 17 00:00:00 2001 From: Ray Zhou Date: Thu, 27 Jun 2019 18:53:36 +0800 Subject: [PATCH 1/6] Update components API doc. --- pkg/apis/resources/v1alpha2/register.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index c78ca754c..bd4dd0c94 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -187,18 +187,18 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/components"). To(components.GetComponents). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc(""). + Doc("List the system components."). Returns(http.StatusOK, ok, map[string]models.Component{})) webservice.Route(webservice.GET("/components/{component}"). To(components.GetComponentStatus). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc(""). + Doc("Describe the specified system component."). Param(webservice.PathParameter("component", "component name")). Returns(http.StatusOK, ok, models.Component{})) webservice.Route(webservice.GET("/componenthealth"). To(components.GetSystemHealthStatus). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc(""). + Doc("Get the health status of system components."). Returns(http.StatusOK, ok, map[string]int{})) tags = []string{"Quotas"} From 70599087dca23557b89531e217a073178c85852d Mon Sep 17 00:00:00 2001 From: runzexia Date: Thu, 27 Jun 2019 22:27:41 +0800 Subject: [PATCH 2/6] update devops api docs Signed-off-by: runzexia --- pkg/apis/devops/v1alpha2/register.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index e3047d519..cb68fdb24 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -157,7 +157,7 @@ func addWebService(c *restful.Container) error { Returns(http.StatusOK, RespOK, devops.ProjectPipeline{}). Writes(devops.ProjectPipeline{})) - webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/sonarStatus"). + webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/sonarstatus"). To(devopsapi.GetPipelineSonarStatusHandler). Doc("Get the sonar quality information for a pipeline under the DevOps Project"). Metadata(restfulspec.KeyOpenAPITags, tags). @@ -166,7 +166,7 @@ func addWebService(c *restful.Container) error { Returns(http.StatusOK, RespOK, []devops.SonarStatus{}). Writes([]devops.SonarStatus{})) - webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipelines}/branches/{branch}/sonarStatus"). + webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipelines}/branches/{branch}/sonarstatus"). To(devopsapi.GetMultiBranchesPipelineSonarStatusHandler). Doc("Get the sonar quality check information for a pipeline branch under the DevOps Project"). Metadata(restfulspec.KeyOpenAPITags, tags). From e15857b5446d742b522c379a3556180add4bbc8a Mon Sep 17 00:00:00 2001 From: Ray Zhou Date: Thu, 27 Jun 2019 22:36:11 +0800 Subject: [PATCH 3/6] Update DevOps API docs --- pkg/apis/devops/v1alpha2/register.go | 112 +++++++++++++-------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index e3047d519..782a8a169 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -50,34 +50,34 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}"). To(devopsapi.GetDevOpsProjectHandler). - Doc("Get a DevOps Project"). + Doc("Get the specified DevOps Project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Returns(http.StatusOK, RespOK, devops.DevOpsProject{}). Writes(devops.DevOpsProject{})) webservice.Route(webservice.PATCH("/devops/{devops}"). To(devopsapi.UpdateProjectHandler). - Doc("Update a DevOps Project"). + Doc("Update the specified DevOps Project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Reads(devops.DevOpsProject{}). Returns(http.StatusOK, RespOK, devops.DevOpsProject{}). Writes(devops.DevOpsProject{})) webservice.Route(webservice.GET("/devops/{devops}/defaultroles"). To(devopsapi.GetDevOpsProjectDefaultRoles). - Doc("Get DevOps Project Build-in Roles Info"). + Doc("Get the build-in roles info of the specified DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Returns(http.StatusOK, RespOK, []devops.Role{}). Writes([]devops.Role{})) webservice.Route(webservice.GET("/devops/{devops}/members"). To(devopsapi.GetDevOpsProjectMembersHandler). - Doc("Get members of the DevOps Project"). + Doc("Get the members of the specified DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.QueryParameter(params.PagingParam, "page"). Required(false). DataFormat("limit=%d,page=%d"). @@ -90,43 +90,43 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/members/{member}"). To(devopsapi.GetDevOpsProjectMemberHandler). - Doc("Get a member of the DevOps Project"). + Doc("Get the specified member of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("member", "Member's username, e.g. admin")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("member", "member's username, e.g. admin")). Returns(http.StatusOK, RespOK, devops.DevOpsProjectMembership{}). Writes(devops.DevOpsProjectMembership{})) webservice.Route(webservice.POST("/devops/{devops}/members"). To(devopsapi.AddDevOpsProjectMemberHandler). - Doc("Add a member of the DevOps Project"). + Doc("Add a member to the specified DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Returns(http.StatusOK, RespOK, devops.DevOpsProjectMembership{}). Writes(devops.DevOpsProjectMembership{})) webservice.Route(webservice.PATCH("/devops/{devops}/members/{member}"). To(devopsapi.UpdateDevOpsProjectMemberHandler). - Doc("Update a member of the DevOps Project"). + Doc("Update the specified member of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("member", "Member's username, e.g. admin")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("member", "member's username, e.g. admin")). Returns(http.StatusOK, RespOK, devops.DevOpsProjectMembership{}). Reads(devops.DevOpsProjectMembership{}). Writes(devops.DevOpsProjectMembership{})) webservice.Route(webservice.DELETE("/devops/{devops}/members/{member}"). To(devopsapi.DeleteDevOpsProjectMemberHandler). - Doc("Delete a member of the DevOps Project"). + Doc("Delete the specified member of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("member", "Member's username, e.g. admin")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("member", "member's username, e.g. admin")). Writes(devops.DevOpsProjectMembership{})) webservice.Route(webservice.POST("/devops/{devops}/pipelines"). To(devopsapi.CreateDevOpsProjectPipelineHandler). - Doc("Create a DevOps Project pipeline"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("Create a DevOps project pipeline"). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Metadata(restfulspec.KeyOpenAPITags, tags). Returns(http.StatusOK, RespOK, devops.ProjectPipeline{}). Writes(devops.ProjectPipeline{}). @@ -134,43 +134,43 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.PUT("/devops/{devops}/pipelines/{pipeline}"). To(devopsapi.UpdateDevOpsProjectPipelineHandler). - Doc("Update DevOps Project pipeline"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("pipeline", "The name of pipeline, e.g. sample-pipeline")). + Doc("Update the specified pipeline of the DevOps project"). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("pipeline", "the name of pipeline, e.g. sample-pipeline")). Metadata(restfulspec.KeyOpenAPITags, tags). Writes(devops.ProjectPipeline{}). Reads(devops.ProjectPipeline{})) webservice.Route(webservice.DELETE("/devops/{devops}/pipelines/{pipeline}"). To(devopsapi.DeleteDevOpsProjectPipelineHandler). - Doc("Delete a pipeline under the DevOps Project"). + Doc("Delete the specified pipeline of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("pipeline", "The name of pipeline, e.g. sample-pipeline"))) + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("pipeline", "the name of pipeline, e.g. sample-pipeline"))) webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/config"). To(devopsapi.GetDevOpsProjectPipelineHandler). - Doc("Get the configuration information of a pipeline under the DevOps Project"). + Doc("Get the configuration information of the specified pipeline of the DevOps Project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("pipeline", "The name of pipeline, e.g. sample-pipeline")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("pipeline", "the name of pipeline, e.g. sample-pipeline")). Returns(http.StatusOK, RespOK, devops.ProjectPipeline{}). Writes(devops.ProjectPipeline{})) webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/sonarStatus"). To(devopsapi.GetPipelineSonarStatusHandler). - Doc("Get the sonar quality information for a pipeline under the DevOps Project"). + Doc("Get the sonar quality information for the specified pipeline of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, e.g. sample-pipeline")). Returns(http.StatusOK, RespOK, []devops.SonarStatus{}). Writes([]devops.SonarStatus{})) webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipelines}/branches/{branch}/sonarStatus"). To(devopsapi.GetMultiBranchesPipelineSonarStatusHandler). - Doc("Get the sonar quality check information for a pipeline branch under the DevOps Project"). + Doc("Get the sonar quality check information for the specified pipeline branch of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipelines", "the name of pipeline, e.g. sample-pipeline")). Param(webservice.PathParameter("branch", "branch name, e.g. master")). Returns(http.StatusOK, RespOK, []devops.SonarStatus{}). @@ -178,41 +178,41 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/{devops}/credentials"). To(devopsapi.CreateDevOpsProjectCredentialHandler). - Doc("Create a Credential under the DevOps Project"). + Doc("Create a Credential in the specified DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Reads(devops.JenkinsCredential{})) webservice.Route(webservice.PUT("/devops/{devops}/credentials/{credential}"). To(devopsapi.UpdateDevOpsProjectCredentialHandler). - Doc("Update a Credential under the DevOps Project"). + Doc("Update the specified credential of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("credential", "Credential's Id, e.g. dockerhub-id")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("credential", "credential's ID, e.g. dockerhub-id")). Reads(devops.JenkinsCredential{})) webservice.Route(webservice.DELETE("/devops/{devops}/credentials/{credential}"). To(devopsapi.DeleteDevOpsProjectCredentialHandler). - Doc("Delete a Credential under the DevOps Project"). + Doc("Delete the specified credential of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("credential", "credential's Id, e.g. dockerhub-id"))) + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("credential", "credential's ID, e.g. dockerhub-id"))) webservice.Route(webservice.GET("/devops/{devops}/credentials/{credential}"). To(devopsapi.GetDevOpsProjectCredentialHandler). - Doc("Get a Credential under the DevOps Project"). + Doc("Get the specified credential of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("credential", "Credential's Id, e.g. dockerhub-id")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("credential", "credential's ID, e.g. dockerhub-id")). Param(webservice.QueryParameter("content", "Get extra content, if not none will get credential's content")). Returns(http.StatusOK, RespOK, devops.JenkinsCredential{}). Reads(devops.JenkinsCredential{})) webservice.Route(webservice.GET("/devops/{devops}/credentials"). To(devopsapi.GetDevOpsProjectCredentialsHandler). - Doc("Get Credentials under the DevOps Project"). + Doc("Get all credentials of the specified DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Returns(http.StatusOK, RespOK, []devops.JenkinsCredential{}). Reads([]devops.JenkinsCredential{})) @@ -220,9 +220,9 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}"). To(devopsapi.GetPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get a Pipeline Inside a DevOps Project"). + Doc("Get the specified pipeline of the DevOps project"). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Returns(http.StatusOK, RespOK, devops.Pipeline{}). Writes(devops.Pipeline{})) @@ -250,16 +250,16 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs"). To(devopsapi.SearchPipelineRuns). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get all runs"). + Doc("Get all runs of the specified pipeline"). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). + Param(webservice.QueryParameter("start", "the item number the search starts from"). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search"). Required(false). DataFormat("limit=%d")). - Param(webservice.QueryParameter("branch", "the name of branch, same as repository brnach, will be filter by branch."). + Param(webservice.QueryParameter("branch", "the name of branch, same as repository branch, will be filtered by branch."). Required(false). DataFormat("branch=%s")). Returns(http.StatusOK, RespOK, []devops.BranchPipelineRun{}). @@ -333,8 +333,8 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/scms/{scm}/verify"). To(devopsapi.Validate). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Validate Github personal access token."). - Param(webservice.PathParameter("scm", "the id of SCM.")). + Doc("Validate the access token of the specified source configuration management (SCM) such as Github"). + Param(webservice.PathParameter("scm", "the SCM ID")). Returns(http.StatusOK, RespOK, devops.Validates{}). Writes(devops.Validates{})) From cc5a632d9e74f8bc88f90d78274f80e9f233ab9d Mon Sep 17 00:00:00 2001 From: Ray Zhou Date: Fri, 28 Jun 2019 11:25:33 +0800 Subject: [PATCH 4/6] Update application API docs --- pkg/apis/resources/v1alpha2/register.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index ee758aa59..d5eb29305 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -114,13 +114,13 @@ func addWebService(c *restful.Container) error { To(resources.ListApplication). Returns(http.StatusOK, ok, models.PageableResponse{}). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("List applications in cluster"). + Doc("List all applications deployed in the cluster"). Param(webservice.QueryParameter(params.ConditionsParam, "query conditions"). Required(false). DataFormat("key=value,key~value"). DefaultValue("")). - Param(webservice.QueryParameter("cluster_id", "cluster id")). - Param(webservice.QueryParameter("runtime_id", "runtime id")). + Param(webservice.QueryParameter("cluster_id", "cluster ID")). + Param(webservice.QueryParameter("runtime_id", "runtime ID")). Param(webservice.QueryParameter(params.PagingParam, "page"). Required(false). DataFormat("limit=%d,page=%d"). @@ -130,12 +130,12 @@ func addWebService(c *restful.Container) error { To(resources.ListNamespacedApplication). Returns(http.StatusOK, ok, models.PageableResponse{}). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("List applications"). + Doc("List all applications within the specified namespace"). Param(webservice.QueryParameter(params.ConditionsParam, "query conditions"). Required(false). DataFormat("key=value,key~value"). DefaultValue("")). - Param(webservice.PathParameter("namespace", "namespace")). + Param(webservice.PathParameter("namespace", "namespace name")). Param(webservice.QueryParameter(params.PagingParam, "page"). Required(false). DataFormat("limit=%d,page=%d"). @@ -145,13 +145,13 @@ func addWebService(c *restful.Container) error { To(resources.DescribeApplication). Returns(http.StatusOK, ok, applications.Application{}). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Describe application"). + Doc("Describe the specified application of the namespace"). Param(webservice.PathParameter("namespace", "namespace name")). - Param(webservice.PathParameter("application", "application id"))) + Param(webservice.PathParameter("application", "application ID"))) webservice.Route(webservice.POST("/namespaces/{namespace}/applications"). To(resources.DeployApplication). - Doc("Deploy application"). + Doc("Deploy a new application"). Metadata(restfulspec.KeyOpenAPITags, tags). Reads(openpitrix.CreateClusterRequest{}). Returns(http.StatusOK, ok, errors.Error{}). @@ -159,11 +159,11 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.DELETE("/namespaces/{namespace}/applications/{application}"). To(resources.DeleteApplication). - Doc("Delete application"). + Doc("Delete the specified application"). Metadata(restfulspec.KeyOpenAPITags, tags). Returns(http.StatusOK, ok, errors.Error{}). Param(webservice.PathParameter("namespace", "namespace name")). - Param(webservice.PathParameter("application", "application id"))) + Param(webservice.PathParameter("application", "application ID"))) tags = []string{"User resources"} From 129a7cf03a34147ae15c0230c34521c371e78caa Mon Sep 17 00:00:00 2001 From: runzexia Date: Fri, 28 Jun 2019 12:51:26 +0800 Subject: [PATCH 5/6] update api docs & reformat code Signed-off-by: runzexia --- pkg/apis/devops/v1alpha2/register.go | 12 ++++++++--- pkg/models/devops/urlconfig.go | 32 ++++++++++++++-------------- pkg/utils/idutils/id_utils.go | 1 - 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index fa1ecd8fe..93bf19ec8 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -202,9 +202,15 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetDevOpsProjectCredentialHandler). Doc("Get the specified credential of the DevOps project"). Metadata(restfulspec.KeyOpenAPITags, tags). - Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). - Param(webservice.PathParameter("credential", "credential's ID, e.g. dockerhub-id")). - Param(webservice.QueryParameter("content", "Get extra content, if not none will get credential's content")). + Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("credential", "Credential's Id, e.g. dockerhub-id")). + Param(webservice.QueryParameter("content", ` +Get extra content, if not none will get credential's content. +There are three main types of fields in the credential. +All credential fields, such as name, id, etc., will be returned each time. +Some credential non-encrypted fields, such as the username of the username-password type credential, which returns when the "content" parameter is set to non-empty. +Some encrypted fields, such as the password of the username password type credential, this part of the field will never return. +`)). Returns(http.StatusOK, RespOK, devops.JenkinsCredential{}). Reads(devops.JenkinsCredential{})) diff --git a/pkg/models/devops/urlconfig.go b/pkg/models/devops/urlconfig.go index 5255040c3..511667187 100644 --- a/pkg/models/devops/urlconfig.go +++ b/pkg/models/devops/urlconfig.go @@ -40,20 +40,20 @@ const ( ReplayPipelineUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/replay/" GetBranchArtifactsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/branches/%s/runs/%s/artifacts/?" GetArtifactsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/artifacts/?" - CheckBranchPipelineUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/branches/%s/runs/%s/nodes/%s/steps/%s/" - CheckPipelineUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/nodes/%s/steps/%s/" - GetBranchNodeStepsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/branches/%s/runs/%s/nodes/%s/steps/?" - GetNodeStepsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/nodes/%s/steps/?" - ValidateUrl = "/blue/rest/organizations/jenkins/scm/%s/validate" - GetSCMOrgUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/?" - GetOrgRepoUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/%s/repositories/?" - GetConsoleLogUrl = "/job/%s/job/%s/indexing/consoleText" - ScanBranchUrl = "/job/%s/job/%s/build?" - GetCrumbUrl = "/crumbIssuer/api/json/" - CheckScriptCompileUrl = "/job/init-job/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition/checkScriptCompile" - CheckCronUrl = "/job/init-job/descriptorByName/hudson.triggers.TimerTrigger/checkSpec?" - ToJenkinsfileUrl = "/pipeline-model-converter/toJenkinsfile" - ToJsonUrl = "/pipeline-model-converter/toJson" - GetNotifyCommitUrl = "/git/notifyCommit/?" - GithubWebhookUrl = "/github-webhook/" + CheckBranchPipelineUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/branches/%s/runs/%s/nodes/%s/steps/%s/" + CheckPipelineUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/nodes/%s/steps/%s/" + GetBranchNodeStepsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/branches/%s/runs/%s/nodes/%s/steps/?" + GetNodeStepsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/nodes/%s/steps/?" + ValidateUrl = "/blue/rest/organizations/jenkins/scm/%s/validate" + GetSCMOrgUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/?" + GetOrgRepoUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/%s/repositories/?" + GetConsoleLogUrl = "/job/%s/job/%s/indexing/consoleText" + ScanBranchUrl = "/job/%s/job/%s/build?" + GetCrumbUrl = "/crumbIssuer/api/json/" + CheckScriptCompileUrl = "/job/init-job/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition/checkScriptCompile" + CheckCronUrl = "/job/init-job/descriptorByName/hudson.triggers.TimerTrigger/checkSpec?" + ToJenkinsfileUrl = "/pipeline-model-converter/toJenkinsfile" + ToJsonUrl = "/pipeline-model-converter/toJson" + GetNotifyCommitUrl = "/git/notifyCommit/?" + GithubWebhookUrl = "/github-webhook/" ) diff --git a/pkg/utils/idutils/id_utils.go b/pkg/utils/idutils/id_utils.go index c7afb0ea5..bec44f0ff 100644 --- a/pkg/utils/idutils/id_utils.go +++ b/pkg/utils/idutils/id_utils.go @@ -116,4 +116,3 @@ func IPv4() (net.IP, error) { } return nil, errors.New("no ip address") } - From 749807896da6acc5286f98926e32dcfc7958310d Mon Sep 17 00:00:00 2001 From: soulseen Date: Fri, 28 Jun 2019 12:57:13 +0800 Subject: [PATCH 6/6] update devops api description Signed-off-by: soulseen --- pkg/apis/devops/v1alpha2/register.go | 128 +++++++++++++-------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index fa1ecd8fe..8a34418c9 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -237,10 +237,10 @@ func addWebService(c *restful.Container) error { Param(webservice.QueryParameter("filter", "Filter some types of jobs. e.g. no-folder,will not get a job of type folder"). Required(false). DataFormat("filter=%s")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.Pipeline{}). @@ -253,7 +253,7 @@ func addWebService(c *restful.Container) error { Doc("Get all runs of the specified pipeline"). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). - Param(webservice.QueryParameter("start", "the item number the search starts from"). + Param(webservice.QueryParameter("start", "the item number of the search starts from"). Required(false). DataFormat("start=%d")). Param(webservice.QueryParameter("limit", "the limit item count of the search"). @@ -271,10 +271,10 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("(MultiBranchesPipeline) Get all runs in a branch"). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(false). DataFormat("start=%d")). Returns(http.StatusOK, RespOK, devops.BranchPipelineRun{}). @@ -285,11 +285,11 @@ func addWebService(c *restful.Container) error { To(devopsapi.GetPipelineRunNodesbyBranch). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("(MultiBranchesPipeline) Get run nodes."). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(false). DataFormat("limit=%d"). DefaultValue("limit=10000")). @@ -302,13 +302,13 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("(MultiBranchesPipeline) Get pipelines step log."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). Param(webservice.PathParameter("node", "pipeline node id, the one node in pipeline.")). Param(webservice.PathParameter("step", "pipeline step id, the one step in pipeline.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -319,12 +319,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("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). Param(webservice.PathParameter("node", "pipeline node id, the one node in pipeline.")). Param(webservice.PathParameter("step", "pipeline step id, the one step in pipeline.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -334,7 +334,7 @@ func addWebService(c *restful.Container) error { To(devopsapi.Validate). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Validate the access token of the specified source configuration management (SCM) such as Github"). - Param(webservice.PathParameter("scm", "the SCM ID")). + Param(webservice.PathParameter("scm", "the id of the source configuration management (SCM).")). Returns(http.StatusOK, RespOK, devops.Validates{}). Writes(devops.Validates{})) @@ -342,9 +342,9 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/scms/{scm}/organizations"). To(devopsapi.GetSCMOrg). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("List organizations of SCM"). - Param(webservice.PathParameter("scm", "the id of SCM.")). - Param(webservice.QueryParameter("credentialId", "credential id for SCM."). + Doc("List all organizations of the specified source configuration management (SCM) such as Github."). + Param(webservice.PathParameter("scm", "the id of the source configuration management (SCM).")). + Param(webservice.QueryParameter("credentialId", "credential id for source configuration management (SCM)."). Required(true). DataFormat("credentialId=%s")). Returns(http.StatusOK, RespOK, []devops.SCMOrg{}). @@ -354,16 +354,16 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/scms/{scm}/organizations/{organization}/repositories"). To(devopsapi.GetOrgRepo). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get SCM repositories in an organization"). - Param(webservice.PathParameter("scm", "SCM id")). + Doc("List all repositories in the specified organization."). + Param(webservice.PathParameter("scm", "The id of the source configuration management (SCM).")). Param(webservice.PathParameter("organization", "organization Id, such as github username.")). Param(webservice.QueryParameter("credentialId", "credential id for SCM."). Required(true). DataFormat("credentialId=%s")). - Param(webservice.QueryParameter("pageNumber", "the number of page."). + Param(webservice.QueryParameter("pageNumber", "page number."). Required(true). DataFormat("pageNumber=%d")). - Param(webservice.QueryParameter("pageSize", "the size of page."). + Param(webservice.QueryParameter("pageSize", "the item count of one page."). Required(true). DataFormat("pageSize=%d")). Returns(http.StatusOK, RespOK, []devops.OrgRepo{}). @@ -373,8 +373,8 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/stop"). To(devopsapi.StopBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Stop pipeline in running."). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("(MultiBranchesPipeline) Stop pipeline."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). @@ -393,8 +393,8 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/{devops}/pipelines/{pipeline}/runs/{run}/stop"). To(devopsapi.StopPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Stop pipeline in running"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("Stop pipeline"). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). Param(webservice.QueryParameter("blocking", "stop and between each retries will sleep."). @@ -413,7 +413,7 @@ func addWebService(c *restful.Container) error { To(devopsapi.ReplayBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("(MultiBranchesPipeline) Replay pipeline"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). @@ -425,7 +425,7 @@ func addWebService(c *restful.Container) error { To(devopsapi.ReplayPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Replay pipeline"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). Returns(http.StatusOK, RespOK, devops.ReplayPipe{}). @@ -435,13 +435,13 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/log"). To(devopsapi.GetBranchRunLog). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Get Pipelines run log."). + Doc("(MultiBranchesPipeline) Get run logs of the specified pipeline activity."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -450,12 +450,12 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs/{run}/log"). To(devopsapi.GetRunLog). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get Pipelines run log."). + Doc("Get run logs of the specified pipeline activity."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(true). DataFormat("start=%d"). DefaultValue("start=0"))) @@ -464,15 +464,15 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/artifacts"). To(devopsapi.GetBranchArtifacts). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Get pipeline artifacts."). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("(MultiBranchesPipeline) Get all artifacts in the specified pipeline."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, "The filed of \"Url\" in response can download artifacts", []devops.Artifacts{}). @@ -482,14 +482,14 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs/{run}/artifacts"). To(devopsapi.GetArtifacts). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get pipeline artifacts."). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("Get all artifacts in the specified pipeline."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("start", "the count of item start."). + Param(webservice.QueryParameter("start", "the item number of the search starts from."). Required(false). DataFormat("start=%d")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, "The filed of \"Url\" in response can download artifacts", []devops.Artifacts{}). @@ -499,8 +499,8 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/branches"). To(devopsapi.GetPipeBranch). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Get pipeline branches."). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("(MultiBranchesPipeline) Get all branches in the specified pipeline."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.QueryParameter("filter", "filter remote scm. e.g. origin"). Required(true). @@ -518,10 +518,10 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps/{step}"). To(devopsapi.CheckBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Proceed/Break paused pipeline"). + Doc("(MultiBranchesPipeline) Proceed or Break the paused pipeline which waiting for user input."). Reads(devops.CheckPlayload{}). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). @@ -532,10 +532,10 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step}"). To(devopsapi.CheckPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Proceed/Break paused pipeline"). + Doc("Proceed or Break the paused pipeline which waiting for user input."). Reads(devops.CheckPlayload{}). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). Param(webservice.PathParameter("node", "pipeline node id, the one node in pipeline.")). @@ -545,9 +545,9 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/consolelog"). To(devopsapi.GetConsoleLog). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get index console log."). + Doc("Get scan reponsitory logs in the specified pipeline."). Produces("text/plain; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment."))) // match /job/{devops}/job/{pipeline}/build?delay=0 @@ -556,7 +556,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Scan remote Repositorie, Start a build if have new branch."). Produces("text/html; charset=utf-8"). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.QueryParameter("delay", "will be delay time to scan."). Required(false). @@ -568,7 +568,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("(MultiBranchesPipeline) Run pipeline."). Reads(devops.RunPayload{}). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Returns(http.StatusOK, RespOK, devops.QueuedBlueRun{}). @@ -580,7 +580,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Run pipeline."). Reads(devops.RunPayload{}). - Param(webservice.PathParameter("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Returns(http.StatusOK, RespOK, devops.QueuedBlueRun{}). Writes(devops.QueuedBlueRun{})) @@ -622,7 +622,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs/{run}"). To(devopsapi.GetPipelineRun). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get run pipeline in project."). + Doc("Get all activities in the specified pipeline."). Param(webservice.PathParameter("devops", "the name of devops project")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). @@ -633,7 +633,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/branches/{branch}"). To(devopsapi.GetBranchPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Get Pipeline run by branch."). + Doc("(MultiBranchesPipeline) Get all activities in the specified pipeline."). Param(webservice.PathParameter("devops", "the name of devops project")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach")). @@ -644,11 +644,11 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes"). To(devopsapi.GetPipelineRunNodes). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get Pipeline run nodes."). + Doc("Get all nodes in the specified activity. node is the stage in the pipeline task"). Param(webservice.PathParameter("devops", "the name of devops project")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build")). - Param(webservice.QueryParameter("limit", "the count of item limit"). + Param(webservice.QueryParameter("limit", "the limit item count of the search"). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.PipelineRunNodes{}). @@ -658,13 +658,13 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps"). To(devopsapi.GetBranchNodeSteps). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) Get steps in node by branch."). + Doc("(MultiBranchesPipeline) Get all steps in the specified node."). Param(webservice.PathParameter("devops", "the name of devops project")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). Param(webservice.PathParameter("node", "pipeline node id, the one node in pipeline.")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodeSteps{}). @@ -674,12 +674,12 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps"). To(devopsapi.GetNodeSteps). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get steps in node."). + Doc("Get all steps in the specified node."). Param(webservice.PathParameter("devops", "the name of devops project")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build")). Param(webservice.PathParameter("node", "pipeline node id, the one node in pipeline.")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(false). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodeSteps{}). @@ -737,12 +737,12 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodesdetail"). To(devopsapi.GetBranchNodesDetail). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("(MultiBranchesPipeline) 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("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("(MultiBranchesPipeline) Gives steps details inside a activity node. For a node, the steps which defined inside the node."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodesDetail{}). @@ -752,12 +752,12 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodesdetail"). To(devopsapi.GetNodesDetail). Metadata(restfulspec.KeyOpenAPITags, tags). - 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("devops", "DevOps Project's Id, e.g. project-RRRRAzLBlLEm")). + Doc("Gives steps details inside a activity node. For a node, the steps which defined inside the node."). + Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")). Param(webservice.PathParameter("pipeline", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). Param(webservice.PathParameter("branch", "the name of branch, same as repository brnach.")). Param(webservice.PathParameter("run", "pipeline run id, the unique id for a pipeline once build.")). - Param(webservice.QueryParameter("limit", "the count of item limit."). + Param(webservice.QueryParameter("limit", "the limit item count of the search."). Required(true). DataFormat("limit=%d")). Returns(http.StatusOK, RespOK, []devops.NodesDetail{}).