All Products
Search
Document Center

Elastic Compute Service:DescribeNetworkInterfaces

Last Updated:Jun 12, 2026

Mengkuerikan detail dari satu atau beberapa antarmuka jaringan elastis (ENI).

Deskripsi operasi

Deskripsi

Operasi DescribeNetworkInterfaces mendukung kueri berhalaman dengan menentukan parameter MaxResults atau NextToken. Catatan penggunaan:

  • Saat Anda mengkuerikan halaman pertama, Anda hanya perlu mengatur MaxResults untuk membatasi jumlah entri yang dikembalikan. Nilai NextToken dalam respons digunakan sebagai token untuk mengkuerikan halaman berikutnya.

  • Saat Anda mengkuerikan halaman berikutnya, atur parameter NextToken ke nilai NextToken yang diperoleh dari respons sebelumnya sebagai token kueri, dan atur MaxResults untuk membatasi jumlah entri yang dikembalikan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeNetworkInterfaces

get

NetworkInterface

acs:ecs:{#regionId}:{#accountId}:eni/{#eniId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

RegionId

string

Yes

ID region. Anda dapat memanggil operasi DescribeRegions untuk mengkuerikan daftar region Alibaba Cloud terbaru.

cn-hangzhou

Tag

array<object>

No

Daftar tag.

object

No

Key

string

No

Kunci tag dari ENI. Nilai N yang valid: 1 hingga 20.

TestKey

Value

string

No

Nilai tag dari ENI. Nilai N yang valid: 1 hingga 20.

Saat Anda menggunakan satu tag untuk memfilter sumber daya, jumlah sumber daya yang dikembalikan tidak boleh melebihi 1.000. Saat Anda menggunakan beberapa tag untuk memfilter sumber daya, jumlah sumber daya yang terikat ke semua tag yang ditentukan tidak boleh melebihi 1.000. Jika jumlah sumber daya melebihi 1.000, gunakan operasi ListTagResources untuk melakukan kueri.

TestValue

RegionId

string

Yes

ID region. Anda dapat memanggil operasi DescribeRegions untuk mengkuerikan daftar region Alibaba Cloud terbaru.

cn-hangzhou

ResourceGroupId

string

No

ID grup sumber daya. Saat Anda menggunakan parameter ini untuk memfilter sumber daya, jumlah sumber daya tidak boleh melebihi 1.000.

Catatan

Pemfilteran berdasarkan grup sumber daya default tidak didukung.

rg-bp67acfmxazb4p****

VSwitchId

string

No

ID dari vSwitch tempat ENI berada.

vsw-bp16usj2p27htro3****

VpcId

string

No

ID dari VPC tempat ENI berada.

vpc-bp1j7w3gc1cexjqd****

PrimaryIpAddress

string

No

Alamat IPv4 privat utama dari ENI.

192.168.**.**

SecurityGroupId

string

No

ID dari grup keamanan tempat ENI sekunder berada.

  • Jika Anda ingin mengkuerikan informasi tentang ENI sekunder berdasarkan ID grup keamanan, tentukan parameter ini.

  • Jika Anda ingin mengkuerikan informasi tentang ENI utama berdasarkan ID grup keamanan, panggil operasi DescribeInstances dan tentukan parameter SecurityGroupId.

sg-bp144yr32sx6ndw****

NetworkInterfaceName

string

No

Nama dari ENI. Panjang nama harus 2 hingga 128 karakter dan dapat berisi karakter yang termasuk dalam kategori letter Unicode (termasuk huruf Inggris, karakter Tionghoa, dan digit). Nama dapat berisi titik dua (:), garis bawah (_), titik (.), dan tanda hubung (-).

test-eni-name

Type

string

No

Tipe dari ENI. Nilai yang valid:

  • Primary: ENI utama.

  • Secondary: ENI sekunder.

Nilai default: null, yang menunjukkan bahwa ENI dari semua tipe akan dikuerikan.

Secondary

InstanceId

string

No

ID dari instance tempat ENI saat ini terlampir.

i-bp1e2l6djkndyuli****

ServiceManaged

boolean

No

Menunjukkan apakah pengguna ENI adalah layanan Alibaba Cloud atau penyedia layanan.

true

Status

string

No

Status dari ENI. Nilai yang valid:

  • Available: tersedia.

  • Attaching: sedang dilampirkan.

  • InUse: terlampir.

  • Detaching: sedang dilepas.

  • Deleting: sedang dihapus.

Nilai default: null, yang menunjukkan bahwa ENI dalam semua status akan dikuerikan.

Available

PageNumber deprecated

integer

No

Catatan

Parameter ini sudah usang. Kami menyarankan Anda menggunakan parameter MaxResults dan NextToken untuk melakukan kueri berhalaman.

1

PageSize deprecated

integer

No

Catatan

Parameter ini sudah usang. Kami menyarankan Anda menggunakan parameter MaxResults dan NextToken untuk melakukan kueri berhalaman.

100

NextToken

string

No

Token kueri. Atur nilainya ke nilai NextToken yang dikembalikan pada panggilan sebelumnya.

Untuk informasi tentang cara melihat data yang dikembalikan oleh operasi ini, lihat deskripsi operasi sebelumnya.

AAAAAdDWBF2****

MaxResults

integer

No

Jumlah maksimum entri per halaman saat Anda melakukan kueri berhalaman. Nilai yang valid: 10 hingga 500.

Nilai default:

  • Jika Anda tidak menetapkan parameter ini atau menetapkannya ke nilai yang lebih kecil dari 10, nilai defaultnya adalah 10.

  • Jika Anda menetapkan parameter ini ke nilai yang lebih besar dari 500, nilai defaultnya adalah 500.

50

PrivateIpAddress

array

No

Alamat IPv4 privat sekunder dari ENI. Nilai N yang valid: 1 hingga 100.

192.168.**.**

string

No

Alamat IPv4 privat sekunder dari ENI. Nilai N yang valid: 1 hingga 100.

192.168.**.**

NetworkInterfaceId

array

No

ID dari ENI. Nilai N yang valid: 1 hingga 100.

eni-bp125p95hhdhn3ot****

string

No

ID dari ENI. Nilai N yang valid: 1 hingga 100.

eni-bp125p95hhdhn3ot****

Ipv6Address

array

No

Alamat IPv6 dari ENI. N menunjukkan bahwa Anda dapat menentukan beberapa alamat IPv6. Nilai N yang valid: 1 hingga 100.

2408:4321:180:1701:94c7:bc38:3bfa:****

string

No

Alamat IPv6 dari ENI. N menunjukkan bahwa Anda dapat menentukan beberapa alamat IPv6. Nilai N yang valid: 1 hingga 100.

2408:4321:180:1701:94c7:bc38:3bfa:****

ResourceGroupId

string

No

ID grup sumber daya. Saat Anda menggunakan parameter ini untuk memfilter sumber daya, jumlah sumber daya tidak boleh melebihi 1.000.

Catatan

Pemfilteran berdasarkan grup sumber daya default tidak didukung.

rg-bp67acfmxazb4p****

Elemen respons

Element

Type

Description

Example

object

NextToken

string

Token kueri yang dikembalikan pada panggilan ini.

AAAAAdDWBF2****

PageSize

integer

Parameter kueri berhalaman.

Catatan

Parameter ini akan usang. Kami menyarankan Anda menggunakan NextToken dan MaxResults untuk melakukan kueri berhalaman.

1

PageNumber

integer

Parameter kueri berhalaman.

Catatan

Parameter ini akan usang. Kami menyarankan Anda menggunakan NextToken dan MaxResults untuk melakukan kueri berhalaman.

1

RequestId

string

ID permintaan.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

TotalCount

integer

Jumlah total ENI yang dikembalikan.

Catatan

Saat Anda menggunakan MaxResults dan NextToken untuk melakukan kueri berhalaman, nilai TotalCount yang dikembalikan tidak bermakna.

2

NetworkInterfaceSets

object

NetworkInterfaceSet

array<object>

Himpunan informasi ENI.

array<object>

CreationTime

string

The time when the security group was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2019-12-25T12:31:31Z

VpcId

string

The ID of the VPC to which the ENI belongs.

vpc-bp1j7w3gc1cexjqd****

Type

string

The type of the ENI.

Secondary

Status

string

The state of the ENI.

Available

NetworkInterfaceTrafficMode

string

The communication mode of the ENI. Valid values:

  • Standard: The TCP communication mode is used.

  • HighPerformance: The Elastic RDMA Interface (ERI) is enabled and the remote direct memory access (RDMA) communication mode is used.

Catatan

This parameter can have a value of HighPerformance only when the ENI is attached to a c7re RDMA-enhanced instance that resides in Beijing Zone K.

Standard

NetworkInterfaceName

string

The name of the ENI.

my-eni-name

MacAddress

string

The MAC address of the ENI.

00:16:3e:12:**:**

QueuePairNumber

integer

Catatan

This parameter is in invitational preview and is not publicly available.

0

NetworkInterfaceId

string

The ID of the ENI.

eni-bp125p95hhdhn3ot****

ServiceID

integer

The ID of the distributor to which the ENI belongs.

12345678910

InstanceId

string

The ID of the Elastic Compute Service (ECS) instance to which the ENI is attached.

Catatan

If the ENI is managed by other Alibaba Cloud services, no instance ID is returned.

i-bp1e2l6djkndyuli****

OwnerId

string

The ID of the account to which the ENI belongs.

123456****

ServiceManaged

boolean

Indicates whether the user of the ENI is an Alibaba Cloud service or a distributor.

true

VSwitchId

string

The ID of the vSwitch.

vsw-bp16usj2p27htro3****

Description

string

The description of the ENI.

DescriptionTest

ResourceGroupId

string

The ID of the resource group to which the ENI belongs.

rg-2ze88m67qx5z****

ZoneId

string

The zone ID of the ENI.

cn-hangzhou-e

PrivateIpAddress

string

The primary private IP address of the ENI.

172.17.**.**

QueueNumber

integer

The number of queues supported by the ENI.

  • If the ENI is a secondary ENI in the InUse state and the number of queues supported by the ENI has never been modified, the default number of queues per secondary ENI that the instance type supports is returned.

  • If the ENI is a secondary ENI and the number of queues supported by the ENI has been modified, the new number of queues is returned.

  • If the ENI is a secondary ENI in the Available state and the number of queues supported by the ENI has never been modified, an empty value is returned.

  • If the ENI is a primary ENI, the default number of queues per primary ENI that the instance type supports is returned.

8

PrivateIpSets

object

PrivateIpSet

array<object>

Details about the private IP addresses of the ENI.

array<object>

PrivateIpAddress

string

The private IP address of the ENI.

172.17.**.**

Primary

boolean

Indicates whether the private IP address is the primary private IP address. Valid values:

  • true: The IP address is the primary private IP address.

  • false: The IP address is a secondary private IP address.

true

AssociatedPublicIp

object

The elastic IP address (EIP) that is associated with the private IP address.

PublicIpAddress

string

The EIP.

116.62.**.**

AllocationId

string

Catatan

This parameter is in invitational preview and is not publicly available.

null

PrivateDnsName

string

The private domain name of the ECS instance.

Catatan

A private domain name can be returned in a specific format only when HostnameType is set to IP or InstanceId.

DnsTestName

Ipv6Sets

object

Ipv6Set

array<object>

The IPv6 addresses of the ENI.

object

Catatan

This parameter is in invitational preview and is unavailable.

Ipv6Address

string

The IPv6 address of the ENI.

2408:4321:180:1701:94c7:bc38:3bfa:****

Ipv4PrefixSets

object

Ipv4PrefixSet

array<object>

The IPv4 prefixes of the ENI.

object

Catatan

This parameter is in invitational preview and is unavailable.

Ipv4Prefix

string

The IPv4 prefix of the ENI.

192.168.**.0/28

Ipv6PrefixSets

object

Ipv6PrefixSet

array<object>

The IPv6 prefixes of the ENI.

object

Catatan

This parameter is in invitational preview and is unavailable.

Ipv6Prefix

string

The IPv6 prefix of the ENI.

2001:db8:1234:1a00:****::/80

Tags

object

Tag

array<object>

The tags of the ENI.

object

TagValue

string

The tag value.

TestValue

TagKey

string

The tag key.

TestKey

SecurityGroupIds

object

SecurityGroupId

array

The security groups to which the ENI belongs.

string

The ID of the security group.

sg-bp18kz60mefsicfg****

AssociatedPublicIp

object

The EIPs that are associated with the secondary private IP addresses of the ENI.

PublicIpAddress

string

The EIP.

116.62.**.**

AllocationId

string

Catatan

This parameter is in invitational preview and is not publicly available.

null

Attachment

object

Catatan

This parameter is in invitational preview and is not publicly available.

DeviceIndex

integer

Catatan

This parameter is in invitational preview and is not publicly available.

0

InstanceId

string

Catatan

This parameter is in invitational preview and is not publicly available.

null

TrunkNetworkInterfaceId

string

Catatan

This parameter is in invitational preview and is not publicly available.

null

NetworkCardIndex

integer

The index of the network card.

  • If the ENI is in the Available state or if no network card index was specified when the ENI was attached, this parameter is empty.

  • If the ENI is in the InUse state and a network card index was specified when the ENI was attached, the specified network card index is returned as the value of this parameter.

0

DeleteOnRelease

boolean

Indicates whether to retain the ENI when the associated instance is released. Valid values:

  • true

  • false

true

SourceDestCheck

boolean

Indicates whether the source and destination IP address check feature is enabled. To improve network security, enable this feature. Valid values:

  • true

  • false

Default value: false.

Catatan

Before you use this parameter, read Source and destination IP address check.

false

Contoh

Respons sukses

JSONformat

{
  "NextToken": "AAAAAdDWBF2****",
  "PageSize": 1,
  "PageNumber": 1,
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "TotalCount": 2,
  "NetworkInterfaceSets": {
    "NetworkInterfaceSet": [
      {
        "CreationTime": "2019-12-25T12:31:31Z",
        "VpcId": "vpc-bp1j7w3gc1cexjqd****",
        "Type": "Secondary",
        "Status": "Available",
        "NetworkInterfaceTrafficMode": "Standard",
        "NetworkInterfaceName": "my-eni-name",
        "MacAddress": "00:16:3e:12:**:**",
        "QueuePairNumber": 0,
        "NetworkInterfaceId": "eni-bp125p95hhdhn3ot****",
        "ServiceID": 12345678910,
        "InstanceId": "i-bp1e2l6djkndyuli****",
        "OwnerId": "123456****",
        "ServiceManaged": true,
        "VSwitchId": "vsw-bp16usj2p27htro3****",
        "Description": "DescriptionTest",
        "ResourceGroupId": "rg-2ze88m67qx5z****",
        "ZoneId": "cn-hangzhou-e",
        "PrivateIpAddress": "172.17.**.**",
        "QueueNumber": 8,
        "PrivateIpSets": {
          "PrivateIpSet": [
            {
              "PrivateIpAddress": "172.17.**.**",
              "Primary": true,
              "AssociatedPublicIp": {
                "PublicIpAddress": "116.62.**.**",
                "AllocationId": "null"
              },
              "PrivateDnsName": "DnsTestName"
            }
          ]
        },
        "Ipv6Sets": {
          "Ipv6Set": [
            {
              "Ipv6Address": "2408:4321:180:1701:94c7:bc38:3bfa:****"
            }
          ]
        },
        "Ipv4PrefixSets": {
          "Ipv4PrefixSet": [
            {
              "Ipv4Prefix": "192.168.**.0/28"
            }
          ]
        },
        "Ipv6PrefixSets": {
          "Ipv6PrefixSet": [
            {
              "Ipv6Prefix": "2001:db8:1234:1a00:****::/80"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "TagValue": "TestValue",
              "TagKey": "TestKey"
            }
          ]
        },
        "SecurityGroupIds": {
          "SecurityGroupId": [
            "sg-bp18kz60mefsicfg****"
          ]
        },
        "AssociatedPublicIp": {
          "PublicIpAddress": "116.62.**.**",
          "AllocationId": "null"
        },
        "Attachment": {
          "DeviceIndex": 0,
          "InstanceId": "null",
          "TrunkNetworkInterfaceId": "null",
          "NetworkCardIndex": 0
        },
        "DeleteOnRelease": true,
        "SourceDestCheck": false
      }
    ]
  }
}

Respons error

JSONformat

{
    "NetworkInterfaceSets": {
        "NetworkInterfaceSet": [
            {
                "AssociatedPublicIp": {
                },
                "CreationTime": "2017-11-24T06:14:22Z",
                "InstanceId": "AY121018033933eaxxxxx",
                "MacAddress": "00:16:3e:0f:XX:XX",
                "NetworkInterfaceId": "eni-bp17pdijfczaxZZZZxxxxx",
                "PrivateIpAddress": "XXX.XXX.XX.XX",
                "PrivateIpSets": {
                    "PrivateIpSet": [
                        {
                            "AssociatedPublicIp": {
                            },
                            "Primary": true,
                            "PrivateIpAddress": "XXX.XXX.XX.XX"
                        }
                    ]
                },
                "SecurityGroupIds": {
                    "SecurityGroupId": [
                        "sg-bp144yr32sx6ndwxxxxx"
                    ]
                },
                "Status": "Available",
                "Type": "Secondary",
                "VpcId": "vpc-bp1j7w3gc1cexjqdxxxxx",
                "VSwitchId": "vsw-bp16usj2p27htro3xxxxx",
                "ZoneId": "cn-hangzhou-e"
            }
        ]
    },
    "PageNumber": 1,
    "PageSize": 100,
    "RequestId": "CEE5C347-0B64-4535-A061-95BE95Axxxxx",
    "TotalCount": 1
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 MissingParameter %s
400 UnsupportedParameter %s
400 InvalidParameter %s
400 InvalidInstanceID.Malformed %s
400 InvalidOperation.InvalidEcsState %s
400 InvalidOperation.InvalidEniState %s
400 InvalidOperation.DetachPrimaryEniNotAllowed %s
400 Forbidden.RegionId %s
400 InvalidRegionId.MalFormed The specified parameter RegionId is not valid.
403 InvalidUserType.NotSupported %s
403 Abs.InvalidAccount.NotFound %s
403 Forbidden.NotSupportRAM %s
403 Forbidden.SubUser %s
403 InvalidParameter %s
403 MaxEniCountExceeded %s
403 EniPerInstanceLimitExceeded %s
403 InvalidOperation.AvailabilityZoneMismatch %s
403 InvalidOperation.VpcMismatch %s
403 SecurityGroupInstanceLimitExceed %s
403 InvalidSecurityGroupId.NotVpc %s
403 InvalidOperation.InvalidEniType %s
403 InvalidVpc.Empty %s
403 Forbidden.RegionId %s
403 InvalidOperation.InvalidEniPageNumber %s
403 InvalidVpc.Indeterminacy %s
404 InvalidEcsId.NotFound %s
404 InvalidEniId.NotFound %s
404 InvalidVSwitchId.NotFound %s
404 InvalidSecurityGroupId.NotFound %s

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.