An open API service indexing awesome lists of open source software.

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

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.
```