Doku durchsuchen
Menü
Geändert am Auf GitHub bearbeiten

Server-API: device groups and folders

Als Markdown kopieren

Diese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in X-API-Key oder ein Anmelde-Token; siehe Die HTTP-API. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.

Device groups, folders and the devices an account was given one by one.

GET /api/panel/device-groups

List device groups with their access lists and member counts.

An account that sees only part of the devices gets the groups open to it and counts only the members it sees.

On the server API, port 21114. Needs device.view.

200: Done (application/json)

Field Type What it is
groups array of object
groups[].guid string
groups[].name string
groups[].note string
groups[].team_id string
groups[].source_type string, one of manual, tag
groups[].tag_filter string The tag of a tag group
groups[].member_count integer
groups[].allowed_users array of string Usernames that see its devices; empty for everyone
groups[].allowed_groups array of string User group guids that see its devices
total integer
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

POST /api/panel/device-groups

Create a device group, or change one when the body has its guid.

The name is cut to 80 characters. Left out on a change, note, team_id and the access lists stay. Setting or changing an access list needs user.edit and an account that sees every device; so does making a tag group. A change of a group whose access list keeps you out is refused.

On the server API, port 21114. Needs device.edit.

Request body, application/json:

Field Type Required What it is
guid string The group to change; without it a new group
name string yes Up to 80 characters
note string Up to 512 characters
team_id string
source_type string, one of manual, tag Default manual
tag_filter string The tag, for a tag group; up to 50 characters
allowed_users array of string Usernames that see its devices
allowed_groups array of string User group guids that see its devices
allowed_users_csv string allowed_users as one comma-separated text
allowed_groups_csv string allowed_groups as one comma-separated text

200: Changed (application/json)

Field Type What it is
guid string
name string
source_type string
tag_filter string
allowed_users array of string What was stored: existing accounts only
allowed_groups array of string
created false

201: Created (application/json)

Field Type
guid string
name string
source_type string
tag_filter string
allowed_users array of string
allowed_groups array of string
created true
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 No group has the guid
503 The database cannot store device groups and folders

DELETE /api/panel/device-groups/{guid}

Delete a device group.

A group with an access list needs user.edit and an account that sees every device, since its devices open to everyone when the list goes.

On the server API, port 21114. Needs device.edit.

Parameter In Type Required What it is
guid path string yes The device group's guid

200: Done (application/json)

Field Type
guid string
deleted true
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 There is no such item

GET /api/panel/device-groups/{guid}/acl

Show who sees a device group's devices.

On the server API, port 21114. Needs device.view.

Parameter In Type Required What it is
guid path string yes The device group's guid

200: Done (application/json)

Who sees the group's devices; empty lists for everyone

Field Type What it is
allowed_users array of string Usernames
allowed_user_groups array of string User group guids
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 There is no such item
503 The database cannot store device groups and folders

PUT /api/panel/device-groups/{guid}/acl

Replace who sees a device group's devices.

Needs an account that sees every device. The answer lists what was stored: existing accounts and user groups only.

On the server API, port 21114. Needs user.edit.

Parameter In Type Required What it is
guid path string yes The device group's guid

Request body, application/json:

Who sees the group's devices; empty lists for everyone

Field Type What it is
allowed_users array of string Usernames
allowed_user_groups array of string User group guids

200: Done (application/json)

Who sees the group's devices; empty lists for everyone

Field Type What it is
allowed_users array of string Usernames
allowed_user_groups array of string User group guids
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 There is no such item
503 The database cannot store device groups and folders

GET /api/panel/device-groups/{guid}/peers

List the devices of a device group.

An account that sees only part of the devices gets only what it sees.

On the server API, port 21114. Needs device.view.

Parameter In Type Required What it is
guid path string yes The device group's guid

200: Done (application/json)

Field Type What it is
guid string
peers array of string Device IDs
total integer
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

PUT /api/panel/device-groups/{guid}/peers

Replace the devices of a device group.

Only devices you see may go in.

On the server API, port 21114. Needs device.edit.

Parameter In Type Required What it is
guid path string yes The device group's guid

Request body, application/json:

Field Type What it is
peers array of string Device IDs

200: Done (application/json)

Field Type
guid string
peers array of string
total integer
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 There is no such item
503 The database cannot store device groups and folders

PUT /api/panel/devices/{id}/device-group

Set the manual device group of a device.

The device joins the group guid and leaves the other groups named in groups, in one step. Its other groups stay.

On the server API, port 21114. Needs device.edit.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type What it is
guid string The group it joins; "" for none
groups array of string The manual groups this choice is about; the device leaves those it does not join

200: Done (application/json)

Field Type
device_id string
guid string
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The device is not in your scope, or a group is not open to you
404 No group has the guid
503 The database cannot store device groups and folders

PUT /api/panel/devices/{id}/folder

Put a device into a folder, or take it out.

On the server API, port 21114. Needs device.edit.

Parameter In Type Required What it is
id path string yes The device ID

Request body, application/json:

Field Type What it is
folder_id integer 0 takes it out of its folder; at least 0

200: Done (application/json)

Field Type
device_id string
folder_id integer
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The device is not in your scope, or the folder is not open to you
503 The database cannot store device groups and folders

GET /api/panel/folders

List folders and which folder each device is in.

An account that sees only part of the devices gets only what it sees.

On the server API, port 21114. Needs device.view.

200: Done (application/json)

Field Type What it is
folders array of object
folders[].id integer
folders[].name string
folders[].color string
folders[].icon string
folders[].sort_order integer
folders[].created_at string (date-time)
assignments object Device ID to folder ID
Error When
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

POST /api/panel/folders

Create a folder.

On the server API, port 21114. Needs device.edit.

Request body, application/json:

Field Type Required What it is
name string yes Up to 80 characters
color string Default #6366f1
icon string Default folder
sort_order integer

201: Created (application/json)

Field Type
id integer
name string
color string
icon string
sort_order integer
created_at string (date-time)
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

PUT /api/panel/folders/{id}

Change a folder.

The body replaces name, color, icon and order. A folder whose access list keeps you out is refused.

On the server API, port 21114. Needs device.edit.

Parameter In Type Required What it is
id path integer yes The folder's ID; at least 1

Request body, application/json:

Field Type Required What it is
name string yes Up to 80 characters
color string
icon string
sort_order integer

200: Done (application/json)

Field Type
id integer
name string
color string
icon string
sort_order integer
created_at string (date-time)
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

DELETE /api/panel/folders/{id}

Delete a folder.

Its devices leave it. A folder with an access list needs user.edit and an account that sees every device.

On the server API, port 21114. Needs device.edit.

Parameter In Type Required What it is
id path integer yes The folder's ID; at least 1

200: Done (application/json)

Field Type
id integer
deleted true
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

GET /api/panel/users/{id}/grants

List the devices an account was given one by one.

On the server API, port 21114. Needs user.view.

Parameter In Type Required What it is
id path integer yes The account ID; at least 1

200: Done (application/json)

Field Type What it is
user_id integer
peers array of string Device IDs
total integer
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
503 The database cannot store device groups and folders

PUT /api/panel/users/{id}/grants

Replace the devices an account was given one by one.

Only for an account whose role you could give, your own included.

On the server API, port 21114. Needs user.edit.

Parameter In Type Required What it is
id path integer yes The account ID; at least 1

Request body, application/json:

Field Type What it is
peers array of string Device IDs

200: Done (application/json)

Field Type
user_id integer
peers array of string
total integer
Error When
400 The request is not valid
401 No credential, or one that is not valid
403 The credential's role lacks the permission
404 There is no such item
503 The database cannot store device groups and folders

Durchsucht Seiten, Abschnitte, Befehle und Einstellungen.