Vai al contenuto principale
POST
/
sites
/
{siteId}
/
commands
/
synchronous
Esegui Comando Sincrono
curl --request POST \
  --url https://api.altostrat.io/sites/{siteId}/commands/synchronous \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "command": "/interface/print",
  "parameters": [
    "=address=8.8.8.8",
    "=count=4"
  ]
}'
[
  {
    ".id": "*1",
    "name": "ether1",
    "type": "ether",
    "mac-address": "00:1A:2B:3C:4D:5E",
    "mtu": 1500,
    "running": true
  },
  {
    ".id": "*2",
    "name": "ether2",
    "type": "ether",
    "mac-address": "00:1A:2B:3C:4D:5F",
    "mtu": 1500,
    "running": false
  }
]

Authorizations

Authorization
string
header
required

Un JWT emesso dal servizio di autenticazione di Altostrat, contenente i claim dell'utente e dell'organizzazione.

Path Parameters

siteId
string
required

L'identificatore univoco per il sito (router).

Body

application/json

Il comando RouterOS e i suoi parametri da eseguire sul sito di destinazione.

command
string
required

Il percorso del comando API RouterOS. Deve essere un comando di sola lettura.

Example:

"/interface/print"

parameters
string[]

Parametri per il comando API RouterOS, formattati come un array di stringhe. Ogni stringa deve essere nel formato '=chiave=valore'.

Example:
["=address=8.8.8.8", "=count=4"]

Response

Il comando è stato eseguito con successo. Il corpo della risposta contiene la risposta grezza dall'API RouterOS.

La risposta grezza dall'API RouterOS, che è tipicamente un array di oggetti che rappresentano l'output del comando.