获取端口列表
获取CCI容器计算实例已开通的端口列表。
GET
https://api.alayanew.com/v1/cci/instance/{id}/open-port/list鉴权(Authorizations)
bearerAuthAuthorizationString必填用户可通过已获取的 Open API Key 做验证。例如:Bearer [YOUR_API_KEY]。
Path Parameters
idString必填实例ID,实例的唯一标识符,例如:08ba7a0e-af00-4072-a5e5-1298ed6c1aa0。
Response
application/json · 200statusInteger业务状态码,200表示成功。
messageString接口响应信息,成功或失败原因描述。
dataObject开放端口响应对象。
显示 properties
portsArray<Object>system端口,没有协议。
显示 properties
protocolString协议。例如: "http/https"。
portInteger端口。例如: 80。
externalHostString外部访问ip。例如: "192.168.1.1"。
externalPortInteger外部访问端口。例如: 31443。
customPortsArray<Object>自定义端口。
显示 properties
protocolString协议。例如: "http/https"。
portInteger端口。例如: 80。
externalHostString外部访问ip。例如: "192.168.1.1"。
externalPortInteger外部访问端口。例如: 31443。
curl -X 'GET' \
'https://api.alayanew.com/v1/cci/instance/08ba7a0e-af00-4072-a5e5-1298ed6c1aa0/open-port/list' \
-H 'accept: application/json' \
-H 'Authorization: Bearer [YOUR_API_KEY]'import requests
url = "https://api.alayanew.com/v1/cci/instance/08ba7a0e-af00-4072-a5e5-1298ed6c1aa0/open-port/list"
headers = {
"accept": "application/json",
"Authorization": "Bearer [YOUR_API_KEY]"
}
response = requests.get(url, headers=headers)
print(response.text)fetch('https://api.alayanew.com/v1/cci/instance/08ba7a0e-af00-4072-a5e5-1298ed6c1aa0/open-port/list', {
method: 'GET',
headers: {
'accept': 'application/json',
'Authorization': 'Bearer [YOUR_API_KEY]'
}
})
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error(error));{
"status": 200,
"message": "OK",
"data": {
"ports": [
{
"protocol": "http/https",
"port": 80,
"externalHost": "192.168.1.1",
"externalPort": 31443
}
],
"customPorts": [
{
"protocol": "http/https",
"port": 80,
"externalHost": "192.168.1.1",
"externalPort": 31443
}
]
}
}{
"status": 403,
"message": "Forbidden",
"data": {}
}{
"status": 500,
"message": "Internal Server Error",
"data": {}
}最后更新于
