Getting Started

This section describes how to create a tracker by calling Cloud Trace Service (CTS) APIs.

The token obtained from Identity and Access Management (IAM) is valid for only 24 hours. If you want to use one token for authentication, you can cache it to avoid frequently obtaining the token.

Involved APIs

For token authentication, you must obtain a token and add X-Auth-Token to the request header when calling an API.

  • API for obtaining tokens from IAM
  • API for creating a tracker

Procedure

  1. Obtain the token by referring to Authentication.
  2. Send POST /v1.0/ {project_id} /tracker.
  3. Add Content-Type and X-Auth-Token to the request header.
  4. Specify the following parameters in the request body:
    POST /v1.0/{project_id}/tracker
    {
     "bucket_name": "obs-f1da",  // Select the name of the OBS bucket to be dumped. This parameter is mandatory and its value is String.
      "is_support_trace_files_encryption": true,  // Specifies whether to enable the encryption function for trace files to be transferred. This parameter is mandatory and its value is Boolean.
     "kms_id": "13a4207c-7abe-4b68-8510-16b84c3b5504",  // Specifies the key ID for encrypting trace files to be transferred. When is_support_trace_files_encryption is set to true, this parameter is mandatory and its value is Boolean.
     "is_obs_created": true,  //Specifies whether to create an OBS bucket. This parameter is optional and its value is Boolean.
     "file_prefix_name": "yO8Q",   // Specifies the prefix of the log file to be stored in OBS. This parameter is optional and its value is String.
      "log_file_validate": {
     "is_support_validate": true  // Specifies whether to enable event file verification. This parameter is optional and its value is Boolean.
     }
    }

    After the request is successfully processed, information about the created tracker is returned.

    {
     "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",   
      "log_file_validate": {
     "is_support_validate": true
     },
    Specifies the tracker name,  // Identifies the tracker name.
    "Status": "Enabled"  // Identifies the tracker status.
    } 

    If the request fails, the error code and information are returned. For details, see Error Code.