Files
doc-exports/docs/css/api-ref/GetRoutes.html
zhengxiu 8f6b8d3664 css api 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:21:12 +00:00

240 lines
11 KiB
HTML

<a name="GetRoutes"></a><a name="GetRoutes"></a>
<h1 class="topictitle1">Obtaining a Cluster Route</h1>
<div id="body1708331107508"><div class="section"><h4 class="sectiontitle">Function</h4><p>By default, a CSS Elasticsearch cluster cannot access a target service—such as a client program or a Lightweight Directory Access Protocol (LDAP) service—that is located in a different VPC. To enable this access, you need to configure cluster routes. This API is used to obtain cluster route information, including the route IP address and the total number of routes.</p>
</div>
<div class="section" id="GetRoutes__atuogenerate_1"><h4 class="sectiontitle">Calling Method</h4><p>For details, see <a href="css_03_0077.html">Calling APIs</a>.</p>
</div>
<div class="section" id="GetRoutes__atuogenerate_2"><h4 class="sectiontitle">URI</h4><p>GET /v1.0/{project_id}/clusters/{cluster_id}/route</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Project ID. For details about how to obtain the project ID and name, see <a href="css_03_0071.html">Obtaining the Project ID and Name</a>.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>Project ID of the account.</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>ID of the target cluster. For details about how to obtain the cluster ID, see <a href="css_03_0101.html">Obtaining the Cluster ID</a>.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>Cluster ID.</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Query Parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p>offset</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>The start value of the query. The default value is 1, indicating that the query starts from the first route.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>1-1000</p>
<p><strong>Default value</strong>:</p>
<p>1</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p>limit</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p><strong>Parameter description</strong>:</p>
<p>Number of routes to be queried. The default value is <strong>10</strong>, indicating that 10 routes are queried at a time.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Options</strong>:</p>
<p>1-1000</p>
<p><strong>Default value</strong>:</p>
<p>10</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Request Parameters</h4><p>None</p>
</div>
<div class="section"><h4 class="sectiontitle">Response Parameters</h4><p><strong>Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GetRoutes__response_GetRoutesResponse" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response body parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.3.2.4.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.3.2.4.1.2"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.3.2.4.1.3"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p>routeResps</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.2 "><p>Array of <a href="#GetRoutes__response_RouteRespsResource">RouteRespsResource</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p><strong>Definition</strong>:</p>
<p>Route IP address.</p>
<p><strong>Value range</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.1 "><p>totalSize</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.3.2.4.1.2 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.3.2.4.1.3 "><p><strong>Definition</strong>:</p>
<p>Total number of routes.</p>
<p><strong>Value range</strong>:</p>
<p>N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="GetRoutes__response_RouteRespsResource"></a><a name="response_RouteRespsResource"></a><table cellpadding="4" cellspacing="0" summary="" id="GetRoutes__response_RouteRespsResource" frame="border" border="1" rules="all"><caption><b>Table 4 </b>RouteRespsResource</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.4.2.4.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.5.4.2.4.1.2"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.4.2.4.1.3"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.4.2.4.1.1 "><p>ipAddress</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.4.2.4.1.3 "><p><strong>Definition</strong>:</p>
<p>IP address.</p>
<p><strong>Value range</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.4.2.4.1.1 "><p>ipNetMask</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.4.2.4.1.3 "><p><strong>Definition</strong>:</p>
<p>Subnet mask.</p>
<p><strong>Value range</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.4.2.4.1.1 "><p>updateAt</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.5.4.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.4.2.4.1.3 "><p><strong>Definition</strong>:</p>
<p>Route IP address update time.</p>
<p><strong>Value range</strong>:</p>
<p>N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Example Requests</h4><p>Obtain cluster routes.</p>
<pre class="screen">GET https://{Endpoint}/v1.0/{project_id}/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/route</pre>
</div>
<div class="section"><h4 class="sectiontitle">Example Responses</h4><p><strong>Status code: 200</strong></p>
<p>Request succeeded.</p>
<pre class="screen">{
"routeResps" : [ {
"ipAddress" : "1.2.3.65",
"ipNetMask" : "255.255.255.255",
"updateAt" : "2023-07-17T08:09:20"
}, {
"ipAddress" : "1.1.1.1",
"ipNetMask" : "255.255.255.255",
"updateAt" : "2023-07-17T08:08:50"
} ],
"totalSize" : 2
}</pre>
</div>
<div class="section"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GetRoutes__status_code" frame="border" border="1" rules="all"><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p>Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>Request succeeded.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>Invalid request.</p>
<p>Modify the request instead of retrying.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>409</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>The request cannot be processed due to a conflict.</p>
<p>This status code indicates that the resource that the client attempts to create already exits, or the requested update failed due to a conflict.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>412</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>The server does not meet one of the requirements that the requester puts on the request.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Error Codes</h4><p>See <a href="css_03_0076.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cluster_management.html">Cluster Management</a></div>
</div>
</div>