跳转到主要内容
PUT
/
gpus
/
v2
/
instances
/
{instance_id}
/
ports
更新实例端口
curl --request PUT \
  --url https://api.ppio.com/gpus/v2/instances/{instance_id}/ports \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "ports": [
    {
      "port": 8080,
      "protocol": "tcp"
    },
    {
      "port": 8888,
      "protocol": "http"
    }
  ]
}
'
{}

请求头

Content-Type
string
必填

枚举值:application/json。

Authorization
string
必填

Bearer 身份验证格式,例如:Bearer {{API 密钥}}

路径参数

instance_id
string
必填

实例 ID。字符串,长度限制:1-255 字符。

请求体

application/json
ports
object[]
必填

暴露端口列表,用于全量更新实例暴露端口。

示例:
[
{ "port": 8080, "protocol": "tcp" },
{ "port": 8888, "protocol": "http" }
]

响应

200 - application/json

成功

The response is of type object.

最后修改于 2026年6月26日