### Start Spread Job Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for starting a spread job, including optional parameters like sites_dlonly, sites_all, reset, and profile. ```JSON { "section": "LINUX_ISOS", "name": "LATEST_DISTRO_1.0-NEW", "sites": [ "SITE1", "SITE2", "SITE3" ], "sites_dlonly": [ "SITE1" ], "sites_all": false, "reset": false, "profile": "DISTRIBUTE" } ``` -------------------------------- ### Start FXP Transfer Job Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for starting an FXP transfer job, specifying source and destination sites and paths. ```JSON { "src_site": "SITE1", "src_section": "SECTION1", "dst_site": "SITE2", "dst_path": "/MISC", "name": "LATEST_DISTRO_1.0-NEW" } ``` -------------------------------- ### Start Download Transfer Job Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for starting a download transfer job, specifying source site and name, with an optional destination path. ```JSON { "src_site": "SITE1", "src_section": "SECTION1", "name": "LATEST_DISTRO_1.0-NEW", "dst_path": "/linux-isos" } ``` -------------------------------- ### Start Upload Transfer Job Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for starting an upload transfer job, specifying destination site and path, with an optional source path. ```JSON { "dst_site": "SITE1", "dst_path": "/linux-isos", "name": "LATEST_DISTRO_1.0-NEW", "src_path": "/linux-isos" } ``` -------------------------------- ### UDP API Plaintext Command Example (Shell) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Example of sending a plaintext command to the UDP API using echo and netcat. Requires password, command, and target. ```Shell echo -n "bestpass raw SITE1 site deluser me" > /dev/udp/127.0.0.1/55477 ``` -------------------------------- ### Partial Site Update Example Source: https://cbftp.glftpd.io/svn/cbftp/API/index Demonstrates how to update an existing site by sending only the modified fields in a JSON payload. This example shows changing the 'affils' for a site. The API will merge these changes with the existing site configuration. ```json { "affils": [ "GROUP3" ] } ``` -------------------------------- ### Add/Modify Section Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for adding or modifying a section, including optional parameters like hotkey, num_jobs, and skiplist. ```JSON { "name": "TESTSEC1", "hotkey": 7, "num_jobs": 0, "skiplist": [ { "action": "DENY", "dir": false, "file": true, "pattern": "*asdf*", "regex": false, "scope": "ALL" } ] } ``` -------------------------------- ### UDP API Encrypted Command Example (Shell) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Example of sending an encrypted command to the UDP API using echo, openssl, and netcat. Requires password and encryption key. ```Shell echo -n "bestpass raw SITE1 site deluser me" | openssl enc -aes-256-cbc \ -md sha256 > /dev/udp/127.0.0.1/55477 ``` -------------------------------- ### Reset Spread Job Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for resetting a spread job, with an optional 'hard' parameter. ```JSON { "hard": false } ``` -------------------------------- ### Abort Spread Job Body Example (JSON) Source: https://cbftp.glftpd.io/svn/cbftp/API/index An example JSON body for aborting a spread job, including optional 'delete' and 'sites' parameters. ```JSON { "delete": "NONE", "sites": [ "SITE1" ] } ``` -------------------------------- ### Get Build Information (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieves various build information, statistics, and status details. ```HTTP GET /info ``` -------------------------------- ### Start Spread Job (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Initiates a new spread job. Requires a JSON body specifying job details like section, name, and target sites. ```HTTP POST /spreadjobs ``` -------------------------------- ### Distribute Spread Job Source: https://cbftp.glftpd.io/svn/cbftp/API/index Starts a spread job with the 'distribute' profile for a specified item on a list of sites. ```APIDOC ## POST /distribute ### Description Starts a spread job with the 'distribute' profile for a specified item on the designated sites. The site list is a comma-separated string of site names. Wildcards are supported. An optional list of download-only sites can be appended. ### Method POST ### Endpoint /distribute ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **section** (string) - Required - The section name containing the file. - **file** (string) - Required - The file name to distribute. - **sitelist** (string) - Required - A comma-separated list of site names (e.g., "site1,site2,site3"). Wildcards (*) are supported. - **dlonlysitelist** (string) - Optional - A comma-separated list of download-only sites. ### Request Example ```json { "password": "your_password", "section": "my_section", "file": "data_file.zip", "sitelist": "siteX,siteY,siteZ" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the distribute job has started. #### Response Example ```json { "message": "Distribute spread job initiated successfully." } ``` ``` -------------------------------- ### Site JSON Structure Source: https://cbftp.glftpd.io/svn/cbftp/API/index Provides an example of the JSON structure used for creating or updating a site via the Cbftp API. It includes various configuration parameters such as addresses, affiliations, download/upload permissions, speed settings, and security options. Not all fields are mandatory when updating. ```json { "name": "SITE1", "addresses": [ "address1.com:46473", "address2.com" ], "affils": [ "GROUP1", "GROUP2" ], "allow_download": "YES", // (YES/NO/MATCH_ONLY) "allow_upload": "NO", // (YES/NO) "avg_speed": { "SITE2": 20000, // speed SITE1 -> SITE2 "SITE3": 30000 }, "base_path": "/", "broken_pasv": false, "cepr": true, "cpsv": true, "disabled": false, "except_source_sites": [ "SITE2" ], "except_target_sites": [ "SITE3" ], "force_binary_mode": false, "leave_free_slot": true, "list_command": "STAT_L", // (STAT_L/LIST) "max_idle_time": 60, "max_logins": 3, "max_sim_down": 2, "max_sim_down_complete": 0, "max_sim_down_pre": 0, "max_sim_down_transferjob": 0, "max_sim_up": 3, "password": "SecretPassword", "pret": false, "priority": "HIGH", // (VERY_LOW/LOW/NORMAL/HIGH/VERY_HIGH) "list_frequency": "AUTO", // (VERY_LOW/FIXED_LOW/FIXED_AVERAGE/ // FIXED_HIGH/FIXED_VERY_HIGH/AUTO/ // DYNAMIC_LOW/DYNAMIC_AVERAGE/ // DYNAMIC_HIGH/DYNAMIC_VERY_HIGH) "proxy_name": "", "proxy_type": "GLOBAL", // (GLOBAL/NONE/USE) "sections": [ { "name": "SEC1", "path": "/some/path" }, { "name": "SEC2", "path": "/some/other/path" } ], "skiplist": [ { "action": "DENY", // (ALLOW/DENY/UNIQUE/SIMILAR) "dir": false, "file": true, "pattern": ".*asdf.*", "regex": true, "scope": "IN_RACE" // (IN_RACE/ALL) } ], "sscn": false, "stay_logged_in": false, "tls_mode": "AUTH_TLS", // (NONE/AUTH_TLS/IMPLICIT) "tls_transfer_policy": "PREFER_OFF", // (ALWAYS_OFF/PREFER_OFF/...) "transfer_protocol": "IPV4_ONLY", // (IPV4_ONLY/PREFER_IPV4/...) "transfer_source_policy": "ALLOW", // (ALLOW/BLOCK) "transfer_target_policy": "BLOCK", "user": "myusername", "xdupe": true } ``` -------------------------------- ### Start Transfer Job (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Initiates a new transfer job. The JSON body specifies the type of transfer (FXP, download, upload) and relevant details. ```HTTP POST /transferjobs ``` -------------------------------- ### Spread Jobs API Source: https://cbftp.glftpd.io/svn/cbftp/API/index Manage spread jobs, including listing, retrieving details, starting, resetting, and aborting. ```APIDOC ## GET /spreadjobs ### Description List all spread jobs. Filters are optional. ### Method GET ### Endpoint /spreadjobs ### Parameters #### Query Parameters - **status** (string) - Optional - Filter by job status (e.g., RUNNING). - **section** (string) - Optional - Filter by section name. - **profile** (string) - Optional - Filter by job profile (e.g., RACE). - **site** (string) - Optional - Filter by site name. - **name** (string) - Optional - Filter by job name (supports wildcards). ### Response #### Success Response (200) - **jobs** (array) - A list of spread jobs. #### Response Example ```json { "jobs": [ { "id": "JOB1", "name": "Job Name", "status": "RUNNING" }, { "id": "JOB2", "name": "Another Job", "status": "PENDING" } ] } ``` ## GET /spreadjobs/{jobName} ### Description Get details of a specific spread job. ### Method GET ### Endpoint /spreadjobs/{jobName} ### Parameters #### Path Parameters - **jobName** (string) - Required - The name or ID of the spread job. ### Response #### Success Response (200) - **jobDetails** (object) - Details of the specified spread job. #### Response Example ```json { "jobDetails": { "id": "JOB1", "name": "Job Name", "status": "RUNNING", "section": "LINUX_ISOS", "sites": ["SITE1", "SITE2"] } } ``` ## POST /spreadjobs ### Description Start a new spread job. ### Method POST ### Endpoint /spreadjobs ### Parameters #### Request Body - **section** (string) - Required - The section for the job. - **name** (string) - Required - The name of the job. - **sites** (array) - Required - A list of site names. - **sites_dlonly** (array) - Optional - Sites for download only. - **sites_all** (boolean) - Optional - Whether to add all sites with the section defined. - **reset** (boolean) - Optional - Whether to reset the job if it already exists. - **profile** (string) - Required - The job profile (RACE/DISTRIBUTE/PREPARE). ### Request Example ```json { "section": "LINUX_ISOS", "name": "LATEST_DISTRO_1.0-NEW", "sites": [ "SITE1", "SITE2", "SITE3" ], "sites_dlonly": [ "SITE1" ], "sites_all": false, "reset": false, "profile": "DISTRIBUTE" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **jobId** (string) - The ID of the newly created job. #### Response Example ```json { "message": "Spread job created successfully.", "jobId": "NEWJOBID" } ``` ## POST /spreadjobs/{jobName}/reset ### Description Reset a spread job. ### Method POST ### Endpoint /spreadjobs/{jobName}/reset ### Parameters #### Path Parameters - **jobName** (string) - Required - The name or ID of the spread job to reset. #### Request Body - **hard** (boolean) - Optional - Perform a hard reset. ### Request Example ```json { "hard": false } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Spread job reset successfully." } ``` ## POST /spreadjobs/{jobName}/abort ### Description Abort a spread job. ### Method POST ### Endpoint /spreadjobs/{jobName}/abort ### Parameters #### Path Parameters - **jobName** (string) - Required - The name or ID of the spread job to abort. #### Request Body - **delete** (string) - Optional - Specifies what to delete (NONE/INCOMPLETE/OWN/ALL). - **sites** (array) - Optional - A list of sites to remove from the job instead of aborting. ### Request Example ```json { "delete": "INCOMPLETE", "sites": [ "SITE1" ] } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Spread job aborted successfully." } ``` ``` -------------------------------- ### Send Raw Command with Curl Source: https://cbftp.glftpd.io/svn/cbftp/API/index Illustrates sending a raw command to the Cbftp API using curl. This example shows how to execute a 'site deluser me' command on specified sites. It uses the POST method and includes a JSON payload with the command and target sites. Certificate verification is disabled with '-k'. ```bash curl -k -u :bestpass -X POST https://localhost:55477/raw -d '{ "command": "site deluser me", "sites": ["SITE1"]}' ``` -------------------------------- ### Race Spread Job Source: https://cbftp.glftpd.io/svn/cbftp/API/index Starts a spread job with the 'race' profile for a specified item on a list of sites. ```APIDOC ## POST /race ### Description Starts a spread job with the 'race' profile for a specified item on the designated sites. The site list is a comma-separated string of site names. Wildcards are supported. An optional list of download-only sites can be appended. ### Method POST ### Endpoint /race ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **section** (string) - Required - The section name containing the file. - **file** (string) - Required - The file name to spread. - **sitelist** (string) - Required - A comma-separated list of site names (e.g., "site1,site2,site3"). Wildcards (*) are supported. - **dlonlysitelist** (string) - Optional - A comma-separated list of download-only sites. ### Request Example ```json { "password": "your_password", "section": "my_section", "file": "important_document.pdf", "sitelist": "siteA,siteB,siteC", "dlonlysitelist": "siteD,siteE" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the race job has started. #### Response Example ```json { "message": "Race spread job initiated successfully." } ``` ``` -------------------------------- ### Transfer Jobs API Source: https://cbftp.glftpd.io/svn/cbftp/API/index Manage transfer jobs, including listing, retrieving details, starting, resetting, and aborting. ```APIDOC ## GET /transferjobs ### Description List all transfer jobs. Filters are optional. ### Method GET ### Endpoint /transferjobs ### Parameters #### Query Parameters - **id** (boolean) - Optional - If true, filter by job ID. - **status** (string) - Optional - Filter by job status (e.g., RUNNING). - **src_site** (string) - Optional - Filter by source site. - **dst_site** (string) - Optional - Filter by destination site. - **type** (string) - Optional - Filter by transfer type (e.g., FXP, UPLOAD). - **site** (string) - Optional - Filter by site name. - **name** (string) - Optional - Filter by job name (supports wildcards). ### Response #### Success Response (200) - **jobs** (array) - A list of transfer jobs. #### Response Example ```json { "jobs": [ { "id": "JOB1", "name": "Job Name", "status": "RUNNING" }, { "id": "JOB2", "name": "Another Job", "status": "COMPLETED" } ] } ``` ## GET /transferjobs/{jobNameOrId} ### Description Get details of a specific transfer job. Use the `id` query parameter to get the job via ID instead of name. ### Method GET ### Endpoint /transferjobs/{jobNameOrId} ### Parameters #### Path Parameters - **jobNameOrId** (string) - Required - The name or ID of the transfer job. #### Query Parameters - **id** (boolean) - Optional - If true, treat `jobNameOrId` as a job ID. ### Response #### Success Response (200) - **jobDetails** (object) - Details of the specified transfer job. #### Response Example ```json { "jobDetails": { "id": "JOB1", "name": "Job Name", "status": "RUNNING", "src_site": "SITE1", "dst_site": "SITE2" } } ``` ## POST /transferjobs ### Description Start a new transfer job. The request body varies depending on the transfer type (FXP, download, upload). ### Method POST ### Endpoint /transferjobs ### Parameters #### Request Body (FXP Job) - **src_site** (string) - Required - The source site. - **src_section** (string) - Required - The source section or path. - **dst_site** (string) - Required - The destination site. - **dst_path** (string) - Required - The destination path or section. - **name** (string) - Required - The name of the job. ### Request Example (FXP Job) ```json { "src_site": "SITE1", "src_section": "SECTION1", "dst_site": "SITE2", "dst_path": "/MISC", "name": "LATEST_DISTRO_1.0-NEW" } ``` #### Request Body (Download Job) - **src_site** (string) - Required - The source site. - **src_section** (string) - Required - The source section or path. - **name** (string) - Required - The name of the job. - **dst_path** (string) - Optional - The destination path. ### Request Example (Download Job) ```json { "src_site": "SITE1", "src_section": "SECTION1", "name": "LATEST_DISTRO_1.0-NEW", "dst_path": "/linux-isos" } ``` #### Request Body (Upload Job) - **dst_site** (string) - Required - The destination site. - **dst_path** (string) - Required - The destination path or section. - **name** (string) - Required - The name of the job. - **src_path** (string) - Optional - The source path. ### Request Example (Upload Job) ```json { "dst_site": "SITE1", "dst_path": "/linux-isos", "name": "LATEST_DISTRO_1.0-NEW", "src_path": "/linux-isos" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message. - **jobId** (string) - The ID of the newly created job. #### Response Example ```json { "message": "Transfer job created successfully.", "jobId": "NEWTRANSFERJOBID" } ``` ## POST /transferjobs/{jobNameOrId}/reset ### Description Reset a transfer job. ### Method POST ### Endpoint /transferjobs/{jobNameOrId}/reset ### Parameters #### Path Parameters - **jobNameOrId** (string) - Required - The name or ID of the transfer job to reset. #### Query Parameters - **id** (boolean) - Optional - If true, treat `jobNameOrId` as a job ID. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Transfer job reset successfully." } ``` ## POST /transferjobs/{jobNameOrId}/abort ### Description Abort a transfer job. ### Method POST ### Endpoint /transferjobs/{jobNameOrId}/abort ### Parameters #### Path Parameters - **jobNameOrId** (string) - Required - The name or ID of the transfer job to abort. #### Query Parameters - **id** (boolean) - Optional - If true, treat `jobNameOrId` as a job ID. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Transfer job aborted successfully." } ``` ``` -------------------------------- ### Get Spread Job Details (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieves the details of a specific spread job using its name. ```HTTP GET /spreadjobs/JOBNAME ``` -------------------------------- ### Get Raw Command Results (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieves the raw results of an asynchronous raw command. It requires the command ID as a path parameter. ```HTTP GET /raw/1 ``` -------------------------------- ### Get Transfer Job Details (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieves details for a specific transfer job, identified by its name or ID. ```HTTP GET /transferjobs/JOBNAME_OR_ID?id=false ``` -------------------------------- ### List Sites with Curl Source: https://cbftp.glftpd.io/svn/cbftp/API/index Demonstrates how to list all available sites using the curl command-line tool. It requires the API password for authentication and specifies the target URL and port. The '-k' flag is used to bypass TLS certificate verification due to the self-signed certificate. ```bash curl -k -u :bestpass https://localhost:55477/sites ``` -------------------------------- ### Add Site with Curl from File Source: https://cbftp.glftpd.io/svn/cbftp/API/index Shows how to add a new site to Cbftp by sending a JSON configuration from a file. The POST method is used with the '/sites' endpoint. The '@' symbol before 'newsite.json' indicates that the content should be read from the specified file. Basic authentication and disabled certificate verification are included. ```bash curl -k -u :bestpass -X POST https://localhost:55477/sites -d @newsite.json ``` -------------------------------- ### UDP API Download Command Source: https://cbftp.glftpd.io/svn/cbftp/API/index Command to initiate a download transfer job via the UDP API. Requires password, source site, source path, and optionally a source file. ```Text download [srcfile] ``` -------------------------------- ### Raw Command with Path Source: https://cbftp.glftpd.io/svn/cbftp/API/index Changes directory to a specified path and then issues a raw command on the listed sites. ```APIDOC ## POST /rawwithpath ### Description Changes directory to the given path and then issues the specified raw command on the listed sites. Both the site list and path can be section names. ### Method POST ### Endpoint /rawwithpath ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **sitelist** (string) - Required - A comma-separated list of site names or a section name. - **path** (string) - Required - The path to change directory to, or a section name. - **command** (string) - Required - The raw command to execute. ### Request Example ```json { "password": "your_password", "sitelist": "siteA,siteB", "path": "/data/files", "command": "PWD" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the raw command with path has been issued. #### Response Example ```json { "message": "Raw command with path issued successfully." } ``` ``` -------------------------------- ### Show File (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Displays the content of a file. An optional timeout can be specified. The maximum file size is limited. ```HTTP GET /file?site=SITENAME&path=/path/to/some/file.nfo&timeout=10 ``` -------------------------------- ### Info API Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieve various build information and statistics. ```APIDOC ## GET /info ### Description Show various build information, stats, etc. ### Method GET ### Endpoint /info ### Response #### Success Response (200) - **info** (object) - Contains various build information and statistics. #### Response Example ```json { "info": { "version": "1.2.3", "uptime": "10 days", "connections": 500 } } ``` ``` -------------------------------- ### Prepare Spread Job Source: https://cbftp.glftpd.io/svn/cbftp/API/index Prepares a spread job with the 'race' profile, logging onto sites and awaiting user input. ```APIDOC ## POST /prepare ### Description Prepares a spread job with the 'race' profile. CBFTP will log onto the specified sites and await user input to start the job. Prepared jobs can be started from the main screen or by pressing 'p'. ### Method POST ### Endpoint /prepare ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **section** (string) - Required - The section name containing the file. - **file** (string) - Required - The file name to prepare for spreading. - **sitelist** (string) - Required - A comma-separated list of site names (e.g., "site1,site2,site3"). Wildcards (*) are supported. - **dlonlysitelist** (string) - Optional - A comma-separated list of download-only sites. ### Request Example ```json { "password": "your_password", "section": "my_section", "file": "config.ini", "sitelist": "server1,server2" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the spread job has been prepared. #### Response Example ```json { "message": "Spread job prepared successfully." } ``` ``` -------------------------------- ### Download to Path Source: https://cbftp.glftpd.io/svn/cbftp/API/index Initiates a transfer job to download a specified item to a given path. ```APIDOC ## POST /downloadtopath ### Description Initiates a transfer job for downloading a specified item to a designated download path. The source file name is optional and defaults to the base name of the source path if omitted. The source path can also be a section name, in which case the source file must be specified. ### Method POST ### Endpoint /downloadtopath ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **srcsite** (string) - Required - The source site name. - **srcpath** (string) - Required - The source path or section name. - **srcfile** (string) - Optional - The source file name. If omitted, defaults to the base name of srcpath. - **dstpath** (string) - Required - The destination path on the local system. ### Request Example ```json { "password": "your_password", "srcsite": "remote_site", "srcpath": "/remote/directory", "srcfile": "data.zip", "dstpath": "/local/download/folder" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the download job has started. #### Response Example ```json { "message": "Download job initiated successfully." } ``` ``` -------------------------------- ### Directory and File Operations API Source: https://cbftp.glftpd.io/svn/cbftp/API/index List directories, show files, and delete directories. ```APIDOC ## GET /path ### Description List a directory. The path can also be a section name. Timeout is optional, defaults to 60 seconds. ### Method GET ### Endpoint /path ### Parameters #### Query Parameters - **site** (string) - Required - The site name. - **path** (string) - Required - The path to list. - **timeout** (integer) - Optional - The timeout in seconds. ### Response #### Success Response (200) - **items** (array) - A list of directory items. #### Response Example ```json { "items": [ { "name": "file1.txt", "type": "file", "size": 1024 }, { "name": "subdir", "type": "dir", "size": 0 } ] } ``` ## DELETE /path ### Description Delete a directory. The path can also be a section name. Type is optional, defaults to ALL. ### Method DELETE ### Endpoint /path ### Parameters #### Query Parameters - **site** (string) - Required - The site name. - **path** (string) - Required - The path to delete. - **type** (string) - Optional - The type of deletion (e.g., OWN, ALL). ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Directory deleted successfully." } ``` ## GET /file ### Description Show a file. Timeout is optional, defaults to 60 seconds. The maximum allowed file size is hardcoded to 500k by default. ### Method GET ### Endpoint /file ### Parameters #### Query Parameters - **site** (string) - Required - The site name. - **path** (string) - Required - The path to the file. - **timeout** (integer) - Optional - The timeout in seconds. ### Response #### Success Response (200) - **content** (string) - The content of the file. #### Response Example ```json { "content": "File content here..." } ``` ``` -------------------------------- ### Sites API Source: https://cbftp.glftpd.io/svn/cbftp/API/index Endpoints for listing, retrieving, creating, updating, and deleting sites. ```APIDOC ## GET /sites ### Description Lists all available sites. An optional section filter can be applied. ### Method GET ### Endpoint /sites ### Query Parameters - **section** (string) - Optional - Filters sites by a specific section name. ### Response #### Success Response (200) - **sites** (array) - An array of site objects. #### Response Example { "sites": [ { "name": "SITE1", "addresses": [ "address1.com:46473", "address2.com" ], "affils": [ "GROUP1", "GROUP2" ], "allow_download": "YES", "allow_upload": "NO", "avg_speed": {}, "base_path": "/", "broken_pasv": false, "cepr": true, "cpsv": true, "disabled": false, "except_source_sites": [], "except_target_sites": [], "force_binary_mode": false, "leave_free_slot": true, "list_command": "STAT_L", "max_idle_time": 60, "max_logins": 3, "max_sim_down": 2, "max_sim_down_complete": 0, "max_sim_down_pre": 0, "max_sim_down_transferjob": 0, "max_sim_up": 3, "password": "SecretPassword", "pret": false, "priority": "HIGH", "list_frequency": "AUTO", "proxy_name": "", "proxy_type": "GLOBAL", "sections": [ { "name": "SEC1", "path": "/some/path" } ], "skiplist": [], "sscn": false, "stay_logged_in": false, "tls_mode": "AUTH_TLS", "tls_transfer_policy": "PREFER_OFF", "transfer_protocol": "IPV4_ONLY", "transfer_source_policy": "ALLOW", "transfer_target_policy": "BLOCK", "user": "myusername", "xdupe": true } ] } ## GET /sites/SITE1 ### Description Retrieves the details of a specific site. ### Method GET ### Endpoint /sites/{SITE1} ### Parameters #### Path Parameters - **SITE1** (string) - Required - The name of the site to retrieve. ### Response #### Success Response (200) - **site object** (object) - Detailed information about the specified site. #### Response Example { "name": "SITE1", "addresses": [ "address1.com:46473", "address2.com" ], "affils": [ "GROUP1", "GROUP2" ], "allow_download": "YES", "allow_upload": "NO", "avg_speed": {}, "base_path": "/", "broken_pasv": false, "cepr": true, "cpsv": true, "disabled": false, "except_source_sites": [], "except_target_sites": [], "force_binary_mode": false, "leave_free_slot": true, "list_command": "STAT_L", "max_idle_time": 60, "max_logins": 3, "max_sim_down": 2, "max_sim_down_complete": 0, "max_sim_down_pre": 0, "max_sim_down_transferjob": 0, "max_sim_up": 3, "password": "SecretPassword", "pret": false, "priority": "HIGH", "list_frequency": "AUTO", "proxy_name": "", "proxy_type": "GLOBAL", "sections": [ { "name": "SEC1", "path": "/some/path" } ], "skiplist": [], "sscn": false, "stay_logged_in": false, "tls_mode": "AUTH_TLS", "tls_transfer_policy": "PREFER_OFF", "transfer_protocol": "IPV4_ONLY", "transfer_source_policy": "ALLOW", "transfer_target_policy": "BLOCK", "user": "myusername", "xdupe": true } ## POST /sites ### Description Adds a new site to the configuration. ### Method POST ### Endpoint /sites ### Request Body - **site object** (object) - Required - A JSON object containing the details of the new site. Unspecified values will receive their default values. ### Request Example ```json { "name": "NEW_SITE", "addresses": [ "newsite.com:46473" ], "affils": [ "NEW_GROUP" ] } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the site was added. #### Response Example { "message": "Site NEW_SITE added successfully." } ## PATCH /sites/SITE1 ### Description Updates an existing site. Only the fields to be modified need to be included in the request body. ### Method PATCH ### Endpoint /sites/{SITE1} ### Parameters #### Path Parameters - **SITE1** (string) - Required - The name of the site to update. ### Request Body - **site object** (object) - Required - A JSON object containing the fields to update for the site. ### Request Example ```json { "allow_download": "MATCH_ONLY", "max_logins": 5 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the site was updated. #### Response Example { "message": "Site SITE1 updated successfully." } ## DELETE /sites/SITE1 ### Description Deletes a specific site. ### Method DELETE ### Endpoint /sites/{SITE1} ### Parameters #### Path Parameters - **SITE1** (string) - Required - The name of the site to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the site was deleted. #### Response Example { "message": "Site SITE1 deleted successfully." } ``` -------------------------------- ### Show Section Details (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieves detailed information for a specific section using its name. ```HTTP GET /sections/SECTIONNAME ``` -------------------------------- ### List Sections (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieves a list of all available sections. ```HTTP GET /sections ``` -------------------------------- ### Raw Command API Source: https://cbftp.glftpd.io/svn/cbftp/API/index Retrieve raw command results for asynchronous raw commands. ```APIDOC ## GET /raw/{id} ### Description Get raw command results for an async raw command with a specific ID. ### Method GET ### Endpoint /raw/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the async raw command. ### Response #### Success Response (200) - **result** (string) - The raw command results. #### Response Example ```json { "result": "Command output here" } ``` ``` -------------------------------- ### Raw Command Source: https://cbftp.glftpd.io/svn/cbftp/API/index Issues a raw command on the specified list of sites. ```APIDOC ## POST /raw ### Description Issues a raw command on the specified list of sites. The site list can also be a section name. Section paths within the command can be inserted using the $path(sectionname) syntax. ### Method POST ### Endpoint /raw ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **sitelist** (string) - Required - A comma-separated list of site names or a section name. - **command** (string) - Required - The raw command to execute. ### Request Example ```json { "password": "your_password", "sitelist": "site1,site2", "command": "LIST -l $path(my_section)" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the raw command has been issued. #### Response Example ```json { "message": "Raw command issued successfully." } ``` ``` -------------------------------- ### Raw Command API Source: https://cbftp.glftpd.io/svn/cbftp/API/index Endpoint for sending raw commands to the Cbftp server. ```APIDOC ## POST /raw ### Description Sends a raw command to the Cbftp server. This can be executed on specific sites, sites with specific sections, or all sites. ### Method POST ### Endpoint /raw ### Request Body - **command object** (object) - Required - An object containing the command and execution details. - **command** (string) - Required - The raw command to execute. - **sites** (array) - Optional - An array of site names to run the command on. - **sites_with_sections** (array) - Optional - An array of section names; the command runs on sites containing these sections. - **sites_all** (boolean) - Optional - If true, run the command on all sites. Mutually exclusive with `sites` and `sites_with_sections`. - **path** (string) - Optional - The path to change to before executing the command. - **path_section** (string) - Optional - The name of a section to change to before executing the command. - **timeout** (integer) - Optional - Maximum time in seconds to wait for the command to finish. - **async** (boolean) - Optional - If true, the command runs in the background and the response contains a request ID. If false, the response waits for the command to complete. ### Request Example ```json { "command": "site deluser me", "sites": ["SITE1"], "timeout": 10, "async": false } ``` ### Response #### Success Response (200) - **result** (string) - The output of the executed command if `async` is false. - **request_id** (string) - A unique identifier for the asynchronous command if `async` is true. #### Response Example (Synchronous) ```json { "result": "User me deleted from SITE1." } ``` #### Response Example (Asynchronous) ```json { "request_id": "a1b2c3d4e5f6" } ``` ``` -------------------------------- ### Idle on Sites Source: https://cbftp.glftpd.io/svn/cbftp/API/index Logs in and idles on the specified sites for a given duration. ```APIDOC ## POST /idle ### Description Logs in and idles on the specified sites. The duration for staying logged in is optional and defaults to the 'max idle time' configured per site. The site list can also be a section name. ### Method POST ### Endpoint /idle ### Parameters #### Request Body - **password** (string) - Required - The password for authentication. - **sitelist** (string) - Required - A comma-separated list of site names or a section name. - **time** (integer) - Optional - The duration in seconds to stay logged in. Defaults to site's max idle time. ### Request Example ```json { "password": "your_password", "sitelist": "site1,site2", "time": 3600 } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the idle command has been issued. #### Response Example ```json { "message": "Idle command issued successfully." } ``` ``` -------------------------------- ### List Directory (REST API) Source: https://cbftp.glftpd.io/svn/cbftp/API/index Lists the contents of a directory. The path can be a directory or a section name. An optional timeout can be specified. ```HTTP GET /path?site=SITE1&path=/&timeout=2 ``` -------------------------------- ### UDP API Upload Command Source: https://cbftp.glftpd.io/svn/cbftp/API/index Command to initiate an upload transfer job via the UDP API. Requires password, source path, optionally source file, destination site, and destination path. ```Text upload [srcfile] ```