You can call this operation to update the Log Service Logstore or OSS bucket to which the specified trail delivers logs. This operation must be called from the API server in the home region of the trail.

Request parameters

Name Type Required Example Description
Action String Yes UpdateTrail The operation that you want to perform. Set the value to UpdateTrail.
RegionId String Yes cn-hangzhou The ID of the region where the instance is located. For more information about the latest list of Alibaba Cloud regions, see DescribeRegions.
Name String Yes cn-hangzhou The name of the trail to be updated.
EventRW String No Write Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.
OssBucketName String No yuanchuang The OSS bucket to which the trail delivers logs. Ensure that this is an existing OSS bucket.
RoleName String No aliyunactiontraildefaultrole The RAM role in ActionTrail permitted by the user.
OssKeyPrefix String No at-product-account-audit-B The prefix of the specified OSS bucket name. This parameter can be left empty.
SlsProjectArn String No acs:log:cn-shanghai:***:project/at-product-account-audit The unique Aliyun Resource Name (ARN) of the Log Service project.
SlsWriteRoleArn String No acs:ram::***:role/aliyunactiontraildefaultrole The unique ARN of the Log Service role.

Response parameters

Name Type Example Description
Name String trail-test The name of the trail.
EventRW String Write Indicates whether the event is a read or a write event. Valid values: Read, Write, and All. Default value: Write.
HomeRegion String cn-hangzhou The home region of the trail.
OssBucketName String yuanchuang The name of the specified OSS bucket.
OssKeyPrefix String at-product-account-audit-B The prefix of the specified OSS bucket name.
RoleName String aliyunactiontraildefaultrole The RAM role in ActionTrail permitted by the user.
SlsProjectArn String acs:log:cn-shanghai::project/*** The unique ARN of the Log Service project.
SlsWriteRoleArn String acs:ram::***:role/aliyunactiontraildefaultrole The unique ARN of the Log Service role.
RequestId String 145318BE-DEE1-4C57-AA7C-5BE7D34A6AE0 The ID of the request.

Examples

Sample requests

http://actiontrail.cn-hangzhou.aliyuncs.com/?
Action=UpdateTrail
&RegionId=cn-hangzhou
&Name=trail-test
&OssBucketName=yuanchuang
&RoleName=aliyunactiontraildefaultrole
&OssKeyPrefix=
&<Common request parameters>

Sample responses

JSON format
{
  "Name": "trail-test",
  "HomeRegion": "cn-hangzhou",
  "OssBucketName": "yuanchuang",
  "OssKeyPrefix": "",
  "RoleName": "aliyunactiontraildefaultrole",
  "SlsProjectArn":"acs:log:cn-shanghai::project/***",
  "SlsWriteRoleArn":"acs:ram::***:role/aliyunactiontraildefaultrole"
}

Error codes

Error code Description HTTP status code
InvalidBucketNameException The error message returned when the name of the specified OSS bucket is invalid. 400
InvalidPrefixException The error message returned when the prefix is invalid. 400
InvalidTrailNameException The error message returned when the name of the specified trail is invalid. 400
InsufficientBucketPolicyException The error message returned when you are not authorized to access the specified OSS bucket. 403
BucketDoesNotExistException The error message returned when the specified OSS bucket does not exist. 404
TrailNotFoundException The error message returned when the specified trail does not exist. 404