批量创建角色
开发中
POST
/core/v1/roles
最后修改时间:2024-08-21 04:00:27
责任人:未设置
请求参数
Header 参数
X-Polaris-Token
string
鉴权凭据,必须传
Body 参数application/json
array of:
id
string
id
name
string
名称
owner
string
必需
source
string
来源
metadata
string
标签
comment
string
描述
ctime
string
创建时间
mtime
string
修改时间
users
array[object (用户) {11}]
角色关联的用户列表
id
string
用户ID
name
string
用户名称
owner
string
所属主帐户
auth_token
string
用户身份凭据
comment
string
用户描述
password
string
用户密码
source
string
用户来源
token_enable
boolean
身份凭据是否可用
user_type
string
用户类型
ctime
string
创建时间
mtime
string
修改时间
user_groups
array[object (用户组) {10}]
角色关联的用户组列表
auth_token
string
必需
comment
string
必需
ctime
string
必需
id
string
必需
mtime
string
必需
name
string
必需
owner
string
必需
relation
object
必需
token_enable
boolean
必需
user_count
integer
必需
示例
[
{
"id": "string",
"name": "string",
"owner": "string",
"source": "string",
"metadata": "string",
"comment": "string",
"ctime": "string",
"mtime": "string",
"users": [
{
"id": "string",
"name": "string",
"owner": "string",
"auth_token": "string",
"comment": "string",
"password": "string",
"source": "string",
"token_enable": true,
"user_type": "string",
"ctime": "string",
"mtime": "string"
}
],
"user_groups": [
{
"auth_token": "string",
"comment": "string",
"ctime": "string",
"id": "string",
"mtime": "string",
"name": "string",
"owner": "string",
"relation": {
"group_id": "string",
"users": [
{
"auth_token": "string",
"comment": "string",
"ctime": "string",
"email": "string",
"id": "string",
"mobile": "string",
"mtime": "string",
"name": "string",
"owner": "string",
"password": "string",
"source": "string",
"token_enable": true,
"user_type": "string"
}
]
},
"token_enable": true,
"user_count": 0
}
]
}
]
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://119.91.66.223:8090/core/v1/roles' \
--header 'X-Polaris-Token;' \
--header 'Content-Type: application/json' \
--data-raw ''
返回响应
🟢200成功
application/json
Body
code
integer
状态码
info
string
提示信息
示例
{
"code": 0,
"info": "string"
}
修改于 2024-08-21 04:00:27