MaxScale 21.06 Admin User Resource
Admin users represent administrative users that are able to query and change MaxScale's configuration.
Resource Operations
Get network user
GET /v1/users/inet/:nameGet a single network user. The :name in the URI must be a valid network user name.
Response
Status: 200 OK
{
"data": {
"attributes": {
"account": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
},
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
}
}Get all network users
GET /v1/users/inetGet all network users.
Response
Status: 200 OK
{
"data": [
{
"attributes": {
"account": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
}
],
"links": {
"self": "http://localhost:8989/v1/users/inet/"
}
}Get enabled UNIX account
GET /v1/users/unix/:nameNote: This endpoint has been deprecated and does nothing.
Get all enabled UNIX accounts
GET /v1/users/unixNote: This endpoint has been deprecated and does nothing.
Get all users
GET /v1/usersGet all administrative users.
Response
Status: 200 OK
{
"data": [
{
"attributes": {
"account": "admin"
},
"id": "admin",
"links": {
"self": "http://localhost:8989/v1/users/inet/admin/"
},
"type": "inet"
}
],
"links": {
"self": "http://localhost:8989/v1/users/inet/"
}
}Create a network user
POST /v1/users/inetCreate a new network user. The request body must define at least the following fields.
data.idThe username
data.typeType of the object, must be
inetdata.attributes.passwordThe password for this user
data.attributes.accountSet to
adminfor administrative users andbasicto read-only users
Only admin accounts can perform POST, PUT, DELETE and PATCH requests. If a basic
account performs one of the aforementioned request, the REST API will respond
with a 401 Unauthorized error.
Here is an example request body defining the network user my-user with the password my-password that is allowed to execute only read-only operations.
{
"data": {
"id": "my-user", // The user to create
"type": "inet", // The type of the user
"attributes": {
"password": "my-password", // The password to use for the user
"account": "basic" // The type of the account
}
}
}Response
Status: 204 No ContentEnable a UNIX account
POST /v1/users/unixThis enables an existing UNIX account on the system for administrative operations. The request body must define at least the following fields.
data.idThe username
data.typeType of the object, must be
unixdata.attributes.accountSet to
adminfor administrative users andbasicto read-only users
Here is an example request body enabling the UNIX account jdoe for read-only operations.
{
"data": {
"id": "jdoe", // Account name
"type": "unix" // Account type
"attributes": {
"account": "basic" // Type of the user account in MaxScale
}
}
}Response
Status: 204 No ContentDelete a network user
DELETE /v1/users/inet/:nameThe :name part of the URI must be a valid user name.
Response
Status: 204 No ContentDisable a UNIX account
DELETE /v1/users/unix/:nameThe :name part of the URI must be a valid user name.
Response
Status: 204 No ContentUpdate a network user
PATCH /v1/users/inet/:nameUpdate network user. Currently, only the password can be updated. This
means that the request body must define the data.attributes.password
field.
Here is an example request body that updates the password.
{
"data": {
"attributes": {
"password": "new-password"
}
}
}Response
Status: 204 No ContentThis page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?

