Queries Elastic Network Interfaces (ENIs).
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ens:DescribeNetworkInterfaces | list |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
NetworkInterfaceId | string | No | The ID of the ENI. | eni-58z57orgmt6d1**** |
InstanceId | string | No | The ID of the instance. | i-5t7z99n32gplriv |
NetworkId | string | No | The ID of the network. | n-2zeuphj08tt7q3brd**** |
VSwitchId | string | No | The ID of the vSwitch. | vsw-12345 |
EnsRegionId | string | No | The region ID of the instance. | cn-tianjin-cmcc |
SecurityGroupId | string | No | The ID of the security group to which the secondary ENI belongs. To query the details of secondary ENIs based on the ID of a security group, specify this parameter. | sg-5p1fg655nh68xyz9i*** |
PrimaryIpAddress | string | No | The primary IP address of the ENI. | *** |
Type | string | No | The type of the ENI. Valid Values:
This parameter is empty by default, which indicates that both primary and secondary ENIs are queried. | Secondary |
NetworkInterfaceName | string | No | The name of the ENI. | test-01 |
Status | string | No | The status of the ENI. Valid values:
This parameter is empty by default, which indicates that ENIs in all states are queried. | Available |
PageNumber | string | No | The page number of the returned page. Pages start from page 1. Default value: 1. | 1 |
PageSize | string | No | The number of entries to return on each page. Maximum value: 100. Default value: 50. | 50 |
Response parameters
Examples
Sample success responses
JSON
format
{
"NetworkInterfaceSets": {
"NetworkInterfaceSet": [
{
"CreationTime": "2022-02-22T03:53:25Z",
"EnsRegionId": "id-jakarta-1",
"InstanceId": "i-5siavnr3",
"MacAddress": "00:16:3e:08:60:0a",
"NetworkInterfaceId": "eni-uf686a5",
"PrimaryIp": "12.23.3.4",
"PrimaryIpType": "private",
"Status": "In_use",
"NetworkId": "n-5w0qd03adw****",
"VSwitchId": "vsw-5rqswx1trlsj9",
"PrivateIpSets": {
"PrivateIpSet": [
{
"PrivateIpAddress": "192.168.0.130",
"Primary": true
}
]
},
"NetworkInterfaceName": "primaryTest",
"Description": "test-description",
"SecurityGroupIds": {
"SecurityGroup": [
"sg-5p1bozeiw711a1***"
]
},
"Type": "Primary",
"Ipv6Sets": {
"Ipv6Set": [
{
"Ipv6Address": ""
}
]
}
}
]
},
"PageNumber": 1,
"PageSize": 50,
"TotalCount": 49,
"RequestId": "708AF9CE-FF92-5DF9-93F8-B7754AB1061A"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | Missing%s | You must specify the parameter %s. |
400 | Invalid%s | The specified parameter %s is invalid. |
400 | ens.interface.error | Failed to call API. |
400 | NoPermission | Permission denied. |
400 | InvalidParameter.%s | The specified field %s invalid. Please check it again. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-09-12 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2023-10-19 | The Error code has changed | View Change Details |
2023-09-21 | The API operation is not deprecated.. The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |