Querying the Open Port List of a Single Server
Function
This API is used to query the open port list of a single server.
Calling Method
For details, see Calling APIs.
URI
GET /v5/{project_id}/asset/ports
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
User ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
host_id |
Yes |
String |
Server ID |
host_name |
No |
String |
Server name |
host_ip |
No |
String |
Server IP address |
port |
No |
Integer |
Port number |
type |
No |
String |
Port type |
enterprise_project_id |
No |
String |
Enterprise project |
limit |
No |
Integer |
Default value: 10 |
offset |
No |
Integer |
Default value: 0 |
category |
No |
String |
Type. The default value is host. The options are as follows:
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
x-auth-token |
Yes |
String |
iam token |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_num |
Integer |
Total number |
data_list |
Array of PortResponseInfo objects |
Port information list |
Example Requests
The first 10 open ports whose host_id is dd91cd32-a238-4c0e-bc01-3b11653714ac are queried by default.
GET https://{endpoint}/v5/{project_id}/asset/ports?hlimit=10&offset=0&host_id=dd91cd32-a238-4c0e-bc01-3b11653714ac
Example Responses
Status code: 200
Port information list
{ "data_list" : [ { "agent_id" : "eb5d03f02fffd85aaf5d0ba5c992d97713244f420e0b076dcf6ae0574c78aa4b", "container_id" : "", "host_id" : "dd91cd32-a238-4c0e-bc01-3b11653714ac", "laddr" : "0.0.0.0", "path" : "/usr/sbin/dhclient", "pid" : 1507, "port" : 68, "status" : "unknow", "type" : "UDP" }, { "agent_id" : "eb5d03f02fffd85aaf5d0ba5c992d97713244f420e0b076dcf6ae0574c78aa4b", "container_id" : "", "host_id" : "dd91cd32-a238-4c0e-bc01-3b11653714ac", "laddr" : "127.0.0.1", "path" : "/usr/sbin/chronyd", "pid" : 493, "port" : 323, "status" : "unknow", "type" : "UDP" } ], "total_num" : 2 }
Status Codes
Status Code |
Description |
---|---|
200 |
Port information list |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot