proxmox-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/index.js +20 -0
- package/dist/src/http-proxmox.repository.js +336 -0
- package/dist/src/proxmox.provider.js +23 -0
- package/dist/src/tools/encode-ssh-key.js +7 -0
- package/dist/src/types/clone-qemu-machine.js +2 -0
- package/dist/src/types/create-qemu-machine.js +2 -0
- package/dist/src/types/delete-qemu-machine.js +2 -0
- package/dist/src/types/download-iso-image.js +2 -0
- package/dist/src/types/index.js +26 -0
- package/dist/src/types/ip.js +2 -0
- package/dist/src/types/list-qemu-machines.js +2 -0
- package/dist/src/types/start-qemu-machine.js +2 -0
- package/dist/src/types/stop-qemu-machine.js +2 -0
- package/dist/src/types/update-qemu-machine.js +2 -0
- package/dist/src/types/upid.js +2 -0
- package/index.ts +2 -0
- package/package.json +32 -0
- package/src/http-proxmox.repository.ts +362 -0
- package/src/tools/encode-ssh-key.ts +3 -0
- package/src/types/clone-qemu-machine.ts +6 -0
- package/src/types/create-qemu-machine.ts +149 -0
- package/src/types/delete-qemu-machine.ts +26 -0
- package/src/types/download-iso-image.ts +23 -0
- package/src/types/index.ts +10 -0
- package/src/types/ip.ts +1 -0
- package/src/types/list-qemu-machines.ts +39 -0
- package/src/types/start-qemu-machine.ts +5 -0
- package/src/types/stop-qemu-machine.ts +5 -0
- package/src/types/update-qemu-machine.ts +205 -0
- package/src/types/upid.ts +1 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
export type OS = "other" | "wxp" | "w2k" | "w2k3" | "w2k8" | "wvista" | "win7" | "win8" | "win10" | "win11" | "l24" | "l26" | "solaris";
|
|
2
|
+
|
|
3
|
+
export type QemuNetwork = {
|
|
4
|
+
bridge: "vmbr0" |"vmbr1";
|
|
5
|
+
/**
|
|
6
|
+
* By default Proxmox set true
|
|
7
|
+
*/
|
|
8
|
+
firewall: boolean;
|
|
9
|
+
model: "virtio";
|
|
10
|
+
/**
|
|
11
|
+
* If wanted, we can associated the machine to a VLAN
|
|
12
|
+
*/
|
|
13
|
+
tag?: number;
|
|
14
|
+
}
|
|
15
|
+
// PUT https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/config
|
|
16
|
+
type UpdateQemuMachineBasePayload = {
|
|
17
|
+
/**
|
|
18
|
+
* Automatic restart after crash (currently ignored).
|
|
19
|
+
*/
|
|
20
|
+
autostart?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Select BIOS implementation.
|
|
23
|
+
*
|
|
24
|
+
* default = seabios.
|
|
25
|
+
*/
|
|
26
|
+
bios?: "seabios" | "ovmf";
|
|
27
|
+
/**
|
|
28
|
+
* Memory quantity.
|
|
29
|
+
*
|
|
30
|
+
* default = 512(MB)
|
|
31
|
+
*/
|
|
32
|
+
memory?: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The name of the VM.
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* The cluster node name.
|
|
40
|
+
*/
|
|
41
|
+
node: string;
|
|
42
|
+
/**
|
|
43
|
+
* Specify guest operating system. This is used to enable special
|
|
44
|
+
* optimization/features for specific operating systems:
|
|
45
|
+
*
|
|
46
|
+
* - l24: Linux 2.4 Kernel
|
|
47
|
+
* - l26: Linux 2.6 - 6.X Kernel
|
|
48
|
+
* - other: unspecified OS
|
|
49
|
+
* - solaris: Solaris/OpenSolaris/OpenIndiania kernel
|
|
50
|
+
* - w2k3: Microsoft Windows 2003
|
|
51
|
+
* - w2k8: Microsoft Windows 2008
|
|
52
|
+
* - w2k: Microsoft Windows 2000
|
|
53
|
+
* - win10: Microsoft Windows 10/2016/2019
|
|
54
|
+
* - win11: Microsoft Windows 11/2022
|
|
55
|
+
* - win7: Microsoft Windows 7
|
|
56
|
+
* - win8: Microsoft Windows 8/2012/2012r2
|
|
57
|
+
* - wvista: Microsoft Windows Vista
|
|
58
|
+
* - wxp: Microsoft Windows XP
|
|
59
|
+
*/
|
|
60
|
+
ostype?: OS;
|
|
61
|
+
/**
|
|
62
|
+
* Tags of the VM. This is only meta information.
|
|
63
|
+
*/
|
|
64
|
+
tags: Array<string>;
|
|
65
|
+
/**
|
|
66
|
+
* The (unique) ID of the VM.
|
|
67
|
+
* It should be between 100 and 999999999.
|
|
68
|
+
*/
|
|
69
|
+
vmid: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type UpdateQemuMachinePayload = UpdateQemuMachineBasePayload & {
|
|
73
|
+
/**
|
|
74
|
+
* The number of cores per socket.
|
|
75
|
+
*
|
|
76
|
+
* default = 1
|
|
77
|
+
*/
|
|
78
|
+
coreCount?: number;
|
|
79
|
+
/**
|
|
80
|
+
* ISO name
|
|
81
|
+
*
|
|
82
|
+
* The name of the filename you gave to the ISO.
|
|
83
|
+
* (e.g: debian.iso)
|
|
84
|
+
*/
|
|
85
|
+
isoName?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Networks configurations
|
|
89
|
+
*/
|
|
90
|
+
networks?: Array<QemuNetwork>;
|
|
91
|
+
/**
|
|
92
|
+
* Override the default password.
|
|
93
|
+
*
|
|
94
|
+
* PROXMOX DOCS
|
|
95
|
+
*
|
|
96
|
+
* cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead.
|
|
97
|
+
* Also note that older cloud-init versions do not support hashed passwords.
|
|
98
|
+
*/
|
|
99
|
+
overridenPassword?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Override the default user
|
|
102
|
+
*
|
|
103
|
+
* PROXMOX DOCS
|
|
104
|
+
*
|
|
105
|
+
* cloud-init: User name to change ssh keys and password for instead of the image's configured default user.
|
|
106
|
+
*/
|
|
107
|
+
overridenUser?: string;
|
|
108
|
+
sshkey?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type UpdateQemuMachineProxmoxPayload = UpdateQemuMachineBasePayload & {
|
|
112
|
+
/**
|
|
113
|
+
* cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead.
|
|
114
|
+
* Also note that older cloud-init versions do not support hashed passwords.
|
|
115
|
+
*/
|
|
116
|
+
cipassword?: string;
|
|
117
|
+
/**
|
|
118
|
+
* cloud-init: User name to change ssh keys and password for instead of the image's configured default user.
|
|
119
|
+
*/
|
|
120
|
+
ciuser?: string;
|
|
121
|
+
/**
|
|
122
|
+
* The number of cores per socket.
|
|
123
|
+
*
|
|
124
|
+
* default = 1
|
|
125
|
+
*/
|
|
126
|
+
cores?: number;
|
|
127
|
+
efidisk0: string;
|
|
128
|
+
/**
|
|
129
|
+
* Use volume as IDE hard disk or CD-ROM (n is 0 to 3). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
|
|
130
|
+
* Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume.
|
|
131
|
+
*
|
|
132
|
+
* [file=]<volume> [,aio=<native|threads|io_uring>] [,backup=<1|0>] [,bps=<bps>] [,bps_max_length=<seconds>] [,bps_rd=<bps>] [,bps_rd_max_length=<seconds>] [,bps_wr=<bps>] [,bps_wr_max_length=<seconds>] [,cache=<enum>] [,cyls=<integer>] [,detect_zeroes=<1|0>] [,discard=<ignore|on>] [,format=<enum>] [,heads=<integer>] [,import-from=<source volume>] [,iops=<iops>] [,iops_max=<iops>] [,iops_max_length=<seconds>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_rd_max_length=<seconds>] [,iops_wr=<iops>] [,iops_wr_max=<iops>] [,iops_wr_max_length=<seconds>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>] [,model=<model>] [,replicate=<1|0>] [,rerror=<ignore|report|stop>] [,secs=<integer>] [,serial=<serial>] [,shared=<1|0>] [,size=<DiskSize>] [,snapshot=<1|0>] [,ssd=<1|0>] [,trans=<none|lba|auto>] [,werror=<enum>] [,wwn=<wwn>]
|
|
133
|
+
*/
|
|
134
|
+
ide0?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Use volume as IDE hard disk or CD-ROM (n is 0 to 3). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
|
|
137
|
+
* Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume.
|
|
138
|
+
*
|
|
139
|
+
* [file=]<volume> [,aio=<native|threads|io_uring>] [,backup=<1|0>] [,bps=<bps>] [,bps_max_length=<seconds>] [,bps_rd=<bps>] [,bps_rd_max_length=<seconds>] [,bps_wr=<bps>] [,bps_wr_max_length=<seconds>] [,cache=<enum>] [,cyls=<integer>] [,detect_zeroes=<1|0>] [,discard=<ignore|on>] [,format=<enum>] [,heads=<integer>] [,import-from=<source volume>] [,iops=<iops>] [,iops_max=<iops>] [,iops_max_length=<seconds>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_rd_max_length=<seconds>] [,iops_wr=<iops>] [,iops_wr_max=<iops>] [,iops_wr_max_length=<seconds>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>] [,model=<model>] [,replicate=<1|0>] [,rerror=<ignore|report|stop>] [,secs=<integer>] [,serial=<serial>] [,shared=<1|0>] [,size=<DiskSize>] [,snapshot=<1|0>] [,ssd=<1|0>] [,trans=<none|lba|auto>] [,werror=<enum>] [,wwn=<wwn>]
|
|
140
|
+
*/
|
|
141
|
+
ide1?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Use volume as IDE hard disk or CD-ROM (n is 0 to 3). Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
|
|
144
|
+
* Use STORAGE_ID:0 and the 'import-from' parameter to import from an existing volume.
|
|
145
|
+
*
|
|
146
|
+
* [file=]<volume> [,aio=<native|threads|io_uring>] [,backup=<1|0>] [,bps=<bps>] [,bps_max_length=<seconds>] [,bps_rd=<bps>] [,bps_rd_max_length=<seconds>] [,bps_wr=<bps>] [,bps_wr_max_length=<seconds>] [,cache=<enum>] [,cyls=<integer>] [,detect_zeroes=<1|0>] [,discard=<ignore|on>] [,format=<enum>] [,heads=<integer>] [,import-from=<source volume>] [,iops=<iops>] [,iops_max=<iops>] [,iops_max_length=<seconds>] [,iops_rd=<iops>] [,iops_rd_max=<iops>] [,iops_rd_max_length=<seconds>] [,iops_wr=<iops>] [,iops_wr_max=<iops>] [,iops_wr_max_length=<seconds>] [,mbps=<mbps>] [,mbps_max=<mbps>] [,mbps_rd=<mbps>] [,mbps_rd_max=<mbps>] [,mbps_wr=<mbps>] [,mbps_wr_max=<mbps>] [,media=<cdrom|disk>] [,model=<model>] [,replicate=<1|0>] [,rerror=<ignore|report|stop>] [,secs=<integer>] [,serial=<serial>] [,shared=<1|0>] [,size=<DiskSize>] [,snapshot=<1|0>] [,ssd=<1|0>] [,trans=<none|lba|auto>] [,werror=<enum>] [,wwn=<wwn>]
|
|
147
|
+
*/
|
|
148
|
+
ide2?: string;
|
|
149
|
+
/**
|
|
150
|
+
* cloud-init: Specify IP addresses and gateways for the corresponding interface.
|
|
151
|
+
*
|
|
152
|
+
* IP addresses use CIDR notation, gateways are optional but need an IP of the same type specified.
|
|
153
|
+
* The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit
|
|
154
|
+
* gateway should be provided.
|
|
155
|
+
*
|
|
156
|
+
* For IPv6 the special string 'auto' can be used to use stateless autoconfiguration. This requires
|
|
157
|
+
* cloud-init 19.4 or newer.
|
|
158
|
+
*
|
|
159
|
+
* If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using
|
|
160
|
+
* dhcp on IPv4.
|
|
161
|
+
*
|
|
162
|
+
* [gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>]
|
|
163
|
+
*/
|
|
164
|
+
ipconfig0?: string;
|
|
165
|
+
/**
|
|
166
|
+
* cloud-init: Specify IP addresses and gateways for the corresponding interface.
|
|
167
|
+
*
|
|
168
|
+
* IP addresses use CIDR notation, gateways are optional but need an IP of the same type specified.
|
|
169
|
+
* The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit
|
|
170
|
+
* gateway should be provided.
|
|
171
|
+
*
|
|
172
|
+
* For IPv6 the special string 'auto' can be used to use stateless autoconfiguration. This requires
|
|
173
|
+
* cloud-init 19.4 or newer.
|
|
174
|
+
*
|
|
175
|
+
* If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using
|
|
176
|
+
* dhcp on IPv4.
|
|
177
|
+
*
|
|
178
|
+
* [gw=<GatewayIPv4>] [,gw6=<GatewayIPv6>] [,ip=<IPv4Format/CIDR>] [,ip6=<IPv6Format/CIDR>]
|
|
179
|
+
*/
|
|
180
|
+
ipconfig1?: string;
|
|
181
|
+
net0: string;
|
|
182
|
+
numa: number;
|
|
183
|
+
/**
|
|
184
|
+
* scsi[n]
|
|
185
|
+
* Use volume as SCSI hard disk or CD-ROM (n is 0 to 30).
|
|
186
|
+
* Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
|
|
187
|
+
* Use STORAGE_ID:0 and the 'import-from' parameter to import
|
|
188
|
+
* from an existing volume.
|
|
189
|
+
*/
|
|
190
|
+
scsi0?: string;
|
|
191
|
+
/**
|
|
192
|
+
* scsi[n]
|
|
193
|
+
* Use volume as SCSI hard disk or CD-ROM (n is 0 to 30).
|
|
194
|
+
* Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
|
|
195
|
+
* Use STORAGE_ID:0 and the 'import-from' parameter to import
|
|
196
|
+
* from an existing volume.
|
|
197
|
+
*/
|
|
198
|
+
scsi2?: string;
|
|
199
|
+
scsihw?: "virtio-scsi-single";
|
|
200
|
+
sockets: number;
|
|
201
|
+
/**
|
|
202
|
+
* cloud-init: Setup public SSH keys (one key per line, OpenSSH format).
|
|
203
|
+
*/
|
|
204
|
+
sshkeys?: string;
|
|
205
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type UPID = string & { readonly "": unique symbol };
|