doc-exports/docs/cce/api-ref/cce_02_0239.html
Dong, Qiu Jian 3bfd56205d CCE API update -20240401 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-04-16 09:26:07 +00:00

227 lines
16 KiB
HTML

<a name="cce_02_0239"></a><a name="cce_02_0239"></a>
<h1 class="topictitle1">Listing Clusters in a Specified Project</h1>
<div id="body1521448221833"><div class="section" id="cce_02_0239__section1686113493165"><h4 class="sectiontitle">Function</h4><p id="cce_02_0239__p209621357141610">This API is used to obtain details about all clusters in a specified project.</p>
</div>
<div class="section" id="cce_02_0239__section8403243161416"><h4 class="sectiontitle">URI</h4><p id="cce_02_0239__p23575517439">GET /api/v3/projects/{project_id}/clusters</p>
<p id="cce_02_0239__p82941159104819"><a href="#cce_02_0239__table2027961241820">Table 1</a> describes the parameters of this API.</p>
<div class="tablenoborder"><a name="cce_02_0239__table2027961241820"></a><a name="table2027961241820"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0239__table2027961241820" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="cce_02_0239__row122809120186"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.4.2.4.1.1"><p id="cce_02_0239__p91421758131813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.810000000000002%" id="mcps1.3.2.4.2.4.1.2"><p id="cce_02_0239__p101421758131816">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="62.19%" id="mcps1.3.2.4.2.4.1.3"><p id="cce_02_0239__p19143115818187">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0239__row32801312121810"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.4.2.4.1.1 "><p id="cce_02_0239__p1714415589184">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="17.810000000000002%" headers="mcps1.3.2.4.2.4.1.2 "><p id="cce_02_0239__p814518580186">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="62.19%" headers="mcps1.3.2.4.2.4.1.3 "><p id="cce_02_0239__p5145175891811">Project ID. For details on how to obtain the project ID, see <a href="cce_02_0271.html">How to Obtain Parameters in the API URI</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="cce_02_0239__section947084713911"><h4 class="sectiontitle">Request</h4><p id="cce_02_0239__p10314164115415"><strong id="cce_02_0239__b162259487412">Request parameters</strong>:</p>
<p id="cce_02_0239__p7105145203655"><a href="#cce_02_0239__table538113720514">Table 2</a> lists the request parameters.</p>
<div class="tablenoborder"><a name="cce_02_0239__table538113720514"></a><a name="table538113720514"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0239__table538113720514" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the request header</caption><thead align="left"><tr id="cce_02_0239__en-us_topic_0199164459_row55001954122614"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.4.1.1"><p id="cce_02_0239__en-us_topic_0199164459_p115009545264">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19%" id="mcps1.3.3.4.2.4.1.2"><p id="cce_02_0239__en-us_topic_0199164459_p175001547265">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="61%" id="mcps1.3.3.4.2.4.1.3"><p id="cce_02_0239__en-us_topic_0199164459_p16500154162611">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0239__en-us_topic_0199164459_row199801811203412"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.4.1.1 "><p id="cce_02_0239__en-us_topic_0199164459_p69808112344">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="19%" headers="mcps1.3.3.4.2.4.1.2 "><p id="cce_02_0239__en-us_topic_0199164459_p3980111103414">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="61%" headers="mcps1.3.3.4.2.4.1.3 "><p id="cce_02_0239__en-us_topic_0199164459_p169801011203416">Message body type (format). Possible values:</p>
<ul id="cce_02_0239__en-us_topic_0199164459_ul7385444163617"><li id="cce_02_0239__en-us_topic_0199164459_li18385114483612">application/json;charset=utf-8</li><li id="cce_02_0239__en-us_topic_0199164459_li3516132853714">application/json</li></ul>
</td>
</tr>
<tr id="cce_02_0239__en-us_topic_0199164459_row3500125412260"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.4.1.1 "><p id="cce_02_0239__en-us_topic_0199164459_p105001654202618">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="19%" headers="mcps1.3.3.4.2.4.1.2 "><p id="cce_02_0239__en-us_topic_0199164459_p20500954182618">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="61%" headers="mcps1.3.3.4.2.4.1.3 "><p id="cce_02_0239__en-us_topic_0199164459_p18824197845">Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details on how to obtain a user token, see <a href="cce_02_0004.html">API Usage Guidelines</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_02_0239__p1611232212217"><strong id="cce_02_0239__b18637103252113">Example request</strong>:</p>
<p id="cce_02_0239__p10992402120">N/A</p>
</div>
<div class="section" id="cce_02_0239__section61819725020"><h4 class="sectiontitle">Response</h4><p id="cce_02_0239__en-us_topic_0079614900_p2018733"><strong id="cce_02_0239__en-us_topic_0079614900_b18168603">Response parameters</strong>:</p>
<p id="cce_02_0239__p16966318249"><a href="#cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_ref458774242">Table 3</a> describes the response parameters.</p>
<div class="tablenoborder"><a name="cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_ref458774242"></a><a name="en-us_topic_0079616779_en-us_topic_0079614912_ref458774242"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_ref458774242" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_row38450714"><th align="left" class="cellrowborder" valign="top" width="20.79%" id="mcps1.3.4.4.2.4.1.1"><p id="cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_p27500114">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="31.540000000000003%" id="mcps1.3.4.4.2.4.1.2"><p id="cce_02_0239__p1654581422214">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.67%" id="mcps1.3.4.4.2.4.1.3"><p id="cce_02_0239__p125451914132219">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_row48220637"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.3.4.4.2.4.1.1 "><p id="cce_02_0239__p44731858185518">kind</p>
</td>
<td class="cellrowborder" valign="top" width="31.540000000000003%" headers="mcps1.3.4.4.2.4.1.2 "><p id="cce_02_0239__p57145269553">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.67%" headers="mcps1.3.4.4.2.4.1.3 "><p id="cce_02_0239__p12712326175517">API type. The value is fixed at <strong id="cce_02_0239__b465594618519">Cluster</strong> and cannot be changed.</p>
</td>
</tr>
<tr id="cce_02_0239__row1698782994313"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.3.4.4.2.4.1.1 "><p id="cce_02_0239__p144741580551">apiVersion</p>
</td>
<td class="cellrowborder" valign="top" width="31.540000000000003%" headers="mcps1.3.4.4.2.4.1.2 "><p id="cce_02_0239__p6707526185513">String</p>
</td>
<td class="cellrowborder" valign="top" width="47.67%" headers="mcps1.3.4.4.2.4.1.3 "><p id="cce_02_0239__p1770492695518">API version. The value is fixed at <strong id="cce_02_0239__b1230117563513">v3</strong> and cannot be changed.</p>
</td>
</tr>
<tr id="cce_02_0239__en-us_topic_0079616779_en-us_topic_0079614912_row28135397"><td class="cellrowborder" valign="top" width="20.79%" headers="mcps1.3.4.4.2.4.1.1 "><p id="cce_02_0239__p92203252379">items</p>
</td>
<td class="cellrowborder" valign="top" width="31.540000000000003%" headers="mcps1.3.4.4.2.4.1.2 "><p id="cce_02_0239__p121914251378"><a href="#cce_02_0239__table34052983203655">items</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="47.67%" headers="mcps1.3.4.4.2.4.1.3 "><p id="cce_02_0239__p2955204118263">A list of details for all clusters in the current project. You can filter clusters by <strong id="cce_02_0239__b396819375714">items.metadata.name</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="cce_02_0239__table34052983203655"></a><a name="table34052983203655"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0239__table34052983203655" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Data structure of the <strong id="cce_02_0239__b4261192213294">items</strong> field</caption><thead align="left"><tr id="cce_02_0239__row73461713174118"><th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.4.5.2.4.1.1"><p id="cce_02_0239__p183483137415">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="32%" id="mcps1.3.4.5.2.4.1.2"><p id="cce_02_0239__p935016137414">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47%" id="mcps1.3.4.5.2.4.1.3"><p id="cce_02_0239__p6353181334117">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0239__row83577139411"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.5.2.4.1.1 "><p id="cce_02_0239__p1236111131411">kind</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.5.2.4.1.2 "><p id="cce_02_0239__p1536211364111">String</p>
</td>
<td class="cellrowborder" valign="top" width="47%" headers="mcps1.3.4.5.2.4.1.3 "><p id="cce_02_0239__p83669139412">API type. The value is fixed at <strong id="cce_02_0239__b195770401172">Cluster</strong> and cannot be changed.</p>
</td>
</tr>
<tr id="cce_02_0239__row2367713184120"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.5.2.4.1.1 "><p id="cce_02_0239__p12369151310411">apiVersion</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.5.2.4.1.2 "><p id="cce_02_0239__p93719131417">String</p>
</td>
<td class="cellrowborder" valign="top" width="47%" headers="mcps1.3.4.5.2.4.1.3 "><p id="cce_02_0239__p19374121364119">API version. The value is fixed at <strong id="cce_02_0239__b058785212714">v3</strong> and cannot be changed.</p>
</td>
</tr>
<tr id="cce_02_0239__row13375413164113"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.5.2.4.1.1 "><p id="cce_02_0239__p73771813134111">metadata</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.5.2.4.1.2 "><p id="cce_02_0239__p2085818323259"><a href="cce_02_0236.html#cce_02_0236__table669019286188">metadata</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="47%" headers="mcps1.3.4.5.2.4.1.3 "><p id="cce_02_0239__p8382151374115">Cluster metadata, which is a collection of attributes.</p>
</td>
</tr>
<tr id="cce_02_0239__row5383813194112"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.5.2.4.1.1 "><p id="cce_02_0239__p1038501314417">spec</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.5.2.4.1.2 "><p id="cce_02_0239__p28797454259"><a href="cce_02_0236.html#cce_02_0236__table195921039143517">spec</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="47%" headers="mcps1.3.4.5.2.4.1.3 "><p id="cce_02_0239__p19125441228">Detailed description of the cluster targeted by this API. CCE creates or updates objects by defining or updating its spec.</p>
</td>
</tr>
<tr id="cce_02_0239__row2039216132419"><td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.4.5.2.4.1.1 "><p id="cce_02_0239__p203945139415">status</p>
</td>
<td class="cellrowborder" valign="top" width="32%" headers="mcps1.3.4.5.2.4.1.2 "><p id="cce_02_0239__p4469647122516"><a href="cce_02_0238.html#cce_02_0238__table6749834132215">status</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="47%" headers="mcps1.3.4.5.2.4.1.3 "><p id="cce_02_0239__p339891394117">Cluster status and jobID of the job that lists clusters in a specified project.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_02_0239__en-us_topic_0079614900_p24465425"><strong id="cce_02_0239__b580255393014">Response example</strong>:</p>
<pre class="screen" id="cce_02_0239__screen74153913253">{
"kind": "Cluster",
"apiVersion": "v3",
"items": [
{
"kind": "Cluster",
"apiVersion": "v3",
"metadata": {
"name": "mycluster",
"uid": "4d1ecb2c-229a-11e8-9c75-0255ac100ceb",
"creationTimestamp": "2020-02-02 03:48:58.968214406 +0000 UTC",
"updateTimestamp": "2020-02-02 04:05:29.386391813 +0000 UTC"
},
"spec": {
"type": "VirtualMachine",
"flavor": "cce.s1.small",
"version": "v1.17.9-r0",
"description": "awesome cluster",
"ipv6enable": false,
"supportIstio": true,
"hostNetwork": {
"vpc": "f0c12911-4fdb-4284-9230-7ffb0860826a",
"subnet": "ac274229-fd2e-4695-9f01-a0c1372b8006",
"SecurityGroup": "5da0b181-e0a2-4981-87ac-1681545cd666"
},
"containerNetwork": {
"mode": "overlay_l2",
"cidr": "172.16.0.0/16"
},
"eniNetwork": {},
"authentication": {
"mode": "rbac",
"authenticatingProxy": {}
},
"billingMode": 0,
"extendParam": {
"alpha.cce/fixPoolMask": "",
"kubernetes.io/cpuManagerPolicy": "",
"patchVersion": "",
"upgradefrom": ""
},
"kubernetesSvcIpRange": "10.247.0.0/16",
"kubeProxyMode": "iptables"
},
"status": {
"phase": "Available",
"endpoints": [
{
"Internal": "https://192.168.0.61:5443",
},
{
"External": "https://10.185.69.54:5443",
},
{
"external_otc": "https://a140174a-2f3e-11e9-9f91-0255ac101405.cce.eu-de.otc.t-systems.com", }
]
}
}</pre>
</div>
<div class="section" id="cce_02_0239__s50f1049a6a4d404c895cf636eb8f3bf1"><h4 class="sectiontitle">Status Code</h4><p id="cce_02_0239__en-us_topic_0079614900_p21869221"><a href="#cce_02_0239__en-us_topic_0079614900_table46761928">Table 5</a> describes the status code of this API.</p>
<div class="tablenoborder"><a name="cce_02_0239__en-us_topic_0079614900_table46761928"></a><a name="en-us_topic_0079614900_table46761928"></a><table cellpadding="4" cellspacing="0" summary="" id="cce_02_0239__en-us_topic_0079614900_table46761928" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Status code</caption><thead align="left"><tr id="cce_02_0239__en-us_topic_0079614900_row33254664"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.2.3.1.1"><p id="cce_02_0239__p55616028205955">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.2.3.1.2"><p id="cce_02_0239__p8604418205955">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="cce_02_0239__en-us_topic_0079614900_row41084259"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.3.1.1 "><p id="cce_02_0239__en-us_topic_0079614900_p39490674">200</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.3.1.2 "><p id="cce_02_0239__en-us_topic_0079614900_p44628050">Information about clusters in the specified project is successfully obtained.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="cce_02_0239__p347213715512">For details about error status codes, see <a href="cce_02_0084.html">Status Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_02_0092.html">Cluster Management</a></div>
</div>
</div>