Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
ae8ee99d
K
kubesphere
项目概览
水淹萌龙
/
kubesphere
与 Fork 源项目一致
Fork自
KubeSphere / kubesphere
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ae8ee99d
编写于
6月 20, 2019
作者:
R
runzexia
提交者:
zryfish
6月 23, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update api docs
Signed-off-by:
N
runzexia
<
runzexia@yunify.com
>
上级
aec4146c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
99 addition
and
99 deletion
+99
-99
pkg/apis/devops/v1alpha2/register.go
pkg/apis/devops/v1alpha2/register.go
+62
-62
pkg/apiserver/devops/member.go
pkg/apiserver/devops/member.go
+3
-3
pkg/apiserver/devops/project_credential.go
pkg/apiserver/devops/project_credential.go
+3
-3
pkg/apiserver/devops/project_pipeline.go
pkg/apiserver/devops/project_pipeline.go
+5
-5
pkg/models/devops/membership.go
pkg/models/devops/membership.go
+4
-4
pkg/models/devops/project.go
pkg/models/devops/project.go
+3
-3
pkg/models/devops/project_credential.go
pkg/models/devops/project_credential.go
+19
-19
未找到文件。
pkg/apis/devops/v1alpha2/register.go
浏览文件 @
ae8ee99d
...
...
@@ -50,34 +50,34 @@ func addWebService(c *restful.Container) error {
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}"
)
.
To
(
devopsapi
.
GetDevOpsProjectHandler
)
.
Doc
(
"Get
devops p
roject"
)
.
Doc
(
"Get
a DevOps P
roject"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
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
devops p
roject"
)
.
Doc
(
"Update
a DevOps P
roject"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
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 default roles
"
)
.
Doc
(
"Get
DevOps Project Build-in Roles Info
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
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
devops project members
"
)
.
Doc
(
"Get
members of the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
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"
)
.
...
...
@@ -88,131 +88,131 @@ func addWebService(c *restful.Container) error {
Returns
(
http
.
StatusOK
,
RespOK
,
[]
devops
.
DevOpsProjectMembership
{})
.
Writes
([]
devops
.
DevOpsProjectMembership
{}))
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/members/{member
s
}"
)
.
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/members/{member}"
)
.
To
(
devopsapi
.
GetDevOpsProjectMemberHandler
)
.
Doc
(
"Get
devops project member
"
)
.
Doc
(
"Get
a Member of the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"member
s"
,
"member's username
"
))
.
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
devops project members
"
)
.
Doc
(
"Add
a member of the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
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
s
}"
)
.
webservice
.
Route
(
webservice
.
PATCH
(
"/devops/{devops}/members/{member}"
)
.
To
(
devopsapi
.
UpdateDevOpsProjectMemberHandler
)
.
Doc
(
"Update
devops project members
"
)
.
Doc
(
"Update
a member of the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"member
s"
,
"member's username
"
))
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
DevOps Project's Id, e.g. project-RRRRAzLBlLEm
"
))
.
Param
(
webservice
.
PathParameter
(
"member
"
,
"Member's username, e.g. admin
"
))
.
Reads
(
devops
.
DevOpsProjectMembership
{})
.
Writes
(
devops
.
DevOpsProjectMembership
{}))
webservice
.
Route
(
webservice
.
DELETE
(
"/devops/{devops}/members/{member
s
}"
)
.
webservice
.
Route
(
webservice
.
DELETE
(
"/devops/{devops}/members/{member}"
)
.
To
(
devopsapi
.
DeleteDevOpsProjectMemberHandler
)
.
Doc
(
"Delete
devops project members
"
)
.
Doc
(
"Delete
a member of the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"member
s"
,
"member's username
"
))
.
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
(
"Add
devops p
roject pipeline"
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Doc
(
"Add
DevOps P
roject 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
{})
.
Reads
(
devops
.
ProjectPipeline
{}))
webservice
.
Route
(
webservice
.
PUT
(
"/devops/{devops}/pipelines/{pipeline
s
}"
)
.
webservice
.
Route
(
webservice
.
PUT
(
"/devops/{devops}/pipelines/{pipeline}"
)
.
To
(
devopsapi
.
UpdateDevOpsProjectPipelineHandler
)
.
Doc
(
"Update
devops p
roject pipeline"
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"pipeline
s"
,
"the name of pipeline, which helps to deliver continuous integration continuous deployment.
"
))
.
Doc
(
"Update
DevOps P
roject 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
"
))
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Returns
(
http
.
StatusOK
,
RespOK
,
devops
.
ProjectPipeline
{})
.
Writes
(
devops
.
ProjectPipeline
{})
.
Reads
(
devops
.
ProjectPipeline
{}))
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/pipelines/{pipeline
s
}/config"
)
.
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/pipelines/{pipeline}/config"
)
.
To
(
devopsapi
.
GetDevOpsProjectPipelineHandler
)
.
Doc
(
"Get
devops project pipeline config
"
)
.
Doc
(
"Get
the configuration information of a pipeline under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"pipeline
s"
,
"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
(
"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
s
}/sonarStatus"
)
.
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/pipelines/{pipeline}/sonarStatus"
)
.
To
(
devopsapi
.
GetPipelineSonarStatusHandler
)
.
Doc
(
"Get
devops project pipeline sonarStatus
"
)
.
Doc
(
"Get
the sonar quality information of a pipeline under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"pipeline
s"
,
"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
(
"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
es
}/sonarStatus"
)
.
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/pipelines/{pipelines}/branches/{branch}/sonarStatus"
)
.
To
(
devopsapi
.
GetMultiBranchesPipelineSonarStatusHandler
)
.
Doc
(
"Get
devops project pipeline sonarStatus
"
)
.
Doc
(
"Get
the sonar quality check information for a pipeline branch under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"pipelines"
,
"the name of pipeline,
which helps to deliver continuous integration continuous deployment.
"
))
.
Param
(
webservice
.
PathParameter
(
"branch
es"
,
"branch name
"
))
.
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
{})
.
Writes
([]
devops
.
SonarStatus
{}))
webservice
.
Route
(
webservice
.
DELETE
(
"/devops/{devops}/pipelines/{pipeline
s
}"
)
.
webservice
.
Route
(
webservice
.
DELETE
(
"/devops/{devops}/pipelines/{pipeline}"
)
.
To
(
devopsapi
.
DeleteDevOpsProjectPipelineHandler
)
.
Doc
(
"Delete
devops project pipeline
"
)
.
Doc
(
"Delete
a pipeline under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"pipeline
s"
,
"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
(
"pipeline
"
,
"The name of pipeline, e.g. sample-pipeline
"
)))
webservice
.
Route
(
webservice
.
POST
(
"/devops/{devops}/credentials"
)
.
To
(
devopsapi
.
CreateDevOpsProjectCredentialHandler
)
.
Doc
(
"
Add project credential pipeline
"
)
.
Doc
(
"
Create a Credential under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
DevOps Project's Id, e.g. project-RRRRAzLBlLEm
"
))
.
Reads
(
devops
.
JenkinsCredential
{}))
webservice
.
Route
(
webservice
.
PUT
(
"/devops/{devops}/credentials/{credential
s
}"
)
.
webservice
.
Route
(
webservice
.
PUT
(
"/devops/{devops}/credentials/{credential}"
)
.
To
(
devopsapi
.
UpdateDevOpsProjectCredentialHandler
)
.
Doc
(
"Update
project credential pipeline
"
)
.
Doc
(
"Update
a Credential under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"credentials"
,
"
credential's I
d"
))
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
DevOps Project's Id, e.g. project-RRRRAzLBlLEm
"
))
.
Param
(
webservice
.
PathParameter
(
"credentials"
,
"
Credential's Id, e.g. dockerhub-i
d"
))
.
Reads
(
devops
.
JenkinsCredential
{}))
webservice
.
Route
(
webservice
.
DELETE
(
"/devops/{devops}/credentials/{credential
s
}"
)
.
webservice
.
Route
(
webservice
.
DELETE
(
"/devops/{devops}/credentials/{credential}"
)
.
To
(
devopsapi
.
DeleteDevOpsProjectCredentialHandler
)
.
Doc
(
"
delete project credential pipeline
"
)
.
Doc
(
"
Delete a Credential under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"credential
s"
,
"credential's I
d"
)))
Param
(
webservice
.
PathParameter
(
"devops"
,
"
DevOps Project's Id, e.g. project-RRRRAzLBlLEm
"
))
.
Param
(
webservice
.
PathParameter
(
"credential
"
,
"credential's Id, e.g. dockerhub-i
d"
)))
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/credentials/{credential
s
}"
)
.
webservice
.
Route
(
webservice
.
GET
(
"/devops/{devops}/credentials/{credential}"
)
.
To
(
devopsapi
.
GetDevOpsProjectCredentialHandler
)
.
Doc
(
"Get
project credential pipeline
"
)
.
Doc
(
"Get
a Credential under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"credential
s"
,
"credential's I
d"
))
.
Param
(
webservice
.
QueryParameter
(
"content"
,
"
get additional
content"
))
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
DevOps Project's Id, e.g. project-RRRRAzLBlLEm
"
))
.
Param
(
webservice
.
PathParameter
(
"credential
"
,
"Credential's Id, e.g. dockerhub-i
d"
))
.
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
project credential pipeline
"
)
.
Doc
(
"Get
Credentials under the DevOps Project
"
)
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
tags
)
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
devops project's Id
"
))
.
Param
(
webservice
.
PathParameter
(
"devops"
,
"
DevOps Project's Id, e.g. project-RRRRAzLBlLEm
"
))
.
Returns
(
http
.
StatusOK
,
RespOK
,
[]
devops
.
JenkinsCredential
{})
.
Reads
([]
devops
.
JenkinsCredential
{}))
...
...
pkg/apiserver/devops/member.go
浏览文件 @
ae8ee99d
...
...
@@ -58,7 +58,7 @@ func GetDevOpsProjectMemberHandler(request *restful.Request, resp *restful.Respo
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
member
:=
request
.
PathParameter
(
"member
s
"
)
member
:=
request
.
PathParameter
(
"member"
)
err
:=
devops
.
CheckProjectUserInRole
(
username
,
projectId
,
devops
.
AllRoleSlice
)
if
err
!=
nil
{
...
...
@@ -132,7 +132,7 @@ func UpdateDevOpsProjectMemberHandler(request *restful.Request, resp *restful.Re
errors
.
ParseSvcErr
(
restful
.
NewError
(
http
.
StatusBadRequest
,
err
.
Error
()),
resp
)
return
}
member
.
Username
=
request
.
PathParameter
(
"member
s
"
)
member
.
Username
=
request
.
PathParameter
(
"member"
)
if
govalidator
.
IsNull
(
member
.
Username
)
{
err
:=
fmt
.
Errorf
(
"error need username"
)
glog
.
Errorf
(
"%+v"
,
err
)
...
...
@@ -175,7 +175,7 @@ func DeleteDevOpsProjectMemberHandler(request *restful.Request, resp *restful.Re
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
member
:=
request
.
PathParameter
(
"member
s
"
)
member
:=
request
.
PathParameter
(
"member"
)
err
:=
devops
.
CheckProjectUserInRole
(
username
,
projectId
,
[]
string
{
devops
.
ProjectOwner
})
if
err
!=
nil
{
...
...
pkg/apiserver/devops/project_credential.go
浏览文件 @
ae8ee99d
...
...
@@ -57,7 +57,7 @@ func UpdateDevOpsProjectCredentialHandler(request *restful.Request, resp *restfu
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
credentialId
:=
request
.
PathParameter
(
"credential
s
"
)
credentialId
:=
request
.
PathParameter
(
"credential"
)
var
credential
*
devops
.
JenkinsCredential
err
:=
request
.
ReadEntity
(
&
credential
)
if
err
!=
nil
{
...
...
@@ -89,7 +89,7 @@ func DeleteDevOpsProjectCredentialHandler(request *restful.Request, resp *restfu
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
credentialId
:=
request
.
PathParameter
(
"credential
s
"
)
credentialId
:=
request
.
PathParameter
(
"credential"
)
var
credential
*
devops
.
JenkinsCredential
err
:=
request
.
ReadEntity
(
&
credential
)
if
err
!=
nil
{
...
...
@@ -121,7 +121,7 @@ func GetDevOpsProjectCredentialHandler(request *restful.Request, resp *restful.R
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
credentialId
:=
request
.
PathParameter
(
"credential
s
"
)
credentialId
:=
request
.
PathParameter
(
"credential"
)
getContent
:=
request
.
QueryParameter
(
"content"
)
domain
:=
request
.
QueryParameter
(
"domain"
)
...
...
pkg/apiserver/devops/project_pipeline.go
浏览文件 @
ae8ee99d
...
...
@@ -56,7 +56,7 @@ func CreateDevOpsProjectPipelineHandler(request *restful.Request, resp *restful.
func
DeleteDevOpsProjectPipelineHandler
(
request
*
restful
.
Request
,
resp
*
restful
.
Response
)
{
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
pipelineId
:=
request
.
PathParameter
(
"pipeline
s
"
)
pipelineId
:=
request
.
PathParameter
(
"pipeline"
)
err
:=
devops
.
CheckProjectUserInRole
(
username
,
projectId
,
[]
string
{
devops
.
ProjectOwner
,
devops
.
ProjectMaintainer
})
if
err
!=
nil
{
...
...
@@ -82,7 +82,7 @@ func UpdateDevOpsProjectPipelineHandler(request *restful.Request, resp *restful.
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
pipelineId
:=
request
.
PathParameter
(
"pipeline
s
"
)
pipelineId
:=
request
.
PathParameter
(
"pipeline"
)
var
pipeline
*
devops
.
ProjectPipeline
err
:=
request
.
ReadEntity
(
&
pipeline
)
if
err
!=
nil
{
...
...
@@ -114,7 +114,7 @@ func GetDevOpsProjectPipelineHandler(request *restful.Request, resp *restful.Res
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
pipelineId
:=
request
.
PathParameter
(
"pipeline
s
"
)
pipelineId
:=
request
.
PathParameter
(
"pipeline"
)
err
:=
devops
.
CheckProjectUserInRole
(
username
,
projectId
,
[]
string
{
devops
.
ProjectOwner
,
devops
.
ProjectMaintainer
})
if
err
!=
nil
{
...
...
@@ -137,7 +137,7 @@ func GetDevOpsProjectPipelineHandler(request *restful.Request, resp *restful.Res
func
GetPipelineSonarStatusHandler
(
request
*
restful
.
Request
,
resp
*
restful
.
Response
)
{
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
pipelineId
:=
request
.
PathParameter
(
"pipeline
s
"
)
pipelineId
:=
request
.
PathParameter
(
"pipeline"
)
err
:=
devops
.
CheckProjectUserInRole
(
username
,
projectId
,
devops
.
AllRoleSlice
)
if
err
!=
nil
{
glog
.
Errorf
(
"%+v"
,
err
)
...
...
@@ -157,7 +157,7 @@ func GetMultiBranchesPipelineSonarStatusHandler(request *restful.Request, resp *
projectId
:=
request
.
PathParameter
(
"devops"
)
username
:=
request
.
HeaderParameter
(
constants
.
UserNameHeader
)
pipelineId
:=
request
.
PathParameter
(
"pipelines"
)
branchId
:=
request
.
PathParameter
(
"branch
es
"
)
branchId
:=
request
.
PathParameter
(
"branch"
)
err
:=
devops
.
CheckProjectUserInRole
(
username
,
projectId
,
devops
.
AllRoleSlice
)
if
err
!=
nil
{
glog
.
Errorf
(
"%+v"
,
err
)
...
...
pkg/models/devops/membership.go
浏览文件 @
ae8ee99d
...
...
@@ -21,10 +21,10 @@ const (
)
type
DevOpsProjectMembership
struct
{
Username
string
`json:"username" description:"
m
ember's username,username can uniquely identify a user"`
ProjectId
string
`json:"project_id" db:"project_id" description:"the
devops p
rojects which project membership belongs to"`
Role
string
`json:"role" description:"
devops p
roject membership's role type. e.g. owner '"`
Status
string
`json:"status" description:"Desperated,
s
tatus of project membership. e.g. active "`
Username
string
`json:"username" description:"
M
ember's username,username can uniquely identify a user"`
ProjectId
string
`json:"project_id" db:"project_id" description:"the
DevOps P
rojects which project membership belongs to"`
Role
string
`json:"role" description:"
DevOps P
roject membership's role type. e.g. owner '"`
Status
string
`json:"status" description:"Desperated,
S
tatus of project membership. e.g. active "`
GrantBy
string
`json:"grand_by,omitempty" description:"Username of the user who assigned the role"`
}
...
...
pkg/models/devops/project.go
浏览文件 @
ae8ee99d
...
...
@@ -37,11 +37,11 @@ type PageableDevOpsProject struct {
}
type
DevOpsProject
struct
{
ProjectId
string
`json:"project_id" db:"project_id" description:"ProjectId must be unique within a
name
space, it is generated by kubesphere."`
ProjectId
string
`json:"project_id" db:"project_id" description:"ProjectId must be unique within a
work
space, it is generated by kubesphere."`
Name
string
`json:"name" description:"DevOps Projects's Name
'
"`
Name
string
`json:"name" description:"DevOps Projects's Name"`
Description
string
`json:"description,omitempty" description:"DevOps Projets's Description, used to describe the DevOps Project'"`
Description
string
`json:"description,omitempty" description:"DevOps Proje
c
ts's Description, used to describe the DevOps Project'"`
Creator
string
`json:"creator" description:"Creator's username'"`
...
...
pkg/models/devops/project_credential.go
浏览文件 @
ae8ee99d
...
...
@@ -26,30 +26,30 @@ const (
)
type
JenkinsCredential
struct
{
Id
string
`json:"id" description:"
id of credential
"`
Type
string
`json:"type" description:"
type of credential,such as
ssh/kubeconfig"`
DisplayName
string
`json:"display_name,omitempty" description:"
c
redential's display name'"`
Id
string
`json:"id" description:"
Id of Credential, e.g. dockerhub-id
"`
Type
string
`json:"type" description:"
Type of Credential, e.g.
ssh/kubeconfig"`
DisplayName
string
`json:"display_name,omitempty" description:"
C
redential's display name'"`
Fingerprint
*
struct
{
FileName
string
`json:"file_name,omitempty" description:"
c
redential's display name and description"`
Hash
string
`json:"hash,omitempty" description:"
credential's hash'
"`
FileName
string
`json:"file_name,omitempty" description:"
C
redential's display name and description"`
Hash
string
`json:"hash,omitempty" description:"
Credential's hash
"`
Usage
[]
*
struct
{
Name
string
`json:"name,omitempty" description:"
j
enkins pipeline full name"`
Name
string
`json:"name,omitempty" description:"
J
enkins pipeline full name"`
Ranges
struct
{
Ranges
[]
*
struct
{
Start
int
`json:"start,omitempty" description:"
s
tart build number"`
End
int
`json:"end,omitempty" description:"
e
nd build number"`
Start
int
`json:"start,omitempty" description:"
S
tart build number"`
End
int
`json:"end,omitempty" description:"
E
nd build number"`
}
`json:"ranges,omitempty"`
}
`json:"ranges,omitempty" description:"
all build num using
credential"`
}
`json:"usage,omitempty" description:"all usage of
c
redential"`
}
`json:"fingerprint,omitempty" description:"usage of
c
redential"`
Description
string
`json:"description,omitempty" description:"
c
redential's description'"`
Domain
string
`json:"domain,omitempty" description:"
c
redential's domain,In ks we only use the default domain, default '_''"`
CreateTime
*
time
.
Time
`json:"create_time,omitempty" description:"
c
redential's create_time'"`
Creator
string
`json:"creator,omitempty" description:"
c
reator's username"`
UsernamePasswordCredential
*
UsernamePasswordCredential
`json:"username_password,omitempty" description:"username password
c
redential struct"`
SshCredential
*
SshCredential
`json:"ssh,omitempty" description:"ssh
c
redential struct"`
SecretTextCredential
*
SecretTextCredential
`json:"secret_text,omitempty" description:"secret_text
c
redential struct"`
KubeconfigCredential
*
KubeconfigCredential
`json:"kubeconfig,omitempty" description:"kubeconfig
c
redential struct"`
}
`json:"ranges,omitempty" description:"
The build number of all pipelines that use this
credential"`
}
`json:"usage,omitempty" description:"all usage of
C
redential"`
}
`json:"fingerprint,omitempty" description:"usage of
the C
redential"`
Description
string
`json:"description,omitempty" description:"
C
redential's description'"`
Domain
string
`json:"domain,omitempty" description:"
C
redential's domain,In ks we only use the default domain, default '_''"`
CreateTime
*
time
.
Time
`json:"create_time,omitempty" description:"
C
redential's create_time'"`
Creator
string
`json:"creator,omitempty" description:"
C
reator's username"`
UsernamePasswordCredential
*
UsernamePasswordCredential
`json:"username_password,omitempty" description:"username password
C
redential struct"`
SshCredential
*
SshCredential
`json:"ssh,omitempty" description:"ssh
C
redential struct"`
SecretTextCredential
*
SecretTextCredential
`json:"secret_text,omitempty" description:"secret_text
C
redential struct"`
KubeconfigCredential
*
KubeconfigCredential
`json:"kubeconfig,omitempty" description:"kubeconfig
C
redential struct"`
}
type
UsernamePasswordCredential
struct
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录