Skip to content

RPC Methods for Plugins

Plugins call the system's JSON-RPC 2.0 methods via server.call(method, params...) (with admin authority), and can register their own methods via server.registerRPC so the frontend and other plugins can call them.

For invocation semantics, argument marshalling, and error handling, see the server module. For full parameter and return-structure documentation of each method, see the RPC documentation.

Permission

server.call requires the allowSystemRPC permission, and invocations run with admin authority — every admin:* method is callable, including sensitive ones like admin:exec. Only declare capabilities you actually need.

Namespaces & Methods

common: (general)

MethodDescription
common:getNodesGet node info ({uuid} optional; returns a single Client or {[uuid]: Client})
common:getNodesLatestStatusGet latest node status ({uuid} / {uuids} optional)
common:getNodeRecentStatusGet a node's recent status records ({uuid})
common:getRecordsQuery historical records by time range (load or ping; metric filtering and point caps)
common:getMeCurrent logged-in user
common:getPublicInfoPublic site & runtime configuration
common:getVersionServer version and build hash

public: (public)

MethodDescription
public:getMeCurrent user (Guest placeholder for visitors)
public:getNodesInformationPublic node basic info (hidden nodes/sensitive fields filtered)
public:getPublicSettingsPublic site settings
public:getVersionServer version
public:getClientRecentRecordsNode's recent status cache
public:getRecordsByUUIDLoad records for one node over a relative window
public:getPingRecordsPing history & statistics by node or task
public:getPublicPingTasksPublic ping tasks
public:listMetricDefinitionsPublic metric definitions & retention policies
public:queryMetricsQuery metric time series (aggregation, tag filtering, empty-bucket filling)
public:getPingMetricStatsPing latency/loss/percentile statistics
public:recordVisitorEventReport a visitor event

admin: (administration, full list)

MethodDescription
admin:addClient / editClient / removeClient / getClient / listClients / getClientToken / orderClientsNode management
admin:clearRecords / clearAllRecordsClear history records
admin:getTasks / getTaskById / getTasksByClientId / getSpecificTaskResult / getTaskResultsByTaskId / execRemote exec tasks
admin:addPingTask / deletePingTask / editPingTask / getAllPingTasks / orderPingTaskPing tasks
admin:addLoadNotification / deleteLoadNotification / editLoadNotification / getAllLoadNotificationsLoad notifications
admin:listOfflineNotifications / editOfflineNotification / enableOfflineNotification / disableOfflineNotificationOffline notifications
admin:listTrafficReportNotifications / editTrafficReportNotifications / enableTrafficReportNotifications / disableTrafficReportNotificationsTraffic reports
admin:getSessions / deleteSession / deleteAllSessionsLogin sessions
admin:getSettings / editSettingsSystem settings
admin:getClipboard / listClipboard / createClipboard / updateClipboard / deleteClipboard / batchDeleteClipboardClipboard
admin:getMessageSenderProvider / setMessageSenderProviderNotification sender config
admin:getOidcProvider / setOidcProviderOIDC config
admin:getLogsPaged audit logs
admin:testSendMessage / testGeoipTest utilities
admin:getXtermjsSettings / setXtermjsSettingsTerminal settings
admin:listMetricDefinitions / updateMetricDefinition / getMetricMigrationStatus / startMetricMigration / cancelMetricMigrationMetric management
admin:getDatabaseSize / vacuumDatabaseDatabase maintenance
admin:listPlugins / setPluginEnabled / getPluginLogs / deletePlugin / getPluginConfiguration / setPluginConfigurationPlugin management

client: (agents)

MethodDescription
client:getPingTasksGet ping tasks assigned to the client
client:uploadPingResultReport a ping execution result
client:taskResultReport a remote exec result

Methods registered by plugins

Any method registered by another plugin via server.registerRPC (preferably with the plugin: prefix) can be called through server.call. The rpc. prefix is reserved; plugins cannot register it.

Examples

js
const server = require("server");

async function collect() {
  // 1. Get all node basic info
  const nodes = await server.call("common:getNodes");

  // 2. Get live status
  const status = await server.call("common:getNodesLatestStatus");

  // 3. Create a ping task
  await server.call("admin:addPingTask", {
    name: "google",
    target: "8.8.8.8",
    type: "icmp",
    interval: 30,
    clients: [Object.keys(nodes)[0]],
    default_on: true
  });

  return { online: Object.keys(status).length };
}

Error handling

js
try {
  await server.call("admin:getClient", { uuid: "not-exist" });
} catch (err) {
  console.log(err.code);    // integer JSON-RPC error code
  console.log(err.message); // error message
  console.log(err.data);    // extra data (optional)
}

Plugin management methods in detail

MethodParamsReturnsNotes
admin:listPluginsnonePlugin[]manifest + {enabled, running, last_error}
admin:setPluginEnabled{short, enabled, approved?}null or {requires_approval: true}approval flow: see Plugin Development Guide
admin:getPluginLogs{short}{logs}64 KiB ring buffer
admin:deletePlugin{short}null404 error if not installed
admin:getPluginConfiguration{short}{configuration, data}declared items + merged saved values
admin:setPluginConfiguration{short, data}nullsave configuration

REST endpoints (admin only):

EndpointDescription
POST /api/admin/plugin/installUpload a ZIP (raw ZIP binary body)
GET /api/admin/plugin/market/sourcesMarket source list
POST/PUT/DELETE /api/admin/plugin/market/sources[/:id]Manage market sources
GET /api/admin/plugin/market/catalogMarket catalog (?refresh=true forces refresh)
POST /api/admin/plugin/market/installInstall from market ({source_id, short})
GET /api/plugin/:short/*filepathPublic plugin page static files (no auth)
GET /api/admin/plugin/:short/*filepathAdmin plugin page static files

Released under the MIT license.