API for Linux commands Atoms
In the “Autoconductor-Bus” tab, there is a command “Interact”. Using this command, commands are transmitted, a list of commands per atom. We can also see the result of executing commands.
Example
https://<admin_address>/backend/api.php
URL - admin panel host (For example : https://adm.pilot-gps.com/)
The login and password from the partner’s Admin are indicated as the login and password!
1. Get a list of sent Linux commands (History) (atom GetAll)
Parameters:
cmd = atom_get_all
ident - The ID by which records are filtered.
Method: GET
Request:
https://<admin_address>/backend/api.php?cmd=atom_get_all&ident=b0:44:6t:0d:a9:04
Response:
[
{"id":27899,"agent_id":null,"ident":"8v:f5:8c:01:13:70","script":"ls \/root\/","processed":null,"ts":1712138610,"result":null}
]
Error Responses:
Code: 400 Bad Request
Content: {"error": "Missing ident param"}
2.Get a list of Linux command templates (get Commands)
Parameters:
cmd = atom_get_commands
Method: GET
Request:
https://<admin_address>backend/api.php?cmd=atom_get_commands&ident=80:c5:80:01:68:08
Response:
[ {"id": 36,"command_name": "Список Видео","description": null,"command": "ls -lsh /video/*.avi"} ]
Error Responses:
Code: 400 Bad Request
Content: Unknown macro: {Unknown macro}
3. Send a Linux command (create Command)
Method: POST
Parameters:
cmd = atom_create_command
ident - Agent ID.
script - Command script (optional)
Request:
https://<admin_address>/backend/api.php?cmd=atom_create_command&ident=b1:42:67:00:00:fd
Response:
27917 - ID of the command added to the queue
Error Responses:
-
Code: 400 Bad Request
-
*Content:{*Missing ident param}
4. Delete Command Linux
You can delete a command that has already been sent only if the response has not yet been received:
Parameters:
cmd = atom_delete_command
command_id - The command ID to delete.
Method: GET
Request:
https://<admin_address>/backend/api.php?cmd=atom_delete_command&ident=b0:44:6f:0d:av:88&command_id=27921
Response:
"Success delete"
Error Responses:
Code: 400 Bad Request
Content: Missing ident param"
Content: "Command already proccessed"