forked from docs/doc-exports
Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com> Co-authored-by: Liu, Siying <liusiying@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Liu, Siying <liusiying@noreply.gitea.eco.tsi-dev.otc-service.com>
39 lines
3.9 KiB
HTML
39 lines
3.9 KiB
HTML
<a name="cts_api_0008"></a><a name="cts_api_0008"></a>
|
|
|
|
<h1 class="topictitle1">Getting Started</h1>
|
|
<div id="body1540451017286"><p id="cts_api_0008__en-us_topic_0121682346_p51148444524">This section describes how to create a tracker by calling APIs.</p>
|
|
<div class="note" id="cts_api_0008__n115de32b334547e281bc6cdfbb5d0543"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cts_api_0008__p16231390384">The token obtained from IAM is valid for only 24 hours. If you want to use the same token for authentication, you can cache it to avoid frequent calling of the IAM API.</p>
|
|
</div></div>
|
|
<div class="section" id="cts_api_0008__en-us_topic_0121682346_section872994"><h4 class="sectiontitle">Involved APIs</h4><p class="litext" id="cts_api_0008__en-us_topic_0121682346_p23385131">For token-based authentication, you must obtain a token and add <strong id="cts_api_0008__b477817592288">X-Auth-Token</strong> to the request header when calling an API.</p>
|
|
<ul id="cts_api_0008__en-us_topic_0121682346_ul15147458"><li id="cts_api_0008__en-us_topic_0121682346_li2109397">IAM API used to obtain a token</li><li id="cts_api_0008__en-us_topic_0121682346_li18984577">CTS API used to create a tracker</li></ul>
|
|
</div>
|
|
<div class="section" id="cts_api_0008__sc5418e49a6f74b8c9585329ab48961be"><h4 class="sectiontitle">Procedure</h4><ol id="cts_api_0008__en-us_topic_0121682346_ol61355793"><li id="cts_api_0008__la6b079a378294da58c4a968c9da42bb6">Obtain a token by referring to <a href="cts_api_0004.html">Authentication</a>.</li><li class="msonormal" id="cts_api_0008__li438163318397">Send <strong id="cts_api_0008__b1047505817217">POST /v1.0/ {project_id} /tracker</strong>.</li><li class="msonormal" id="cts_api_0008__ld531af0f91494173a1c4b3c0cb5cbe84">Add <strong id="cts_api_0008__b842352706102737">Content-Type</strong> and <strong id="cts_api_0008__af7ae672ee2a342a9ad32279115b76b3b">X-Auth-Token</strong> to the request header.</li><li class="msonormal" id="cts_api_0008__l32e4cbbd573b41c3a82dd91d010a4f92">Set parameters in the request body as follows:<pre class="screen" id="cts_api_0008__screen171955131997">POST /v1.0/{project_id}/tracker
|
|
{
|
|
"bucket_name": "obs-f1da", //Name of an Object Storage Service (OBS) bucket to which traces will be transferred. This parameter is mandatory and its value is a string.
|
|
"is_support_trace_files_encryption": true, //Whether trace files will be encrypted during transfer. This parameter is optional and its value is of boolean type.
|
|
"kms_id": "13a4207c-7abe-4b68-8510-16b84c3b5504", //ID of the key for trace file encryption. When <strong id="cts_api_0008__b1621005717498">is_support_trace_files_encryption</strong> is set to <strong id="cts_api_0008__b172101575491">true</strong>, this parameter is mandatory.
|
|
"is_obs_created": true, //Whether a new OBS bucket will be created. This parameter is optional and its value is of boolean type.
|
|
"file_prefix_name": "yO8Q", //File name prefix to mark trace files that need to be stored in OBS. This parameter is optional and its value is a string.
|
|
"log_file_validate": {
|
|
"is_support_validate": true //Whether trace files will be verified. This parameter is optional and its value is of boolean type.
|
|
}
|
|
}</pre>
|
|
<p id="cts_api_0008__p719517131490">If the request is successful, information about the created tracker is returned.</p>
|
|
<pre class="screen" id="cts_api_0008__screen141966136914">{
|
|
"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
|
|
},
|
|
"tracker_name": "system", //Tracker name
|
|
"status": "enabled" //Tracker status
|
|
} </pre>
|
|
<p id="cts_api_0008__p1719612135914">If the request fails, an error code and error message are returned. For details, see <a href="ErrorCode.html">Error Codes</a>.</p>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
|