forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
42 lines
3.6 KiB
HTML
42 lines
3.6 KiB
HTML
<a name="drs_api_0106"></a><a name="drs_api_0106"></a>
|
|
|
|
<h1 class="topictitle1">Obtaining a Project ID</h1>
|
|
<div id="body0000001073078471"><div class="section" id="drs_api_0106__en-us_topic_0172726780_section3682103592310"><h4 class="sectiontitle">Obtaining a Project ID from the Console</h4><p id="drs_api_0106__en-us_topic_0172726780_p319120186281">A project ID needs to be specified in the URLs of some APIs. Therefore, you need to obtain a project ID before calling such APIs. To do so, perform the following operations:</p>
|
|
<ol id="drs_api_0106__en-us_topic_0172726780_ol1449901513354"><li id="drs_api_0106__en-us_topic_0172726780_li17914130122814"><span>Sign up and log in to the management console.</span></li><li id="drs_api_0106__en-us_topic_0172726780_li11993234162815"><span>Click the username and choose <strong id="drs_api_0106__b14428155302515">My Credentials</strong> from the drop-down list.</span></li><li id="drs_api_0106__en-us_topic_0172726780_li27151325193517"><span>On the <strong id="drs_api_0106__b12805103682718">API Credentials</strong> page, view the project ID in the project list.</span><p><p id="drs_api_0106__en-us_topic_0172726780_p183567556271">If there are multiple projects in one region, expand <strong id="drs_api_0106__en-us_topic_0172726780_b851982115342">Region</strong> and view subproject IDs in the <strong id="drs_api_0106__en-us_topic_0172726780_b18520102113344">Project ID</strong> column.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="drs_api_0106__en-us_topic_0172726780_section11269315243"><h4 class="sectiontitle">Obtaining the Project ID by Calling an API</h4><p id="drs_api_0106__en-us_topic_0172726780_p1033710172412">You can also obtain the project ID by calling the API used to query project information based on the specified criteria.</p>
|
|
<p id="drs_api_0106__en-us_topic_0172726780_p1933716122415">The API used to obtain a project ID is <strong id="drs_api_0106__en-us_topic_0172726780_b12649275357">GET https://</strong><em id="drs_api_0106__en-us_topic_0172726780_i165119712359">{Endpoint}</em><strong id="drs_api_0106__en-us_topic_0172726780_b13652177153510">/v3/projects/</strong>, where <em id="drs_api_0106__en-us_topic_0172726780_i1765457103513">{Endpoint}</em> indicates the IAM endpoint. You can obtain the IAM endpoint from <a href="https://docs.otc.t-systems.com/endpoint/index.html" target="_blank" rel="noopener noreferrer">Regions and Endpoints</a>. For details about API authentication, see <a href="drs_01_0005.html">Authentication</a>.</p>
|
|
<p id="drs_api_0106__en-us_topic_0172726780_p1233731132413">The following is an example response. The value of <strong id="drs_api_0106__en-us_topic_0172726780_b14547259123514">id</strong> is the project ID.</p>
|
|
<pre class="screen" id="drs_api_0106__en-us_topic_0172726780_screen173375162419">{
|
|
"projects": [
|
|
{
|
|
"domain_id": "65382450e8f64ac0870cd180d14e684b",
|
|
"is_domain": false,
|
|
"parent_id": "65382450e8f64ac0870cd180d14e684b",
|
|
"name": "eu-de",
|
|
"description": "",
|
|
"links": {
|
|
"next": null,
|
|
"previous": null,
|
|
"self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99"
|
|
},
|
|
"id": "a4a5d4098fb4474fa22cd05f897d6b99",
|
|
"enabled": true
|
|
}
|
|
],
|
|
"links": {
|
|
"next": null,
|
|
"previous": null,
|
|
"self": "https://www.example.com/v3/projects"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="drs_03_0125.html">Appendix</a></div>
|
|
</div>
|
|
</div>
|
|
|