Queries information about multiple elastic container instances at a time.
Operation description
-
After an elastic container instance is terminated, its underlying computing resources are recycled. By default, other resources, such as elastic IP addresses (EIPs), that are created together with the instance are released together with the instance.
-
The metadata of an instance in the final status (Failed, Succeeded, or Expired) is retained based on the following rules:
- All metadata information is retained within 1 hour since the instance enters the final status.
- One hour after the instance enters the final status, only the latest 100 entries of metadata information in each region are retained.
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 |
---|---|---|---|---|
eci:DescribeContainerGroups | get | *ContainerGroup acs:eci:{#regionId}:{#accountId}:containergroup/* *ContainerGroup acs:eci:{#regionId}:{#accountId}:containergroup/{#containergroupId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the instance. | cn-hangzhou |
ZoneId | string | No | The ID of the zone in which the elastic container instances are deployed. If you do not specify this parameter, the system selects a zone. This parameter is empty by default. | cn-hangzhou-h |
VSwitchId | string | No | The ID of the vSwitch to which the elastic container instances are connected. | vsw-bp1jrgfqqy54kg5hc**** |
NextToken | string | No | The token that determines the start point of the query. If this parameter is left empty, all results have been returned. Note
You do not need to specify this parameter in the first request. Starting from the second request, you can obtain the token from the result returned by the previous request.
| d78f2dd8-5979-42fe-****-b16db43be5bc |
Limit | integer | No | The maximum number of resources to return. Default value: 20. Maximum value: 20. Note
The number of returned resources is less than or equal to the specified number.
| 20 |
ContainerGroupIds | string | No | The IDs of the elastic container instances in JSON format. You can specify up to 20 IDs. | ["eci-bp17gw49eu09yiwm****", "eci-bp19aq49du01abcm****", "eci-2zegym1qhbmdfr1s****"] |
ContainerGroupName | string | No | The name of the elastic container instance. | test |
Status | string | No | The status of the elastic container instance. Valid values:
| Running |
ResourceGroupId | string | No | The ID of the resource group to which the instance belongs. | rg-aekzh43v***** |
WithEvent | boolean | No | Specify whether to return event information. | true |
Tag | array<object> | No | The tag of the instances. | |
object | No | The tag of the instances. | ||
Key | string | No | The tag key of the instances. | name |
Value | string | No | The tag value of the instances. | test |
ComputeCategory | string | No | The compute category of the instance. Valid values:
| economy |
SecurityGroupId | string | No | The ID of the security group to which the instance belongs. | sg-uf66jeqopgqa9hdn**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"TotalCount": 1,
"NextToken": "d78f2dd8-5979-42fe-****-b16db43be5bc",
"RequestId": "89945DD3-9072-47D0-A318-353284CFC7B3",
"ContainerGroups": [
{
"Status": "Running",
"CreationTime": "2018-08-02T15:00:00Z",
"VpcId": "vpc-1vzjjflab6wvjox****",
"InternetIp": "192.0.XX.XX",
"TenantSecurityGroupId": "sg-xxx",
"SecurityGroupId": "sg-bp12ujq5zpxuyjfo3o8r",
"HostAliases": [
{
"Hostnames": [
"['hehe.com', 'haha.com']"
],
"Ip": "192.0.XX.XX"
}
],
"Tags": [
{
"Key": "name",
"Value": "test-xh"
}
],
"Events": [
{
"Type": "Normal",
"LastTimestamp": "2018-08-02T15:00:00Z",
"Message": "Started container",
"Name": "test-xxx",
"Reason": "Created",
"Count": 20,
"FirstTimestamp": "2018-08-02T15:00:00Z"
}
],
"SucceededTime": "2019-12-11T04:33:42Z",
"SpotStrategy": "NoSpot",
"SpotPriceLimit": 0.025,
"EphemeralStorage": 20,
"TenantEniInstanceId": "i-xxx",
"Discount": 9,
"RestartPolicy": "Never",
"Memory": 4,
"TenantVSwitchId": "vsw-xxx",
"Containers": [
{
"LivenessProbe": {
"SuccessThreshold": 1,
"InitialDelaySeconds": 10,
"FailureThreshold": 3,
"TimeoutSeconds": 10,
"TcpSocket": {
"Host": "1.2.3.4",
"Port": 80
},
"Execs": [
"[\"/bin/sh\", \"-c\", \"echo Hello world > /usr/share/message\"]"
],
"HttpGet": {
"Scheme": "HTTP",
"Path": "/usr/nginx/",
"Port": 80
},
"PeriodSeconds": 5
},
"Commands": [
"[/bin/sh echo]"
],
"VolumeMounts": [
{
"MountPropagation": "None",
"MountPath": "/usr/share/",
"ReadOnly": false,
"Name": "test-empty",
"SubPath": "/usr/sub"
}
],
"Args": [
"[\"hello\"]"
],
"Image": "mysql",
"Ports": [
{
"Protocol": "TCP",
"Port": 8080
}
],
"RestartCount": 0,
"ImagePullPolicy": "Always",
"StdinOnce": true,
"Cpu": 2,
"PreviousState": {
"StartTime": "2018-08-02T15:00:00Z\t",
"FinishTime": "2018-08-02T15:00:00Z\t",
"DetailStatus": "working",
"State": "Terminated",
"Message": "Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)",
"Signal": 1,
"ExitCode": 0,
"Reason": "Completed"
},
"Tty": false,
"WorkingDir": "/usr/local/nginx",
"CurrentState": {
"StartTime": "2019-12-19T12:05:02Z",
"FinishTime": "2018-08-02T15:00:00Z\t",
"DetailStatus": "working",
"State": "Terminated",
"Message": "Back-off 5m0s restarting failed container=test pod=test_eci-xxx(xxx)",
"Signal": 1,
"ExitCode": 0,
"Reason": "Started"
},
"Ready": true,
"Gpu": 1,
"SecurityContext": {
"ReadOnlyRootFilesystem": true,
"RunAsUser": 1000,
"Capability": {
"Adds": [
"[NET_ADMIN]"
]
}
},
"Memory": 2,
"Stdin": true,
"Name": "nginx",
"EnvironmentVars": [
{
"Key": "PATH",
"Value": "/usr/bin/",
"ValueFrom": {
"FieldRef": {
"FieldPath": "status.podIP"
}
}
}
],
"ReadinessProbe": {
"SuccessThreshold": 1,
"InitialDelaySeconds": 5,
"FailureThreshold": 3,
"TimeoutSeconds": 1,
"TcpSocket": {
"Host": "1.2.3.4",
"Port": 8888
},
"Execs": [
"[\"/bin/sh\", \"-c\", \"echo Hello world > /usr/share/message\"]"
],
"HttpGet": {
"Scheme": "HTTP",
"Path": "/usr/local",
"Port": 8080
},
"PeriodSeconds": 1
}
}
],
"EniInstanceId": "eni-bp14rzqi6fd8satm****",
"InitContainers": [
{
"VolumeMounts": [
{
"MountPropagation": "None",
"MountPath": "/usr/share/",
"ReadOnly": false,
"Name": "test-empty"
}
],
"Args": [
"['hello world']"
],
"Image": "nginx",
"Ports": [
{
"Protocol": "TCP",
"Port": 8888
}
],
"RestartCount": 5,
"ImagePullPolicy": "Always",
"PreviousState": {
"StartTime": "2019-12-24T05:35:44Z",
"FinishTime": "2019-12-24T05:35:44Z",
"DetailStatus": "working",
"State": "Terminated",
"Message": "Started container",
"Signal": 1,
"ExitCode": 0,
"Reason": "completed"
},
"WorkingDir": "/usr/test",
"Cpu": 1,
"CurrentState": {
"StartTime": "2018-08-02T15:00:00Z\t",
"FinishTime": "2018-08-02T15:00:00Z\t",
"DetailStatus": "working",
"State": "Running",
"Message": "Created container",
"Signal": 1,
"ExitCode": 0,
"Reason": "Started"
},
"Command": [
"[/bin/sh echo]"
],
"Ready": true,
"Gpu": 1,
"SecurityContext": {
"ReadOnlyRootFilesystem": true,
"RunAsUser": 1557,
"Capability": {
"Adds": [
"NET_ADMIN"
]
}
},
"Memory": 2,
"Name": "Init-xxx",
"EnvironmentVars": [
{
"Key": "PATH",
"Value": "/usr/local/bin",
"ValueFrom": {
"FieldRef": {
"FieldPath": "status.podIP"
}
}
}
]
}
],
"ContainerGroupId": "eci-bp1jrgfqqy54kg5hc****",
"TenantEniIp": "10.10.XX.XX",
"InstanceType": "ecs.g5.large",
"IntranetIp": "172.16.XX.XX",
"Ipv6Address": "2001:XXXX:4:4:4:4:4:4",
"RegionId": "cn-hangzhou",
"DnsConfig": {
"Searches": [
"svc.local.kubenetes"
],
"Options": [
{
"Value": "value",
"Name": "name"
}
],
"NameServers": [
"[10.2.*.*]"
]
},
"Volumes": [
{
"Type": "EmptyDirVolume",
"DiskVolumeDiskId": "d-xxxx",
"NFSVolumeReadOnly": false,
"ConfigFileVolumeConfigFileToPaths": [
{
"Path": "/usr/bin/",
"Content": "hello world"
}
],
"FlexVolumeFsType": "ntfs",
"FlexVolumeDriver": "flexvolume",
"DiskVolumeFsType": "xfs",
"FlexVolumeOptions": "[nolock,tcp,noresvport]",
"NFSVolumeServer": "0eafxxxxx-xxxxx.cn-hangzhou.nas.aliyuncs.com",
"NFSVolumePath": "/eci",
"Name": "test-empty",
"EmptyDirVolumeMedium": "Memory",
"EmptyDirVolumeSizeLimit": "256Mi"
}
],
"RamRoleName": "ram:PassRole",
"VSwitchId": "vsw-bp1vzjjflab6wvjox****",
"Cpu": 2,
"ExpiredTime": "2018-08-02T15:00:00Z",
"ResourceGroupId": "rg-8db03793gfrz****",
"ZoneId": "cn-hangzhou-h",
"ContainerGroupName": "test",
"EciSecurityContext": {
"Sysctls": [
{
"Value": "65536",
"Name": "kernel.msgmax"
}
]
},
"FailedTime": "2018-08-02T15:00:00Z",
"ComputeCategory": "economy",
"DnsPolicy": ""
}
]
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParameter.MismatchInstanceType | The instanceId mismatch instance type. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-09-26 | The Error code has changed. The response structure of the API has changed | View Change Details |
2024-09-04 | The Error code has changed | View Change Details |
2023-12-27 | The request parameters of the API has changed | View Change Details |
2023-12-25 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2023-04-17 | The response structure of the API has changed | View Change Details |
2023-04-04 | The response structure of the API has changed | View Change Details |