forked from docs/doc-exports
Reviewed-by: Rumpler, Mihály <mihaly.rumpler@t-systems.com> Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com> Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
170 lines
14 KiB
HTML
170 lines
14 KiB
HTML
<a name="rms_06_0701"></a><a name="rms_06_0701"></a>
|
|
|
|
<h1 class="topictitle1">Overview</h1>
|
|
<div id="body0000001223178364"><p id="rms_06_0701__p16448143611539">ResourceQL provides SQL-like functions, allowing you to flexibly query your cloud resources.</p>
|
|
<pre class="screen" id="rms_06_0701__screen12313188135516">SELECT name, created, updated FROM resources WHERE region_id = 'regionid1'</pre>
|
|
<p id="rms_06_0701__p151331435174315">The statement is case insensitive. SELECT COUNT(*) and select CoUnT(*) are the same. Use single quotation marks to represent the literal of a string.</p>
|
|
<p id="rms_06_0701__p973216103571">The following are data types supported by ResourceQL. For the array type, [] is used to index a position, and the number starts from 1.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rms_06_0701__table1440616284583" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Supported data types</caption><thead align="left"><tr id="rms_06_0701__row164071128205810"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.3.1.1"><p id="rms_06_0701__p3407132885816">Type Name</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.3.1.2"><p id="rms_06_0701__p6407102810588">Type</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rms_06_0701__row1740718288583"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p7407128175811">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p13407228135811">Int/Integer</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row1407112855815"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p740752813581">Float</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p44071028155811">Float/Double</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row13407528125818"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p19407102805812">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p1840752865817">Boolean</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row204072285587"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p140742817582">Array</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p140742835815">Array</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row5407728175819"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p440718284585">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p1240762825819">String</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row1440772835816"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p14407162875812">Dictionary</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p2407628125815">Object</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row1680872120214"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.1 "><p id="rms_06_0701__p158096219213">Timestamp</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.3.1.2 "><p id="rms_06_0701__p198091021121">Date</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="rms_06_0701__p1636312196116">All your cloud resources are included in a table. The table name is fixed to <strong id="rms_06_0701__b163541124123511">resources</strong>. The resources under your aggregator account forms a table. The table name is fixed to <strong id="rms_06_0701__b123021533015">aggregator_resources</strong>. Each row in the table records a piece of data. The conventions of each column are as follows.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rms_06_0701__table1658091413276" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter descriptions in table <strong id="rms_06_0701__b16219020553510">resources</strong></caption><thead align="left"><tr id="rms_06_0701__row165811140279"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.7.2.4.1.1"><p id="rms_06_0701__p11581101413278">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.7.2.4.1.2"><p id="rms_06_0701__p15581191411271">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.7.2.4.1.3"><p id="rms_06_0701__p658117146275">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rms_06_0701__row9581114162713"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p1234102943120">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p27321505334">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p10375412133515">Specifies the resource ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row15581141482716"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p15341429113110">name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p97329500335">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p19375141215356">Specifies the resource name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row758113142273"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p2345291319">provider</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p2732550173319">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p12375612103510">Specifies the cloud service name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row15581121411271"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p0349291314">type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p167321450143318">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p113751412103511">Specifies the resource type.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row058101417279"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p034929103112">region_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p20732105015335">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p1337591233515">Specifies the region ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row458121492713"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p7348291317">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p1973211509331">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p137520127351">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row458141417278"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p634182914313">ep_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p0732350173310">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p837511219354">Specifies the enterprise project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row18981101173214"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p36581948113219">checksum</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p18732155033318">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p1937521213512">Specifies the resource checksum.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row130917123326"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p4658248133219">created</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p873235023317">Date</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p163752012143513">Specifies the time when the resource was created.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row18861912193217"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p11659184823214">updated</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p373235053310">Date</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p11375512183520">Specifies the time when the resource was updated.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row2275161313323"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p176594486321">provisioning_state</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p2073212508339">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p1637541210357">Specifies the result of an operation on resources.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row1832912141320"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p146591548153212">tag</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p187326505331">Array(Map<String,String>)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p537516126351">Specifies the resource tag.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rms_06_0701__row193041483219"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.1 "><p id="rms_06_0701__p1465934813214">properties</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.2 "><p id="rms_06_0701__p1573319506330">Map<String,Object></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.7.2.4.1.3 "><p id="rms_06_0701__p837515125358">Specifies the resource attribute details.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="rms_06_0701__p205894363119"><strong id="rms_06_0701__b10877162323020">aggregator_resources</strong> contains <strong id="rms_06_0701__b967685183010">domain_id</strong> that indicates the account ID. The type of a domain ID is a string.</p>
|
|
<p id="rms_06_0701__p512182815417"><strong id="rms_06_0701__b254942912371">provider</strong> and <strong id="rms_06_0701__b754911294379">type</strong> represent a unique resource. For different resources, <strong id="rms_06_0701__b10549162963720">properties</strong> varies. For example, for an ECS, the <strong id="rms_06_0701__b19120287527">provider</strong> and <strong id="rms_06_0701__b15291636145215">type</strong> are <strong id="rms_06_0701__b15573161211535">ecs</strong> and <strong id="rms_06_0701__b16773161515314">cloudservers</strong>, and the <strong id="rms_06_0701__b04822584017">properties</strong> contains <strong id="rms_06_0701__b1072771011113">flavor</strong>. For a VPC, the <strong id="rms_06_0701__b6741202613111">provider</strong> and <strong id="rms_06_0701__b874120266112">type</strong> are <strong id="rms_06_0701__b13115181122">vpc</strong> and <strong id="rms_06_0701__b388010315215">publicips</strong>, and the <strong id="rms_06_0701__b1451011511921">properties</strong> contains <strong id="rms_06_0701__b1365316114310">bandwidth</strong>.</p>
|
|
<p id="rms_06_0701__p22971929163915">You can obtain resource attributes that can be included in the <strong id="rms_06_0701__b1425519316229">properties</strong> element for each resource on Config console or by calling the related API. For more details, see <a href="rms_08_0100.html#rms_08_0100__section1077795954511">How Can I Obtain Resource Attributes Reported to Config?</a></p>
|
|
<p id="rms_06_0701__p612428245"><strong id="rms_06_0701__b38360138816">properties</strong> supports nested queries. The following shows an example of how to query the <strong id="rms_06_0701__b258173416123">addresses</strong> parameter under <strong id="rms_06_0701__b1819718215132">properties</strong> for the running ECS.</p>
|
|
<pre class="screen" id="rms_06_0701__screen124420471753">SELECT name, created, updated, properties.addresses FROM resources
|
|
WHERE provider = 'ecs' AND type = 'cloudservers' AND properties.status = 'ACTIVE'</pre>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rms_06_0700.html">ResourceQL Syntax</a></div>
|
|
</div>
|
|
</div>
|
|
|