Queries the detailed information about trails.

This topic shows you how to query the information about the single-account trails within an Alibaba Cloud account. In this example, the information about a trail named test-4 is returned.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeTrails

The operation that you want to perform. Set the value to DescribeTrails.

IncludeShadowTrails Boolean No false

Specifies whether to return the information about shadow trails. Valid values:

  • false: Do not return the information about shadow trails. It is the default value.
  • true: Return the information about shadow trails.
NameList String No abc,def

The names of the trails whose information you want to query. Separate multiple trail names with commas (,).

IncludeOrganizationTrail Boolean No false

Specifies whether to query the information about multi-account trails. Valid values:

  • true: Query the information about multi-account trails.
  • false: Query the information about single-account trails. It is the default value.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String ED8BC689-69DA-42AC-855E-3B06C1271194

The ID of the request.

TrailList Array of Trail

The returned information about the trails.

TrailRegion String All

The one or more regions from which the trail delivers events.

Status String Enable

The status of the trail. Valid values:

  • Stopped: Logging is disabled for the trail.
  • Enable: Logging is enabled for the trail.
  • Fresh: Logging is not enabled for the trail after it is created.
UpdateTime String 2021-04-06T02:16:24Z

The time when the configuration of the trail was last updated.

HomeRegion String cn-hangzhou

The home region of the trail.

CreateTime String 2021-03-01T06:27:28Z

The time when the trail was created.

OssKeyPrefix String trail1

The prefix of the log files stored in the destination Object Storage Service (OSS) bucket.

EventRW String All

The read/write type of the delivered events. Valid values:

  • Write: write events. It is the default value.
  • Read: read events.
  • All: read and write events.
StartLoggingTime String 2021-04-06T02:08:38Z

The time when logging was last enabled for the trail.

OssWriteRoleArn String acs:ram::***:role/aliyunserviceroleforactiontrail

The Alibaba Cloud Resource Name (ARN) of the service-linked role that is assumed by ActionTrail to deliver events to the destination OSS bucket.

SlsProjectArn String acs:log:cn-qingdao:159498693826****:project/zhengze-audit-log

The ARN of the Log Service project to which events are delivered.

IsOrganizationTrail Boolean false

Indicates whether the trail was created as a multi-account trail. Valid values:

  • false: The trail is not a multi-account trail. It is the default value.
  • true: The trail is a multi-account trail.
SlsWriteRoleArn String acs:ram::159498693826****:role/aliyunserviceroleforactiontrail

The ARN of the service-linked role that is assumed by ActionTrail to deliver events to the destination Log Service project.

StopLoggingTime String 2021-04-06T02:09:04Z

The time when logging was last disabled for the trail.

Name String test-4

The name of the trail.

OssBucketName String secloud

The name of the OSS bucket to which events are delivered.

Region String cn-hangzhou

The region where the trail resides.

OrganizationId String rd-EV****

The ID of the resource directory.

Note This parameter is returned only when the queried trail is a multi-account trail.
OssBucketLocation String oss-cn-hangzhou

The region where the destination OSS bucket resides.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeTrails
&<Common request parameters>

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "ED8BC689-69DA-42AC-855E-3B06C1271194",
  "TrailList" : [ {
    "Status" : "Disable",
    "HomeRegion" : "cn-hangzhou",
    "StartLoggingTime" : "2021-04-06T02:08:38Z",
    "CreateTime" : "2021-03-01T06:27:28Z",
    "StopLoggingTime" : "2021-04-06T02:09:04Z",
    "SlsWriteRoleArn" : "acs:ram::159498693826****:role/aliyunserviceroleforactiontrail",
    "OssBucketLocation" : "",
    "TrailRegion" : "All",
    "Name" : "test-4",
    "IsOrganizationTrail" : false,
    "SlsProjectArn" : "acs:log:cn-qingdao:159498693826****:project/zhengze-audit-log",
    "EventRW" : "All",
    "OssKeyPrefix" : "",
    "UpdateTime" : "2021-04-06T02:16:24Z",
    "Region" : "cn-hangzhou",
    "OssBucketName" : "",
    "OssWriteRoleArn" : "",
    "IsShadowTrail" : 0
  } ]
}

Error codes

HTTP status code Error code Error message Description
400 InvalidTrailNameException The specified Trail name is invalid. The error message returned because the specified trail name is invalid. Specify a valid trail name.
400 InvalidQueryParameter The specified query parameter is invalid. The error message returned because the specified request parameters are invalid.

For a list of error codes, visit the API Error Center.