Skip to content
/ svcctl Public

Provide a web interface to query/control Windows Service

Notifications You must be signed in to change notification settings

koho/svcctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.