Skip to content

Node Model ​

class SystemInfo(BaseModel) ​

Node system information

FieldTypeDescription
typestrSystem type
hostnamestrHostname
platformstrPlatform architecture
releasestrSystem version
uptimefloatSystem uptime (unit: seconds)
cwdstrRemote node runtime path
loadavgtuple[float, float, float]System load average (Linux and macOS only), representing CPU load over the past 1, 5, and 15 minutes
freememintAvailable memory (unit: bytes)
cpuUsagefloatCPU usage
memUsagefloatMemory usage
totalmemintTotal memory (unit: bytes)

class DaemonSetting(BaseModel) ​

Node System Configuration Information

Field NameTypeDescription
languagestrNode language
uploadSpeedRateintUpload speed limit (0 = no limit, limit is (n * 64)KB/s)
downloadSpeedRateintDownload speed limit (0 = no limit, limit is (n * 64) KB/s)
portRangeStartintPort range start value
portRangeEndintPort range end value
portAssignIntervalintUnknown
portintNode listening port
maxDownloadFromUrlFileCountintMaximum number of concurrent remote download tasks allowed

class DaemonSystemInfo(DaemonStatus) ​

Node Information

Field NameTypeDescription
versionstr | None = NoneNode version
processProcessInfo | None = NoneNode process info
instanceInstanceStat | None = NoneNode instance stats
systemSystemInfo | None = NoneNode system information
cpuMemChartlist[CpuMemChart] | None = NoneCPU and memory usage trends
configDaemonSetting | None = NoneNode configuration information

class DaemonOperation(BaseModel) ​

Node operation

FieldTypeDescription
uuidstrNode UUID

method delete() ​

Delete this node

Returns ​

  • bool: Returns True after successful operation

Attempt to connect to this node

Returns ​

  • bool: Returns True after successful operation

method updateConfig(self, config: dict[str, Any]) ​

Update the configuration of this node

Parameters ​

  • config: Node configuration provided as a dictionary, missing fields will be filled with the original node config

Returns ​

  • bool: Returns True after successful operation

method createInstance(self, config: dict[str, Any]) ​

Create an instance on the current node

Parameters ​

  • config: Instance configuration provided as a dictionary, missing fields will be supplemented by the InstanceConfig model

Returns ​

  • InstanceCreateResult: An object containing the result of the newly created instance information

method deleteInstance(self, uuids: list[str], deleteFile=False) ​

Delete one or more instances on the current node

Parameters ​

  • uuids: List of instance UUIDs to delete
  • deleteFile: Whether to delete associated files

Returns ​

  • list[str]: List of UUIDs returned after the deletion operation

class DaemonConfig(BaseModel) ​

Node configuration information

FieldTypeDescription
ipstrRemote node IP
portintRemote node port
prefixstrRemote node path prefix
remarksstrRemote node remarks
apiKeystrRemote node API key

class DaemonStatus(DaemonOperation) ​

Node status information

FieldTypeDescription
ipstrRemote node IP
portintRemote node port
prefixstrRemote node path prefix
remarksstrRemote node remarks
availableboolNode availability status

class DaemonInfo(DaemonStatus) ​

Node information

FieldTypeDescription
instanceslist[InstanceDetail]List of node instances

class DaemonUpdateConfig(DaemonConfig) ​

Node update configuration information

FieldTypeDescription
settingDaemonSettingNode system settings

Released under the MIT License.