Queries event information about multiple container groups at a time.

Description

You can call this operation to query the event information of multiple container groups at a time. By default, the latest 50 entries of events of each container group are returned.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeContainerGroupEvents

The operation that you want to perform. Set the value to DescribeContainerGroupEvents.

RegionId String Yes cn-hangzhou

The region ID of the container groups.

ZoneId String No cn-hangzhou-k

The zone ID of the container groups.

VSwitchId String No vsw-uf6h3rbwbm90urjwa****

The ID of the vSwitch.

ResourceGroupId String No rg-uf66jeqopgqa9hdn****

The ID of the resource group.

ContainerGroupIds String No ["eci-bp17gw49eu09yiwm****", "eci-bp19aq49du01abcm****", "eci-2zegym1qhbmdfr1s****"]

The IDs of the container groups. You can specify up to 20 IDs. Each ID must be a string in JSON format.

NextToken String No d78f2dd8-5979-42fe-xaee-b16db43be5bc

The token that is used for the next query. If this parameter is empty, all results have been returned.

You do not need to specify this parameter in the first request. You can obtain the token from the result returned by the previous request.

EventSource String No K8sAgent

The component reporting this event. Valid values:

  • EciService
  • K8sAgent

This parameter is empty by default, which indicates that events reported by all types of components are queried.

SinceSecond Integer No 60

A relative time in seconds before the current time from which to show event information. This parameter is used to poll incremental events.

Limit Integer No 200

Specifies the maximum number of container groups to be returned for this request. Default value: 200.

Note The number of container groups to be returned is no greater than this parameter value.
Tag.N.Value String No name

The value of tag N.

Tag.N.Key String No test

The key of tag N.

Response parameters

Parameter Type Example Description
RequestId String 1340C38D-6189-54D1-86F6-7D5ECF3E0088

The ID of the request.

TotalCount Integer 10

The number of entries of returned events.

Data Array of data

An array of event details.

ContainerGroupId String eci-uf6fonnghi50v6nq****

The ID of the container group.

Events Array of events

An array of events.

Type String Normal

The type of the event.

Count Integer 10

The number of events.

FirstTimestamp String 2021-10-04T09:08:04Z

The time at which the event was first recorded.

LastTimestamp String 2021-10-04T09:08:04Z

The time at which the most recent occurrence of this event was recorded.

Message String Started container

A description of the status of this operation.

Reason String Started

The reason for the transition into the current status of the event.

ReportingComponent String test

Name of the controller that emitted the event.

ReportingInstance String test

ID of the controller instance.

Source Object

The component reporting this event.

Component String kubelet

The component for the operation.

Host String eci

The type of the host.

involvedObject Object

The object that this event is about.

Kind String Pod

The type of the resource.

Name String test

The name of the resource.

Namespace String default

The namespace where the resource resides.

Uid String eci-8vb5nkcq3a5cu0p3****

The ID of the resource.

ApiVersion String v1

The version of Kubernetes.

Metadata Object

The metadata of the event.

Name String eci-uto-created-eci-for-ubuntu.167e3fb73cc7f9cb

The name of the event.

Namespace String default

The namespace.

Examples

Sample requests

https://eci.aliyuncs.com/?Action=DescribeContainerGroupEvents
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-k
&VSwitchId=vsw-uf6h3rbwbm90urjwa****
&ResourceGroupId=rg-uf66jeqopgqa9hdn****
&ContainerGroupIds=["eci-bp17gw49eu09yiwm****", "eci-bp19aq49du01abcm****", "eci-2zegym1qhbmdfr1s****"]
&Tag=[{"Value":"name","Key":"test"}]
&NextToken=d78f2dd8-5979-42fe-xaee-b16db43be5bc
&EventSource=K8sAgent
&SinceSecond=60
&Limit=200
&Common request parameters

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeContainerGroupEventsResponse>
    <RequestId>1340C38D-6189-54D1-86F6-7D5ECF3E0088</RequestId>
    <TotalCount>10</TotalCount>
    <Data>
        <ContainerGroupId>eci-uf6fonnghi50v6nq****</ContainerGroupId>
        <Events>
            <Type>Normal</Type>
            <Count>10</Count>
            <FirstTimestamp>2021-10-04T09:08:04Z</FirstTimestamp>
            <LastTimestamp>2021-10-04T09:08:04Z</LastTimestamp>
            <Message>Started container</Message>
            <Reason>Started</Reason>
            <ReportingComponent>test</ReportingComponent>
            <ReportingInstance>test</ReportingInstance>
            <Source>
                <Component>kubelet</Component>
                <Host>eci</Host>
            </Source>
            <involvedObject>
                <Kind>Pod</Kind>
                <Name>test</Name>
                <Namespace>default</Namespace>
                <Uid>eci-8vb5nkcq3a5cu0p3****</Uid>
                <ApiVersion>v1</ApiVersion>
            </involvedObject>
            <Metadata>
                <Name>eci-uto-created-eci-for-ubuntu.167e3fb73cc7f9cb</Name>
                <Namespace>default</Namespace>
            </Metadata>
        </Events>
    </Data>
</DescribeContainerGroupEventsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "1340C38D-6189-54D1-86F6-7D5ECF3E0088",
  "TotalCount" : 10,
  "Data" : [ {
    "ContainerGroupId" : "eci-uf6fonnghi50v6nq****",
    "Events" : [ {
      "Type" : "Normal",
      "Count" : 10,
      "FirstTimestamp" : "2021-10-04T09:08:04Z",
      "LastTimestamp" : "2021-10-04T09:08:04Z",
      "Message" : "Started container",
      "Reason" : "Started",
      "ReportingComponent" : "test",
      "ReportingInstance" : "test",
      "Source" : {
        "Component" : "kubelet",
        "Host" : "eci"
      },
      "involvedObject" : {
        "Kind" : "Pod",
        "Name" : "test",
        "Namespace" : "default",
        "Uid" : "eci-8vb5nkcq3a5cu0p3****",
        "ApiVersion" : "v1"
      },
      "Metadata" : {
        "Name" : "eci-uto-created-eci-for-ubuntu.167e3fb73cc7f9cb",
        "Namespace" : "default"
      }
    } ]
  } ]
}

Error codes

For a list of error codes, visit the API Error Center.