External VPS
Pripojte Linuxový server, ktorý už vlastníte, a ovládajte jeho súbory, prístup cez SSH a služby.
External VPS pripojí Linuxový server, ktorý už vlastníte, k Xuda cez SSH a potom vám umožní ovládať ho skriptmi namiesto klikania v dashboarde: čítať jeho živé metriky, na diaľku ovládať jeho súborový systém a služby, publikovať ho na verejnej adrese URL HTTPS a vytvárať tokenizovaný vývojársky prístup cez SSH. Tridsaťštyri jeho metód je dostupných s API kľúčom účtu a celý povrch je dostupný aj AI agentovi cez MCP.
Práca so súborovým systémom
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 a vps_fs_tail bežia cez
SFTP na pripojenom serveri. Každá cesta je absolútna a zápis je prepísanie, nie pripojenie na
koniec, preto zavolajte najprv vps_fs_mkdir, keď nadradený priečinok nemusí existovať.
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 zapíše až 128 súborov jedným volaním v jednej relácii SFTP a podľa potreby
vytvorí nadradené priečinky, čo je rýchla cesta na nahranie priečinka. Nie je atomická: jeden
zlyhaný súbor neukončí ostatné, preto čítajte jeho počet failed a pole results po jednotlivých
cestách a nespoliehajte sa len na obálku code: 1.
Publikovanie a prístup
vps_enable_web_url / vps_disable_web_url a vps_set_web_port sprístupnia server na verejnej
adrese URL HTTPS. vps_ssh_access_create vytvorí naraz jeden tokenizovaný vývojársky prístup cez
SSH, _list, _update, _rotate, _set_status a _delete ho potom spravujú a
vps_ssh_session_events / vps_ssh_command_log čítajú späť, čo sa cez ňu udialo.
agent_firewall_list / _open / _close spravujú otvorené porty servera a agent_domain_connect
(pozri Domains) naň nasmeruje jednu z vašich domén.
Metódy
Tabuľka nižšie je úplný katalóg app_module, ten istý, na ktorý odkazuje
Development Platform: každá vyššie uvedená metóda VPS pre súbory, SSH
a firewall je v ňom, popri zvyšku toho, čo táto mikroslužba robí.
agent_firewall_closeFirewall: close portsFirewall: close portsClose inbound TCP port(s) on the current app's firewall. Acts only on the current app.No fieldsuseragent_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.0 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.No fieldsuserchange_under_attack_modeChange Under Attack ModeChange Under Attack ModeToggles Cloudflare under-attack mode for the application.1 fieldadminclear_traffic_logsClear Traffic LogsClear Traffic LogsLaunches a background job that deletes the application's visit log documents.No fieldsadmincompact_databaseCompact DatabaseCompact DatabaseLaunches a background job that deletes stat-4 documents and compacts the application's database.No fieldsadmincreate_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.1 fielduserdelete_progDelete ProgDelete ProgSoft-deletes a studio node (Studio's stat 4 convention). The global node cannot be deleted.1 fielduserdestroy_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.1 fieldadminget_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.1 fieldpublicget_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.No fieldsadminget_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.1 fielduser_accessget_app_tablesGet App TablesGet App TablesReturns the app's studio table docs, excluding pouchdb-backed local tables.1 fieldadminget_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.No fieldsadminget_app_traffic_overviewGet App Traffic OverviewGet App Traffic OverviewRetrieves application traffic overview.No fieldsadminget_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.No fieldsadminget_progGet ProgGet ProgFetches one studio node (full JSON) by its id.1 fielduserget_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.1 fielduserget_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.No fieldsadminget_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.1 fielduser_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.No fieldsuserget_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.No fieldsuserlist_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).1 fielduser_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.1 fielduserset_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.1 fieldadminset_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.1 fieldadminturn_app_offTurn App OffTurn App OffTurns off (suspends) the specified application.No fieldsadminturn_app_onTurn App OnTurn App OnTurns on (resumes) the specified application.No fieldsadminupdate_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.1 fieldadminvalidate_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).1 fielduserverify_app_dns_infoVerify App Dns InfoVerify App Dns InfoLooks up WHOIS data and verifies the SSL certificate for the app's configured custom domain.No fieldsadminvps_disable_sshVPS: disable SSHVPS: disable SSHDisables SSH-over-WebSocket access for the VPS (the router stops resolving the tunnel). Keeps the subdomain.No fieldsuservps_disable_web_urlVPS: disable web URLVPS: disable web URLStops serving the VPS's public xuda.app URL (keeps the subdomain reserved for re-enable).No fieldsuservps_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.No fieldsuservps_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.1 fielduservps_fs_deleteVPS Files: deleteVPS Files: deleteDeletes a file or directory (recursively) on the project's VPS over SFTP.1 fielduservps_fs_disk_usageVPS Files: disk usageVPS Files: disk usageReturns one-level disk usage (du) of a directory on the VPS, largest children first.1 fielduservps_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).1 fielduservps_fs_mkdirVPS Files: create directoryVPS Files: create directoryCreates a directory (recursively) on the project's VPS over SFTP.1 fielduservps_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.1 fielduservps_fs_renameVPS Files: rename / moveVPS Files: rename / moveRenames or moves a file or directory on the project's VPS over SFTP.1 fielduservps_fs_searchVPS Files: searchVPS Files: searchSearches a directory subtree on the VPS by filename or by file contents.1 fielduservps_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.1 fielduservps_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).1 fielduservps_fs_writeVPS Files: write fileVPS Files: write fileCreates or overwrites a file on the project's VPS over SFTP.1 fielduservps_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.1 fielduservps_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.No fieldsuservps_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.1 fielduservps_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.1 fielduservps_ssh_access_deleteVPS SSH: delete developer accessVPS SSH: delete developer accessDeletes a named SSH developer access. Its token stops working immediately.1 fielduservps_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.No fieldsuservps_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.1 fielduservps_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.1 fielduservps_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.1 fielduservps_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.1 fielduservps_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.1 fielduservps_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.1 fielduser
agent_domain_list / agent_domain_connect sú v tabuľke Domains a get_deploy_info je v tabuľke
Deploy, pozri Domains a Cloud Hosting.
save_deploy_settings zostáva v tejto istej tabuľke vyššie, popri zvyšku app_module.