获取容器日志信息

最近更新时间:2018-09-18 16:58:21

1. 接口描述

接口请求域名: cis.tencentcloudapi.com 。

此接口(DescribeContainerLog)用于获取容器日志信息

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeContainerLog
Version String 公共参数,本接口取值:2018-04-08
InstanceName String 容器实例名称
ContainerName String 容器名称
Tail Integer 日志显示尾部行数
SinceTime String 日志起始时间

3. 输出参数

参数名称 类型 描述
ContainerLogList Array of ContainerLog 容器日志数组
RequestId String 唯一请求ID,每次请求都会返回。定位问题时需要提供该次请求的RequestId。

4. 示例

示例1 获取sshdlog容器实例日志信息

输入示例

https://cis.tencentcloudapi.com/?Action=DescribeContainerLog
&InstanceName=sshdlog
&<公共请求参数>

输出示例

{
  "Response": {
    "ContainerLogList": [
      {
        "Log": "2018-05-18 06:34:04,123 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:04"
      },
      {
        "Log": "2018-05-18 06:34:04,123 WARN No file matches via include \"/etc/supervisord.d/*.ini\"",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:04"
      },
      {
        "Log": "2018-05-18 06:34:04,123 INFO Included extra file \"/etc/supervisord.d/sshd-bootstrap.conf\" during parsing",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:04"
      },
      {
        "Log": "2018-05-18 06:34:04,123 INFO Included extra file \"/etc/supervisord.d/sshd-wrapper.conf\" during parsing",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:04"
      },
      {
        "Log": "2018-05-18 06:34:04,126 INFO supervisord started with pid 1",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:04"
      },
      {
        "Log": "2018-05-18 06:34:05,129 INFO spawned: 'supervisor_stdout' with pid 7",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:05"
      },
      {
        "Log": "2018-05-18 06:34:05,131 INFO spawned: 'sshd-bootstrap' with pid 8",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:05"
      },
      {
        "Log": "2018-05-18 06:34:05,205 INFO spawned: 'sshd-wrapper' with pid 9",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:05"
      },
      {
        "Log": "2018-05-18 06:34:05,605 INFO success: supervisor_stdout entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:05"
      },
      {
        "Log": "2018-05-18 06:34:05,605 INFO success: sshd-bootstrap entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:05"
      },
      {
        "Log": "2018-05-18 06:34:05,605 INFO success: sshd-wrapper entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:05"
      },
      {
        "Log": "sshd-bootstrap stdout | Initialising SSH.",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "sshd-bootstrap stdout | ",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "================================================================================",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "SSH Details",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "--------------------------------------------------------------------------------",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "user : app-admin",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "password : n1KI5zLucvzr8hqY",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "id : 500:500",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "home : /home/app-admin",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "chroot path : N/A",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "shell : /bin/bash",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "sudo : ALL=(ALL) ALL",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "key fingerprints :",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "dd:3b:b8:2e:85:04:06:e9:ab:ff:a8:0a:c0:04:6e:d6 (insecure key)",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "rsa host key fingerprint :",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "37:aa:b8:20:2f:b1:05:59:5d:af:aa:1b:28:d6:fc:ad",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "--------------------------------------------------------------------------------",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "3.21979",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      },
      {
        "Log": "2018-05-18 06:34:08,617 INFO exited: sshd-bootstrap (exit status 0; expected)",
        "Name": "sshd",
        "Time": "2018-05-18 14:34:08"
      }
    ],
    "RequestId": "44156dc9-c6b5-4f58-b11f-7aeec0beac76"
  }
}

5. 开发者资源

API Explorer

该工具提供了在线调用、签名验证、 SDK 代码生成和快速检索接口等能力,能显著降低使用云 API 的难度,推荐使用。

SDK

云 API 3.0 提供了配套的开发工具集( SDK ),支持多种编程语言,能更方便的调用 API 。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码 描述
InternalError 内部错误。
InvalidParameter 参数错误。