-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
149 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,93 @@ | ||
# ReactPHP Trassir API Client | ||
|
||
 | ||
 | ||
|
||
This application allows you to control Trassir Server via API | ||
|
||
[](https://www.buymeacoffee.com/alexmorbo) | ||
|
||
## Installation | ||
|
||
Docker | ||
```bash | ||
docker run -d --name trassir-api-client -p 8080:8080 \ | ||
-v /path/to/data.db:/app/data/data.db \ | ||
ghcr.io/alexmorbo/react-trassir:master | ||
``` | ||
|
||
## Usage | ||
|
||
Application exposes api, default on port 8080 | ||
|
||
Endpoints: | ||
- POST /instances - add trassir instance | ||
POST JSON: | ||
```json | ||
{ | ||
"ip": "11.11.11.11", | ||
"http_port": 8080, | ||
"rtsp_port": 555, | ||
"login": "username", | ||
"password": "password" | ||
} | ||
``` | ||
|
||
- GET /instances - get all instances | ||
|
||
Example: | ||
```json | ||
[ | ||
{ | ||
"id": 1, | ||
"ip": "11.11.11.11", | ||
"name": "some_server_name", | ||
"http_port": 8080, | ||
"rtsp_port": 555, | ||
"login": "username", | ||
"password": "password", | ||
"created_at": "2023-02-07 21:10:22", | ||
"state": 1, | ||
"channels": [ | ||
{ | ||
"guid": "some_guid", | ||
"name": "some_name", | ||
"rights": "1", | ||
"codec": "H.264", | ||
"have_mainstream": "1", | ||
"have_substream": "1", | ||
"have_hardware_archive": "0", | ||
"have_ptz": "1", | ||
"fish_eye": 0, | ||
"have_voice_comm": "0", | ||
"aspect_ratio": "auto", | ||
"flip": "", | ||
"rotate": "" | ||
}, | ||
... | ||
], | ||
"remote_channels": [ | ||
... | ||
], | ||
"zombies": [ | ||
... | ||
], | ||
"templates": [ | ||
... | ||
] | ||
}, | ||
... | ||
] | ||
``` | ||
|
||
- GET /instances/{id} - get instance by id | ||
Response like GET /instances, but with single instance | ||
|
||
- DELETE /instances/{id} - delete instance by id | ||
|
||
- GET /instances/{id}/channel/{channelGuid}/screenshot - get screenshot from channel | ||
channelGuid - guid of channel from GET /instances/{id} | ||
|
||
- GET /instances/{id}/channel/{channelGuid}/video/{container} - get stream from channel | ||
channelGuid - guid of channel from GET /instances/{id} | ||
container - container of stream, can be: hls, rtsp |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters