|
| 1 | +import { PublicIPResult, ResultStates } from "../zos"; |
| 2 | + |
| 3 | +interface NetworkInterface { |
| 4 | + /** The network identifier */ |
| 5 | + network: string; |
| 6 | + /** The IP address of the interface */ |
| 7 | + ip: string; |
| 8 | +} |
| 9 | + |
| 10 | +interface ComputeCapacity { |
| 11 | + /** Number of CPU cores allocated */ |
| 12 | + cpu: number; |
| 13 | + /** Amount of memory allocated in MB */ |
| 14 | + memory: number; |
| 15 | +} |
| 16 | + |
| 17 | +interface BaseMountData { |
| 18 | + /** The name of the mount */ |
| 19 | + name: string; |
| 20 | + /** The mount point in the filesystem */ |
| 21 | + mountPoint: string; |
| 22 | +} |
| 23 | + |
| 24 | +interface ExtendedMountData extends BaseMountData { |
| 25 | + /** The size of the mount (optional) */ |
| 26 | + size?: number; |
| 27 | + /** The state of the mount result (optional) */ |
| 28 | + state?: ResultStates; |
| 29 | + /** Message providing additional information about the mount result (optional) */ |
| 30 | + message?: string; |
| 31 | + /** Cache information (optional) */ |
| 32 | + cache?: any; |
| 33 | + /** Prefix information (optional) */ |
| 34 | + prefix?: any; |
| 35 | + /** Minimal shards (optional) */ |
| 36 | + minimal_shards?: number; |
| 37 | + /** Expected shards (optional) */ |
| 38 | + expected_shards?: number; |
| 39 | + /** QSFS ZDBs name (optional) */ |
| 40 | + qsfs_zdbs_name?: string; |
| 41 | + /** Metrics endpoint (optional) */ |
| 42 | + metricsEndpoint?: string; |
| 43 | +} |
| 44 | + |
| 45 | +// Union type for the mount data |
| 46 | +type MountData = BaseMountData | ExtendedMountData; |
| 47 | + |
| 48 | +interface ZmachineData { |
| 49 | + /** The version of the workload */ |
| 50 | + version: number; |
| 51 | + /** The contract ID associated with the workload */ |
| 52 | + contractId: number; |
| 53 | + /** The node ID where the workload is deployed */ |
| 54 | + nodeId: string; |
| 55 | + /** The name of the workload */ |
| 56 | + name: string; |
| 57 | + /** The creation timestamp of the workload result */ |
| 58 | + created: number; |
| 59 | + /** The current state of the workload */ |
| 60 | + status: string; |
| 61 | + /** Message providing additional information about the workload state */ |
| 62 | + message: string; |
| 63 | + /** The flist (file list) used by the workload */ |
| 64 | + flist: string; |
| 65 | + /** The public IP address obtained by the machine */ |
| 66 | + publicIP: PublicIPResult; |
| 67 | + /** The planetary IP address of the machine */ |
| 68 | + planetary: string; |
| 69 | + /** The Mycelium IP address of the machine, if applicable */ |
| 70 | + myceliumIP: string; |
| 71 | + /** List of network interfaces */ |
| 72 | + interfaces: NetworkInterface[]; |
| 73 | + /** The compute capacity (CPU and memory) allocated to the machine */ |
| 74 | + capacity: ComputeCapacity; |
| 75 | + /** List of mounts associated with the machine */ |
| 76 | + mounts: MountData[]; |
| 77 | + /** Environment variables set for the workload */ |
| 78 | + env: Record<string, unknown>; |
| 79 | + /** The entrypoint command for the workload */ |
| 80 | + entrypoint: string; |
| 81 | + /** Metadata associated with the workload */ |
| 82 | + metadata: string; |
| 83 | + /** Description of the workload */ |
| 84 | + description: string; |
| 85 | + /** Size of the root filesystem */ |
| 86 | + rootfs_size: number; |
| 87 | + /** Indicates if corex is enabled */ |
| 88 | + corex: boolean; |
| 89 | + /** The list of the GPUs */ |
| 90 | + gpu: string[] | undefined; |
| 91 | +} |
| 92 | + |
| 93 | +interface VM extends ZmachineData { |
| 94 | + customDomain?: string; |
| 95 | + deploymentName: string; |
| 96 | + projectName: string; |
| 97 | + wireguard: string; |
| 98 | +} |
| 99 | + |
| 100 | +export { ZmachineData, VM }; |
0 commit comments