You can call this operation to collect logs of specified ECS instances in a deployment environment.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request headers

This operation uses common request headers, instead of special request headers. For more information, see the "Common request headers" section in "Common request and response headers."

Request syntax

POST /pop/v1/wam/appEnv/gatherLog HTTP/1.1

Request parameters

Parameter Type Required? Example Description
EnvId String Yes wa-5d1af9c802470221ab7*****

The ID of the deployment environment in which you want to collect logs of specified ECS instances.

LogPath String No /home/admin/app/webplus-app.log

The path to the logs to be collected.

TargetInstances String No ["i-wz94zz7mx8kt5kz*****"]

The ID list of the ECS instances of which you want to collect logs.

Response parameters

Parameter Type Example Description
Code String OK

The response code. The value is OK if the request is successful.

EnvChange

The information about the change.

ChangeId String wc-5d41015c56fd7c14ac9*****

The ID of the change.

EnvId String we-5d3eaaea2977ca5251e*****

The ID of the deployment environment.

StartTime String 1564541276614

The start time of the change.

Message String success

The response message. The value is success if the request is successful.

RequestId String 41CF0D98-CAD7-43CB-8BF0-CFA4D3F*****

The ID of the request.

Examples

Sample request


http://webplus.cn-hangzhou.aliyuncs.com/pop/v1/wam/appEnv/gatherLog&&<Common request parameters>
{
  "EnvId": "wa-5d1af9c802470221ab7*****",
  "TargetInstances":"["i-wz94zz7mx8kt5kz*****"]",
  "LogPath":"/home/admin/app/webplus-app.log"
}

Sample success response

XML format

<GatherAppEnvLogResponse>
      <Message>success</Message>
      <EnvChange>
            <EnvId>we-5d39b8ba6786bd4b1495****</EnvId>
            <StartTime>1564541276614</StartTime>
            <ChangeId>wc-5d3a963d5802611c4ddc****</ChangeId>
      </EnvChange>
      <RequestId>97CEF6FD-0266-4C15-8745-9325E2AB****</RequestId>
      <Code>OK</Code>
</GatherAppEnvLogResponse>

JSON format

{
	"Message":"success",
	"RequestId":"41CF0D98-CAD7-43CB-8BF0-CFA4D3F*****",
	"EnvChange":{
		"EnvId":"we-5d3eaaea2977ca5251e*****",
		"ChangeId":"wc-5d41015c56fd7c14ac9*****",
		"StartTime":1564541276614
	},
	"Code":"OK"
}

Error codes

For more information about error codes, see API Error Center.