User Management
Reminders:
- Please read Access and Authentication REST API and understand how authentication works.
- On Curl command line, don't forget to quote the URL if it contains the special char
&.
Get User Listâ
-
GET http://host:port/kylin/api/user -
Introduced in: 5.0
-
Request Parameters
name-optionalstring, username.is_case_sensitive-optionalboolean, whether case sensitive on user name andfalseis by default.page_offset-optionalint, offset of returned result, 0 by default.page_size-optionalint, quantity of returned result per page, 10 by default.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X GET \'http://host:port/kylin/api/user' \-H 'Accept: application/vnd.apache.kylin-v4-public+json' \-H 'Accept-Language: en' \-H 'Authorization: Basic QURNSU46S1lMSU4=' \-H 'Content-Type: application/json;charset=utf-8' -
Response Example
{"code": "000","data": {"value": [{"username": "test","authorities": [{"authority": "ALL_USERS"}...],"disabled": false,"default_password": false,"locked": false,"uuid": "af11440a-8e9d-4801-8508-5d0ce0e04a2f","last_modified": 1592296833935,"create_time": 1592296833844,"locked_time": 0,"wrong_time": 0,"first_login_failed_time": 0}...],"offset": 0,"limit": 10,"total_size": 3},"msg": ""}
Create Userâ
-
POST http://host:port/kylin/api/user -
Introduced in: 5.0
-
HTTP Body: JSON Object
username-requiredstring, username.password-requiredstring, password.disabled-requiredboolean, enable the user or not,truemeans the user is disabled andfalsemeans the user is enabled.authorities-requiredarray[string], the user belongs which user group.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X POST \'http://host:port/kylin/api/user' \-H 'Accept: application/vnd.apache.kylin-v4-public+json' \-H 'Accept-Language: en' \-H 'Authorization: Basic QURNSU46S1lMSU4=' \-H 'Content-Type: application/json;charset=utf-8' \-d '{"username": "test","password": "Password@123","disabled": "false","authorities":["ALL_USERS"]}' -
Response Example
{"code": "000","data": "","msg": ""}
Modify the group where user belongsâ
Note: Modifying a user will overwrite the user group values.
-
PUT http://host:port/kylin/api/user -
Introduced in: 5.0
-
HTTP Body: JSON Object
username-requiredstring, username.authorities-requiredarray[string], the user belongs which user group.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X PUT \'http://host:port/kylin/api/user' \-H 'Accept: application/vnd.apache.kylin-v4-public+json' \-H 'Accept-Language: en' \-H 'Authorization: Basic QURNSU46S1lMSU4=' \-H 'Content-Type: application/json;charset=utf-8' \-d '{"username": "createuser","authorities":["ALL_USERS"]}' -
Response Example
{"code": "000","data": "","msg": ""}
Change Passwordâ
-
PUT http://host:port/kylin/api/user/password -
Introduced in: 5.0
-
HTTP Body: JSON Object
username-requiredstring, username.password-requiredstring, original password.new_password-requiredstring, new password.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X PUT \'http://host:port/kylin/api/user' \-H 'Accept: application/vnd.apache.kylin-v4-public+json' \-H 'Accept-Language: en' \-H 'Authorization: Basic QURNSU46S1lMSU4=' \-H 'Content-Type: application/json;charset=utf-8' \-d '{"username": "test","password": "Password@123","new_password": "Password@1234"}' -
Response Example
{"code": "000","data": "","msg": ""}
Delete Userâ
-
DELETE http://host:port/kylin/api/user -
Introduced in: 5.0
-
HTTP Body: JSON Object
username-requiredstring, username.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X DELETE \'http://host:port/kylin/api/user' \-H 'Accept: application/vnd.apache.kylin-v4-public+json' \-H 'Accept-Language: en' \-H 'Authorization: Basic QURNSU46S1lMSU4=' \-H 'Content-Type: application/json;charset=utf-8'-d '{"username": "testuser"}' -
Response Example
{"code": "000","data": "","msg": ""}
Get ACL of a User or Groupâ
-
GET http://host:port/kylin/api/access/acls -
Introduced in: 5.0
-
Request Parameters
type-requiredstring, represents users or user groups, optional values areuserorgroup.name-requiredstring, user or group name.project-optionalstring, project name, fill in the value to get all the permissions of a user or user group in the specified project.
-
HTTP Header
Accept: application/vnd.apache.kylin-v4-public+jsonAccept-Language: enContent-Type: application/json;charset=utf-8
-
Curl Request Example
curl -X GET \'http://host:port/kylin/api/access/acls?type=user&name=ADMIN' \-H 'Accept: application/vnd.apache.kylin-v4-public+json' \-H 'Accept-Language: en' \-H 'Authorization: Basic QURNSU46S1lMSU4=' \-H 'Content-Type: application/json;charset=utf-8' -
Response Example
{"code": "000","data": [{"project_name": "test","project_permission": "ADMIN","acl_info": [{"tables": [{"authorized": true,"columns": [{"authorized": true,"column_name": "C_ADDRESS"}...],"rows": [],"table_name": "CUSTOMER","authorized_column_num": 8,"total_column_num": 8}...],"authorized_table_num": 6,"total_table_num": 6,"database_name": "SSB"}...]}...],"msg": ""}