Queries the status of a trail.

This topic describes how to query the status of a sample single-account trail named trail-test.

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 GetTrailStatus

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

Name String Yes trail-test

The name of the trail.

The name must be 6 to 36 characters in length. It must start with a letter and can contain letters, digits, hyphens (-), and underscores (_).

Note The name must be unique within your Alibaba Cloud account.
IsOrganizationTrail Boolean No false

Specifies whether to query the status of a multi-account trail. Valid values:

  • true: Query the status of a multi-account trail.
  • false: Query the status of a single-account trail. It is the default value.

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

Response parameters

Parameter Type Example Description
RequestId String 8067369B-B923-4D26-85BC-61BF33922505

The ID of the request.

StartLoggingTime String 2021-02-24T09:19:44Z

The time when logging was last enabled for the trail.

LatestDeliveryError String write sls failed, exception: the parent of sub user must be project owner, itemscount: 1

The log of the last failed delivery.

StopLoggingTime String 2021-02-25T09:19:44Z

The time when logging was last disabled for the trail.

IsLogging Boolean true

Indicates whether logging is enabled for the trail. Valid values:

  • true: Logging is enabled for the trail.
  • false: Logging is disabled for the trail.
LatestDeliveryTime String 2021-02-26T09:19:44Z

The most recent time when an event was delivered by the trail.

LatestDeliveryLogServiceError String write sls failed, exception: the parent of sub user must be project owner, itemscount: 1

The log of the last failed delivery to Log Service.

LatestDeliveryLogServiceTime String 2021-02-26T09:19:44Z

The most recent time when an event was delivered to Log Service.

OssBucketStatus Boolean true

Indicates the status of the destination Object Storage Service (OSS) bucket. Valid values:

  • true: The OSS bucket is available.
  • false: The OSS bucket is unavailable.
SlsLogStoreStatus Boolean true

Indicates the status of the destination Log Service Logstore. Valid values:

  • true: The Log Service Logstore is available.
  • false: The Log Service Logstore is unavailable.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetTrailStatus
&Name=trail-test
&IsOrganizationTrail=false
&<Common request parameters>

Sample success responses

JSON format

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

{
  "RequestId" : "7FA636C6-AEE2-4827-A398-F08F708B9A3D",
  "StartLoggingTime" : "2021-02-24T09:19:44Z",
  "OssBucketStatus" : false,
  "SlsLogStoreStatus" : true,
  "IsLogging" : true
}

Error codes

HTTP status code Error code Error message Description
404 TrailNotFoundException The specified Trail does not exist. The error message returned because the specified trail does not exist.

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