All Products
Search
Document Center

ActionTrail:DescribeTrails

Last Updated:Mar 01, 2024

Queries created trails.

Operation description

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.

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.
OperationAccess levelResource typeCondition keyAssociated operation
actiontrail:DescribeTrailsRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IncludeShadowTrailsbooleanNo

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.
false
NameListstringNo

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

abc,def
IncludeOrganizationTrailbooleanNo

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

  • true
  • false (default)
false

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

ED8BC689-69DA-42AC-855E-3B06C1271194
TrailListobject []

A list of returned trails.

TrailRegionstring

The region of the trail.

All
Statusstring

The status of the trail. Valid values:

  • Disable: disabled.
  • Enable: enabled.
  • Fresh: The trail is created but is not enabled.
Enable
UpdateTimestring

The time when the configurations of the trail were last updated.

2021-04-06T02:16:24Z
HomeRegionstring

The home region of the trail.

cn-hangzhou
CreateTimestring

The time when the trail was created.

2021-03-01T06:27:28Z
OssKeyPrefixstring

The prefix of the files that are stored in the Object Storage Service (OSS) bucket.

trail1
EventRWstring

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

  • Write: write events. This is the default value.
  • Read: read events.
  • All: read and write events.
All
StartLoggingTimestring

The time when the trail was last enabled.

2021-04-06T02:08:38Z
OssWriteRoleArnstring

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

acs:ram::***:role/aliyunserviceroleforactiontrail
SlsProjectArnstring

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

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

Indicates whether the trail is a multi-account trail. Valid values:

  • false (default)
  • true
false
SlsWriteRoleArnstring

The ARN of the RAM role that is assumed by ActionTrail to deliver events to the Log Service project.

acs:ram::159498693826****:role/aliyunserviceroleforactiontrail
StopLoggingTimestring

The time when the trail was last disabled.

2021-04-06T02:09:04Z
Namestring

The name of the trail.

test-4
OssBucketNamestring

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

secloud
Regionstring

The region where the trail resides.

cn-hangzhou
OrganizationIdstring

The ID of the resource directory.

Note This parameter is returned only when the trail is a multi-account trail.
rd-EV****
OssBucketLocationstring

The region where the OSS bucket resides.

oss-cn-hangzhou
TrailArnstring

The ARN of the trail.

acs:actiontrail:cn-hangzhou:159498693826****:trail/test-delivery-other

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidTrailNameExceptionThe specified Trail name is invalid.The specified Trail name is not valid.
400InvalidQueryParameterThe specified query parameter is invalid.The specified query parameter is not valid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-09The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2021-08-18The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.