forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
253 lines
26 KiB
HTML
253 lines
26 KiB
HTML
<a name="EN-US_TOPIC_0000001231272819"></a><a name="EN-US_TOPIC_0000001231272819"></a>
|
||
|
||
<h1 class="topictitle1">Getting Started</h1>
|
||
<div id="body8662426"><p id="EN-US_TOPIC_0000001231272819__en-us_topic_0091558317_p262185013913">This section describes how to use GaussDB(DWS) APIs to manage clusters. The procedure of the management clusters is as follows:</p>
|
||
<ol id="EN-US_TOPIC_0000001231272819__ob9af59860fe04936981f0cd298583861"><li id="EN-US_TOPIC_0000001231272819__l7a49b93070f94e8eab9bbf3b1ffb0452">Call the API in <a href="dws_02_0064.html">Authentication</a> to obtain the user token, which will be put into the request header for authentication in a subsequent request.</li><li id="EN-US_TOPIC_0000001231272819__li89181143118">Call the API in <a href="dws_02_0022.html">Querying the Supported Node Types</a> to obtain the supported node types.</li><li id="EN-US_TOPIC_0000001231272819__li3331350153117">Call the API in <a href="dws_02_0020.html">Creating a Cluster</a> to create a cluster.</li><li id="EN-US_TOPIC_0000001231272819__li6205434174413">Call the API in <a href="dws_02_0018.html">Querying the Cluster List</a> to obtain the cluster information.</li><li id="EN-US_TOPIC_0000001231272819__li109471837456">Call the API in <a href="dws_02_0019.html">Querying Cluster Details</a> to view cluster details.</li><li id="EN-US_TOPIC_0000001231272819__li73071427174517">Call the API in <a href="dws_02_0026.html">Creating a Snapshot</a> to create a snapshot.</li><li id="EN-US_TOPIC_0000001231272819__li1712365114516">Call the API in <a href="dws_02_0024.html">Querying the Snapshot List</a> to check whether the snapshot is successfully created.</li><li id="EN-US_TOPIC_0000001231272819__li145791148104615">Call the API in <a href="dws_02_0032.html">Restoring a Cluster</a> to restore a cluster using its snapshot.</li><li id="EN-US_TOPIC_0000001231272819__li10679111564711">Call the API in <a href="dws_02_0027.html">Deleting a Manual Snapshot</a> to delete an unwanted snapshot.</li><li id="EN-US_TOPIC_0000001231272819__li14970329134611">Call the API in <a href="dws_02_0021.html">Deleting a Cluster</a> to delete a finished or unwanted cluster.</li></ol>
|
||
<div class="section" id="EN-US_TOPIC_0000001231272819__s18b770fcb98c4842a37db54d44696086"><h4 class="sectiontitle">Prerequisites</h4><ul id="EN-US_TOPIC_0000001231272819__u46ba12c94ce248a4929a48e348243e24"><li id="EN-US_TOPIC_0000001231272819__lacb38eae9bfa4076a9fd2fb037a6e2c5">You have created a VPC, subnet, and security group and obtained their IDs. For details, see <a href="dws_02_0040.html">Creating a VPC</a>.</li><li id="EN-US_TOPIC_0000001231272819__li19941325195211">You have obtained the endpoints of IAM and GaussDB(DWS). For details, see "Regions and Endpoints".</li><li id="EN-US_TOPIC_0000001231272819__li1343795316955">You have obtained the project ID. For details, see <a href="dws_02_0011.html">Obtaining a Project ID</a>.</li></ul>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001231272819__sbee2db72d04f4871b74e0c859bd458f2"><h4 class="sectiontitle">Managing a Cluster</h4><p id="EN-US_TOPIC_0000001231272819__a430d4917563941c3ad4711ecdf98f9dc">The following values are examples (replace them based on the actual situation).</p>
|
||
<ul id="EN-US_TOPIC_0000001231272819__ufa8e1e6516fe44caacbd4eee37b9e220"><li id="EN-US_TOPIC_0000001231272819__lc1f4844260224b948b31454ae5a767be">IAM endpoint: <strong id="EN-US_TOPIC_0000001231272819__b55028566292223">iam_endpoint</strong></li><li id="EN-US_TOPIC_0000001231272819__li57730294152923">GaussDB(DWS) endpoint: <strong id="EN-US_TOPIC_0000001231272819__b17172115318189">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b55992094152935">_endpoint</strong></li><li id="EN-US_TOPIC_0000001231272819__l09de2081aa8f488487892ede3519afb6">VPC ID: <strong id="EN-US_TOPIC_0000001231272819__en-us_topic_0091558317_b5214874917">219ab8a0-1272-4049-a383-8ad0b770fa1</strong><strong id="EN-US_TOPIC_0000001231272819__en-us_topic_0091558317_b11223814912">1</strong></li><li id="EN-US_TOPIC_0000001231272819__en-us_topic_0091558317_li69201435259">Subnet ID: <strong id="EN-US_TOPIC_0000001231272819__aa67ed392621d466082a2d7f8b2c17222">d23ef2e9-8b90-49b3-bc4a-fd7d6bea6bec</strong></li><li id="EN-US_TOPIC_0000001231272819__li66876397152333">Security group ID: <strong id="EN-US_TOPIC_0000001231272819__b84235270692349">12e3c23a-8710-4b75-95e4-5c8d7f68ef3c</strong></li><li id="EN-US_TOPIC_0000001231272819__li13739115161059">Project ID: <strong id="EN-US_TOPIC_0000001231272819__b9795145519312">9bc552e6-19af-4326-800d-281a92984636</strong></li></ul>
|
||
<p id="EN-US_TOPIC_0000001231272819__a03911300f7234185a3c778fdd34f3766">Perform the following operations to manage the cluster.</p>
|
||
<ol id="EN-US_TOPIC_0000001231272819__ol245789165115"><li id="EN-US_TOPIC_0000001231272819__li114574913519"><span>Before calling other APIs, call the API in <a href="dws_02_0064.html">Authentication</a> to obtain the token and set it as an environment variable.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen164579965114">curl -H "Content-type:application/json" https://{<strong id="EN-US_TOPIC_0000001231272819__b1445716905113">iam_endpoint</strong>}/v3/auth/tokens -X POST -d '{
|
||
"auth": {
|
||
"identity": {
|
||
"methods": [
|
||
"password"
|
||
],
|
||
"password": {
|
||
"user": {
|
||
"name": "<strong id="EN-US_TOPIC_0000001231272819__b1545710913514">testname</strong>",
|
||
"domain": {
|
||
"name": "<strong id="EN-US_TOPIC_0000001231272819__b13457129135115">testname</strong>"
|
||
},
|
||
"password": "<strong id="EN-US_TOPIC_0000001231272819__b24571096511">Passw0rd</strong>"
|
||
}
|
||
}
|
||
},
|
||
"scope": {
|
||
"project": {
|
||
"name": "eu-de"
|
||
}
|
||
}
|
||
}
|
||
}' -v -k</pre>
|
||
<ol type="a" id="EN-US_TOPIC_0000001231272819__ol34383117521"><li id="EN-US_TOPIC_0000001231272819__li13437511105210">Obtain the value of <span class="parmname" id="EN-US_TOPIC_0000001231272819__parmname174912215892721"><b>X-Subject-Token</b></span> from the response header as follows. <span class="parmname" id="EN-US_TOPIC_0000001231272819__parmname142166443692813"><b>X-Subject-Token</b></span> indicates the token.<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen1043711112521">X-Subject-Token:MIidkgYJKoZIhvcNAQcCoIidgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...</pre>
|
||
</li><li id="EN-US_TOPIC_0000001231272819__li54381311125210">Run the following command to set the token as an environment variable:<p id="EN-US_TOPIC_0000001231272819__p2878728195213"><a name="EN-US_TOPIC_0000001231272819__li54381311125210"></a><a name="li54381311125210"></a><b><span class="cmdname" id="EN-US_TOPIC_0000001231272819__cmdname16438011105216">export Token={X-Subject-Token}</span></b></p>
|
||
<div class="p" id="EN-US_TOPIC_0000001231272819__p917965211527"><strong id="EN-US_TOPIC_0000001231272819__b84235270692919">X-Subject-Token</strong> is the token obtained in the preceding step.<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen7438131110526">export Token<strong id="EN-US_TOPIC_0000001231272819__b34381411185213">=</strong>MIidkgYJKoZIhvcNAQcCoIidgzCCA38CAQExDTALBglghkgBZQMEAgEwgXXXXX...</pre>
|
||
</div>
|
||
</li></ol>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li260247205117"><span>Call the API in <a href="dws_02_0022.html">Querying the Supported Node Types</a> to obtain the supported node types.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen559737175118">curl -X GET -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" https://{dws_endpoint}/v1.0/9bc552e6-19af-4326-800d-281a92984636/node_types -v -k</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p105982710517">The request response is as follows:</p>
|
||
<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen12601117115119">status CODE 200
|
||
{
|
||
"node_types": [
|
||
{
|
||
"spec_name": "dws.d1.xlarge",
|
||
"id": "ebe532d6-665f-40e6-a4d4-3c51545b6a67",
|
||
"detail": [
|
||
{
|
||
"type": "vCPU",
|
||
"value": "4"
|
||
},
|
||
{
|
||
"value": "1675",
|
||
"type": "LOCAL_DISK",
|
||
"unit": "GB"
|
||
},
|
||
{
|
||
"type": "mem",
|
||
"value": "32",
|
||
"unit": "GB"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"spec_name": "dws.m1.xlarge.ultrahigh",
|
||
"id": "ebe532d6-665f-40e6-a4d4-3c51545b4f71",
|
||
"detail": [
|
||
{
|
||
"type": "vCPU",
|
||
"value": "4"
|
||
},
|
||
{
|
||
"value": "512",
|
||
"type": "SSD",
|
||
"unit": "GB"
|
||
},
|
||
{
|
||
"type": "mem",
|
||
"value": "32",
|
||
"unit": "GB"
|
||
}
|
||
]
|
||
}
|
||
]
|
||
}</pre>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li18518655135315"><span>Call the API in <a href="dws_02_0020.html">Creating a Cluster</a> to create a cluster.</span><p><p id="EN-US_TOPIC_0000001231272819__p17217143318397">The examples for configuring the cluster are as follows:</p>
|
||
<ul id="EN-US_TOPIC_0000001231272819__ul1446125034614"><li id="EN-US_TOPIC_0000001231272819__li1445145074614">Cluster name: <strong id="EN-US_TOPIC_0000001231272819__b84235270693830">dws-demo</strong></li><li id="EN-US_TOPIC_0000001231272819__li1445115012468">Administrator username: <strong id="EN-US_TOPIC_0000001231272819__b84235270693854">dbadmin</strong></li><li id="EN-US_TOPIC_0000001231272819__li1745135018467">Administrator password: <strong id="EN-US_TOPIC_0000001231272819__b84235270693910">Dws2017demo!</strong></li><li id="EN-US_TOPIC_0000001231272819__li445105016469">Port: <strong id="EN-US_TOPIC_0000001231272819__b84235270693927">8000</strong></li><li id="EN-US_TOPIC_0000001231272819__li945105064619">Node type: <strong id="EN-US_TOPIC_0000001231272819__b165926611276">dws.d1.xlarge</strong><strong id="EN-US_TOPIC_0000001231272819__b12592146112716"></strong></li><li id="EN-US_TOPIC_0000001231272819__li104515074619">Number of nodes: <strong id="EN-US_TOPIC_0000001231272819__b84235270693954">3</strong></li><li id="EN-US_TOPIC_0000001231272819__li1046145017462">Elastic IP (EIP): <strong id="EN-US_TOPIC_0000001231272819__b8423527069409">auto_assign</strong></li></ul>
|
||
<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen17461450174616">curl -X POST -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" -d '{
|
||
"node_type": "dws.d1.xlarge",
|
||
"number_of_node": 3,
|
||
"subnet_id": "<strong id="EN-US_TOPIC_0000001231272819__b1645350194612">d23ef2e9-8b90-49b3-bc4a-fd7d6bea6bec</strong>",
|
||
"security_group_id": "<strong id="EN-US_TOPIC_0000001231272819__b3815151205912">12e3c23a-8710-4b75-95e4-5c8d7f68ef3c</strong>",
|
||
"vpc_id": "<strong id="EN-US_TOPIC_0000001231272819__b164511502465">219ab8a0-1272-4049-a383-8ad0b770fa11</strong>",
|
||
"port": 8000,
|
||
"name": "dws-demo",
|
||
"user_name": "dbadmin",
|
||
"user_pwd": "Dws2017demo!",
|
||
"public_ip": {
|
||
"public_bind_type": "auto_assign"
|
||
}
|
||
}' https://<strong id="EN-US_TOPIC_0000001231272819__b10469504461">{</strong><strong id="EN-US_TOPIC_0000001231272819__b184635094613">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b1046165016467">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b164675084618">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b4638145715816">9bc552e6-19af-4326-800d-281a92984636</strong>/clusters -v -k</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p16722192723911">If status code <strong id="EN-US_TOPIC_0000001231272819__b8423527069410">200</strong> is returned, the request for creating a cluster is successfully sent.</p>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li07507455563"><span>Call the API in <a href="dws_02_0018.html">Querying the Cluster List</a> to obtain the cluster information.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen974810455564">curl -X GET -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" https://<strong id="EN-US_TOPIC_0000001231272819__b374844520561">{</strong><strong id="EN-US_TOPIC_0000001231272819__b67481845155616">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b67481045115615">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b1174864520568">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b1931361305">9bc552e6-19af-4326-800d-281a92984636</strong>/clusters -k –v</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p16748164545615">The request response is as follows:</p>
|
||
<pre class="screen" id="EN-US_TOPIC_0000001231272819__sc0c0dcd083d441a0b4542e56072985c3">{
|
||
"clusters": [
|
||
{
|
||
"id": "7ba031f6-81f4-4670-ad20-c490b91877e5",
|
||
"status": "AVAILABLE",
|
||
"sub_status": "NORMAL",
|
||
"task_status": null,
|
||
"action_progress": null,
|
||
"node_type": "dws.d1.xlarge",
|
||
"subnet_id": "d23ef2e9-8b90-49b3-bc4a-fd7d6bea6bec",
|
||
"security_group_id": "12e3c23a-8710-4b75-95e4-5c8d7f68ef3c",
|
||
"number_of_node": 3,
|
||
"availability_zone": "eu-de-01",
|
||
"port": 8000,
|
||
"name": "dws-demo",
|
||
"version": "1.1.0",
|
||
"vpc_id": "219ab8a0-1272-4049-a383-8ad0b770fa11",
|
||
"user_name": "dbadmin",
|
||
"public_ip": {
|
||
"public_bind_type": "auto_assign",
|
||
"eip_id": "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574"
|
||
},
|
||
"public_endpoints": [
|
||
{
|
||
"public_connect_info": "10.0.0.8:8000",
|
||
"jdbc_url": "jdbc:postgresql://10.0.0.8:8000/<<em id="EN-US_TOPIC_0000001231272819__i9341521102115">YOUR_DATABASE_name</em>>"
|
||
}
|
||
],
|
||
"endpoints": [
|
||
{
|
||
"connect_info": "192.168.0.10:8000",
|
||
"jdbc_url": "jdbc:postgresql://192.168.0.10:8000/<<em id="EN-US_TOPIC_0000001231272819__i1179951772110">YOUR_DATABASE_name</em>>"
|
||
},
|
||
{
|
||
"connect_info": "192.168.0.12:8000",
|
||
"jdbc_url": "jdbc:postgresql://192.168.0.12:8000/<<em id="EN-US_TOPIC_0000001231272819__i20794320193510">YOUR_DATABASE_name</em>>"
|
||
}
|
||
] ,
|
||
"updated": "2018-01-15T12:50:06",
|
||
"created": "2018-01-15T12:50:06",
|
||
"recent_event": 1
|
||
}
|
||
]
|
||
}</pre>
|
||
<ul id="EN-US_TOPIC_0000001231272819__ul12534037141411"><li id="EN-US_TOPIC_0000001231272819__li553417377141">If <strong id="EN-US_TOPIC_0000001231272819__b84235270694159">status</strong> is <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue3869823009429"><b>CREATING</b></span>, the cluster is being created. If <strong id="EN-US_TOPIC_0000001231272819__b44258225894226">status</strong> is <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue94809843194231"><b>AVAILABLE</b></span>, the cluster is successfully created.</li><li id="EN-US_TOPIC_0000001231272819__li1534193716141">The UUID of cluster <strong id="EN-US_TOPIC_0000001231272819__b84235270694322">dws-demo</strong> is <strong id="EN-US_TOPIC_0000001231272819__b84235270694332">7ba031f6-81f4-4670-ad20-c490b91877e5</strong>. Record the UUID for subsequent use.</li></ul>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li117201521205920"><span>Call the API in <a href="dws_02_0019.html">Querying Cluster Details</a> to view cluster details.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen971422120592">curl -X GET -H "Content-type:application/json" -H "X-Auth-Token:$Token"
|
||
https://<strong id="EN-US_TOPIC_0000001231272819__b10714121165913">{</strong><strong id="EN-US_TOPIC_0000001231272819__b1471492115916">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b97141821125911">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b67141021125917">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b113593917416">9bc552e6-19af-4326-800d-281a92984636</strong>/clusters/<strong id="EN-US_TOPIC_0000001231272819__b124419321947">7ba031f6-81f4-4670-ad20-c490b91877e5</strong> -k -v</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p3715112145919">The request response is as follows:</p>
|
||
<pre class="screen" id="EN-US_TOPIC_0000001231272819__s5a751affa97a40c4824bae1fe658eea8">{
|
||
"cluster": {
|
||
"id": "7ba031f6-81f4-4670-ad20-c490b91877e5",
|
||
"status": "AVAILABLE",
|
||
"name": "dws-demo",
|
||
"updated": "2018-01-15T12:50:06",
|
||
"created": "2018-01-15T12:50:06",
|
||
"user_name": "dbadmin",
|
||
"sub_status": "NORMAL",
|
||
"task_status": null,
|
||
"action_progress": null,
|
||
"node_type": "dws.d1.xlarge",
|
||
"node_type_id": "5ddb1071-c5d7-40e0-a874-8a032e81a697",
|
||
"subnet_id": "d23ef2e9-8b90-49b3-bc4a-fd7d6bea6bec",
|
||
"security_group_id": "12e3c23a-8710-4b75-95e4-5c8d7f68ef3c",
|
||
"number_of_node": 3,
|
||
"availability_zone": "eu-de-01",
|
||
"port": 8000,
|
||
"vpc_id": "219ab8a0-1272-4049-a383-8ad0b770fa11",
|
||
"public_ip": {
|
||
"public_bind_type": "auto_assign",
|
||
"eip_id": "85b20d7e-9eb7-4b2a-98f3-3c8843ea3574"
|
||
},
|
||
"public_endpoints": [
|
||
{
|
||
"public_connect_info": "10.0.0.8:8000",
|
||
"jdbc_url": "jdbc:postgresql://10.0.0.8:8000/<<em id="EN-US_TOPIC_0000001231272819__i7551201918317">YOUR_DATABASE_name</em>>"
|
||
}
|
||
],
|
||
"endpoints": [
|
||
{
|
||
"connect_info": "192.168.0.10:8000",
|
||
"jdbc_url": "jdbc:postgresql://192.168.0.10:8000/<<em id="EN-US_TOPIC_0000001231272819__i11698471717">YOUR_DATABASE_name</em>>"
|
||
},
|
||
{
|
||
"connect_info": "192.168.0.12:8000",
|
||
"jdbc_url": "jdbc:postgresql://192.168.0.12:8000/<<em id="EN-US_TOPIC_0000001231272819__i15677114010372">YOUR_DATABASE_name</em>>"
|
||
}
|
||
],
|
||
"version": "1.1.0",
|
||
"maintain_window": {
|
||
"day": "Wed",
|
||
"start_time": "22:00",
|
||
"end_time": "02:00"
|
||
},
|
||
"recent_event": 1,
|
||
"tags": null,
|
||
"parameter_group": {
|
||
"id": "157e9cc4-64a8-11e8-adc0-fa7ae01bbebc", "name": "Default-Parameter-Group-dws ", "status": "In-Sync"
|
||
}
|
||
}
|
||
}</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p4715172113594"><span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue44962006394432"><b>public_endpoints</b></span> and <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue48333613094432"><b>endpoints</b></span> can be queried from the response. After the cluster is successfully created, you can use <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue116343164694526"><b>public_endpoints</b></span> or <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue127308061794526"><b>endpoints</b></span> to access the cluster from an external source.</p>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li1665119525266"><span>Call the API in <a href="dws_02_0026.html">Creating a Snapshot</a> to create a snapshot.</span><p><div class="p" id="EN-US_TOPIC_0000001231272819__p103921825113811">Create snapshot <strong id="EN-US_TOPIC_0000001231272819__b84235270694612">snapshotForDemoCluster</strong> for cluster <strong id="EN-US_TOPIC_0000001231272819__b84235270694626">dws-demo</strong>.<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen17520196203717">curl -X POST -H "Content-type:application/json" -H "X-Auth-Token:$Token" -d '{
|
||
"snapshot": {
|
||
"name": "snapshotForDemoCluster",
|
||
"cluster_id": "7ba031f6-81f4-4670-ad20-c490b91877e5",
|
||
"description": "Snapshot description"
|
||
}
|
||
}' https://<strong id="EN-US_TOPIC_0000001231272819__b2520196133715">{dws_endpoint}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b252015643716">9bc552e6-19af-4326-800d-281a92984636</strong>/snapshots -k -v</pre>
|
||
</div>
|
||
<p id="EN-US_TOPIC_0000001231272819__p1152076113716">The request response is as follows:</p>
|
||
<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen135201766374">{
|
||
"snapshot": {
|
||
"id": "2a4d0f86-67cd-408a-8b66-017454fb7793"
|
||
}
|
||
}</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p1752013614376">If status code <strong id="EN-US_TOPIC_0000001231272819__b84235270694651">200</strong> is returned, the request for creating a snapshot is successfully sent. Record <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue114057897694751"><b>id</b></span> so that the ID can be used when you query the snapshot details later.</p>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li10425121852718"><span>Call the API in <a href="dws_02_0024.html">Querying the Snapshot List</a> to check whether the snapshot is successfully created.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen7423151822718">curl -X GET -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" https://<strong id="EN-US_TOPIC_0000001231272819__b1242341842717">{</strong><strong id="EN-US_TOPIC_0000001231272819__b1542371882717">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b10423518122718">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b642341816275">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b1047619208393">9bc552e6-19af-4326-800d-281a92984636</strong>/snapshots/<strong id="EN-US_TOPIC_0000001231272819__b159395725410">2a4d0f86-67cd-408a-8b66-017454fb7793</strong> -k -v</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p1142381813270">If the snapshot status in the response is <span class="parmvalue" id="EN-US_TOPIC_0000001231272819__parmvalue111987991794951"><b>AVAILABLE</b></span>, the snapshot is successfully created. If the snapshot status is <span class="parmname" id="EN-US_TOPIC_0000001231272819__parmname76964790595025"><b>CREATING</b></span>, the snapshot is being created.</p>
|
||
<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen11425101817277">{
|
||
"snapshot": {
|
||
"id": "2a4d0f86-67cd-408a-8b66-017454fb7793",
|
||
"name": "snapshotForDemoCluster",
|
||
"description": "Snapshot description",
|
||
"started": "2018-01-18T13:59:23Z",
|
||
"finished": "2018-01-18T13:01:40Z",
|
||
"size": 500,
|
||
"status": "AVAILABLE",
|
||
"type": "MANUAL",
|
||
"cluster_id": "4f87d3c4-9e33-482f-b962-e23b30d1a18c"
|
||
}
|
||
}</pre>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li21082054314"><span>Call the API in <a href="dws_02_0032.html">Restoring a Cluster</a> to restore a cluster using its snapshot.</span><p><div class="p" id="EN-US_TOPIC_0000001231272819__p1591745834211">Restore snapshot <strong id="EN-US_TOPIC_0000001231272819__b84235270695053">snapshotForDemoCluster</strong> to new cluster <strong id="EN-US_TOPIC_0000001231272819__b8423527069518">dws-restore</strong>.<pre class="screen" id="EN-US_TOPIC_0000001231272819__screen35191012194210">curl -X POST -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" -d '{
|
||
"restore": {
|
||
"name": "dws-restore"
|
||
}
|
||
}' https://<strong id="EN-US_TOPIC_0000001231272819__b5519131234212">{</strong><strong id="EN-US_TOPIC_0000001231272819__b851931294216">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b115191912104216">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b14519912144218">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b11519212114213">9bc552e6-19af-4326-800d-281a92984636</strong>/snapshots/<strong id="EN-US_TOPIC_0000001231272819__b85199127420">2a4d0f86-67cd-408a-8b66-017454fb7793</strong>/actions -v -k</pre>
|
||
</div>
|
||
<p id="EN-US_TOPIC_0000001231272819__p195191312174214">If status code <strong id="EN-US_TOPIC_0000001231272819__b84235270695145">200</strong> is returned, the cluster is successfully restored. You can check the cluster restoration status by performing operations in <a href="dws_02_0025.html">Querying Snapshot Details</a>.</p>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li15629173783213"><span>Call the API in <a href="dws_02_0027.html">Deleting a Manual Snapshot</a> to delete an unwanted snapshot.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen12629837103216">curl -X DELETE -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" https://<strong id="EN-US_TOPIC_0000001231272819__b1262953719326">{</strong><strong id="EN-US_TOPIC_0000001231272819__b66291737153213">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b13629137193220">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b206291537123212">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b114691823171913">9bc552e6-19af-4326-800d-281a92984636</strong>/snapshots/<strong id="EN-US_TOPIC_0000001231272819__b1522313141913">2a4d0f86-67cd-408a-8b66-017454fb7793</strong> -v -k</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p17629133783217">If status code <strong id="EN-US_TOPIC_0000001231272819__b2065570450">202</strong> is returned, the snapshot is successfully deleted.</p>
|
||
</p></li><li id="EN-US_TOPIC_0000001231272819__li20172202317349"><span>Call the API in <a href="dws_02_0021.html">Deleting a Cluster</a> to delete an unwanted cluster.</span><p><pre class="screen" id="EN-US_TOPIC_0000001231272819__screen17172182383417">curl -X DELETE -H 'Content-type:application/json;charset=utf-8' -H "X-Auth-Token:$Token" -d '{
|
||
"keep_last_manual_snapshot":0
|
||
}' https://<strong id="EN-US_TOPIC_0000001231272819__b4172823133419">{</strong><strong id="EN-US_TOPIC_0000001231272819__b191724232349">dws</strong><strong id="EN-US_TOPIC_0000001231272819__b7172162343411">_endpoint</strong><strong id="EN-US_TOPIC_0000001231272819__b1317282373417">}</strong>/v1.0/<strong id="EN-US_TOPIC_0000001231272819__b153608193439">9bc552e6-19af-4326-800d-281a92984636</strong>/clusters/<strong id="EN-US_TOPIC_0000001231272819__b68911922134310">7ba031f6-81f4-4670-ad20-c490b91877e5</strong> -v -k</pre>
|
||
<p id="EN-US_TOPIC_0000001231272819__p21721123143418">If status code <strong id="EN-US_TOPIC_0000001231272819__b1730187885">202</strong> is returned, the cluster is successfully deleted.</p>
|
||
</p></li></ol>
|
||
</div>
|
||
</div>
|
||
|