容器实例新增一个对外端口(AddPort)
更新时间:2025-05-08 07:50:27
基本信息
Action:/qai/aicp/notebooks/namespaces/{namespace}/notebooks/add_port
Method: POST
Content-Type:application/json
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
namespance |
string |
命名空间。 |
yes |
uuid |
string |
某容器实例 ID。 |
yes |
port |
integer |
开放端口号,0~65536。 |
yes |
protocol |
string |
协议类型,http 或 https,其中默认值为 http。 |
no |
响应参数
此接口包含的公共响应参数,可参见前文内容,其他参数介绍如下:
data.url | string | 服务的 URL 地址。 |
---|---|---|
data.target_port |
integer |
目标端口。 |
data.server_type |
string |
服务类型。 |
data.server_name |
string |
服务名称。 |
data.status |
boolean |
服务状态。 |
data.protocol |
string |
协议类型,http 或 https。 |
data.password |
string |
服务密码。 |
请求示例
curl -X 'POST' \
'https://ai.coreshub.cn/qai/aicp/notebooks/namespaces/usr-5HY8cxxx/notebooks/add_port' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"uuid": "string",
"port": 1,
"protocol": "http"
}'
响应示例
{
"ret_code": 0,
"message": "success",
"meta": {
"X_REQUEST_ID": "string",
"X_REQUEST_USER": "string"
},
"data": {
"url": "string",
"target_port": 0,
"server_type": "string",
"server_name": "string",
"status": false,
"protocol": "http",
"password": "string"
}
}