doc-exports/docs/iam/api-ref/iam_02_0030.html
Wei, Hongmin c7cf8ac24f IAM API 0711 Version
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2024-07-11 11:57:45 +00:00

243 lines
15 KiB
HTML

<a name="iam_02_0030"></a><a name="iam_02_0030"></a>
<h1 class="topictitle1">Querying the ACL for API Access</h1>
<div id="body1597737539340"><div class="section" id="iam_02_0030__section12579655162018"><h4 class="sectiontitle">Function</h4><p id="iam_02_0030__p267816554200">This API is used to query the ACL for API access.</p>
</div>
<div class="section" id="iam_02_0030__section5580115552014"><h4 class="sectiontitle">URI</h4><p id="iam_02_0030__p467835582019">GET /v3.0/OS-SECURITYPOLICY/domains/{domain_id}/api-acl-policy</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table165803559206" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="iam_02_0030__row4678955132020"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="iam_02_0030__p156786552201">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="10%" id="mcps1.3.2.3.2.5.1.2"><p id="iam_02_0030__p15678175572018">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="iam_02_0030__p1567835516205">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.3.2.5.1.4"><p id="iam_02_0030__p20678055102017">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row11678105515201"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="iam_02_0030__p12678355122020">domain_id</p>
</td>
<td class="cellrowborder" valign="top" width="10%" headers="mcps1.3.2.3.2.5.1.2 "><p id="iam_02_0030__p267816554206">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="iam_02_0030__p10678115552014">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.3.2.5.1.4 "><p id="iam_02_0030__p186789559202">Domain ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="iam_02_0030__section558455515209"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table175841552207" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters in the request header</caption><thead align="left"><tr id="iam_02_0030__row76781655142013"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="iam_02_0030__p76781055192020">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="10%" id="mcps1.3.3.2.2.5.1.2"><p id="iam_02_0030__p2067817552208">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="iam_02_0030__p9678205532018">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.2.5.1.4"><p id="iam_02_0030__p11678165514202">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row567825514208"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="iam_02_0030__p176788552203">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="10%" headers="mcps1.3.3.2.2.5.1.2 "><p id="iam_02_0030__p20678355172010">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="iam_02_0030__p0678115518209">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="iam_02_0030__p6678125517201">Token with <strong id="iam_02_0030__b15994155274717">Security Administrator</strong> permissions.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="iam_02_0030__section9587105510200"><h4 class="sectiontitle">Response Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table185881255182016" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters in the response body</caption><thead align="left"><tr id="iam_02_0030__row2678185517201"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.4.1.1"><p id="iam_02_0030__p1867865592010">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.4.1.2"><p id="iam_02_0030__p146789558208">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.2.2.4.1.3"><p id="iam_02_0030__p17678185518202">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row1067845572011"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.4.1.1 "><p id="iam_02_0030__p8678125572019"><a href="#iam_02_0030__table205901355132011">api_acl_policy</a></p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.4.1.2 "><p id="iam_02_0030__p26781555208">object</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.2.2.4.1.3 "><p id="iam_02_0030__p1967810556203">ACL for API access.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="iam_02_0030__table205901355132011"></a><a name="table205901355132011"></a><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table205901355132011" frame="border" border="1" rules="all"><caption><b>Table 4 </b>api_acl_policy</caption><thead align="left"><tr id="iam_02_0030__row1667805512203"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="iam_02_0030__p6678115532010">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="iam_02_0030__p0678955172018">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="iam_02_0030__p26785556201">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row1367865511204"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="iam_02_0030__p6678175532014"><a href="#iam_02_0030__table459414558202">allow_address_netmasks</a></p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="iam_02_0030__p4678205542011">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="iam_02_0030__p2067965518204">IPv4 CIDR blocks from which API access is allowed.</p>
</td>
</tr>
<tr id="iam_02_0030__row5679555202011"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="iam_02_0030__p15679125518204"><a href="#iam_02_0030__table659605519206">allow_ip_ranges</a></p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="iam_02_0030__p14880213133415">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="iam_02_0030__p15679185512018">IP address ranges from which API access is allowed.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="iam_02_0030__table459414558202"></a><a name="table459414558202"></a><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table459414558202" frame="border" border="1" rules="all"><caption><b>Table 5 </b>allow_address_netmasks</caption><thead align="left"><tr id="iam_02_0030__row767910558201"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.1"><p id="iam_02_0030__p1767945562012">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.4.2.4.1.2"><p id="iam_02_0030__p14679655192014">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.4.2.4.1.3"><p id="iam_02_0030__p1679185517202">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row176791155132019"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="iam_02_0030__p19679125517204">address_netmask</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="iam_02_0030__p1679195502011">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="iam_02_0030__p367985517204">IPv4 CIDR block, for example, <strong id="iam_02_0030__b857675942816">192.168.0.1/24</strong>.</p>
</td>
</tr>
<tr id="iam_02_0030__row196791555132020"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.1 "><p id="iam_02_0030__p367912551207">description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.4.2.4.1.2 "><p id="iam_02_0030__p2067912556209">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.4.2.4.1.3 "><p id="iam_02_0030__p106793559201">Description about the IPv4 CIDR block.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="iam_02_0030__table659605519206"></a><a name="table659605519206"></a><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table659605519206" frame="border" border="1" rules="all"><caption><b>Table 6 </b>allow_ip_ranges</caption><thead align="left"><tr id="iam_02_0030__row1667905519204"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.5.2.4.1.1"><p id="iam_02_0030__p2679145516201">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.5.2.4.1.2"><p id="iam_02_0030__p186793557209">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.5.2.4.1.3"><p id="iam_02_0030__p267912553208">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row467915522017"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.1 "><p id="iam_02_0030__p5679165582010">description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.2 "><p id="iam_02_0030__p7679145572013">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.5.2.4.1.3 "><p id="iam_02_0030__p146791455152017">Description about an IP address range.</p>
</td>
</tr>
<tr id="iam_02_0030__row767995514208"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.1 "><p id="iam_02_0030__p1679155592013">ip_range</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.5.2.4.1.2 "><p id="iam_02_0030__p14680355162011">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.5.2.4.1.3 "><p id="iam_02_0030__p5680755182015">IP address range, for example, <strong id="iam_02_0030__b1796441642919">0.0.0.0-255.255.255.255</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="iam_02_0030__section16599145512015"><h4 class="sectiontitle">Example Request</h4><pre class="screen" id="iam_02_0030__screen16801355172010">GET https://sample.domain.com/v3.0/OS-SECURITYPOLICY/domains/{domain_id}/api-acl-policy</pre>
</div>
<div class="section" id="iam_02_0030__section8600155516203"><h4 class="sectiontitle">Example Response</h4><p id="iam_02_0030__p768065592016"><strong id="iam_02_0030__b882632072913">Status code: 200</strong></p>
<p id="iam_02_0030__p9680205542010">The request is successful.</p>
<pre class="screen" id="iam_02_0030__screen268085562016">{
"api_acl_policy" : {
"allow_ip_ranges" : [ {
"ip_range" : "0.0.0.0-255.255.255.255",
"description" : ""
}, {
"ip_range" : "0.0.0.0-255.255.255.255",
"description" : ""
} ],
"allow_address_netmasks" : [ {
"address_netmask" : "192.168.0.1/24",
"description" : ""
}, {
"address_netmask" : "192.168.0.1/24",
"description" : ""
} ]
}
}</pre>
</div>
<p id="iam_02_0030__p11887632103415"><strong id="iam_02_0030__b62431222112920">Status code: 403</strong></p>
<p id="iam_02_0030__p10887163213349">Access denied.</p>
<ul id="iam_02_0030__ul78871032143411"><li id="iam_02_0030__li1588711321347">Example 1</li></ul>
<pre class="screen" id="iam_02_0030__screen2717103623410">{
"error_msg" : "You are not authorized to perform the requested action.",
"error_code" : "IAM.0002"
}</pre>
<ul id="iam_02_0030__ul8682137183412"><li id="iam_02_0030__li15682937123418">Example 2</li></ul>
<pre class="screen" id="iam_02_0030__screen1631210424344">{
"error_msg" : "Policy doesn't allow %(actions)s to be performed.",
"error_code" : "IAM.0003"
}</pre>
<p id="iam_02_0030__p14887183263417"><strong id="iam_02_0030__b395152522910">Status code: 404</strong></p>
<p id="iam_02_0030__p88872325348">The requested resource cannot be found.</p>
<pre class="screen" id="iam_02_0030__screen18887832163417">{
"error_msg" : "Could not find %(target)s: %(target_id)s.",
"error_code" : "IAM.0004"
}</pre>
<p id="iam_02_0030__p488717323348"><strong id="iam_02_0030__b1196562612293">Status code: 500</strong></p>
<p id="iam_02_0030__p178872326343">Internal server error.</p>
<pre class="screen" id="iam_02_0030__screen2887832103415">{
"error_msg" : "An unexpected error prevented the server from fulfilling your request.",
"error_code" : "IAM.0006"
}</pre>
<div class="section" id="iam_02_0030__section18605555152012"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="iam_02_0030__table16605155514206" frame="border" border="1" rules="all"><thead align="left"><tr id="iam_02_0030__row2068165514208"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.19.2.1.3.1.1"><p id="iam_02_0030__p368145592019">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.19.2.1.3.1.2"><p id="iam_02_0030__p86811955162010">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="iam_02_0030__row1368195592014"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.19.2.1.3.1.1 "><p id="iam_02_0030__p13681955112015">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.19.2.1.3.1.2 "><p id="iam_02_0030__p1468114555208">The request is successful.</p>
</td>
</tr>
<tr id="iam_02_0030__row146811355102017"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.19.2.1.3.1.1 "><p id="iam_02_0030__p15681135582014">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.19.2.1.3.1.2 "><p id="iam_02_0030__p1681185519205">Authentication failed.</p>
</td>
</tr>
<tr id="iam_02_0030__row7681175519207"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.19.2.1.3.1.1 "><p id="iam_02_0030__p176811755112010">403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.19.2.1.3.1.2 "><p id="iam_02_0030__p16681855172013">Access denied.</p>
</td>
</tr>
<tr id="iam_02_0030__row9681155513206"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.19.2.1.3.1.1 "><p id="iam_02_0030__p1568114555208">404</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.19.2.1.3.1.2 "><p id="iam_02_0030__p6681125513201">The requested resource cannot be found.</p>
</td>
</tr>
<tr id="iam_02_0030__row2681205592013"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.19.2.1.3.1.1 "><p id="iam_02_0030__p4681165512208">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.19.2.1.3.1.2 "><p id="iam_02_0030__p6681175512011">Internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="iam_02_0020.html">Security Settings</a></div>
</div>
</div>