doc-exports/docs/cce/api-ref/cce_02_0004.html
Dong, Qiu Jian 11d29221d4 CCE API: Updated the ipv6enable field - 20240524 version
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2024-06-07 15:48:26 +00:00

26 lines
5.2 KiB
HTML

<a name="cce_02_0004"></a><a name="cce_02_0004"></a>
<h1 class="topictitle1">API Usage Guidelines</h1>
<div id="body1569373330500"><p id="cce_02_0004__p694217218">Cloud APIs comply with the RESTful API design principles. REST-based web services are organized into resources. Each resource is identified by one or more Uniform Resource Identifiers (URIs). An application accesses a resource based on the resource's Unified Resource Locator (URL). A URL is usually in the following format: <em id="cce_02_0004__i8449151122912">https://Endpoint/uri</em>. In the URL, <em id="cce_02_0004__i114521051192914">uri</em> indicates the resource path, that is, the API access path.</p>
<p id="cce_02_0004__p4816427810259">Cloud APIs use HTTPS as the transmission protocol. Requests/Responses are transmitted by using JSON messages, with media type represented by <strong id="cce_02_0004__b1025950229154127">Application/json</strong>.</p>
<ul id="cce_02_0004__ul13319112316819"><li id="cce_02_0004__li43190231280">The URL of APIs described in <a href="cce_02_0092.html">Cluster Management</a> is in the format of <em id="cce_02_0004__i1611453113614">https://Endpoint/uri</em>. In the URL, uri indicates the resource path, that is, the API access path. Use X-Auth-Token as a header.</li><li id="cce_02_0004__li11319132310812">The URL of Kubernetes-native APIs described in <a href="cce_02_0320.html">Add-on Management</a> and <a href="cce_02_0340.html">Kubernetes APIs</a> is in the format of <strong id="cce_02_0004__b1319152318817">https://{clusterid}.Endpoint/uri</strong>. In the URL, {clusterid} indicates a cluster ID, and uri indicates the resource path, that is, the API access path. Use X-Auth-Token as a header.</li><li id="cce_02_0004__li251551565014">The URL of Kubernetes-native APIs is in the format of <strong id="cce_02_0004__b1760920115129">https://{publicip}:5443/uri</strong>. In the URL, <strong id="cce_02_0004__b166093113127">{publicip}</strong> indicates EIP of the cluster, and <strong id="cce_02_0004__b146096111217">uri</strong> indicates the resource path, that is, the API access path. Use X-Remote-User or Authorization as a header.<div class="p" id="cce_02_0004__p1887502514125">Before using X-Remote-User as a header, obtain the required certificate in advance. Two types of certificates are supported:<ul id="cce_02_0004__ul1498525216115"><li id="cce_02_0004__li594175418416">Self-owned certificate uploaded during cluster creation. For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_10_0028.html" target="_blank" rel="noopener noreferrer">Creating a Cluster</a>.<p id="cce_02_0004__p519555315"></p>
<p id="cce_02_0004__p518617427121"><span><img id="cce_02_0004__image11224948173814" src="en-us_image_0000001854551680.png" title="Click to enlarge" class="imgResize"></span></p>
</li><li id="cce_02_0004__li119868526113">Cluster certificate generated and downloaded after cluster creation. For details, see <a href="https://docs.otc.t-systems.com/en-us/usermanual2/cce/cce_10_0175.html" target="_blank" rel="noopener noreferrer">Obtaining a Cluster Certificate</a>.<p id="cce_02_0004__p2297165721520"></p>
<p id="cce_02_0004__p72691437151617"><span><img id="cce_02_0004__image66181323201716" src="en-us_image_0000001868229221.png" title="Click to enlarge" class="imgResize"></span></p>
</li></ul>
</div>
</li></ul>
<p id="cce_02_0004__p156196428514">For details about how to use APIs, see <a href="https://docs.otc.t-systems.com/en-us/api/apiug/apig-en-api-180328001.html?tag=API Documents" target="_blank" rel="noopener noreferrer">API Usage Guidelines</a>.</p>
<p id="cce_02_0004__p1928010407415">CCE provides two methods to authenticate requests for calling an API: token and AK/SK. Select an authentication method based on actual requirements. If token-based authentication is used, you can call service APIs by using either of the following methods after obtaining a token:</p>
<ul id="cce_02_0004__ul4552184012514"><li id="cce_02_0004__li17245131773918">Method 1: Add <strong id="cce_02_0004__b16119186394">X-Auth-Token</strong> to the request header and set <strong id="cce_02_0004__b9161823912">X-Auth-Token: ${token}</strong> with the obtained IAM token.</li><li id="cce_02_0004__li1387183419395">Method 2: Add <strong id="cce_02_0004__b1057022318263">Authorization</strong> to the request header and set <strong id="cce_02_0004__b6248243183920">Authorization: Bearer ${token}</strong> with the obtained IAM token or token from Kubernetes service account.</li><li id="cce_02_0004__li89714112401">Method 3: Add <strong id="cce_02_0004__b43089717408">X-Remote-User</strong> to the request header and set <strong id="cce_02_0004__b5208739122619">X-Remote-User</strong>: <strong id="cce_02_0004__b17930741152615">user</strong> with a valid certificate.</li></ul>
<div class="note" id="cce_02_0004__note162803401947"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_02_0004__p107403334488">Method 3 requires that the CA root certificate must has been uploaded before you create a cluster on the CCE console.</p>
</div></div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>