External VPS
Conecta un servidor Linux que ya tienes y gestiona sus archivos, el acceso SSH y los servicios.
External VPS conecta a Xuda por SSH un servidor Linux que ya tienes y luego te permite automatizarlo en lugar de hacer clic en el panel: leer sus métricas en vivo, gestionar a distancia su sistema de archivos y sus servicios, publicarlo en una URL HTTPS pública y crear accesos SSH de desarrollador con token. Treinta y cuatro de sus métodos son accesibles con una clave de API de cuenta, y toda la superficie está disponible también para un agente de IA por MCP.
Trabajar con el sistema de archivos
vps_fs_list, vps_fs_read, vps_fs_write, vps_fs_write_batch, vps_fs_mkdir,
vps_fs_rename, vps_fs_delete, vps_fs_search, vps_fs_disk_usage y vps_fs_tail se ejecutan por
SFTP contra la máquina conectada. Todas las rutas son absolutas y una escritura sobrescribe, no
añade, así que llama primero a vps_fs_mkdir cuando el directorio padre pueda no existir.
curl -s https://xuda.ai/cpi/vps_fs_write \
-H 'content-type: application/json' \
-d '{"api_key":"YOUR_API_KEY","app_id":"YOUR_APP_ID","path":"/var/www/site/index.html","content":"<h1>Hello</h1>"}'
const res = await fetch('https://xuda.ai/cpi/vps_fs_write', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
api_key: 'YOUR_API_KEY',
app_id: 'YOUR_APP_ID',
path: '/var/www/site/index.html',
content: '<h1>Hello</h1>',
}),
});
const { code, data } = await res.json();
import requests
res = requests.post(
'https://xuda.ai/cpi/vps_fs_write',
json={
'api_key': 'YOUR_API_KEY',
'app_id': 'YOUR_APP_ID',
'path': '/var/www/site/index.html',
'content': '<h1>Hello</h1>',
},
)
vps_fs_write_batch escribe hasta 128 archivos en una sola llamada con una única sesión SFTP, creando
los directorios padre según haga falta, el camino rápido para subir una carpeta. No es atómico: un archivo fallido
no aborta el resto, así que lee su recuento failed y el array results por ruta en lugar de
fiarte solo de un sobre code: 1.
Publicación y acceso
vps_enable_web_url / vps_disable_web_url y vps_set_web_port ponen la máquina en una URL HTTPS
pública. vps_ssh_access_create crea una credencial SSH de desarrollador con token cada vez, _list,
_update, _rotate, _set_status y _delete la gestionan después, y vps_ssh_session_events
/ vps_ssh_command_log leen lo que ocurrió con ella. agent_firewall_list / _open / _close
gestionan los puertos abiertos de la máquina, y agent_domain_connect (consulta Dominios) apunta uno de
tus dominios a ella.
Métodos
La tabla de abajo es el catálogo completo de app_module, el mismo que enlaza
Plataforma de desarrollo: todos los métodos de archivos, SSH y firewall de VPS
anteriores están en ella, junto con el resto de lo que hace ese microservicio.
agent_firewall_closeFirewall: close portsFirewall: close portsClose inbound TCP port(s) on the current app's firewall. Acts only on the current app.1 fielduseragent_firewall_listFirewall: list open portsFirewall: list open portsList the inbound firewall rules (open ports) for the current app. Check what is reachable from outside before opening or closing ports.No fieldsuseragent_firewall_openFirewall: open portsFirewall: open portsOpen inbound TCP port(s) on the current app's firewall so the service becomes reachable from outside. Use when a service is up locally but times out from outside. Acts only on the current app.1 fielduserchange_under_attack_modeChange Under Attack ModeChange Under Attack ModeToggles Cloudflare under-attack mode for the application.2 fieldsadminclear_traffic_logsClear Traffic LogsClear Traffic LogsLaunches a background job that deletes the application's visit log documents.1 fieldadmincompact_databaseCompact DatabaseCompact DatabaseLaunches a background job that deletes stat-4 documents and compacts the application's database.1 fieldadmincreate_progCreate ProgCreate ProgCreates a new studio node (program, table, component, folder...) using the same factory Studio itself uses. Returns the created doc.5 fieldsusercreate_projectCreate ProjectCreate ProjectCreates a new project for the caller from the app fields sent in data. Fields only the platform may set are ignored. Free plugins listed in data.app_plugins_purchased are installed into the new project, and its default drive folders are created.2 fieldsuserdelete_progDelete ProgDelete ProgSoft-deletes a studio node (Studio's stat 4 convention). The global node cannot be deleted.3 fieldsuserdestroy_appDestroy AppDestroy AppPermanently deletes the specified application. The pre_dispatch hook stamps app_cost.terminated_ts synchronously before the destruction job is queued, so billing UI updates instantly.2 fieldsadminget_app_configGet App ConfigGet App ConfigReturns the public configuration of a live deployment: its branding and icon, address, current build, launch route, and the launch and login settings its public screens need (access mode, login methods, device frame and the preview password check). The app is found by app_id, by its domain, or by a live preview token.3 fieldspublicget_app_firewallGet App FirewallGet App FirewallReturns the app's current firewall rules: the live rules of a hosted virtual server, the cloud firewall attached to the app, or, when neither exists yet, a default ruleset that allows outbound traffic and no inbound traffic.1 fieldadminget_app_infoGet App InfoGet App InfoReturns the app's record together with the caller's access to it: the caller's access_type, a readonly flag when the call is made with an API key, and for a VPS its access-consent scopes and their state. For a user group app it also opens an app session and returns its app_token.2 fieldsuser_accessget_app_tablesGet App TablesGet App TablesReturns the app's studio table docs, excluding pouchdb-backed local tables.2 fieldsadminget_app_traffic_metricsGet App Traffic MetricsGet App Traffic MetricsReturns visit counts for a deployment by country, device, browser, vendor, operating system, engine, model and device type, plus total visitors and visitors by date. For a project, the counts are summed across its datacenters.1 fieldadminget_app_traffic_overviewGet App Traffic OverviewGet App Traffic OverviewRetrieves application traffic overview.1 fieldadminget_db_activityGet Db ActivityGet Db ActivityReturns recent activity on the app's database, the background jobs currently running for it, and, for each document type, how many deleted documents are waiting to be cleared by compaction.1 fieldadminget_progGet ProgGet ProgFetches one studio node (full JSON) by its id.2 fieldsuserget_prog_examplesGet Prog ExamplesGet Prog ExamplesCurated, WORKING example progs from the xuda kitchen-sink project. Call without example_id to list (name, type, tags, one-liner); then fetch one by example_id and pattern your build on it. Examples are sanitized reference docs. Create your own progs with create_prog, never save an example verbatim.4 fieldsuserget_progsGet ProgsGet ProgsLists the studio nodes (programs, tables, components, routes...) of a studio project. Returns summaries by default; pass full=true for complete docs.6 fieldsuserget_project_instancesGet Project InstancesGet Project InstancesLists the project's instances whose maintainer is the project's owner.1 fieldadminget_studio_docs_by_typeGet Studio Docs By TypeGet Studio Docs By TypeReturns studio (or deployed-build) docs for an app filtered by menuType, status, and optional build id.4 fieldsuser_accessget_studio_guideGet Studio GuideGet Studio GuideThe xuda Studio authoring guide for AIs. READ THIS FIRST before creating or editing studio progs. Call without a topic for the primer + required workflow + topic index; then read the topic matching what you build (components, tables, programs, javascript, attributes, anatomy, gotchas). Enumerable facts (menu types, xu attributes, workflow actions) are merged from this server's live registries, so the guide always matches the deployed runtime.1 fielduserget_vps_diagnose_reportGet VPS Diagnose ReportGet VPS Diagnose ReportReturns the last stored Auto Diagnose report for the app (or null). Read-only: reads the report already saved on the app doc, no SSH or file access. Owner-gated via _vps_fs_resolve.1 fielduserlist_studio_doc_versionsList Studio Doc VersionsList Studio Doc VersionsLists version-history snapshots for a studio doc from the app's history database (server-side capture).2 fieldsuser_accesssave_deploy_settingsSave Deploy SettingsSave Deploy SettingsUpdates an app's deployment settings: launch and access mode, billed add-ons (offline, User Monitor, Auto Diagnose), VPS access consent, the release and route to serve, and the login and setup configuration. The app's monthly cost is recalculated afterwards.20 fieldsadminsave_progSave ProgSave ProgUpdates an existing studio node with a full doc (must include _id; _rev is checked for conflicts). Pass the doc as prog_json (a JSON-encoded string). Identity/audit fields (docType, created, createdByUid) are server-owned. Javascript progs are COMPILED on save (like Studio's own save): on success scriptData.dependencies is refreshed, on failure the doc is saved with a build_error and the response carries compile.error.2 fieldsuserset_runtime_user_assistSet Runtime User AssistSet Runtime User AssistTurns the deployed app's User Monitor add-on (in-app help) on or off and recalculates the app's monthly cost.2 fieldsadminset_runtime_utility_screenSet Runtime Utility ScreenSet Runtime Utility ScreenDeprecated: use set_runtime_user_assist. Utility Screen is now part of User Monitor, so this turns the same add-on on or off and recalculates the app's monthly cost.2 fieldsadminturn_app_offTurn App OffTurn App OffTurns off (suspends) the specified application.1 fieldadminturn_app_onTurn App OnTurn App OnTurns on (resumes) the specified application.1 fieldadminupdate_domain_setupUpdate Domain SetupUpdate Domain SetupSets the app's address: a subdomain of the platform app domain, a custom domain the customer owns, or a domain registered through Xuda. A custom domain starts a DNS and SSL check; a registered domain is attached to the project and stored as a custom domain.5 fieldsadminupdate_npm_dependenciesUpdate Npm DependenciesUpdate Npm DependenciesSaves the app's npm dependencies to its project package.json, installs them, and syncs the project's files to its servers. If package.json cannot be read, a new one is created and the call asks you to refresh and save again.2 fieldsadminvalidate_progValidate ProgValidate ProgValidates a studio prog with xuda's own checker (structure, cross-references, workflow actions, expressions) PLUS a landmine scan for AI-typical mistakes (quotes inside xu-script/xu-style, unknown xu attributes, designer-state $-keys, malformed nodes). RUN THIS BEFORE EVERY save_prog and fix all errors; warnings are real problems too. Pass prog_json (candidate doc, pre-save) or prog_id (existing node).3 fieldsuserverify_app_dns_infoVerify App Dns InfoVerify App Dns InfoLooks up WHOIS data and verifies the SSL certificate for the app's configured custom domain.1 fieldadminvps_disable_sshVPS: disable SSHVPS: disable SSHDisables SSH-over-WebSocket access for the VPS (the router stops resolving the tunnel). Keeps the subdomain.1 fielduservps_disable_web_urlVPS: disable web URLVPS: disable web URLStops serving the VPS's public xuda.app URL (keeps the subdomain reserved for re-enable).1 fielduservps_enable_sshVPS: enable SSHVPS: enable SSHEnables SSH/SFTP-over-WebSocket access for the VPS (idempotent). Returns the connect commands with a token on first enable.1 fielduservps_enable_web_urlVPS: enable web URLVPS: enable web URLGives the VPS a public https://<sub>.xuda.app URL that reverse-proxies to its web server (default port 80). Allocates a subdomain if needed.3 fieldsuservps_fs_deleteVPS Files: deleteVPS Files: deleteDeletes a file or directory (recursively) on the project's VPS over SFTP.2 fieldsuservps_fs_disk_usageVPS Files: disk usageVPS Files: disk usageReturns one-level disk usage (du) of a directory on the VPS, largest children first.2 fieldsuservps_fs_listVPS Files: list directoryVPS Files: list directoryLists a directory on the project's VPS over SFTP. Returns typed entries (file/dir, size, mtime, mode).2 fieldsuservps_fs_mkdirVPS Files: create directoryVPS Files: create directoryCreates a directory (recursively) on the project's VPS over SFTP.2 fieldsuservps_fs_readVPS Files: read fileVPS Files: read fileReads a file on the project's VPS over SFTP. Detects text/image/binary and caps inline size.2 fieldsuservps_fs_renameVPS Files: rename / moveVPS Files: rename / moveRenames or moves a file or directory on the project's VPS over SFTP.3 fieldsuservps_fs_searchVPS Files: searchVPS Files: searchSearches a directory subtree on the VPS by filename or by file contents.4 fieldsuservps_fs_service_actionVPS Files: service actionVPS Files: service actionRuns a bounded service action (nginx test/reload, apache, caddy, systemd daemon-reload, or systemctl verb on a named unit) on the VPS.4 fieldsuservps_fs_tailVPS Files: tail fileVPS Files: tail fileReturns the tail of a file on the VPS, with an offset for incremental polling (live log follow).3 fieldsuservps_fs_writeVPS Files: write fileVPS Files: write fileCreates or overwrites a file on the project's VPS over SFTP.4 fieldsuservps_fs_write_batchVPS Files: batch uploadVPS Files: batch uploadWrites many files to the project's VPS over a single SFTP session, creating parent directories as needed. Used for folder uploads.2 fieldsuservps_rotate_ssh_tokenVPS: rotate SSH tokenVPS: rotate SSH tokenIssues a fresh one-time SSH/SFTP-over-WebSocket bearer token for the VPS (invalidates any previous one) and returns the ready-to-paste connect commands. The server's own SSH login is still required.1 fielduservps_set_web_portVPS: set web portVPS: set web portChanges the upstream port (and optional https scheme) the public xuda.app URL proxies to on the VPS.3 fieldsuservps_ssh_access_createVPS SSH: add developer accessVPS SSH: add developer accessCreates a new named SSH-over-WebSocket developer access, mints a one-time connection token (only its hash is stored), and returns the plaintext token and connect commands once. Optionally sets an expiry.3 fieldsuservps_ssh_access_deleteVPS SSH: delete developer accessVPS SSH: delete developer accessDeletes a named SSH developer access. Its token stops working immediately.2 fieldsuservps_ssh_access_listVPS SSH: list developer accessesVPS SSH: list developer accessesLists every SSH/SFTP-over-WebSocket developer access for a VPS: label, creation date, expiry, active or suspended status, and live online state. Read-only, owner-gated. Never returns the token itself.1 fielduservps_ssh_access_rotateVPS SSH: regenerate access tokenVPS SSH: regenerate access tokenRegenerates the connection token for an existing named SSH developer access (invalidates the previous one) and returns the new plaintext token and connect commands once.2 fieldsuservps_ssh_access_set_statusVPS SSH: suspend or activate accessVPS SSH: suspend or activate accessSuspends or re-activates a named SSH developer access. A suspended access is refused by the router immediately.3 fieldsuservps_ssh_access_updateVPS SSH: edit developer accessVPS SSH: edit developer accessEdits a named SSH developer access: change its label and or expiry. Does not change the token.4 fieldsuservps_ssh_command_logVPS SSH: command historyVPS SSH: command historyLists the commands run over SSH on this server, read live from the server's own command log. Read-only, owner-gated. Requires the command log to be switched on for the server, and only covers interactive shell sessions.2 fieldsuservps_ssh_command_log_setVPS SSH: switch command history on or offVPS SSH: switch command history on or offTurns the in-server command log on or off. When on, every command typed in an interactive SSH session is recorded on the server itself so the owner can review it. Owner-gated and off by default.2 fieldsuservps_ssh_session_eventsVPS SSH: session historyVPS SSH: session historyLists every SSH/SFTP session opened against this server through the secure tunnel: which access was used, the client address, when it started and ended, how long it lasted, and how much data moved each way. Read-only, owner-gated. Session envelopes only, the tunnel is end-to-end encrypted so commands and file names are never visible to the platform.2 fieldsuser
agent_domain_list / agent_domain_connect están en la tabla de Domains y get_deploy_info está en
la tabla de Deploy, consulta Dominios y Cloud Hosting.
save_deploy_settings sigue en esta misma tabla de arriba, junto con el resto de app_module.