Endurance

Roles & permissions

Users

Get Users

GET /localUsers/users

curl
curl -X GET "https://appliance.example.com/api/v1/localUsers/users" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/localUsers/users';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/localUsers/users", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/users', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the users
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/users
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "All Users",
  "data": [
    {
      "id": "5e1-db5-4e8-c26",
      "email": "loadbalancer@loadbalancer.org",
      "firstName": "John",
      "lastName": "Doe",
      "disabled": false,
      "groups": [],
      "roles": []
    }
  ]
}

Add a User

POST /localUsers/users

This change is staged. Send PUT /services/apply to apply it.

Body parameters
email string Required
firstname string Required
lastname string Required
password string Required
disabled string Required
groups array
roles array
curl
curl -X POST "https://appliance.example.com/api/v1/localUsers/users" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>",
  "firstname": "<firstname>",
  "lastname": "<lastname>",
  "password": "<password>",
  "disabled": "<disabled>",
  "groups": [
    "<groups>"
  ],
  "roles": [
    "<roles>"
  ]
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/localUsers/users';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'email' => '<email>',
    'firstname' => '<firstname>',
    'lastname' => '<lastname>',
    'password' => '<password>',
    'disabled' => '<disabled>',
    'groups' => [
        '<groups>',
    ],
    'roles' => [
        '<roles>',
    ],
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "email": "<email>",
    "firstname": "<firstname>",
    "lastname": "<lastname>",
    "password": "<password>",
    "disabled": "<disabled>",
    "groups": [
        "<groups>"
    ],
    "roles": [
        "<roles>"
    ]
}

response = requests.post("https://appliance.example.com/api/v1/localUsers/users", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/users', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>",
  "firstname": "<firstname>",
  "lastname": "<lastname>",
  "password": "<password>",
  "disabled": "<disabled>",
  "groups": [
    "<groups>"
  ],
  "roles": [
    "<roles>"
  ]
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a user
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/users
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "email": "<email>",
    "firstname": "<firstname>",
    "lastname": "<lastname>",
    "password": "<password>",
    "disabled": "<disabled>",
    "groups": [
      "<groups>"
    ],
    "roles": [
      "<roles>"
    ]
  }
}
Response
{
  "status": "success",
  "message": "User added",
  "data": {
    "id": "5e1-db5-4e8-c26"
  }
}

Users by ID

Get User

GET /localUsers/users/{id}

Path parameters
id string Required
curl
curl -X GET "https://appliance.example.com/api/v1/localUsers/users/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/localUsers/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/localUsers/users/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/users/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get a user
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/users/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Get User",
  "data": {
    "id": "5e1-db5-4e8-c26",
    "email": "loadbalancer@loadbalancer.org",
    "firstName": "John",
    "lastName": "Doe",
    "disabled": false,
    "groups": [],
    "roles": []
  }
}

Delete a user

DELETE /localUsers/users/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/localUsers/users/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/localUsers/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/localUsers/users/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/users/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Delete a user
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/users/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "User Deleted"
}

Groups

Get Groups

GET /rbac/groups

curl
curl -X GET "https://appliance.example.com/api/v1/rbac/groups" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/groups';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/rbac/groups", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/groups', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the groups
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/groups
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "All Groups",
  "data": [
    {
      "id": "5e1-db5-4e8-c26",
      "name": "loadbalancer",
      "users": [],
      "roles": []
    }
  ]
}

Add a Group

POST /rbac/groups

This change is staged. Send PUT /services/apply to apply it.

Body parameters
id string Required
name string Required
curl
curl -X POST "https://appliance.example.com/api/v1/rbac/groups" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "<id>",
  "name": "<name>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/groups';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'id' => '<id>',
    'name' => '<name>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "id": "<id>",
    "name": "<name>"
}

response = requests.post("https://appliance.example.com/api/v1/rbac/groups", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/groups', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "id": "<id>",
  "name": "<name>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a group
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/groups
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "id": "<id>",
    "name": "<name>"
  }
}
Response
{
  "status": "success",
  "message": "Group added",
  "data": {
    "id": "5e1-db5-4e8-c26"
  }
}

Groups by ID

Get Group

GET /rbac/groups/{id}

Path parameters
id string Required

The id of the group.

curl
curl -X GET "https://appliance.example.com/api/v1/rbac/groups/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/groups/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/rbac/groups/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/groups/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get a group
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/groups/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Get Group",
  "data": {
    "id": "5e1-db5-4e8-c26",
    "name": "loadbalancer",
    "users": [],
    "roles": []
  }
}

Edit a Group

PUT /rbac/groups/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

.Body parameters

name string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/rbac/groups/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/groups/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "name": "<name>"
}

response = requests.put("https://appliance.example.com/api/v1/rbac/groups/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/groups/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Update a group
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/groups/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "name": "<name>"
  }
}
Response
{
  "status": "success",
  "message": "Group edited"
}

Delete a group

DELETE /rbac/groups/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/rbac/groups/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/groups/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/rbac/groups/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/groups/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Delete a group
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/groups/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Group deleted"
}

Roles

Get Roles

GET /rbac/roles

curl
curl -X GET "https://appliance.example.com/api/v1/rbac/roles" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/roles';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/rbac/roles", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/roles', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the roles
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/roles
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "All Roles",
  "data": [
    {
      "id": "5e1-db5-4e8-c26",
      "name": "Admin",
      "users": [
        "5e1-db5-4e8-564"
      ],
      "groups": [],
      "endpoints": [
        {
          "path": "/haproxy",
          "methods": [
            "GET"
          ]
        }
      ]
    }
  ]
}

Add a Role

POST /rbac/roles

This change is staged. Send PUT /services/apply to apply it.

Body parameters
name string Required
users array Required

Array of users ids

groups array Required

Array of groups ids

endpoints array Required

Array of endpoints ids

curl
curl -X POST "https://appliance.example.com/api/v1/rbac/roles" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>",
  "users": [
    "<users>"
  ],
  "groups": [
    "<groups>"
  ],
  "endpoints": [
    "<endpoints>"
  ]
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/roles';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
    'users' => [
        '<users>',
    ],
    'groups' => [
        '<groups>',
    ],
    'endpoints' => [
        '<endpoints>',
    ],
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "name": "<name>",
    "users": [
        "<users>"
    ],
    "groups": [
        "<groups>"
    ],
    "endpoints": [
        "<endpoints>"
    ]
}

response = requests.post("https://appliance.example.com/api/v1/rbac/roles", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/roles', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>",
  "users": [
    "<users>"
  ],
  "groups": [
    "<groups>"
  ],
  "endpoints": [
    "<endpoints>"
  ]
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a role
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/roles
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "name": "<name>",
    "users": [
      "<users>"
    ],
    "groups": [
      "<groups>"
    ],
    "endpoints": [
      "<endpoints>"
    ]
  }
}
Response
{
  "status": "success",
  "message": "Role added",
  "data": {
    "id": "5e1-db5-4e8-c26"
  }
}

Roles by ID

Get Role

GET /rbac/roles/{id}

Path parameters
id string Required
curl
curl -X GET "https://appliance.example.com/api/v1/rbac/roles/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/roles/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/rbac/roles/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/roles/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get a role
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/roles/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Get Role",
  "data": {
    "id": "5e1-db5-4e8-c26",
    "name": "Admin",
    "users": [
      "5e1-db5-4e8-564"
    ],
    "groups": [],
    "endpoints": [
      {
        "path": "/",
        "methods": [
          "GET",
          "POST",
          "PUT",
          "DELETE"
        ]
      }
    ]
  }
}

Delete a role

DELETE /rbac/roles/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/rbac/roles/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/rbac/roles/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/rbac/roles/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/rbac/roles/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Delete a role
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/rbac/roles/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Role Deleted"
}