All Products
Search
Document Center

DescribeContainerGroups

Last Updated: Oct 25, 2018

You can call this operation to obtain information about the specified container groups.

Request parameters

Name Type Required Description
Action String Yes The operation that you want to perform. Set the value to DescribeContainerGroups.
RegionId String Yes The ID of the region in which the instance resides.
ZoneId String No The ID of the zone in which the instance resides. If you leave the parameter blank, the system assigns a zone for you. The default value is blank.
VSwitchId String No The ID of the specified VSwitch. Currently, ECI instances can only be deployed in VPCs.
ContainerGroupIds String No The IDs of the container groups. Maximum: 20. The strings must be in the JSON format.
ContainerGroupName String No The name of the container group.
Status String No The status list.
Tags Tag[] No The tag of the container. Maximum: 10.
NextToken String No The token required to get the next set of results. You do not need to specify the parameter value in the first call. If a NextToken is returned by a previous call, there are more results available.
Limit Integer No The limit on the returned resources of the current request. If you leave the parameter value blank, the default value is 20. Maximum: 20. The returned results are no more than the specified number.

Response parameters

Name Type Description
ContainerGroups ContainerGroup[] The container group.
TotalCount Integer The total number of container groups.
NextToken String The token required to get the next set of results.

Examples

Sample requests

  1. http://eci.aliyuncs.com/&Action=DescribeContainerGroups
  2. &RegionId=cn-shanghai
  3. &<Common request parameters>

Sample responses

JSON format
  1. {
  2. "NextToken":"",
  3. "TotalCount":6,
  4. "ContainerGroups":[
  5. {
  6. "Containers":[
  7. {
  8. "Name":"u1",
  9. "ImagePullPolicy":"IfNotPresent",
  10. "VolumeMounts":[
  11. ],
  12. "Cpu":1.0,
  13. "Memory":2.0,
  14. "PreviousState":{
  15. "DetailStatus":"",
  16. "State":"",
  17. "FinishTime":"",
  18. "StartTime":""
  19. },
  20. "Image":"ubuntu",
  21. "EnvironmentVars":[
  22. ],
  23. "WorkingDir":"",
  24. "CurrentState":{
  25. "DetailStatus":"",
  26. "State":"",
  27. "FinishTime":"",
  28. "StartTime":""
  29. },
  30. "Ports":[
  31. ]
  32. }
  33. ],
  34. "SecurityGroupId":"sg-uf66jeqopgqa9hdn2atd",
  35. "RestartPolicy":"Always",
  36. "Events":[
  37. ],
  38. "InternetIp":"",
  39. "ZoneId":"cn-shanghai-b",
  40. "ContainerGroupName":"1oo",
  41. "VSwitchId":"vsw-uf6h3rbwbm90urjwavskd",
  42. "CreationTime":"2018-09-10T05:05Z",
  43. "Tags":[
  44. ],
  45. "ContainerGroupId":"eci-uf6fonnghi50u374a0i4",
  46. "Status":"Scheduling",
  47. "SucceededTime":"",
  48. "Memory":2.0,
  49. "Cpu":1.0,
  50. "RegionId":"cn-shanghai",
  51. "IntranetIp":"172.16.2.82",
  52. "Volumes":[
  53. ]
  54. }
  55. ]
  56. }

Definitions

Name Description
ContainerGroup The container group.
Container The container.
ContainerState The status of the container.
Event The event of the container group.
ImageRegistryCredential The information for logging on to the container image registry.
Volume The data volume.
VolumeMount The volume mount point.
Tag The tag of the container.

ContainerGroup

Name Type Required Description
RegionId String Yes The ID of the region in which the instance resides.
ZoneId String No The ID of the zone in which the instance resides. If you leave the parameter blank, the system assigns a zone for you. The default value is blank.
SecurityGroupId String Yes The ID of the security group to which the instance belongs. Instances in the same security group can access one another.
VSwitchId String Yes The ID of the VSwitch. Currently, ECI instances can only be deployed in VPCs.
ContainerGroupName String Yes The name of the container group.
ContainerGroupID String No The ID of the container group.
ImageRegistryCredentials ImageRegistryCredential[] No The information for logging on to the container image registry. You can set a maximum 10 sets of logon information for each account.
Volumes Volume[] No The data volume. You can configure a maximum of 20 data volumes.
RestartPolicy String No The policy for restarting the container. Valid values: Always, OnFailure, and Never.
Containers Container[] Yes The list of containers. You can configure a maximum of five containers in a container group.
Events Event[] No The event details.
IntranetIP String No The internal network IP address.
Tags Tag[] No The instance tag in the format of a key/value pair. You can define a maximum of 20 tags for each instance.
Status String No The creation status of the container. Valid values: Pending, Running, Succeeded, Failed, Scheduling, and ScheduleFailed.
CreationTime String No The time at which the system receives the request for creating the container group. The time stamp must be in UTC and follow the RFC 3339 format. For example, 2018-08-02T15:00:00Z.
SucceededTime String No The time at which all containers in the same container group exit after executing specified tasks. The time stamp must be in UTC and follow the RFC 3339 format. For example, 2018-08-02T15:00:00Z.

Container

Name Type Required Description
Commands String[] No The commands run by the container. You can define a maximum of 20 commands. Minimum length per string: 256 characters.
Args String[] No The arguments passed to the commands. Maximum: 10.
EnvironmentVars EnvironmentVar[] No The environment variables in the operating system in which you operate the container. The environment variables are key/value pairs, and both the key and the value are strings. Maximum: 100. Key indicates the name of the environment variable. Value indicates the value of the environment variable.
Image String Yes The container image.
Name String Yes The name of the container.
Cpu Float Yes The central processing unit (CPU) assigned to the container.
Memory Float Yes The memory assigned to the container. Unit: GiB.
VolumeMounts VolumeMount[] No The number of data volumes that are mounted onto the container. Maximum: 16.
CurrentState ContainerState No The current status of the container.
PreviousState ContainerState No The previous status of the container.
RestartCount Integer No The number of restarts.
WorkingDir String No The working directory for the container.
Ports ContainerPort[] No The container ports or protocols to be exposed. You can expose a maximum of 100 container ports (protocols).

ContainerState

The following parameters are response parameters only.

Name Type Description
StartTime Timestamp The time at which the container starts running.
State String The status of the container. Valid values: Waiting, Running, and Terminated.
DetailStatus String The details for the container status.
FinishTime Timestamp The time at which the container stops running.
ExitCode Integer The exit code for the container.

Event

The following parameters are response parameters only.

Name Type Description
Count Integer The number of occurrences of the event.
FirstTimestamp String The time at which the event starts.
LastTimestamp String The time at which the event finishes.
Message String The event message.
Name String The name of the event.
Type String The type of the event. Valid values: Normal and Warning.

ImageRegistryCredential

Name Type Required Description
Server String Yes The URL for the image registry without http:// or https:// prefix.
UserName String Yes The username for the image registry.
Password String Yes The password for the image registry.

Volume

Name Type Required Description
Type String Yes The type of the data volume. Valid values: EmptyDirVolume, NFSVolume, and ConfigFileVolume.
Name String Yes The name of the data volume.
NFSVolume.Server String No The address for the NFS server.
NFSVolume.Path String No The path to the NFS volume.
NFSVolume.ReadOnly Boolean No Default value: False.
ConfigFileVolume.ConfigFileToPath ConfigFileToPath[] No The path to the configuration file.
EmptyDirVolume.Enable Boolean No Default value: False.

ConfigFileToPath

Name Type Required Description
Path String Yes The relative file path.
Content String No The content of the configuration file. Maximum size: 32 KB.

VolumeMount

Name Type Required Description
Name String Yes The name of the data volume.
MountPath String Yes Mount point
The volume mount point. Boolean Yes Default value: False.

Tag

Name Type Required Description
Key String Yes The keyword of the tag.
Value String No The value of the tag.

Error codes

Error codes specific to this API operation are as follows. For more information about the error codes that are common to all ECI API operations, see Common error codes.

Error code Error message HTTP status code Description
400 InvalidParameter The specified parameter {ParameterName} is not valid. The error message returned when the parameter value is invalid.
400 MissingParameter The input parameter {ParameterName} that is mandatory for processing this request is not supplied. The error message returned when a required parameter is not specified.
400 InvalidParameter.LengthExceeded The length of {ParameterName} exceeded, limit: {Value}. The error message returned when the length of the list parameter value exceeds the upper limit.