All Products
Search
Document Center

Elastic Container Instance:DescribeContainerLog

Last Updated:Sep 13, 2024

Queries the logs of a container in a container group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
eci:DescribeContainerLogget
  • containergroup
    acs:eci:{#regionId}:{#accountId}:containergroup/{#containergroupId}
  • eci:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the elastic container instance.

cn-hangzhou
ContainerGroupIdstringYes

The instance ID.

eci-uf6fonnghi50v6nq****
ContainerNamestringYes

The name of the container.

nginx
StartTimestringNo

The beginning of the time range to query. Specify the time in the RFC 3339 standard. The time must be in UTC.

2018-08-02T15:00:00Z
TailintegerNo

The number of the most recent log entries that you want to query. Default value: 500. Maximum value: 2000.
A maximum of 1 MB log data can be returned.

500
LastTimebooleanNo

Specifies whether to query the logs of the previous container if the container exits and restarts. Valid values:

  • true
  • false

Default value: false.

false
SinceSecondsintegerNo

A relative time in seconds before the current time from which to show logs. Examples: 10, 20, and 30.

10
LimitByteslongNo

The limit on the total size of logs. Unit: bytes. Valid values: 1 to 1048576(1 MB).

123798
TimestampsbooleanNo

Specifies whether to return the timestamps of logs. Valid values:

  • true
  • false

Default value: false.

false

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

CA850ADA-****-4AC8-****-5B5990EAB7D0
ContainerNamestring

The container name.

nginx
Contentstring

The content of the log.

{}

Examples

Sample success responses

JSONformat

{
  "RequestId": "CA850ADA-****-4AC8-****-5B5990EAB7D0",
  "ContainerName": "nginx",
  "Content": "{}"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history