You need to enable JavaScript to run this app.
导航
CreateTrail - 创建跟踪
最近更新时间:2024.12.31 17:17:18首次发布时间:2024.12.31 17:17:18

创建跟踪

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

CreateTrail

要执行的操作,取值:CreateTrail。

Version
String

2018-01-01

API的版本,取值:2018-01-01。

TrailName
String

trail-test

跟踪名

EventRW
String

All

跟踪读写类型

EventSources.N
Array of String

iam

跟踪事件源

TrailType
Integer

0

跟踪类型:0单账号,1多账号

TosBucketRegion
String

cn-beijing

TOS桶region

TosBucketName
String

bucket1

TOS桶名

TosKeyPrefix
String

prefix

TOS路径前缀

TosBucketProject
String

""

TOS桶所属的iam项目

TlsProjectRegion
String

cn-beijing

TLS项目region

TlsProjectName
String

project1

TLS项目名

TlsTopicName
String

topic1

TLS主题名

TlsProjectTopicProject
String

""

TLS项目主题所属的iam项目

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
TrailName
String

trail-test

跟踪名

EventRW
String

All

跟踪读写类型

EventSources
Array of String

["iam"]

跟踪事件源

TrailType
Integer

0

跟踪类型:0单账号,1多账号

TosBucketRegion
String

cn-beijing

TOS桶region

TosBucketName
String

bucket1

TOS桶名

TosKeyPrefix
String

prefix

TOS路径前缀

TlsProjectRegion
String

cn-beijing

TLS项目region

TlsProjectName
String

project1

TLS项目名

TlsTopicName
String

topic1

TLS主题名

请求示例

POST /?Action=CreateTrail&Version=2018-01-01 HTTP/1.1
Host: volcengineapi.byted.org
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Date: 20241217T062621Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20241217/cn-beijing/cloud_trail/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

EventRW=All&EventSources.1=iam&TlsProjectName=trail-test&TlsProjectRegion=cn-beijing&TlsTopicName=trail-test-1&TosBucketName=trail-test-1&TosBucketRegion=cn-beijing&TrailName=test1&TrailType=0

返回示例

{
  "ResponseMetadata": {
    "RequestId": "20241217142758134070197252FEDBA9",
    "Action": "CreateTrail",
    "Version": "2018-01-01",
    "Service": "cloud_trail",
    "Region": "cn-beijing"
  },
  "Result": {
    "TrailName": "test1",
    "EventRW": "All",
    "EventSources": [
      "iam"
    ],
    "TrailType": 0,
    "TosBucketRegion": "cn-beijing",
    "TosBucketName": "trail-test-1",
    "TlsProjectRegion": "cn-beijing",
    "TlsProjectName": "trail-test",
    "TlsTopicName": "trail-test-1"
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
InvalidParameter
The parameter '%s' is invalid.
400
SiteDoesNotMatch
The site does not match the identity.
400
InvalidTrailName
The specified trail name '%s' is invalid.
400
InvalidTosBucketName
The specified TOS bucket name is invalid.
400
InvalidTosBucketPrefix
The specified TOS bucket prefix is invalid.
400
TosServiceDisabled
Tos service is disabled for this account.
400
InvalidTlsProjectName
The specified TLS project name is invalid.
400
InvalidTlsTopicName
The specified TLS topic name is invalid.
400
TlsServiceDisabled
Tls service is disabled for this account.
400
InvalidTrailConfiguration
You must specify at least one TOS bucket or TLS project.
400
InvalidEventSources
The specified event source '%s' is invalid
400
TrailQuotaExceeded
The number of specified trail has exceeded the quota
403
AccessDenied
You have no permission for this action.
409
TrailAlreadyExists
Trail '%s' already exists.
500
ServiceFailure
The requested service failed due to an unknown error.