update api docs (#490)
* update api docs Signed-off-by: hongming <talonwan@yunify.com> * fix: kube-apiserver host in kubeconfig Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user