获取云主机日志信息:可根据云主机ID来获取云主机日志信息列表。 如果不指定任何过滤条件,则会返回错误信息。

Request Parameters

Parameter name Type Description Required
action String API 标识符 Yes
obj_id String 云主机 ID Yes

Response Elements

Name Type Description
message String 执行结果信息
code Integer HTTP Resonpe响应状态码
data String 云主机日志信息


Example Request:

Request Headers:

POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/json

JSON Data:

  "action": "LogInstance",
  "obj_id": "568c45bf-bed9-424f-a68a-4fe475fde363"

Example Response:

  "message": "成功",
  "code": 200,
  "data": "?%G\t\tWelcome to CentOS \nStarting udev: %G[  OK  ]\nSetting hostname sphinx-01:  [  OK  ]\nSetting up Logical Volume Management:   No volume groups found\n[  OK  ]\nChecking filesystems\nChecking all file systems.\n[/sbin/fsck.ext4 (1) -- /] fsck.ext4 -a /dev/vda2 \n/dev/vda2: clean, 53990/1299984 files, 584937/5191424 blocks\n[/sbin/fsck.ext4 (1) -- /boot] fsck.ext4 -a /dev/vda1 \n/dev/vda1: recovering journal\n/dev/vda1: clean, 39/51200 files, 40264/204800 blocks\n[  OK  ]\nRemounting root filesystem in read-write mode:  [  OK  ]\nMounting local filesystems:  [  OK  ]\nEnabling local filesystem quotas:  [  OK  ]\nEnabling /etc/fstab swaps:  [  OK  ]\nEntering non-interactive startup\nCalling the system activity data collector (sadc)... \nip6tables: Applying firewall rules: [  OK  ]\nBringing up loopback interface:  [  OK  ]\nBringing up interface eth0:  \nDetermining IP information for eth0... done.\n[  OK  ]\nStarting auditd: [  OK  ]\nStarting portreserve: [  OK  ]\nStarting system logger: [  OK  ]\nStarting irqbalance: [  OK  ]\nStarting rpcbind: [  OK  ]\nStarting NFS statd: [  OK  ]\nStarting kdump:[FAILED]\nStarting system message bus: [  OK  ]\nStarting cups: [  OK  ]\nMounting filesystems:  [  OK  ]\nStarting acpi daemon: [  OK  ]\nStarting HAL daemon: [  OK  ]\nRetrigger failed udev events[  OK  ]\nLoading autofs4: [  OK  ]\nStarting automount: [  OK  ]\nStarting mcelog daemon\n[  OK  ]Starting sshd: [  OK  ]\nStarting ntpd: [  OK  ]\nStarting postfix: [  OK  ]\nStarting abrt daemon: [  OK  ]\nStarting crond: [  OK  ]\nStarting atd: [  OK  ]\nStarting certmonger: [  OK  ]\nChanging password for user root.\npasswd: all authentication tokens updated successfully.\n\nCentOS release 6.5 (Final)\nKernel 2.6.32-431.el6.x86_64 on an x86_64\n\nsphinx-01 login: "