https://github.com/koho/svcctl
Provide a web interface to query/control Windows Service
https://github.com/koho/svcctl
Last synced: 4 months ago
JSON representation
Provide a web interface to query/control Windows Service
- Host: GitHub
- URL: https://github.com/koho/svcctl
- Owner: koho
- Created: 2020-06-15T09:54:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-10T18:25:00.000Z (over 3 years ago)
- Last Synced: 2025-10-31T05:41:00.039Z (8 months ago)
- Language: C++
- Size: 1.18 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# svcctl
Provide a web api to query/control service in Windows.
## API
### Query
URL: /query/{name}
Method: GET
Headers:
- Authorization: {token}
ContentType: JSON
Response:
- `code`: Status code. If no errors occurred, it should be zero. Otherwise, it's a nonzero value.
- `msg`: Message about calling result.
- `name`: Name of the service.
- `status`: The Service status(bool). It's `true` when the service is running.
Description:
- `name`: Service name.
- `token`: API token for authorization.
### Control
URL: /ctl/{name}/{action}[&timeout={timeout}]
Method: GET
Headers:
- Authorization: {token}
ContentType: JSON
Response:
- `code`: Status code. If no errors occurred, it should be zero. Otherwise, it's a nonzero value.
- `msg`: Message about calling result.
- `name`: Name of the service.
- `action`: The control action of the service.
Description:
- `name`: Service name.
- `action`: Control action(start|stop).
- `token`: API token for authorization.
- `timeout`: Operation timeout(in seconds).
### File
URL: /file?path=
Method: GET/POST
Headers:
- Authorization: {token}
Query:
- `path`: Download/Upload file path.
Form:
GET: -
POST:
`file`: Upload file
Response:
- GET: application/octet-stream
- POST: JSON
Description:
- `path`: Download/Upload file path.
- `token`: API token for authorization.
## Server
### Build
```
build.cmd
```
Binary files are located in `bin`.
### Usage
```
Usage of svcctl.exe:
-address string
Address to be serve on. (default ":9001")
-install
Install as service.
-service
Run as service.
-token string
API token for authorization.
-uninstall
Uninstall service.
-version
Print version info.
```