All Products
Search
Document Center

Obtain the metadata of an elastic container instance

Last Updated: May 21, 2021

This topic describes the metadata items of elastic container instances and how to obtain the metadata of an elastic container instance.

Obtain the metadata of an elastic container instance

Metadata of an elastic container instance includes basic information such as the ID, IP address, region, and vSwitch ID. You can perform the following steps to obtain the metadata of an elastic container instance:

  1. Connect to a container. For more information, see Debug an elastic container instance.

  2. Run the following command to access the root directory of the metadata:

    curl http://100.100.100.200/latest/meta-data/
  3. Append the name of a specific metadata item to the command to obtain the corresponding information.

    For example, run the following command to obtain the ID of the elastic container instance:

    curl http://100.100.100.200/latest/meta-data/instance-id

Metadata items

The following table describes basic metadata items that can be obtained from an elastic container instance.

Metadata item

Description

/dns-conf/nameservers

The Domain Name System (DNS) configurations of the elastic container instance.

/eipv4

The elastic IP address (EIP) of the elastic container instance. The value is an IPv4 address.

/hostname

The hostname of the elastic container instance, which is the value of ContainerGroupName.

/instance-id

The ID of the elastic container instance.

/mac

The media access control (MAC) address of the elastic container instance.

/network/interfaces/

The MAC addresses of the network interface controllers (NICs).

/network/interfaces/macs/[mac]/network-interface-id

The ID of the NIC. Replace [mac] with the MAC address of the elastic container instance.

/network/interfaces/macs/[mac]/netmask

The subnet mask of the NIC.

/network/interfaces/macs/[mac]/vswitch-cidr-block

The IPv4 Classless Inter-Domain Routing (CIDR) block of the vSwitch to which the NIC is connected.

/network/interfaces/macs/[mac]/vpc-cidr-block

The IPv4 CIDR block of the VPC to which the NIC belongs.

/network/interfaces/macs/[mac]/private-ipv4s

The private IPv4 addresses assigned to the NIC.

/network/interfaces/macs/[mac]/vpc-ipv6-cidr-blocks

The IPv6 CIDR block of the VPC to which the NIC belongs. This item is applicable only to the elastic container instances that reside in VPCs and are assigned IPv6 addresses.

/network/interfaces/macs/[mac]/vswitch-id

The ID of the vSwitch that is in the same VPC as the security group of the NIC.

/network/interfaces/macs/[mac]/vpc-id

The ID of the VPC to which the security group of the NIC belongs.

/network/interfaces/macs/[mac]/primary-ip-address

The primary private IP address of the NIC.

/network/interfaces/macs/[mac]/gateway

The IPv4 gateway address of the VPC to which the NIC belongs.

/instance/max-netbw-egress

The maximum outbound internal bandwidth of the elastic container instance. Unit: Kbit/s.

/instance/max-netbw-ingerss

The maximum inbound internal bandwidth of the elastic container instance. Unit: Kbit/s.

/network/interfaces/macs/[mac]/ipv6s

The IPv6 addresses assigned to the NIC. This item is applicable only to the elastic container instances that reside in VPCs and are assigned IPv6 addresses.

/network/interfaces/macs/[mac]/ipv6-gateway

The IPv6 gateway address of the VPC to which the NIC belongs.

/network/interfaces/macs/[mac]/vswitch-ipv6-cidr-block

The IPv6 CIDR block of the vSwitch to which the NIC is connected. This item is applicable only to the elastic container instances that reside in VPCs and are assigned IPv6 addresses.

/private-ipv4

The private IPv4 address of the elastic container instance.

/ntp-conf/ntp-servers

The IP address of the Network Time Protocol (NTP) server.

/owner-account-id

The ID of the Alibaba Cloud account to which the elastic container instance belongs.

/region-id

The region ID of the elastic container instance.

/serial-number

The serial number of the elastic container instance.

/vpc-id

The ID of the VPC to which the elastic container instance belongs.

/vpc-cidr-block

The CIDR block of the VPC to which the elastic container instance belongs.

/vswitch-cidr-block

The CIDR block of the vSwitch to which the elastic container instance is connected.

/vswitch-id

The ID of the vSwitch to which the elastic container instance is connected.

/zone-id

The zone ID of the elastic container instance.

/ram/security-credentials/[role-name]

The temporary Security Token Service (STS) credentials generated for the Resource Access Management (RAM) role of the elastic container instance. You can obtain the STS credentials only after the elastic container instance assumes a RAM role. Replace [role-name] with the name of the RAM role. If the [role-name] parameter is not specified, the name of the RAM role is returned.