Creating a Tracker
All API URLs described in this section are case-sensitive.
Function
This API is used to create a tracker.
A tracker will be automatically created after Cloud Trace Service (CTS) is enabled. All traces recorded by CTS are associated with the tracker. Currently, only one tracker can be created for an account in a region.
On the management console, you can query the last seven days of operation records. To obtain more operation records, you can enable Object Storage Service (OBS) and deliver operation records to OBS buckets for long-term storage in real time.
URI
POST /v1.0/{project_id}/tracker
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID |
Request
- Parameters
Table 2 Parameters in the request Parameter
Sub-Parameter
Mandatory
Type
Description
bucket_name
N/A
Yes
String
OBS bucket name. Starts with a digit or letter and contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), and periods (.)
file_prefix_name
N/A
No
String
Prefix of a log that needs to be stored in an OBS bucket. The value is a string of 0 to 64 characters and can contain uppercase and lowercase letters (a to z and A to Z), digits (0 to 9), hyphens (-), underscores (_), or periods (.)
is_obs_created
N/A
Yes
Boolean
Whether a new OBS bucket can be created.
- When the value is true, you can create an OBS bucket to store trace files.
- When the value is false, you can select an existing OBS bucket to store trace files.
The bucket name is a string of 3 to 64 characters and can only contain digits, letters, hyphens (-), and periods (.). Only one period and hyphen can be contained in the string.
is_support_trace_files_encryption
N/A
Yes
Boolean
Whether the function of encrypting stored trace files is enabled or not. This parameter must be used with kms_id.
kms_id
N/A
Yes
String
Key ID used for dumping and encrypting trace files. This key ID is obtained from KMS.
This parameter is mandatory when the value of is_support_trace_files_encryption is true.
lts
is_lts_enabled
Yes
Boolean
Whether the LTS search function is enabled or not.
log_group_name
Yes
String
Name of the log group that CTS creates in LTS.
log_topic_name
Yes
String
Name of the log topic that CTS creates in LTS.
log_file_validate
N/A
No
json
Whether to enable the trace file verification function.
-
is_support_validate
Yes
Boolean
Whether the trace file verification function is supported or not.
- Example request
POST /v1.0/{project_id}/tracker { "bucket_name": "obs-f1da", "is_support_trace_files_encryption": true, "kms_id": "13a4207c-7abe-4b68-8510-16b84c3b5504", "is_obs_created": true, "file_prefix_name": "yO8Q", "lts": { "is_lts_enabled": true, "log_group_name": "CTS", "log_topic_name": "system-trace" }, "log_file_validate": { "is_support_validate": true } }
Response
- Parameters
Table 3 Parameters in the response Parameter
Sub-Parameter
Type
Description
bucket_name
N/A
String
OBS bucket name. Starts with a digit or letter and contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), and periods (.)
file_prefix_name
N/A
String
Prefix of a log that needs to be stored in an OBS bucket.
status
N/A
String
Status of a tracker. The value is enabled.
tracker_name
N/A
String
Tracker name. Currently, only tracker "system" is available.
is_obs_created
N/A
Boolean
Whether a new OBS bucket can be created.
- When the value is true, you can create an OBS bucket to store trace files.
- When the value is false, you can select an existing OBS bucket to store trace files.
The bucket name is a string of 3 to 64 characters and can only contain digits, letters, hyphens (-), and periods (.). Only one period and hyphen can be contained in the string.
is_support_trace_files_encryption
N/A
Boolean
Whether the function of encrypting stored trace files is enabled or not. This parameter must be used with kms_id.
kms_id
N/A
String
Key ID used for dumping and encrypting trace files. This key ID is obtained from KMS.
This parameter is mandatory when the value of is_support_trace_files_encryption is true.
lts
is_lts_enabled
Boolean
Name of the log group that CTS creates in LTS.
log_topic_name
String
Name of the log topic that CTS creates in LTS.
log_group_id
String
ID of the log group that CTS creates in LTS.
log_topic_id
String
ID of the log topic that CTS creates in LTS.
log_file_validate
log_file_validate
JSON object
Whether to enable the trace file verification function.
is_support_validate
is_support_validate
Boolean
Whether the trace file verification function is supported or not.
- Example response
{ "bucket_name": "obs-f1da", "file_prefix_name": "yO8Q", "is_obs_created": true, "is_support_trace_files_encryption": true, "kms_id": "13a4207c-7abe-4b68-8510-16b84c3b5504", "need_notify_user_list": [ "user1", "user2" ] }, "lts": { "is_lts_enabled": true, "log_group_name": "CTS", "log_topic_name": "system-trace", "log_group_id": "b6895f40-b897-11e7-8aa6-2866d488c81c", "log_topic_id": "b68d5281-b897-11e7-8aa7-2866d488c81c" }, "log_file_validate": { "is_support_validate": true }, "tracker_name": "system", "status": "enabled" }
Returned Value
- Normal
Table 4 Return code for successful requests Returned Value
Description
201
The request is successfully processed.
- Abnormal
Table 5 Return code for failed requests Returned Value
Description
400
The server failed to process the request.
403
You are forbidden to access the requested page.
500
Failed to complete the request because of an internal service error.
401
Your access request is rejected.
404
The requested OBS bucket does not exist.
Last Article: Tracker Management
Next Article: Modifying a Tracker
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.