Queries the logs of a container in a container group.
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:DescribeContainerLog | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the elastic container instance. | cn-hangzhou |
ContainerGroupId | string | Yes | The instance ID. | eci-uf6fonnghi50v6nq**** |
ContainerName | string | Yes | The name of the container. | nginx |
StartTime | string | No | 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 |
Tail | integer | No | The number of the most recent log entries that you want to query. Default value: 500. Maximum value: 2000. | 500 |
LastTime | boolean | No | Specifies whether to query the logs of the previous container if the container exits and restarts. Valid values:
Default value: false. | false |
SinceSeconds | integer | No | A relative time in seconds before the current time from which to show logs. Examples: 10, 20, and 30. | 10 |
LimitBytes | long | No | The limit on the total size of logs. Unit: bytes. Valid values: 1 to 1048576(1 MB). | 123798 |
Timestamps | boolean | No | Specifies whether to return the timestamps of logs. Valid values:
Default value: false. | false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "CA850ADA-****-4AC8-****-5B5990EAB7D0",
"ContainerName": "nginx",
"Content": "{}"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|