Merge branch 'master' into master

This commit is contained in:
Zhuxiaoyang
2019-06-21 22:20:55 +08:00
committed by GitHub
18 changed files with 101 additions and 106 deletions

View File

@@ -116,7 +116,7 @@ func ListNamespaceUsers(req *restful.Request, resp *restful.Response) {
func ListUserRoles(req *restful.Request, resp *restful.Response) {
username := req.PathParameter("username")
username := req.PathParameter("user")
roles, err := iam.GetUserRoles("", username)

View File

@@ -61,7 +61,7 @@ func CreateGroup(req *restful.Request, resp *restful.Response) {
}
func DeleteGroup(req *restful.Request, resp *restful.Response) {
path := req.PathParameter("path")
path := req.PathParameter("group")
if path == "" {
resp.WriteHeaderAndEntity(http.StatusBadRequest, errors.Wrap(fmt.Errorf("group path must not be null")))
@@ -84,7 +84,7 @@ func DeleteGroup(req *restful.Request, resp *restful.Response) {
}
func UpdateGroup(req *restful.Request, resp *restful.Response) {
groupPathInPath := req.PathParameter("path")
groupPathInPath := req.PathParameter("group")
var group models.Group
@@ -108,7 +108,7 @@ func UpdateGroup(req *restful.Request, resp *restful.Response) {
func DescribeGroup(req *restful.Request, resp *restful.Response) {
path := req.PathParameter("path")
path := req.PathParameter("group")
group, err := iam.DescribeGroup(path)
@@ -127,7 +127,7 @@ func DescribeGroup(req *restful.Request, resp *restful.Response) {
func ListGroupUsers(req *restful.Request, resp *restful.Response) {
path := req.PathParameter("path")
path := req.PathParameter("group")
group, err := iam.DescribeGroup(path)

View File

@@ -77,7 +77,7 @@ func CreateUser(req *restful.Request, resp *restful.Response) {
}
func DeleteUser(req *restful.Request, resp *restful.Response) {
username := req.PathParameter("username")
username := req.PathParameter("user")
operator := req.HeaderParameter(constants.UserNameHeader)
@@ -98,7 +98,7 @@ func DeleteUser(req *restful.Request, resp *restful.Response) {
func UpdateUser(req *restful.Request, resp *restful.Response) {
usernameInPath := req.PathParameter("username")
usernameInPath := req.PathParameter("user")
usernameInHeader := req.HeaderParameter(constants.UserNameHeader)
var user models.User
@@ -161,8 +161,8 @@ func isUserManager(username string) (bool, error) {
return false, nil
}
func UserLoginLog(req *restful.Request, resp *restful.Response) {
username := req.PathParameter("username")
func UserLoginLogs(req *restful.Request, resp *restful.Response) {
username := req.PathParameter("user")
logs, err := iam.LoginLog(username)
if err != nil {
@@ -187,7 +187,7 @@ func UserLoginLog(req *restful.Request, resp *restful.Response) {
func DescribeUser(req *restful.Request, resp *restful.Response) {
username := req.PathParameter("username")
username := req.PathParameter("user")
user, err := iam.DescribeUser(username)

View File

@@ -77,7 +77,7 @@ func DescribeWorkspaceRole(req *restful.Request, resp *restful.Response) {
func DescribeWorkspaceUser(req *restful.Request, resp *restful.Response) {
workspace := req.PathParameter("workspace")
username := req.PathParameter("username")
username := req.PathParameter("member")
workspaceRole, err := iam.GetUserWorkspaceRole(workspace, username)
@@ -132,7 +132,7 @@ func InviteUser(req *restful.Request, resp *restful.Response) {
func RemoveUser(req *restful.Request, resp *restful.Response) {
workspace := req.PathParameter("workspace")
username := req.PathParameter("username")
username := req.PathParameter("member")
err := workspaces.RemoveUser(workspace, username)
if err != nil {

View File

@@ -117,7 +117,7 @@ func ListNamespacedApplication(req *restful.Request, resp *restful.Response) {
}
func DescribeApplication(req *restful.Request, resp *restful.Response) {
clusterId := req.PathParameter("cluster_id")
clusterId := req.PathParameter("application")
namespaceName := req.PathParameter("namespace")
app, err := applications.GetApp(clusterId)
if err != nil {
@@ -166,7 +166,7 @@ func DeployApplication(req *restful.Request, resp *restful.Response) {
}
func DeleteApplication(req *restful.Request, resp *restful.Response) {
clusterId := req.PathParameter("cluster_id")
clusterId := req.PathParameter("application")
namespaceName := req.PathParameter("namespace")
app, err := applications.GetApp(clusterId)
if err != nil {

View File

@@ -29,7 +29,7 @@ import (
func GetKubectl(req *restful.Request, resp *restful.Response) {
user := req.PathParameter("username")
user := req.PathParameter("user")
kubectlPod, err := kubectl.GetKubectlPod(user)
@@ -43,7 +43,7 @@ func GetKubectl(req *restful.Request, resp *restful.Response) {
func GetKubeconfig(req *restful.Request, resp *restful.Response) {
user := req.PathParameter("username")
user := req.PathParameter("user")
kubectlConfig, err := kubeconfig.GetKubeConfig(user)

View File

@@ -107,7 +107,7 @@ func ListNamespacesByUsername(req *restful.Request, resp *restful.Response) {
func ListNamespaces(req *restful.Request, resp *restful.Response) {
workspace := req.PathParameter("workspace")
username := req.PathParameter("username")
username := req.PathParameter("member")
// /workspaces/{workspace}/members/{username}/namespaces
if username == "" {
// /workspaces/{workspace}/namespaces
@@ -218,7 +218,7 @@ func ListDevopsProjectsByUsername(req *restful.Request, resp *restful.Response)
func ListDevopsProjects(req *restful.Request, resp *restful.Response) {
workspace := req.PathParameter("workspace")
username := req.PathParameter(constants.UserNameHeader)
username := req.PathParameter("member")
if username == "" {
username = req.HeaderParameter(constants.UserNameHeader)
}
@@ -245,7 +245,7 @@ func ListDevopsProjects(req *restful.Request, resp *restful.Response) {
}
func DeleteDevopsProject(req *restful.Request, resp *restful.Response) {
projectId := req.PathParameter("id")
projectId := req.PathParameter("devops")
workspaceName := req.PathParameter("workspace")
username := req.HeaderParameter(constants.UserNameHeader)

View File

@@ -26,7 +26,7 @@ import (
"kubesphere.io/kubesphere/pkg/models/status"
)
func GetClusterResourceStatus(req *restful.Request, resp *restful.Response) {
func GetClusterAbnormalWorkloads(req *restful.Request, resp *restful.Response) {
res, err := status.GetClusterResourceStatus()
if err != nil {
resp.WriteHeaderAndEntity(http.StatusInternalServerError, errors.Wrap(err))
@@ -35,7 +35,7 @@ func GetClusterResourceStatus(req *restful.Request, resp *restful.Response) {
resp.WriteAsJson(res)
}
func GetNamespacesResourceStatus(req *restful.Request, resp *restful.Response) {
func GetNamespacedAbnormalWorkloads(req *restful.Request, resp *restful.Response) {
res, err := status.GetNamespacesResourceStatus(req.PathParameter("namespace"))
if err != nil {
resp.WriteHeaderAndEntity(http.StatusInternalServerError, errors.Wrap(err))