Console: remote-targets
Copy as MarkdownThese routes are on the console, port 3375. They take an API token as Authorization: Bearer ndt_...; see API tokens.
RDP and VNC targets.
List remote targets.
Lists the targets the account sees, by the scope of the device list, each with its device groups.
Needs remote_target.view. neodesk remote-targets list calls it.
| Parameter | In | Type | What it is |
|---|---|---|---|
include_disabled |
query | string, one of true, false |
true to list turned-off targets too; default "false" |
200: The targets (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.targets |
array of RemoteTargetDevice | |
data.total |
integer |
| 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 |
Add an RDP or VNC target.
The target is made by the API server, which names the console as created_by. created_at and updated_at in the answer are 0001-01-01T00:00:00Z; read the target again for the real times.
Needs remote_target.edit. neodesk remote-targets create calls it.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
name |
string | yes | at most 160 characters; at most 160 characters |
protocol |
string, one of rdp, vnc |
yes | |
host |
string | yes | a host name or IP address, at most 253 characters, without spaces or slashes; at most 253 characters |
port |
integer | yes | at least 1, at most 65535 |
platform |
string | ||
username |
string | ||
credential_mode |
string, one of saved, prompt, none |
prompt when missing | |
tls_mode |
string, one of required, preferred, disabled |
preferred when missing | |
cert_fingerprint |
string | the certificate fingerprint to trust, at most 128 characters; at most 128 characters | |
org_id |
string | the organization the target belongs to | |
enabled |
boolean | true when missing |
201: Added (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
RemoteTarget |
| Error | When |
|---|---|
| 400 | The body is not valid (the API server's message) |
| 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 whether remote targets can be reached from here.
Needs remote_target.view. neodesk remote-targets readiness calls it.
200: The readiness (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
success |
true |
yes | |
data |
object | ||
data.vault |
boolean | Whether passwords can be saved (REMOTE_TARGET_VAULT_KEY is set) | |
data.guacd |
boolean | Whether sessions can start (guacd answers at GUACD_ADDRESS) |
| 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 API server did not answer |
Check that an address answers, before adding it as a target.
The server opens a TCP connection to host and port, waiting at most 5 seconds. Loopback, link-local and cloud metadata addresses are refused (remote target is not allowed). Nothing is saved.
Needs remote_target.test. neodesk remote-targets test calls it.
Request body, application/json:
The same fields as for adding a target; only host and port are tried, the rest is checked.
| Field | Type | Required | What it is |
|---|---|---|---|
name |
string | yes | at most 160 characters; at most 160 characters |
protocol |
string, one of rdp, vnc |
yes | |
host |
string | yes | a host name or IP address, at most 253 characters, without spaces or slashes; at most 253 characters |
port |
integer | yes | at least 1, at most 65535 |
platform |
string | ||
username |
string | ||
credential_mode |
string, one of saved, prompt, none |
prompt when missing | |
tls_mode |
string, one of required, preferred, disabled |
preferred when missing | |
cert_fingerprint |
string | the certificate fingerprint to trust, at most 128 characters; at most 128 characters | |
org_id |
string | the organization the target belongs to | |
enabled |
boolean | true when missing |
200: The address answers (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.reachable |
true |
|
data.protocol |
string | |
data.host |
string | |
data.port |
integer |
| Error | When |
|---|---|
| 400 | The body is not valid, the address is not allowed, or it does not answer (remote target is unreachable) |
| 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 one remote target.
Answers the target with its device groups.
Needs remote_target.view. neodesk remote-targets get calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
200: The target (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
RemoteTargetDevice |
| 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 |
| 404 | There is no such item, or the account does not see it |
Change a remote target.
Fields that are missing or empty keep their value, except platform, which a change without it clears.
Needs remote_target.edit. neodesk remote-targets update calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
Request body, application/json:
Fields that are missing or empty keep their value, except platform.
| Field | Type | What it is |
|---|---|---|
name |
string | at most 160 characters; at most 160 characters |
protocol |
string, one of rdp, vnc |
|
host |
string | a host name or IP address, at most 253 characters, without spaces or slashes; at most 253 characters |
port |
integer | at least 1, at most 65535 |
platform |
string | replaces the platform; missing or empty clears it |
username |
string | |
credential_mode |
string, one of saved, prompt, none |
prompt when missing |
tls_mode |
string, one of required, preferred, disabled |
preferred when missing |
cert_fingerprint |
string | the certificate fingerprint to trust, at most 128 characters; at most 128 characters |
org_id |
string | the organization the target belongs to |
enabled |
boolean | keeps its value when missing |
200: Changed (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
RemoteTarget |
| Error | When |
|---|---|
| 400 | The body is not valid (the API server's message) |
| 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 item, or the account does not see it |
Delete a remote target.
Needs remote_target.delete. neodesk remote-targets delete calls it. It cannot be undone.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
200: Deleted (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.status |
"deleted" |
|
data.id |
string |
| Error | When |
|---|---|
| 400 | The API server could not delete it |
| 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 item, or the account does not see it |
Trust a remote target's certificate.
Saves the fingerprint as the target's trusted certificate; sessions then check it.
Needs remote_target.connect. neodesk remote-targets certificate-accept calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
fingerprint |
string | yes | hexadecimal; spaces are taken out and letters made small. The first group must have at least 32 characters. |
200: Trusted (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.status |
"ok" |
|
data.fingerprint |
string |
| Error | When |
|---|---|
| 400 | The fingerprint 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 item, or the account does not see it |
Show whether a remote target has a saved sign-in (never the password).
Needs remote_target.view. neodesk remote-targets credentials calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
200: The sign-in state (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.username |
string | |
data.password_set |
boolean | |
data.credential_mode |
string, one of saved, prompt, none |
| 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 |
| 404 | There is no such item, or the account does not see it |
| 502 | The API server did not answer |
Save a remote target's sign-in (stored encrypted).
The API server encrypts the password and keeps it; credential_mode becomes saved. Needs REMOTE_TARGET_VAULT_KEY on the server.
Needs remote_target.edit. neodesk remote-targets credentials-set calls it.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
username |
string | at most 256 characters; at most 256 characters | |
password |
string | yes | at most 4096 characters; at most 4096 characters |
200: Saved (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.status |
"ok" |
|
data.username |
string | |
data.password_set |
true |
| Error | When |
|---|---|
| 400 | password is missing, a value is too long, or the credential vault is not configured |
| 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 item, or the account does not see it |
Delete a remote target's saved sign-in.
Deletes the saved password; credential_mode becomes prompt. The username stays.
Needs remote_target.edit. neodesk remote-targets credentials-delete calls it. It cannot be undone.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
id |
path | string | yes | The remote target ID (rt_...) |
200: Deleted (application/json)
| Field | Type | Required |
|---|---|---|
success |
true |
yes |
data |
object | |
data.status |
"ok" |
|
data.credential_mode |
"prompt" |
| Error | When |
|---|---|
| 400 | The API server could not delete it |
| 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 item, or the account does not see it |