删除虚拟机NAT规则
POST
/{adminPath}/nat/del
最后修改时间:2024-12-30 08:56:01
责任人:未设置
请求参数
Path 参数
adminPath
string
必需
示例值:
admin
Header 参数
Authorization
string
可选
示例值:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiYzE1ZGU5NjYtNmZiMi00Mjg2LWE3MjMtZDBiMTdjNmJkMTFiMSIsInNlY3JldCI6ImhiQ2UwYmhmejlrRWl2NHFpMWhXcXFIN2J0dXgrcnIvUVZYS2dMTWZqckk9IiwiZXhwIjoxNzM1NDgwNzg0fQ.NF1ZY5UQNOhAVipe7HUEQsVizP6qdbryNY53bB-Ah2Y
Body 参数application/json
source_port
integer
必需
destination_ip
string
必需
destination_port
integer
必需
protocol
string
必需
vm
string
必需
示例
{
"source_port": 7780,
"destination_ip": "192.168.7.12",
"destination_port": 7780,
"protocol": "udp",
"vm": "10"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/admin/nat/del' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiYzE1ZGU5NjYtNmZiMi00Mjg2LWE3MjMtZDBiMTdjNmJkMTFiMSIsInNlY3JldCI6ImhiQ2UwYmhmejlrRWl2NHFpMWhXcXFIN2J0dXgrcnIvUVZYS2dMTWZqckk9IiwiZXhwIjoxNzM1NDgwNzg0fQ.NF1ZY5UQNOhAVipe7HUEQsVizP6qdbryNY53bB-Ah2Y' \
--header 'Content-Type: application/json' \
--data-raw '{
"source_port": 7780,
"destination_ip": "192.168.7.12",
"destination_port": 7780,
"protocol": "udp",
"vm": "10"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
total
integer
必需
current
integer
必需
pages
integer
必需
size
integer
必需
records
array [object {3}]
必需
示例
{
"code": 20000,
"message": "请求成功",
"data": {
"total": 1,
"current": 1,
"pages": 1,
"size": 20,
"records": [
{
"vmhost": {
"id": 25,
"nodeid": 1,
"vmid": 103,
"name": "VM-01",
"sockets": 1,
"cores": 2,
"threads": 2,
"devirtualization": false,
"kvm": true,
"cpuModel": null,
"modelGroup": null,
"cpu": "host",
"cpuUnits": 1024,
"args": null,
"arch": "x86_64",
"acpi": 1,
"memory": 1024,
"swap": null,
"agent": 1,
"ide0": null,
"ide2": "local-lvm:cloudinit",
"net0": "virtio,bridge=vmbr0",
"net1": null,
"os": "CentOS-8-Stream-x64.qcow2",
"osType": "linux",
"iso": null,
"template": null,
"onBoot": 1,
"bandwidth": 100,
"storage": "local-lvm",
"systemDiskSize": 40,
"dataDisk": {
"1": 40
},
"bridge": "vmbr0",
"ipConfig": {
"1": "ip=192.168.36.1/24,gw=192.168.36.2"
},
"nested": 0,
"task": {
"1692783654292": 135,
"1692783654310": 136,
"1692783693695": 137,
"1692783694983": 138,
"1692783695855": 139,
"1692783696541": 140
},
"status": 0,
"createTime": 1692783654293,
"expirationTime": 2008143654293
},
"current": {
"data": {
"running-qemu": "6.1.0",
"name": "VM-01",
"mem": 553115648,
"disk": 0,
"pid": 41319,
"status": "running",
"diskread": 857323698,
"proxmox-support": {
"pbs-dirty-bitmap-savevm": true,
"pbs-masterkey": true,
"query-bitmap-info": true,
"pbs-dirty-bitmap": true,
"pbs-dirty-bitmap-migration": true,
"pbs-library-version": "1.2.0 (6e555bc73a7dcfb4d0b47355b958afd101ad27b5)"
},
"agent": 1,
"nics": {
"tap103i0": {
"netout": 2048408,
"netin": 146164136
}
},
"cpu": 0.0312977631257886,
"maxdisk": 42949672960,
"freemem": 254599168,
"qmpstatus": "running",
"diskwrite": 552444416,
"blockstat": {
"scsi1": {
"account_invalid": true,
"wr_operations": 0,
"rd_merged": 0,
"unmap_total_time_ns": 0,
"unmap_bytes": 0,
"unmap_merged": 0,
"rd_total_time_ns": 119191813,
"wr_bytes": 0,
"timed_stats": [],
"failed_unmap_operations": 0,
"failed_flush_operations": 0,
"idle_time_ns": 66957079181668,
"invalid_wr_operations": 0,
"unmap_operations": 0,
"invalid_unmap_operations": 0,
"flush_total_time_ns": 0,
"failed_rd_operations": 0,
"wr_highest_offset": 0,
"rd_operations": 434,
"account_failed": true,
"wr_merged": 0,
"invalid_flush_operations": 0,
"failed_wr_operations": 0,
"flush_operations": 0,
"invalid_rd_operations": 0,
"wr_total_time_ns": 0,
"rd_bytes": 9629696
},
"ide2": {
"unmap_bytes": 0,
"unmap_total_time_ns": 0,
"rd_merged": 0,
"account_invalid": true,
"wr_operations": 0,
"unmap_operations": 0,
"invalid_wr_operations": 0,
"failed_flush_operations": 0,
"failed_unmap_operations": 0,
"idle_time_ns": 66956996453557,
"timed_stats": [],
"wr_bytes": 0,
"rd_total_time_ns": 31770289,
"unmap_merged": 0,
"invalid_flush_operations": 0,
"wr_merged": 0,
"account_failed": true,
"rd_operations": 80,
"wr_highest_offset": 0,
"failed_rd_operations": 0,
"flush_total_time_ns": 0,
"invalid_unmap_operations": 0,
"wr_total_time_ns": 0,
"rd_bytes": 278706,
"invalid_rd_operations": 0,
"flush_operations": 0,
"failed_wr_operations": 0
},
"scsi0": {
"unmap_merged": 0,
"rd_total_time_ns": 23389570377,
"wr_bytes": 552444416,
"failed_unmap_operations": 0,
"failed_flush_operations": 0,
"idle_time_ns": 18807941480,
"timed_stats": [],
"unmap_operations": 0,
"invalid_wr_operations": 0,
"account_invalid": true,
"wr_operations": 13321,
"rd_merged": 0,
"unmap_total_time_ns": 0,
"unmap_bytes": 0,
"failed_wr_operations": 0,
"flush_operations": 4640,
"invalid_rd_operations": 0,
"wr_total_time_ns": 28158216376,
"rd_bytes": 847415296,
"flush_total_time_ns": 2741837421,
"invalid_unmap_operations": 0,
"wr_highest_offset": 42018529280,
"failed_rd_operations": 0,
"rd_operations": 23603,
"invalid_flush_operations": 0,
"wr_merged": 0,
"account_failed": true
}
},
"ballooninfo": {
"total_mem": 807714816,
"free_mem": 254599168,
"last_update": 1693025679,
"major_page_faults": 6841,
"minor_page_faults": 14395839,
"actual": 1073741824,
"max_mem": 1073741824,
"mem_swapped_out": 168591360,
"mem_swapped_in": 44277760
},
"uptime": 66977,
"vmid": 103,
"netin": 146164136,
"cpus": 2,
"maxmem": 1073741824,
"netout": 2048408,
"ha": {
"managed": 0
},
"balloon": 1073741824,
"running-machine": "pc-i440fx-6.1+pve0"
}
},
"rrddata": null
}
]
}
}
修改于 2024-12-30 08:56:01