### Create New Server (API) Source: https://context7.com/pelican-dev/wings/llms.txt Provisions and installs a new server instance. This is a POST request that accepts a JSON payload defining the server's configuration and build details. Returns HTTP 202 Accepted as the installation is asynchronous. ```bash curl -X POST https://wings.example.com/api/servers \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "uuid": "new-server-uuid", "start_on_completion": true, "settings": { "uuid": "new-server-uuid", "suspended": false }, "process_configuration": { "startup": { "done": "Server started", "user_interaction": [], "strip_ansi": true }, "stop": { "type": "command", "value": "stop" }, "configs": [] }, "build": { "memory_limit": 2048, "swap": 0, "io_weight": 500, "cpu_limit": 200, "threads": "0-3", "disk_space": 10240, "oom_disabled": false }, "container": { "image": "ghcr.io/pelican-dev/yolks:java_17", "oom_disabled": false, "requires_rebuild": false }, "egg": { "id": "minecraft-java", "file_denylist": [] } }' ``` -------------------------------- ### Start Pelican Wings Daemon Source: https://context7.com/pelican-dev/wings/llms.txt Commands to start the Pelican Wings daemon with various configuration options. Supports default configuration, debug logging, automatic TLS certificate generation, and profiling. ```bash # Basic startup with default configuration ./wings --config /etc/pelican/config.yml # Start with debug logging enabled ./wings --debug --config /etc/pelican/config.yml # Start with automatic TLS certificate generation via Let's Encrypt ./wings --auto-tls --tls-hostname wings.example.com # Start with profiling enabled for performance analysis ./wings --pprof --pprof-port 6060 # Check version information ./wings version ``` -------------------------------- ### POST /api/servers Source: https://context7.com/pelican-dev/wings/llms.txt Provisions and installs a new server instance. This endpoint is used to create and configure new servers on the Wings platform. ```APIDOC ## Create New Server ### Description Provision and install new server instance ### Method POST ### Endpoint /api/servers ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **uuid** (string) - Required - The unique identifier for the new server. - **start_on_completion** (boolean) - Optional - Whether to start the server upon completion of installation. - **settings** (object) - Required - Server configuration settings. - **uuid** (string) - Required - The server's UUID. - **suspended** (boolean) - Optional - Initial suspension state of the server. - **process_configuration** (object) - Required - Configuration for the server's process. - **startup** (object) - Required - Configuration for server startup. - **done** (string) - Required - Message indicating successful startup. - **user_interaction** (array) - Optional - List of user interaction prompts during startup. - **strip_ansi** (boolean) - Optional - Whether to strip ANSI escape codes from output. - **stop** (object) - Required - Configuration for server stop. - **type** (string) - Required - The type of stop action (e.g., "command"). - **value** (string) - Required - The command or value for stopping the server. - **configs** (array) - Optional - Additional configuration files. - **build** (object) - Required - Server build specifications. - **memory_limit** (integer) - Required - Memory limit in MB. - **swap** (integer) - Required - Swap space limit in MB. - **io_weight** (integer) - Required - I/O weight for the container. - **cpu_limit** (integer) - Required - CPU limit as a percentage. - **threads** (string) - Required - CPU threads allocation (e.g., "0-3"). - **disk_space** (integer) - Required - Disk space limit in MB. - **oom_disabled** (boolean) - Optional - Whether Out-Of-Memory killer is disabled. - **container** (object) - Required - Container runtime configuration. - **image** (string) - Required - Docker image to use for the container. - **oom_disabled** (boolean) - Optional - Whether Out-Of-Memory killer is disabled for the container. - **requires_rebuild** (boolean) - Optional - Whether the container requires a rebuild. - **egg** (object) - Required - Egg configuration for the server. - **id** (string) - Required - The ID of the egg. - **file_denylist** (array) - Optional - List of files denied for the egg. ### Request Example ```json { "uuid": "new-server-uuid", "start_on_completion": true, "settings": { "uuid": "new-server-uuid", "suspended": false }, "process_configuration": { "startup": { "done": "Server started", "user_interaction": [], "strip_ansi": true }, "stop": { "type": "command", "value": "stop" }, "configs": [] }, "build": { "memory_limit": 2048, "swap": 0, "io_weight": 500, "cpu_limit": 200, "threads": "0-3", "disk_space": 10240, "oom_disabled": false }, "container": { "image": "ghcr.io/pelican-dev/yolks:java_17", "oom_disabled": false, "requires_rebuild": false }, "egg": { "id": "minecraft-java", "file_denylist": [] } } ``` ### Response #### Success Response (202 Accepted) Installation runs asynchronously. #### Response Example HTTP 202 Accepted ``` -------------------------------- ### GET /api/system Source: https://context7.com/pelican-dev/wings/llms.txt Retrieves hardware and system information from the Wings node. ```APIDOC ## System Information Retrieval ### Description Fetches information about the server's hardware and operating system. ### Method GET ### Endpoint `/api/system` ### Query Parameters - **v** (integer) - Optional - Specifies the version of the system information API to use. `v=2` provides more detailed information. ### Request Example (Basic Info) ```bash curl -X GET https://wings.example.com/api/system \ -H "Authorization: Bearer your-token-here" ``` ### Request Example (Detailed Info) ```bash curl -X GET "https://wings.example.com/api/system?v=2" \ -H "Authorization: Bearer your-token-here" ``` ### Response #### Success Response (200) - **Response Body** - The response body will contain system and hardware details. The structure varies based on the `v` query parameter. For `v=2`, it includes detailed CPU, memory, disk, and network information. ``` -------------------------------- ### Retrieve System Information - GET Source: https://context7.com/pelican-dev/wings/llms.txt Fetches hardware and system information from the Wings node. You can request basic information using the default endpoint or more detailed information by appending `?v=2` to the URL. ```bash # Get basic system info (v1 format) curl -X GET https://wings.example.com/api/system \ -H "Authorization: Bearer your-token-here" ``` ```bash # Get detailed system info (v2 format) curl -X GET "https://wings.example.com/api/system?v=2" \ -H "Authorization: Bearer your-token-here" ``` -------------------------------- ### Server Power Management API Source: https://context7.com/pelican-dev/wings/llms.txt Control server power states (start, stop, restart, kill) with asynchronous execution. ```APIDOC ## POST /api/servers/{server_id}/power ### Description Controls the power state of a specific game server instance. Operations are asynchronous and return an immediate acceptance response. ### Method POST ### Endpoint `/api/servers/{server_id}/power` ### Parameters #### Path Parameters - **server_id** (string) - Required - The unique identifier of the server instance. #### Request Body - **action** (string) - Required - The power action to perform. Options: `start`, `stop`, `restart`, `kill`. - **wait_seconds** (integer) - Optional - The grace period in seconds before forceful termination for `stop` and `restart` actions. ### Request Example ```json { "action": "start" } ``` ### Response #### Success Response (202 Accepted) Indicates that the power operation request has been accepted and is being processed asynchronously. #### Response Example (No specific response body is defined for success, but a 202 status code is returned.) ``` -------------------------------- ### Get System Resource Utilization (API) Source: https://context7.com/pelican-dev/wings/llms.txt Retrieves current system resource usage including memory, CPU, and disk space. Requires authentication with a bearer token. ```bash curl -X GET https://wings.example.com/api/system/utilization \ -H "Authorization: Bearer your-token-here" ``` -------------------------------- ### GET /api/servers Source: https://context7.com/pelican-dev/wings/llms.txt Retrieves a list of all registered servers on the Wings instance. This is useful for managing and identifying existing server instances. ```APIDOC ## List All Servers ### Description Retrieve all registered servers on Wings instance ### Method GET ### Endpoint /api/servers ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET https://wings.example.com/api/servers \ -H "Authorization: Bearer your-token-here" ``` ### Response #### Success Response (200) - **[servers]** (array) - A list of server objects. - **uuid** (string) - The unique identifier for the server. - **settings** (object) - Server configuration settings. - **uuid** (string) - The server's UUID. - **suspended** (boolean) - Indicates if the server is suspended. - **process_configuration** (object) - Details about the server's process configuration. - **startup** (object) - Configuration for server startup. - **done** (string) - Message indicating successful startup. - **user_interaction** (array) - List of user interaction prompts during startup. - **stop** (object) - Configuration for server stop. - **type** (string) - The type of stop action (e.g., "command"). - **value** (string) - The command or value for stopping the server. #### Response Example ```json [ { "uuid": "abc12345-1234-1234-1234-123456789abc", "settings": { "uuid": "abc12345-1234-1234-1234-123456789abc", "suspended": false }, "process_configuration": { "startup": { "done": "Server started", "user_interaction": [] }, "stop": { "type": "command", "value": "stop" } } } ] ``` ``` -------------------------------- ### GET /api/system/utilization Source: https://context7.com/pelican-dev/wings/llms.txt Retrieves detailed system resource utilization information, including CPU, memory, and disk usage. This endpoint is essential for monitoring the health and performance of the Wings instance. ```APIDOC ## System Resource Utilization ### Description Monitor CPU, memory, disk, and network usage. ### Method GET ### Endpoint /api/system/utilization ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X GET https://wings.example.com/api/system/utilization \ -H "Authorization: Bearer your-token-here" ``` ### Response #### Success Response (200) - **memory** (object) - Memory usage details. - **total** (integer) - Total memory in bytes. - **used** (integer) - Used memory in bytes. - **available** (integer) - Available memory in bytes. - **cpu** (object) - CPU usage details. - **cores** (integer) - Number of CPU cores. - **threads** (integer) - Number of CPU threads. - **usage** (float) - CPU usage percentage. - **disk** (object) - Disk usage details for different mount points. - **[mount_point]** (object) - Disk usage for a specific mount point. - **total** (integer) - Total disk space in bytes. - **used** (integer) - Used disk space in bytes. - **available** (integer) - Available disk space in bytes. #### Response Example ```json { "memory": { "total": 16777216000, "used": 8388608000, "available": 8388608000 }, "cpu": { "cores": 8, "threads": 16, "usage": 45.2 }, "disk": { "root": { "total": 1000000000000, "used": 500000000000, "available": 500000000000 }, "data": { "total": 2000000000000, "used": 1000000000000, "available": 1000000000000 } } } ``` ``` -------------------------------- ### Read File Contents - GET Source: https://context7.com/pelican-dev/wings/llms.txt Retrieves the content of a specified file on the server. The file content is returned directly in the response body. For downloading a file with appropriate headers, use the `download=1` parameter. ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/files/contents?file=/server.properties" \ -H "Authorization: Bearer your-token-here" ``` ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/files/contents?file=/world/level.dat&download=1" \ -H "Authorization: Bearer your-token-here" \ -o level.dat ``` -------------------------------- ### GET /api/servers/{server_id}/files/contents Source: https://context7.com/pelican-dev/wings/llms.txt Reads the contents of a file on the server. Can also be used to download a file by appending the `download=1` query parameter. ```APIDOC ## Read File Contents ### Description Retrieves the content of a specified file. If the `download` query parameter is set to `1`, the file will be sent as an attachment. ### Method GET ### Endpoint `/api/servers/{server_id}/files/contents` ### Query Parameters - **file** (string) - Required - The path to the file to read. - **download** (integer) - Optional - Set to `1` to trigger a file download. ### Request Example (Read) ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/files/contents?file=/server.properties" \ -H "Authorization: Bearer your-token-here" ``` ### Request Example (Download) ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/files/contents?file=/world/level.dat&download=1" \ -H "Authorization: Bearer your-token-here" \ -o level.dat ``` ### Response #### Success Response (200) - **Headers** - X-Mime-Type (string) - The MIME type of the file. - Content-Length (integer) - The size of the file in bytes. - Content-Disposition (string) - Present if `download=1`, indicates the filename. - **Response Body** - The content of the file if read, or the file itself if downloaded. ``` -------------------------------- ### Server Power Management API - cURL Source: https://context7.com/pelican-dev/wings/llms.txt Control server power states (start, stop, restart, kill) using cURL requests to the Pelican Wings API. Supports asynchronous execution with optional grace periods. ```bash # Start a server curl -X POST https://wings.example.com/api/servers/abc12345/power \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "action": "start" }' # Stop a server with 30 second grace period curl -X POST https://wings.example.com/api/servers/abc12345/power \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "action": "stop", "wait_seconds": 30 }' # Restart a server curl -X POST https://wings.example.com/api/servers/abc12345/power \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "action": "restart", "wait_seconds": 30 }' # Force kill a server (immediate termination) curl -X POST https://wings.example.com/api/servers/abc12345/power \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "action": "kill" }' # Response: HTTP 202 Accepted (operation runs asynchronously) ``` -------------------------------- ### Create Backup - POST Source: https://context7.com/pelican-dev/wings/llms.txt Initiates the creation of a server backup. You can specify the storage adapter ('wings' for local, 's3' for Amazon S3), a unique backup UUID, and files/directories to ignore. This operation is asynchronous and returns HTTP 202 Accepted. ```bash # Create local backup curl -X POST https://wings.example.com/api/servers/abc12345/backup \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "adapter": "wings", "uuid": "backup-uuid-12345", "ignore": "*.log,cache/*,temp/*" }' ``` ```bash # Create S3 backup curl -X POST https://wings.example.com/api/servers/abc12345/backup \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "adapter": "s3", "uuid": "backup-uuid-67890", "ignore": "*.log,cache/*" }' ``` -------------------------------- ### POST /api/servers/{server_id}/files/compress Source: https://context7.com/pelican-dev/wings/llms.txt Creates an archive from specified files and directories. ```APIDOC ## Compress Files ### Description Creates a compressed archive (e.g., tar.gz) from a list of files and directories. ### Method POST ### Endpoint `/api/servers/{server_id}/files/compress` ### Parameters #### Request Body - **root** (string) - Required - The root directory for the file operations. - **files** (array) - Required - An array of strings, where each string is the path to a file or directory to include in the archive. ### Request Example ```json { "root": "/", "files": [ "world", "plugins", "server.properties" ] } ``` ### Response #### Success Response (200) - **Response Body** - **file** (string) - The name of the created archive file. ### Response Example ```json { "file": "archive-2024-01-20-142530.tar.gz" } ``` ``` -------------------------------- ### POST /api/servers/{server_id}/backup Source: https://context7.com/pelican-dev/wings/llms.txt Creates a backup of the server's files, supporting local and S3 storage. ```APIDOC ## Backup Creation ### Description Initiates the creation of a server backup. The backup can be stored locally on the Wings node or uploaded to an S3 compatible storage. ### Method POST ### Endpoint `/api/servers/{server_id}/backup` ### Parameters #### Request Body - **adapter** (string) - Required - The storage adapter to use. Options: `wings` (local), `s3`. - **uuid** (string) - Required - A unique identifier for this backup. - **ignore** (string) - Optional - A comma-separated list of file patterns to ignore during backup. ### Request Example (Local Backup) ```json { "adapter": "wings", "uuid": "backup-uuid-12345", "ignore": "*.log,cache/*,temp/*" } ``` ### Request Example (S3 Backup) ```json { "adapter": "s3", "uuid": "backup-uuid-67890", "ignore": "*.log,cache/*" } ``` ### Response #### Success Response (202) Accepted. The backup process has started and runs asynchronously. ``` -------------------------------- ### Sending Console Commands Source: https://context7.com/pelican-dev/wings/llms.txt Send commands to running server instances via stdin. ```APIDOC ## POST /api/servers/{server_id}/commands ### Description Sends one or more commands to the standard input of a running game server instance. ### Method POST ### Endpoint `/api/servers/{server_id}/commands` ### Parameters #### Path Parameters - **server_id** (string) - Required - The unique identifier of the server instance. #### Request Body - **commands** (array of strings) - Required - A list of commands to be sent to the server console. ### Request Example ```json { "commands": [ "say Server maintenance in 5 minutes", "save-all", "whitelist add PlayerName" ] } ``` ### Response #### Success Response (204 No Content) Indicates that the commands were successfully sent to the server. #### Error Response (502 Bad Gateway) Returned if the server is not running and cannot accept commands. ``` -------------------------------- ### Compress Files - POST Source: https://context7.com/pelican-dev/wings/llms.txt Creates a compressed archive (e.g., .tar.gz) from specified files and directories on the server. The request body includes the root directory and a list of files/directories to compress. The response contains the name of the created archive file. ```bash curl -X POST https://wings.example.com/api/servers/abc12345/files/compress \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "root": "/", "files": [ "world", "plugins", "server.properties" ] }' ``` -------------------------------- ### POST /api/servers/{server_id}/files/write Source: https://context7.com/pelican-dev/wings/llms.txt Creates or overwrites file contents on the server. ```APIDOC ## Write File ### Description Writes content to a file. If the file does not exist, it will be created. If it exists, its content will be overwritten. ### Method POST ### Endpoint `/api/servers/{server_id}/files/write` ### Parameters #### Request Body - **root** (string) - Required - The root directory for the file operations. - **files** (array) - Required - An array of file objects to write. - **path** (string) - Required - The path of the file to write relative to the root. - **content** (string) - Required - The content to write to the file. ### Request Example ```json { "root": "/", "files": [ { "path": "server.properties", "content": "gamemode=survival\ndifficulty=normal\nmax-players=20\nmotd=My Server" } ] } ``` ### Response #### Success Response (204) No Content. Indicates the operation was successful. ``` -------------------------------- ### POST /api/servers/{server_id}/backup/{backup_uuid}/restore Source: https://context7.com/pelican-dev/wings/llms.txt Restores the server from a previously created backup archive. ```APIDOC ## Backup Restoration ### Description Restores the server's files from a specified backup archive. You can choose whether to keep or delete existing files before restoration. ### Method POST ### Endpoint `/api/servers/{server_id}/backup/{backup_uuid}/restore` ### Parameters #### Request Body - **adapter** (string) - Required - The storage adapter where the backup is located (`wings` or `s3`). - **truncate_directory** (boolean) - Required - If `true`, deletes all existing files in the server directory before restoring. If `false`, existing files are kept. - **download_url** (string) - Optional - Required if `adapter` is `s3`. The direct download URL for the backup archive. ### Request Example (Restore from Local Backup) ```json { "adapter": "wings", "truncate_directory": false } ``` ### Request Example (Restore from S3 Backup) ```json { "adapter": "s3", "truncate_directory": true, "download_url": "https://s3.amazonaws.com/bucket/backup.tar.gz?signature=xyz" } ``` ### Response #### Success Response (202) Accepted. The restoration process has started and runs asynchronously. ``` -------------------------------- ### List All Servers (API) Source: https://context7.com/pelican-dev/wings/llms.txt Fetches a list of all servers registered on the Wings instance. This endpoint requires an authorization header. ```bash curl -X GET https://wings.example.com/api/servers \ -H "Authorization: Bearer your-token-here" ``` -------------------------------- ### Restore Backup - POST Source: https://context7.com/pelican-dev/wings/llms.txt Restores a server from a previously created backup. You can choose whether to keep existing files by setting `truncate_directory` to `false` or delete them by setting it to `true`. For S3 backups, a `download_url` is required. This operation is asynchronous and returns HTTP 202 Accepted. ```bash # Restore from local backup (keeps existing files) curl -X POST https://wings.example.com/api/servers/abc12345/backup/backup-uuid-12345/restore \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "adapter": "wings", "truncate_directory": false }' ``` ```bash # Restore from S3 backup (deletes existing files first) curl -X POST https://wings.example.com/api/servers/abc12345/backup/backup-uuid-67890/restore \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "adapter": "s3", "truncate_directory": true, "download_url": "https://s3.amazonaws.com/bucket/backup.tar.gz?signature=xyz" }' ``` -------------------------------- ### File System Operations - List Directory Source: https://context7.com/pelican-dev/wings/llms.txt List files and directories within a server's file system. ```APIDOC ## GET /api/servers/{server_id}/files/list-directory ### Description Lists the contents of a specified directory within a game server's file system. ### Method GET ### Endpoint `/api/servers/{server_id}/files/list-directory` ### Parameters #### Path Parameters - **server_id** (string) - Required - The unique identifier of the server instance. #### Query Parameters - **directory** (string) - Required - The path to the directory to list. Use `/` for the root directory. ### Request Example ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/files/list-directory?directory=/plugins" \ -H "Authorization: Bearer your-token-here" ``` ### Response #### Success Response (200 OK) Returns a JSON array of file and directory objects. #### Response Example ```json [ { "name": "server.properties", "created": "2024-01-15T10:30:00Z", "modified": "2024-01-20T14:25:00Z", "mode": "-rw-r--r--", "mode_bits": "0644", "size": 1247, "directory": false, "file": true, "symlink": false, "mime": "text/plain" } ] ``` ``` -------------------------------- ### Server Console Logs Retrieval Source: https://context7.com/pelican-dev/wings/llms.txt Retrieve recent console output from server instances. ```APIDOC ## GET /api/servers/{server_id}/logs ### Description Retrieves recent console output lines from a running game server instance. ### Method GET ### Endpoint `/api/servers/{server_id}/logs` ### Parameters #### Path Parameters - **server_id** (string) - Required - The unique identifier of the server instance. #### Query Parameters - **size** (integer) - Optional - The number of log lines to retrieve. Defaults to 100, with a maximum of 100. ### Request Example ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/logs?size=50" \ -H "Authorization: Bearer your-token-here" ``` ### Response #### Success Response (200 OK) Returns a JSON object containing an array of log lines. #### Response Example ```json { "data": [ "[14:25:33] [Server thread/INFO]: Starting minecraft server version 1.20.1", "[14:25:34] [Server thread/INFO]: Loading properties", "[14:25:35] [Server thread/INFO]: Done (2.5s)! For help, type \"help\"" ] } ``` ``` -------------------------------- ### POST /api/servers/{server_id}/files/delete Source: https://context7.com/pelican-dev/wings/llms.txt Deletes files and directories from the server. ```APIDOC ## Delete Files ### Description Deletes specified files and directories from the server. This operation is irreversible. ### Method POST ### Endpoint `/api/servers/{server_id}/files/delete` ### Parameters #### Request Body - **root** (string) - Required - The root directory for the file operations. - **files** (array) - Required - An array of strings, where each string is the path to a file or directory to delete. ### Request Example ```json { "root": "/", "files": [ "logs/old.log", "temp-folder", "cache/data.tmp" ] } ``` ### Response #### Success Response (204) No Content. Indicates the operation was successful. ``` -------------------------------- ### Write File Contents - POST Source: https://context7.com/pelican-dev/wings/llms.txt Creates or overwrites the content of one or more files on the server. This endpoint accepts a JSON payload specifying the root directory and a list of files with their paths and content. A successful operation returns HTTP 204 No Content. ```bash curl -X POST https://wings.example.com/api/servers/abc12345/files/write \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "root": "/", "files": [ { "path": "server.properties", "content": "gamemode=survival\ndifficulty=normal\nmax-players=20\nmotd=My Server" } ] }' ``` -------------------------------- ### File System Operations - Read File Contents Source: https://context7.com/pelican-dev/wings/llms.txt Retrieve or download file contents from server. ```APIDOC ## GET /api/servers/{server_id}/files/read-file ### Description Retrieves the content of a specified file from the game server's file system. This can be used for reading configuration files or small data files. ### Method GET ### Endpoint `/api/servers/{server_id}/files/read-file` ### Parameters #### Path Parameters - **server_id** (string) - Required - The unique identifier of the server instance. #### Query Parameters - **file** (string) - Required - The path to the file to read. ### Request Example ```bash curl -X GET "https://wings.example.com/api/servers/abc12345/files/read-file?file=/server.properties" \ -H "Authorization: Bearer your-token-here" ``` ### Response #### Success Response (200 OK) Returns the content of the file as plain text or binary data depending on the file type. #### Response Example (The response body will contain the raw content of the requested file.) ``` -------------------------------- ### SFTP Server Access for File Management Source: https://context7.com/pelican-dev/wings/llms.txt Provides SFTP access for managing server files. Users connect using a specific username format (username.serverid) and port 2022. Supports password or public key authentication and automated operations via command piping. ```bash # Connect via SFTP client # Username format: username.serverid # Example: admin.abc12345 sftp -P 2022 admin.abc12345@wings.example.com # Using FileZilla or similar clients: # Host: wings.example.com # Port: 2022 # Protocol: SFTP # Username: admin.abc12345 # Password: your-password-or-key # Example automated SFTP operations echo "cd /plugins put myplugin.jar chmod 644 myplugin.jar ls -la exit" | sftp -P 2022 admin.abc12345@wings.example.com # SFTP with public key authentication sftp -P 2022 -i ~/.ssh/id_rsa admin.abc12345@wings.example.com ``` -------------------------------- ### POST /api/servers/{server_id}/files/decompress Source: https://context7.com/pelican-dev/wings/llms.txt Extracts the contents of an archive file into a specified directory. ```APIDOC ## Decompress Archive ### Description Extracts the contents of a specified archive file into a directory on the server. ### Method POST ### Endpoint `/api/servers/{server_id}/files/decompress` ### Parameters #### Request Body - **root** (string) - Required - The root directory where the archive is located and where its contents will be extracted. - **file** (string) - Required - The name of the archive file to decompress. ### Request Example ```json { "root": "/", "file": "backup.tar.gz" } ``` ### Response #### Success Response (204) No Content. Indicates the operation was successful. ``` -------------------------------- ### SFTP Server Access Source: https://context7.com/pelican-dev/wings/llms.txt Provides access to a built-in SFTP server for file management operations. Users can connect using standard SFTP clients to upload, download, and manage files within their server's environment. ```APIDOC ## SFTP Server Access ### Description Built-in SFTP server for file management ### Method SFTP ### Endpoint wings.example.com (Port: 2022) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash # Connect via SFTP client # Username format: username.serverid # Example: admin.abc12345 sftp -P 2022 admin.abc12345@wings.example.com # Using FileZilla or similar clients: # Host: wings.example.com # Port: 2022 # Protocol: SFTP # Username: admin.abc12345 # Password: your-password-or-key # Example automated SFTP operations echo "cd /plugins put myplugin.jar chmod 644 myplugin.jar ls -la exit" | sftp -P 2022 admin.abc12345@wings.example.com # SFTP with public key authentication sftp -P 2022 -i ~/.ssh/id_rsa admin.abc12345@wings.example.com ``` ### Response #### Success Response (SFTP connection established. File operations are performed.) #### Response Example (No specific response body for connection, relies on SFTP client output for file operation status.) ``` -------------------------------- ### Real-time Server Console and Event Streaming (WebSocket) Source: https://context7.com/pelican-dev/wings/llms.txt Establishes a WebSocket connection for real-time server console output, status changes, and statistics. Supports JWT authentication and sending commands or setting power states. ```javascript // Connect to server WebSocket with JWT authentication const token = "your-jwt-token"; const ws = new WebSocket(`wss://wings.example.com/api/servers/abc12345/ws`); ws.onopen = () => { // Authenticate with JWT token ws.send(JSON.stringify({ event: "auth", args: [token] })); // Request initial console output ws.send(JSON.stringify({ event: "send logs", args: [] })); }; ws.onmessage = (event) => { const data = JSON.parse(event.data); // Handle console output if (data.event === "console output") { console.log("Console:", data.args[0]); } // Handle status changes if (data.event === "status") { console.log("Status:", data.args[0]); // "running", "offline", "starting", "stopping" } // Handle stats updates if (data.event === "stats") { console.log("CPU:", data.args[0].cpu_absolute, "%"); console.log("Memory:", data.args[0].memory_bytes, "bytes"); } }; // Send command to server ws.send(JSON.stringify({ event: "send command", args: ["say Hello from WebSocket!"] })); // Set server power state ws.send(JSON.stringify({ event: "set state", args: ["start"] // "start", "stop", "restart", "kill" })); ``` -------------------------------- ### PUT /api/servers/{server_id}/files/rename Source: https://context7.com/pelican-dev/wings/llms.txt Renames or moves files and directories within the server. ```APIDOC ## Rename/Move Files ### Description Renames or moves files and directories. Multiple rename/move operations can be performed in a single request. ### Method PUT ### Endpoint `/api/servers/{server_id}/files/rename` ### Parameters #### Request Body - **root** (string) - Required - The root directory for the file operations. - **files** (array) - Required - An array of objects specifying the `from` and `to` paths for renaming/moving. - **from** (string) - Required - The original path of the file or directory. - **to** (string) - Required - The new path for the file or directory. ### Request Example ```json { "root": "/", "files": [ { "from": "old-folder", "to": "new-folder" }, { "from": "backup.zip", "to": "archives/backup-2024.zip" } ] } ``` ### Response #### Success Response (204) No Content. Indicates the operation was successful. ``` -------------------------------- ### WebSocket Connection Source: https://context7.com/pelican-dev/wings/llms.txt Establishes a WebSocket connection for real-time server console output and event streaming. This allows for interactive control and monitoring of server activities. ```APIDOC ## WebSocket Connection ### Description Real-time server console and event streaming ### Method WebSocket ### Endpoint /api/servers/{server_id}/ws ### Parameters #### Path Parameters - **server_id** (string) - Required - The unique identifier of the server. #### Query Parameters None #### Request Body None (for connection establishment) ### Request Example ```javascript // Connect to server WebSocket with JWT authentication const token = "your-jwt-token"; const ws = new WebSocket(`wss://wings.example.com/api/servers/abc12345/ws`); ws.onopen = () => { // Authenticate with JWT token ws.send(JSON.stringify({ event: "auth", args: [token] })); // Request initial console output ws.send(JSON.stringify({ event: "send logs", args: [] })); }; ws.onmessage = (event) => { const data = JSON.parse(event.data); // Handle console output if (data.event === "console output") { console.log("Console:", data.args[0]); } // Handle status changes if (data.event === "status") { console.log("Status:", data.args[0]); // "running", "offline", "starting", "stopping" } // Handle stats updates if (data.event === "stats") { console.log("CPU:", data.args[0].cpu_absolute, "%"); console.log("Memory:", data.args[0].memory_bytes, "bytes"); } }; // Send command to server ws.send(JSON.stringify({ event: "send command", args: ["say Hello from WebSocket!"] })); // Set server power state ws.send(JSON.stringify({ event: "set state", args: ["start"] // "start", "stop", "restart", "kill" })); ``` ### Response #### Success Response (WebSocket connection established. Data frames contain event information.) - **event** (string) - The type of event received (e.g., "console output", "status", "stats"). - **args** (array) - An array containing event-specific data. #### Response Example ```json { "event": "console output", "args": [ "Server started successfully." ] } ``` ``` -------------------------------- ### List Directory Contents - cURL Source: https://context7.com/pelican-dev/wings/llms.txt List files and directories within a server's file system using the Pelican Wings API and cURL. Supports specifying the directory path. ```bash # List root directory curl -X GET "https://wings.example.com/api/servers/abc12345/files/list-directory?directory=/" \ -H "Authorization: Bearer your-token-here" # List specific subdirectory curl -X GET "https://wings.example.com/api/servers/abc12345/files/list-directory?directory=/plugins" \ -H "Authorization: Bearer your-token-here" # Response format: # [ # { # "name": "server.properties", # "created": "2024-01-15T10:30:00Z", # "modified": "2024-01-20T14:25:00Z", # "mode": "-rw-r--r--", # "mode_bits": "0644", # "size": 1247, # "directory": false, # "file": true, # "symlink": false, # "mime": "text/plain" # } # ] ``` -------------------------------- ### Rename/Move Files - PUT Source: https://context7.com/pelican-dev/wings/llms.txt Renames or moves files and directories within the server's file system. The request body contains a JSON object specifying the root directory and an array of file objects, each with a 'from' (original path) and 'to' (new path). A successful operation returns HTTP 204 No Content. ```bash curl -X PUT https://wings.example.com/api/servers/abc12345/files/rename \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "root": "/", "files": [ { "from": "old-folder", "to": "new-folder" }, { "from": "backup.zip", "to": "archives/backup-2024.zip" } ] }' ``` -------------------------------- ### Wings Configuration File Structure (YAML) Source: https://context7.com/pelican-dev/wings/llms.txt Defines the structure and common parameters found in the Wings configuration file (config.yml), typically located at /etc/pelican/config.yml. It includes settings for debugging, panel integration, and API configuration. ```yaml # /etc/pelican/config.yml debug: false app_name: pelican uuid: node-uuid-here # Panel authentication token_id: your-token-id token: your-authentication-token remote: https://panel.example.com # API configuration api: host: 0.0.0.0 port: 8080 ssl: enabled: true cert: /etc/pelican/cert.pem key: /etc/pelican/key.pem upload_limit: 100 trusted_proxies: - 127.0.0.1 ``` -------------------------------- ### DELETE /api/servers/{server_id}/backup/{backup_uuid} Source: https://context7.com/pelican-dev/wings/llms.txt Deletes a specific backup file from the local Wings storage. ```APIDOC ## Delete Backup ### Description Removes a specified backup file from the Wings local storage. ### Method DELETE ### Endpoint `/api/servers/{server_id}/backup/{backup_uuid}` ### Response #### Success Response (204) No Content. Indicates the backup was successfully deleted. #### Error Response (404) Not Found. Indicates the specified backup was not found. ``` -------------------------------- ### Send Server Commands - cURL Source: https://context7.com/pelican-dev/wings/llms.txt Send commands to running game server instances via the Pelican Wings API using cURL. Supports sending multiple commands in a single request. ```bash curl -X POST https://wings.example.com/api/servers/abc12345/commands \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "commands": [ "say Server maintenance in 5 minutes", "save-all", "whitelist add PlayerName" ] }' # Response: HTTP 204 No Content (commands sent successfully) # Returns HTTP 502 if server is not running ``` -------------------------------- ### Delete Files - POST Source: https://context7.com/pelican-dev/wings/llms.txt Deletes files and directories from the server. The request body is a JSON object specifying the root directory and an array of file paths to be deleted. A successful operation returns HTTP 204 No Content. ```bash curl -X POST https://wings.example.com/api/servers/abc12345/files/delete \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{ "root": "/", "files": [ "logs/old.log", "temp-folder", "cache/data.tmp" ] }' ```