Console: resource-control
Copy as MarkdownThese routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.
USB, disks, monitors and quotas on devices.
Show how many devices follow the resource policy.
Asks the server API (GET /api/org/default/resource-policy/compliance); when that fails, the answer is all zeros.
Needs server.config. neodesk resource-control compliance calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
total_devices |
integer | yes | |
compliant |
integer | yes | |
non_compliant |
integer | yes | |
no_policy |
integer | yes | |
compliance_percent |
integer | yes | Percent |
categories |
object | yes | |
categories.usb |
object | ||
categories.usb.enforced |
integer | yes | |
categories.usb.total |
integer | yes | |
categories.optical |
object | ||
categories.optical.enforced |
integer | yes | |
categories.optical.total |
integer | yes | |
categories.monitors |
object | ||
categories.monitors.enforced |
integer | yes | |
categories.monitors.total |
integer | yes | |
categories.disks |
object | ||
categories.disks.enforced |
integer | yes | |
categories.disks.total |
integer | yes | |
categories.quotas |
object | ||
categories.quotas.enforced |
integer | yes | |
categories.quotas.total |
integer | yes | |
with_policy |
integer | Devices with a rule that limits something | |
unreported |
integer | Devices with rules that have not reported on the rules they follow now | |
devices |
object | Per device with a report on the rules it follows now: the state of each kind that limits something |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
List devices for resource control.
Lists every device the server API knows, with a few fields each.
Needs server.config. neodesk resource-control devices calls it.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
devices |
array of object | yes | |
devices[].id |
string | ||
devices[].hostname |
string | ||
devices[].platform |
string | ||
devices[].status |
string | The live status, else the stored one; offline when neither is set | |
devices[].device_type |
string | ||
devices[].tags |
string | The tags as the server API gives them | |
total |
integer | yes |
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 502 | The server API could not be reached |
Show the default resource policy.
The console passes the call on to the server API (GET /api/org/default/resource-policy) and answers with its status and body.
Needs server.config. neodesk resource-control default calls it.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Set the default resource policy.
The console passes the call on to the server API (PUT /api/org/default/resource-policy) and answers with its status and body.
Needs server.config. neodesk resource-control default-set calls it.
Request body, application/json:
The policy, passed on to the server API as it is
Object.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The body is no valid rule |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
Show a device's resource policy.
The console passes the call on to the server API (GET /api/devices/{id}/resources) and answers with its status and body.
Needs server.config. neodesk resource-control policy calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The device ID is not valid |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") |
Set a device's policy for disks.
The console passes the call on to the server API (POST /api/devices/{id}/resources/disks) and answers with its status and body.
Needs server.config. neodesk resource-control disks-set calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
Request body, application/json:
The policy, passed on to the server API as it is
Object.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The body is no valid rule |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") |
Set a device's policy for monitors.
The console passes the call on to the server API (POST /api/devices/{id}/resources/monitors) and answers with its status and body.
Needs server.config. neodesk resource-control monitors-set calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
Request body, application/json:
The policy, passed on to the server API as it is
Object.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The body is no valid rule |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") |
Set a device's policy for optical drives.
The console passes the call on to the server API (POST /api/devices/{id}/resources/optical) and answers with its status and body.
Needs server.config. neodesk resource-control optical-set calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
Request body, application/json:
The policy, passed on to the server API as it is
Object.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The body is no valid rule |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") |
Set a device's policy for disk quotas.
The console passes the call on to the server API (POST /api/devices/{id}/resources/quotas) and answers with its status and body.
Needs server.config. neodesk resource-control quotas-set calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
Request body, application/json:
The policy, passed on to the server API as it is
Object.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The body is no valid rule |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") |
Set a device's policy for USB devices.
The console passes the call on to the server API (POST /api/devices/{id}/resources/usb) and answers with its status and body.
Needs server.config. neodesk resource-control usb-set calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
Request body, application/json:
The policy, passed on to the server API as it is
Object.
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The body is no valid rule |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") |
Hand one kind of a device's rules back to the default.
The console passes the call on to the server API (DELETE /api/devices/{id}/resources/{kind}) and answers with its status and body: the rules the device follows afterwards.
Needs server.config. neodesk resource-control use-default calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
deviceId |
path | string | yes | The device's ID |
kind |
path | string, one of usb, optical, monitors, disks, quotas |
yes | The kind of rule |
200: Done (application/json)
The server API's answer, passed on as it is
| Error | When |
|---|---|
| 400 | The device ID can't go into a path |
| 401 | No session or API token, or one that is not valid (code session_required or token_invalid) |
| 403 | The account or the token may not do this, or a write from a browser came without a good CSRF token |
| 404 | There is no such device (error "Device not found") or kind of rule (error "Unknown kind of rule") |