Skip to content

Latest commit

 

History

History
887 lines (666 loc) · 22.6 KB

File metadata and controls

887 lines (666 loc) · 22.6 KB

github.com/Phi-S/cs-server-manager API v1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Base URLs:

server

Send game-server command

POST /command

Body parameter

{
  "command": "string"
}

Parameters

Name In Type Required Description
body body handlers.CommandRequest true This command will be executed on the game server
» command body string true none

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK OK string
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Start the server

POST /start

Starts the server with the given start parameters

Body parameter

{
  "hostname": "string",
  "max_players": 128,
  "password": "string",
  "start_map": "string",
  "steam_login_token": "string"
}

Parameters

Name In Type Required Description
body body handlers.StartBody false You can provide no, all or only a few start parameters. The provided start parameters will overwrite the saved start parameters in the start-parameters.json file if the server started successfully.
» hostname body string false none
» max_players body integer false none
» password body string false none
» start_map body string false none
» steam_login_token body string false none

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Get the current status of the server

GET /status

Example responses

200 Response

{
  "hostname": "string",
  "ip": "string",
  "is_game_server_installed": true,
  "map": "string",
  "max_player_count": 0,
  "password": "string",
  "player_count": 0,
  "port": "string",
  "state": "idle"
}

Responses

Status Meaning Description Schema
200 OK OK status.InternalStatus
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Stop the server

POST /stop

Stops the server of if the server is not running, returns 200 OK

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

files

Get editable files

GET /files

Example responses

200 Response

[
  {
    "files": [
      "string"
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [handlers.FilesResponse] false none none
» files [string] false none none
This operation does not require authentication

Get files content

GET /files/{file}

Parameters

Name In Type Required Description
file path string true file to get content for

Example responses

200 Response

"string"

Responses

Status Meaning Description Schema
200 OK OK string
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Set files content

PATCH /files{file}

Body parameter

string

Parameters

Name In Type Required Description
file path string true file to set content for
body body string true file content

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

logs

Get logs

GET /logs/{count}

Parameters

Name In Type Required Description
count path integer true Get the last X logs

Example responses

200 Response

[
  {
    "log_type": "string",
    "message": "string",
    "timestamp": "string"
  }
]

Responses

Status Meaning Description Schema
200 OK OK Inline
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [logwrt.LogEntry] false none none
» log_type string false none none
» message string false none none
» timestamp string false none none
This operation does not require authentication

plugins

Get all available plugins

GET /plugins

Example responses

200 Response

{
  "description": "string",
  "name": "string",
  "url": "string",
  "versions": [
    {
      "dependencies": [
        {
          "dependencies": [
            {}
          ],
          "download_url": "string",
          "install_dir": "string",
          "name": "string",
          "version": "string"
        }
      ],
      "installed": true,
      "name": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK handlers.PluginResponse
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Install given plugin

POST /plugins

Body parameter

{
  "name": "string",
  "version": "string"
}

Parameters

Name In Type Required Description
body body handlers.InstallPluginRequest true The plugin and version that should be installed
» name body string false none
» version body string false none

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Uninstall the currently installed plugin

DELETE /plugins

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

settings

Get the current settings

GET /settings

Example responses

200 Response

{
  "hostname": "string",
  "max_players": 128,
  "password": "string",
  "start_map": "string",
  "steam_login_token": "string"
}

Responses

Status Meaning Description Schema
200 OK OK handlers.SettingsModel
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Update settings

POST /settings

Body parameter

{
  "hostname": "string",
  "max_players": 128,
  "password": "string",
  "start_map": "string",
  "steam_login_token": "string"
}

Parameters

Name In Type Required Description
body body handlers.SettingsModel true The updated settings
» hostname body string true none
» max_players body integer true none
» password body string false none
» start_map body string true none
» steam_login_token body string false none

Example responses

200 Response

{
  "hostname": "string",
  "max_players": 128,
  "password": "string",
  "start_map": "string",
  "steam_login_token": "string"
}

Responses

Status Meaning Description Schema
200 OK OK handlers.SettingsModel
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

update

Start server update

POST /update

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Cancel the server update

POST /update/cancel

Cancel the currently running server update or if no update is currently running, returns 200 OK

Example responses

400 Response

Responses

Status Meaning Description Schema
200 OK OK None
400 Bad Request Bad Request handlers.ErrorResponse
500 Internal Server Error Internal Server Error handlers.ErrorResponse
This operation does not require authentication

Schemas

handlers.CommandRequest

{
  "command": "string"
}

Properties

Name Type Required Restrictions Description
command string true none none

handlers.ErrorResponse

{
  "message": "string",
  "request_id": "string",
  "status": 0
}

Properties

Name Type Required Restrictions Description
message string false none none
request_id string false none none
status integer false none none

handlers.FilesResponse

{
  "files": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
files [string] false none none

handlers.InstallPluginRequest

{
  "name": "string",
  "version": "string"
}

Properties

Name Type Required Restrictions Description
name string false none none
version string false none none

handlers.PluginDependencyResponse

{
  "dependencies": [
    {
      "dependencies": [],
      "download_url": "string",
      "install_dir": "string",
      "name": "string",
      "version": "string"
    }
  ],
  "download_url": "string",
  "install_dir": "string",
  "name": "string",
  "version": "string"
}

Properties

Name Type Required Restrictions Description
dependencies [handlers.PluginDependencyResponse] false none none
download_url string false none none
install_dir string false none none
name string false none none
version string false none none

handlers.PluginResponse

{
  "description": "string",
  "name": "string",
  "url": "string",
  "versions": [
    {
      "dependencies": [
        {
          "dependencies": [
            {}
          ],
          "download_url": "string",
          "install_dir": "string",
          "name": "string",
          "version": "string"
        }
      ],
      "installed": true,
      "name": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
description string false none none
name string false none none
url string false none none
versions [handlers.PluginVersionResponse] false none none

handlers.PluginVersionResponse

{
  "dependencies": [
    {
      "dependencies": [
        {}
      ],
      "download_url": "string",
      "install_dir": "string",
      "name": "string",
      "version": "string"
    }
  ],
  "installed": true,
  "name": "string"
}

Properties

Name Type Required Restrictions Description
dependencies [handlers.PluginDependencyResponse] false none none
installed boolean false none none
name string false none none

handlers.SettingsModel

{
  "hostname": "string",
  "max_players": 128,
  "password": "string",
  "start_map": "string",
  "steam_login_token": "string"
}

Properties

Name Type Required Restrictions Description
hostname string true none none
max_players integer true none none
password string false none none
start_map string true none none
steam_login_token string false none none

handlers.StartBody

{
  "hostname": "string",
  "max_players": 128,
  "password": "string",
  "start_map": "string",
  "steam_login_token": "string"
}

Properties

Name Type Required Restrictions Description
hostname string false none none
max_players integer false none none
password string false none none
start_map string false none none
steam_login_token string false none none

logwrt.LogEntry

{
  "log_type": "string",
  "message": "string",
  "timestamp": "string"
}

Properties

Name Type Required Restrictions Description
log_type string false none none
message string false none none
timestamp string false none none

status.InternalStatus

{
  "hostname": "string",
  "ip": "string",
  "is_game_server_installed": true,
  "map": "string",
  "max_player_count": 0,
  "password": "string",
  "player_count": 0,
  "port": "string",
  "state": "idle"
}

Properties

Name Type Required Restrictions Description
hostname string false none none
ip string false none none
is_game_server_installed boolean false none none
map string false none none
max_player_count integer false none none
password string false none none
player_count integer false none none
port string false none none
state status.State false none none

status.State

"idle"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous idle
anonymous server-starting
anonymous server-started
anonymous server-stopping
anonymous steamcmd-updating
anonymous plugin-installing
anonymous plugin-uninstalling