Files
acc-server-manager/swagger/swagger.json
Fran Jurmanović ac61ba5223
All checks were successful
Release and Deploy / build (push) Successful in 2m16s
Release and Deploy / deploy (push) Successful in 25s
update swagger docs
2025-08-05 14:32:37 +02:00

1975 lines
69 KiB
JSON

{
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"info": {
"description": "API for managing Assetto Corsa Competizione dedicated servers",
"title": "ACC Server Manager API",
"contact": {
"name": "ACC Server Manager Support",
"url": "https://github.com/FJurmanovic/acc-server-manager"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"version": "1.0"
},
"host": "https://acc.jurmanovic.com",
"basePath": "/api/v1",
"paths": {
"/v1/api/server": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all ACC servers with filtering options",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "List all servers (API format)",
"parameters": [
{
"type": "string",
"name": "name",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"name": "serverID",
"in": "query"
},
{
"type": "string",
"name": "serviceName",
"in": "query"
},
{
"type": "string",
"name": "sortBy",
"in": "query"
},
{
"type": "boolean",
"name": "sortDesc",
"in": "query"
},
{
"type": "string",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of servers",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.ServerAPI"
}
}
},
"400": {
"description": "Invalid filter parameters",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/auth/login": {
"post": {
"description": "Authenticate a user and receive a JWT token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "User login",
"parameters": [
{
"description": "Login credentials",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "JWT token",
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Invalid credentials",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/auth/me": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get details of the currently authenticated user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authentication"
],
"summary": "Get current user details",
"responses": {
"200": {
"description": "Current user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/lookup/car-models": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available ACC car models with their identifiers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Lookups"
],
"summary": "Get available car models",
"responses": {
"200": {
"description": "List of car models",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"class": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/lookup/cup-categories": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available racing cup categories",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Lookups"
],
"summary": "Get cup categories",
"responses": {
"200": {
"description": "List of cup categories",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string"
}
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/lookup/driver-categories": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all driver categories (Bronze, Silver, Gold, Platinum)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Lookups"
],
"summary": "Get driver categories",
"responses": {
"200": {
"description": "List of driver categories",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "number"
},
"name": {
"type": "string"
}
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/lookup/session-types": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available session types (Practice, Qualifying, Race)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Lookups"
],
"summary": "Get session types",
"responses": {
"200": {
"description": "List of session types",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/lookup/tracks": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available ACC tracks with their identifiers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Lookups"
],
"summary": "Get available tracks",
"responses": {
"200": {
"description": "List of tracks",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/membership": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all registered users",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "List all users",
"responses": {
"200": {
"description": "List of users",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.User"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new user account with specified role",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Create a new user",
"parameters": [
{
"description": "User details",
"name": "user",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"role": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "Created user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"409": {
"description": "User already exists",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/membership/roles": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available user roles",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Get all roles",
"responses": {
"200": {
"description": "List of roles",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Role"
}
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/membership/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get detailed information about a specific user",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Get user by ID",
"parameters": [
{
"type": "string",
"description": "User ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "User details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid user ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update user details by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Update user",
"parameters": [
{
"type": "string",
"description": "User ID (UUID format)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated user details",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/service.UpdateUserRequest"
}
}
],
"responses": {
"200": {
"description": "Updated user details",
"schema": {
"$ref": "#/definitions/model.User"
}
},
"400": {
"description": "Invalid request body or ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete a specific user by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Management"
],
"summary": "Delete user",
"parameters": [
{
"type": "string",
"description": "User ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "User successfully deleted"
},
"400": {
"description": "Invalid user ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "User not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all ACC servers with detailed information",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "List all servers",
"parameters": [
{
"type": "string",
"name": "name",
"in": "query"
},
{
"type": "integer",
"name": "page",
"in": "query"
},
{
"type": "integer",
"name": "pageSize",
"in": "query"
},
{
"type": "string",
"name": "serverID",
"in": "query"
},
{
"type": "string",
"name": "serviceName",
"in": "query"
},
{
"type": "string",
"name": "sortBy",
"in": "query"
},
{
"type": "boolean",
"name": "sortDesc",
"in": "query"
},
{
"type": "string",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of servers with full details",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Server"
}
}
},
"400": {
"description": "Invalid filter parameters",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create a new ACC server instance with the provided configuration",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "Create a new ACC server",
"parameters": [
{
"description": "Server configuration",
"name": "server",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Server"
}
}
],
"responses": {
"200": {
"description": "Created server details",
"schema": {
"type": "object"
}
},
"400": {
"description": "Invalid server data",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get detailed information about a specific ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "Get server by ID",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Server details",
"schema": {
"$ref": "#/definitions/model.Server"
}
},
"400": {
"description": "Invalid server ID format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update configuration for an existing ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "Update an ACC server",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated server configuration",
"name": "server",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.Server"
}
}
],
"responses": {
"200": {
"description": "Updated server details",
"schema": {
"type": "object"
}
},
"400": {
"description": "Invalid server data or ID",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
"BearerAuth": []
}
],
"description": "Delete an existing ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server"
],
"summary": "Delete an ACC server",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Deleted server details",
"schema": {
"type": "object"
}
},
"400": {
"description": "Invalid server data or ID",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/config": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get a list of all available configuration files for an ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server Configuration"
],
"summary": "List available configuration files",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "List of available configuration files",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": "Invalid server ID",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/config/{file}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieve a specific configuration file for an ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server Configuration"
],
"summary": "Get server configuration file",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Config file name (e.g., configuration.json, settings.json, event.json)",
"name": "file",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Configuration file content as JSON",
"schema": {
"type": "object"
}
},
"400": {
"description": "Invalid server ID",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server or config file not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
},
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update a specific configuration file for an ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Server Configuration"
],
"summary": "Update server configuration file",
"parameters": [
{
"type": "string",
"description": "Server ID (UUID format)",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Config file name (e.g., configuration.json, settings.json, event.json)",
"name": "file",
"in": "path",
"required": true
},
{
"description": "Configuration file content as JSON",
"name": "content",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "Update successful",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request or JSON format",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Server or config file not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/service/restart": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Stop and start a Windows service for an ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Service Control"
],
"summary": "Restart a Windows service",
"parameters": [
{
"description": "Service name to restart",
"name": "service",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "Service restarted successfully",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Service not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/service/start": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Start a stopped Windows service for an ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Service Control"
],
"summary": "Start a Windows service",
"parameters": [
{
"description": "Service name to start",
"name": "service",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "Service started successfully",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Service not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"409": {
"description": "Service already running",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/service/stop": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Stop a running Windows service for an ACC server",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Service Control"
],
"summary": "Stop a Windows service",
"parameters": [
{
"description": "Service name to stop",
"name": "service",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "Service stopped successfully",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid request body",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"403": {
"description": "Insufficient permissions",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Service not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"409": {
"description": "Service already stopped",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/server/{id}/service/{service}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get the current status of a Windows service",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Service Control"
],
"summary": "Get service status",
"parameters": [
{
"type": "string",
"description": "Service name",
"name": "service",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Service status information",
"schema": {
"type": "object",
"properties": {
"state": {
"type": "string"
},
"status": {
"type": "string"
}
}
}
},
"400": {
"description": "Invalid service name",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"404": {
"description": "Service not found",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/error_handler.ErrorResponse"
}
}
}
}
},
"/v1/state-history": {
"get": {
"description": "Return StateHistorys",
"tags": [
"StateHistory"
],
"summary": "Return StateHistorys",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"/v1/state-history/statistics": {
"get": {
"description": "Return StateHistorys",
"tags": [
"StateHistory"
],
"summary": "Return StateHistorys",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"/v1/system/health": {
"get": {
"description": "Return service control status",
"tags": [
"system"
],
"summary": "Return service control status",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {
"error_handler.ErrorResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"details": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"error": {
"type": "string"
}
}
},
"model.Permission": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"model.Role": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Permission"
}
}
}
},
"model.Server": {
"type": "object",
"properties": {
"dateCreated": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"description": "e.g. \"/acc/servers/server1/\"",
"type": "string"
},
"serviceName": {
"description": "Windows service name",
"type": "string"
},
"state": {
"$ref": "#/definitions/model.ServerState"
},
"status": {
"$ref": "#/definitions/model.ServiceStatus"
}
}
},
"model.ServerAPI": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"playerCount": {
"type": "integer"
},
"state": {
"$ref": "#/definitions/model.ServerState"
},
"status": {
"$ref": "#/definitions/model.ServiceStatus"
},
"track": {
"type": "string"
}
}
},
"model.ServerState": {
"type": "object",
"properties": {
"maxConnections": {
"type": "integer"
},
"playerCount": {
"type": "integer"
},
"session": {
"type": "string"
},
"sessionDurationMinutes": {
"type": "integer"
},
"sessionStart": {
"type": "string"
},
"track": {
"type": "string"
}
}
},
"model.ServiceStatus": {
"type": "integer",
"enum": [
0,
1,
2,
3,
4,
5
],
"x-enum-varnames": [
"StatusUnknown",
"StatusStopped",
"StatusStopping",
"StatusRestarting",
"StatusStarting",
"StatusRunning"
]
},
"model.User": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"role": {
"$ref": "#/definitions/model.Role"
},
"role_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"service.UpdateUserRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"roleId": {
"type": "string"
},
"username": {
"type": "string"
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"description": "Type \"Bearer\" followed by a space and JWT token.",
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}