forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Zheng, Xiu <zhengxiu@huawei.com> Co-committed-by: Zheng, Xiu <zhengxiu@huawei.com>
56 lines
5.7 KiB
HTML
56 lines
5.7 KiB
HTML
<a name="css_03_0062"></a><a name="css_03_0062"></a>
|
|
|
|
<h1 class="topictitle1">Getting Started</h1>
|
|
<div id="body8662426"><p id="css_03_0062__en-us_topic_0171174235_p51148444524">This section describes how to create a CSS cluster by using APIs. <a href="#css_03_0062__en-us_topic_0171174235_fig4812113917173">Figure 1</a> illustrates the API calling process.</p>
|
|
<div class="fignone" id="css_03_0062__en-us_topic_0171174235_fig4812113917173"><a name="css_03_0062__en-us_topic_0171174235_fig4812113917173"></a><a name="en-us_topic_0171174235_fig4812113917173"></a><span class="figcap"><b>Figure 1 </b>API calling process</span><br><span><img class="vsd" id="css_03_0062__image68441061565" src="en-us_image_0000001554910161.png"></span></div>
|
|
<div class="note" id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_note78851219195410"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_p13885419115419">The token obtained on IAM is valid for only 24 hours. If you want to use one token for authentication, you can cache it to avoid frequent calling.</p>
|
|
</div></div>
|
|
<div class="section" id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_section101152312311"><h4 class="sectiontitle">Involved APIs</h4><p id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_p208391848152419">If you use a token for authentication, you must obtain the token and add <strong id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_b93839580536">X-Auth-Token</strong> to the request header of the API when making an API call.</p>
|
|
<ul id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_ul18839104814240"><li id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_li48397486241">API for obtaining tokens from IAM</li><li id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_li1583954822419">API for creating CSS clusters</li></ul>
|
|
</div>
|
|
<div class="section" id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_section84735913247"><h4 class="sectiontitle">Procedure</h4><ol id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_ol17437102653012"><li id="css_03_0062__en-us_topic_0171174235_li1265543762911"><a name="css_03_0062__en-us_topic_0171174235_li1265543762911"></a><a name="en-us_topic_0171174235_li1265543762911"></a>Obtain the token. Send <strong id="css_03_0062__b245372905916">POST https://</strong><strong id="css_03_0062__b73441112826">IAM</strong><strong id="css_03_0062__b545314299599"><em id="css_03_0062__i1334010121129"> endpoint</em></strong><strong id="css_03_0062__b245442935917">/v3/auth/tokens</strong>.<p id="css_03_0062__p175004152139">Obtain the token by following instructions in <a href="css_03_0139.html">Authentication</a>.</p>
|
|
<p id="css_03_0062__p67561824152">The value of <span class="parmname" id="css_03_0062__en-us_topic_0000001134543542_en-us_topic_0000001096804707_en-us_topic_0000001127381857_en-us_topic_0000001096804707_en-us_topic_0000001096752971_parmname33391418185012"><b>X-Subject-Token</b></span> in the response header is the user token.</p>
|
|
</li><li id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_li207811546133015">Add <strong id="css_03_0062__b982017561818">Content-type</strong> and <strong id="css_03_0062__b41544017912">X-Auth-Token</strong> to the request header.<ul id="css_03_0062__ul20175151465914"><li id="css_03_0062__en-us_topic_0168405763_li972916419595"><strong id="css_03_0062__b11379203722218">Content-Type</strong>: specifies the request body type or format. Its default value is <span class="parmvalue" id="css_03_0062__parmvalue11380837142210"><b>application/json</b></span>.</li><li id="css_03_0062__en-us_topic_0168405763_li1642421012595"><strong id="css_03_0062__b3399819694">X-Auth-Token</strong>: Enter the user token obtained in <a href="#css_03_0062__en-us_topic_0171174235_li1265543762911">1</a>.</li></ul>
|
|
</li><li id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_li17564135310303">Send a cluster creation request and specify the following parameters in the request body:<pre class="screen" id="css_03_0062__en-us_topic_0171174235_en-us_topic_0111418639_screen336756143714">POST /v1.0/6204a5bd270343b5885144cf9c8c158d/clusters
|
|
{
|
|
"cluster": {
|
|
"name": "ES-Test",
|
|
"backupStrategy": {
|
|
"period": "16:00 GMT+02:00",
|
|
"prefix": "snapshot",
|
|
"keepday": 7
|
|
},
|
|
"instanceNum": 3,
|
|
"instance": {
|
|
"flavorRef": "css.large.8",
|
|
"volume": {
|
|
"volume_type": "COMMON",
|
|
"size": 100
|
|
},
|
|
"nics": {
|
|
"vpcId": "fccd753c-91c3-40e2-852f-5ddf76d1a1b2",
|
|
"netId": "af1c65ae-c494-4e24-acd8-81d6b355c9f1",
|
|
"securityGroupId": "7e3fed21-1a44-4101-ab29-34e57124f614"
|
|
}
|
|
},
|
|
"httpsEnable": "false",
|
|
"diskEncryption" : {
|
|
"systemEncrypted" : "1",
|
|
"systemCmkid" : "42546bb1-8025-4ad1-868f-600729c341ae"
|
|
}
|
|
}
|
|
}</pre>
|
|
<div class="p" id="css_03_0062__p1480001531319">View the response message. The following is an example response:<pre class="screen" id="css_03_0062__en-us_topic_0171174235_screen4345181711110">{
|
|
"cluster": {
|
|
"id": "ef683016-871e-48bc-bf93-74a29d60d214",
|
|
"name": "ES-Test"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<p id="css_03_0062__p7110922185113">If the request is successful, 200 OK is returned.</p>
|
|
<p id="css_03_0062__en-us_topic_0171174235_p250142016315">If the request fails, an error code and error information are returned. For details, see section <a href="css_03_0075.html">Status Code</a>.</p>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
|