未验证 提交 845d035c 编写于 作者: R rayzhou2017 提交者: GitHub

Merge branch 'master' into api-docs

...@@ -130,7 +130,7 @@ func addWebService(c *restful.Container) error { ...@@ -130,7 +130,7 @@ func addWebService(c *restful.Container) error {
To(resources.ListNamespacedApplication). To(resources.ListNamespacedApplication).
Returns(http.StatusOK, ok, models.PageableResponse{}). Returns(http.StatusOK, ok, models.PageableResponse{}).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}).
Doc("List applications"). Doc("List all applications within the specified namespace").
Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a"). Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a").
Required(false). Required(false).
DataFormat("key=value,key~value"). DataFormat("key=value,key~value").
...@@ -145,13 +145,13 @@ func addWebService(c *restful.Container) error { ...@@ -145,13 +145,13 @@ func addWebService(c *restful.Container) error {
To(resources.DescribeApplication). To(resources.DescribeApplication).
Returns(http.StatusOK, ok, applications.Application{}). Returns(http.StatusOK, ok, applications.Application{}).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}).
Doc("Describe application"). Doc("Describe the specified application of the namespace").
Param(webservice.PathParameter("namespace", "namespace name")). 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"). webservice.Route(webservice.POST("/namespaces/{namespace}/applications").
To(resources.DeployApplication). To(resources.DeployApplication).
Doc("Deploy application"). Doc("Deploy a new application").
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}).
Reads(openpitrix.CreateClusterRequest{}). Reads(openpitrix.CreateClusterRequest{}).
Returns(http.StatusOK, ok, errors.Error{}). Returns(http.StatusOK, ok, errors.Error{}).
...@@ -159,11 +159,11 @@ func addWebService(c *restful.Container) error { ...@@ -159,11 +159,11 @@ func addWebService(c *restful.Container) error {
webservice.Route(webservice.DELETE("/namespaces/{namespace}/applications/{application}"). webservice.Route(webservice.DELETE("/namespaces/{namespace}/applications/{application}").
To(resources.DeleteApplication). To(resources.DeleteApplication).
Doc("Delete application"). Doc("Delete the specified application").
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}).
Returns(http.StatusOK, ok, errors.Error{}). Returns(http.StatusOK, ok, errors.Error{}).
Param(webservice.PathParameter("namespace", "namespace name")). Param(webservice.PathParameter("namespace", "namespace name")).
Param(webservice.PathParameter("application", "application id"))) Param(webservice.PathParameter("application", "application ID")))
webservice.Route(webservice.GET("/users/{user}/kubectl"). webservice.Route(webservice.GET("/users/{user}/kubectl").
To(resources.GetKubectl). To(resources.GetKubectl).
...@@ -183,18 +183,18 @@ func addWebService(c *restful.Container) error { ...@@ -183,18 +183,18 @@ func addWebService(c *restful.Container) error {
webservice.Route(webservice.GET("/components"). webservice.Route(webservice.GET("/components").
To(components.GetComponents). To(components.GetComponents).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ComponentStatusTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.ComponentStatusTag}).
Doc(""). Doc("List the system components.").
Returns(http.StatusOK, ok, map[string]models.Component{})) Returns(http.StatusOK, ok, map[string]models.Component{}))
webservice.Route(webservice.GET("/components/{component}"). webservice.Route(webservice.GET("/components/{component}").
To(components.GetComponentStatus). To(components.GetComponentStatus).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ComponentStatusTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.ComponentStatusTag}).
Doc(""). Doc("Describe the specified system component.").
Param(webservice.PathParameter("component", "component name")). Param(webservice.PathParameter("component", "component name")).
Returns(http.StatusOK, ok, models.Component{})) Returns(http.StatusOK, ok, models.Component{}))
webservice.Route(webservice.GET("/componenthealth"). webservice.Route(webservice.GET("/componenthealth").
To(components.GetSystemHealthStatus). To(components.GetSystemHealthStatus).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ComponentStatusTag}). Metadata(restfulspec.KeyOpenAPITags, []string{constants.ComponentStatusTag}).
Doc(""). Doc("Get the health status of system components.").
Returns(http.StatusOK, ok, map[string]int{})) Returns(http.StatusOK, ok, map[string]int{}))
webservice.Route(webservice.GET("/quotas"). webservice.Route(webservice.GET("/quotas").
......
...@@ -40,20 +40,20 @@ const ( ...@@ -40,20 +40,20 @@ const (
ReplayPipelineUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/replay/" 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/?" 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/?" 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/" 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/" 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/?" 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/?" GetNodeStepsUrl = "/blue/rest/organizations/jenkins/pipelines/%s/pipelines/%s/runs/%s/nodes/%s/steps/?"
ValidateUrl = "/blue/rest/organizations/jenkins/scm/%s/validate" ValidateUrl = "/blue/rest/organizations/jenkins/scm/%s/validate"
GetSCMOrgUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/?" GetSCMOrgUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/?"
GetOrgRepoUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/%s/repositories/?" GetOrgRepoUrl = "/blue/rest/organizations/jenkins/scm/%s/organizations/%s/repositories/?"
GetConsoleLogUrl = "/job/%s/job/%s/indexing/consoleText" GetConsoleLogUrl = "/job/%s/job/%s/indexing/consoleText"
ScanBranchUrl = "/job/%s/job/%s/build?" ScanBranchUrl = "/job/%s/job/%s/build?"
GetCrumbUrl = "/crumbIssuer/api/json/" GetCrumbUrl = "/crumbIssuer/api/json/"
CheckScriptCompileUrl = "/job/init-job/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition/checkScriptCompile" CheckScriptCompileUrl = "/job/init-job/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition/checkScriptCompile"
CheckCronUrl = "/job/init-job/descriptorByName/hudson.triggers.TimerTrigger/checkSpec?" CheckCronUrl = "/job/init-job/descriptorByName/hudson.triggers.TimerTrigger/checkSpec?"
ToJenkinsfileUrl = "/pipeline-model-converter/toJenkinsfile" ToJenkinsfileUrl = "/pipeline-model-converter/toJenkinsfile"
ToJsonUrl = "/pipeline-model-converter/toJson" ToJsonUrl = "/pipeline-model-converter/toJson"
GetNotifyCommitUrl = "/git/notifyCommit/?" GetNotifyCommitUrl = "/git/notifyCommit/?"
GithubWebhookUrl = "/github-webhook/" GithubWebhookUrl = "/github-webhook/"
) )
...@@ -116,4 +116,3 @@ func IPv4() (net.IP, error) { ...@@ -116,4 +116,3 @@ func IPv4() (net.IP, error) {
} }
return nil, errors.New("no ip address") return nil, errors.New("no ip address")
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册