Files
doc-exports/docs/dcs/api-ref/ResetPassword.html
chenjunjie 63188fad94 DCS API 20240705 version
Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com>
Co-authored-by: chenjunjie <chenjunjie@huawei.com>
Co-committed-by: chenjunjie <chenjunjie@huawei.com>
2025-03-17 15:42:06 +00:00

263 lines
19 KiB
HTML

<a name="ResetPassword"></a><a name="ResetPassword"></a>
<h1 class="topictitle1">Resetting a Password</h1>
<div id="body1708331107508"><div class="section" id="ResetPassword__section2045512112419"><h4 class="sectiontitle">Function</h4><p id="ResetPassword__p1445551119410">This API is used to reset the password of a DCS instance.</p>
</div>
<div class="section" id="ResetPassword__section134561011184112"><h4 class="sectiontitle">URI</h4><p id="ResetPassword__p10456131154116">POST /v2/{project_id}/instances/{instance_id}/password/reset</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ResetPassword__table64571611154117" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="ResetPassword__row345719116415"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="ResetPassword__p845716116418">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="ResetPassword__p94578118413">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="ResetPassword__p145831154113">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="ResetPassword__p3458511164117">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ResetPassword__row14571411134114"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ResetPassword__p14458171184113">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ResetPassword__p10458191124113">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ResetPassword__p44590112413">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ResetPassword__p1459181113412">Instance ID.</p>
</td>
</tr>
<tr id="ResetPassword__row5457311164120"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="ResetPassword__p1945917111410">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="ResetPassword__p1445931113410">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="ResetPassword__p17460181112411">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="ResetPassword__p8460171110415">Project ID. For details, see <a href="dcs-api-0312045.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ResetPassword__section16460311124114"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ResetPassword__request_ResetInstancePasswordBody" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr id="ResetPassword__row04615116419"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="ResetPassword__p104611211154112">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="ResetPassword__p1146212116415">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="ResetPassword__p84621111134111">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="ResetPassword__p13462161119417">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ResetPassword__row13461711194113"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ResetPassword__p16462191124114">new_password</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ResetPassword__p34633110410">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ResetPassword__p14463111114416">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ResetPassword__p17463611154114">New password. When <strong id="ResetPassword__b13653194035720">no_password_access</strong> is set to false or not specified, the request must contain the password parameter.</p>
<p id="ResetPassword__p18638548114014">The password of a DCS Redis instance must meet the following complexity requirements:</p>
<ul id="ResetPassword__ul2093015489325"><li id="ResetPassword__li093064803214">Can contain 8 to 32 characters.</li><li id="ResetPassword__li1293013483323">Must contain at least three of the following character types:<ul id="ResetPassword__ul139302487325"><li id="ResetPassword__li13930174810328">Lowercase letters</li><li id="ResetPassword__li109306484323">Uppercase letters</li><li id="ResetPassword__li193154814327">Digits</li><li id="ResetPassword__li19314485325">Special characters `~!@#$^&amp;*()-_=+\|{},&lt;.&gt;/?</li></ul>
</li></ul>
</td>
</tr>
<tr id="ResetPassword__row94611611174110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="ResetPassword__p19463161116419">no_password_access</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="ResetPassword__p1846414116415">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="ResetPassword__p24641611134117">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="ResetPassword__p146411118412">Whether to change the DCS instance to password-free.</p>
<ul id="ResetPassword__ul1033114349583"><li id="ResetPassword__li8331143445816"><strong style="color:#36383C;" id="ResetPassword__b20354154155814">true</strong>: The instance can be accessed without a password.</li><li id="ResetPassword__li20332734145815"><strong style="color:#36383C;" id="ResetPassword__b58412455583">false</strong>: The instance can be accessed only after password authentication.<p id="ResetPassword__p18332133413588">If this parameter is not set, the default value <strong style="color:#36383C;" id="ResetPassword__b124011016592">false</strong> is used.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ResetPassword__section15464211144117"><h4 class="sectiontitle">Response Parameters</h4><p id="ResetPassword__p6465711144114"><strong id="ResetPassword__b3465181184118">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ResetPassword__response_ResetInstancePasswordResp" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response body parameters</caption><thead align="left"><tr id="ResetPassword__row04651611194115"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="ResetPassword__p13467151134115">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="ResetPassword__p346717116414">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="ResetPassword__p5467011104118">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ResetPassword__row14465911174118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ResetPassword__p16468511104111">retry_times_left</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ResetPassword__p154681511124111">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ResetPassword__p154681311174119">Number of remaining password attempts. Resetting a password does not verify passwords. This parameter is deprecated and <strong id="ResetPassword__b5835122171519">5</strong> is returned by default.</p>
</td>
</tr>
<tr id="ResetPassword__row12466201119412"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ResetPassword__p124681011124110">lock_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ResetPassword__p1146991114111">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ResetPassword__p94691311114113">Lock duration, in minutes. Resetting a password does not involve locks. This parameter is deprecated and <strong id="ResetPassword__b1681418153150">0</strong> is returned by default.</p>
</td>
</tr>
<tr id="ResetPassword__row174661111154118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ResetPassword__p19469511164114">lock_time_left</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ResetPassword__p4469111134120">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ResetPassword__p17470201119417">Remaining time before the account is unlocked, in minutes. Resetting a password does not involve locks. This parameter is deprecated and <strong id="ResetPassword__b124091529101516">0</strong> is returned by default.</p>
</td>
</tr>
<tr id="ResetPassword__row918614576583"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ResetPassword__p1789043045913">code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ResetPassword__p14890730175912">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ResetPassword__p1918716579586">Code of a password reset result.</p>
<p id="ResetPassword__p141514963613"><strong id="ResetPassword__b1958411701217">1</strong>: Successful</p>
</td>
</tr>
<tr id="ResetPassword__row16451857165812"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ResetPassword__p208902304597">message</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ResetPassword__p1089053075911">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ResetPassword__p16461757175814">Password reset result.</p>
</td>
</tr>
<tr id="ResetPassword__row19841158195812"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="ResetPassword__p4890530105919">ext_message</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="ResetPassword__p6890630195919">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="ResetPassword__p15591195819275">Password reset error message. The value is <strong id="ResetPassword__b159165813271">null</strong> when the reset is successful.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="ResetPassword__p1247014118415"><strong id="ResetPassword__b144701811184118">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ResetPassword__response_ErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Response body parameters</caption><thead align="left"><tr id="ResetPassword__row3470511184111"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="ResetPassword__p4471311134110">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="ResetPassword__p74711811114118">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="ResetPassword__p1847161119412">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ResetPassword__row1947016113416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ResetPassword__p94718117415">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ResetPassword__p947213111411">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ResetPassword__p2472911104118">Error message.</p>
</td>
</tr>
<tr id="ResetPassword__row154701811114120"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ResetPassword__p847251124119">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ResetPassword__p64721911174118">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ResetPassword__p34731611204114">Error code.</p>
</td>
</tr>
<tr id="ResetPassword__row447015110414"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="ResetPassword__p1473101184114">error_ext_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="ResetPassword__p94737114417">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="ResetPassword__p447361114112">Extended error information. This parameter is not used currently and is set to <strong id="ResetPassword__b18473151184117">null</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="ResetPassword__p1947316112419"><strong id="ResetPassword__b3474191104113">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ResetPassword__table104741011144116" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Response body parameters</caption><thead align="left"><tr id="ResetPassword__row2474121115412"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="ResetPassword__p24741711184111">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="ResetPassword__p14475101115412">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="ResetPassword__p114754118417">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ResetPassword__row347411116411"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="ResetPassword__p104751911114117">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="ResetPassword__p1947531164117">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="ResetPassword__p144751811194110">Error message.</p>
</td>
</tr>
<tr id="ResetPassword__row174745116419"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="ResetPassword__p747691144116">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="ResetPassword__p7476511114118">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="ResetPassword__p18476811134110">Error code.</p>
</td>
</tr>
<tr id="ResetPassword__row047415111415"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="ResetPassword__p18476411154115">error_ext_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="ResetPassword__p44778114412">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="ResetPassword__p2477171114419">Extended error information. This parameter is not used currently and is set to <strong id="ResetPassword__b647710111412">null</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ResetPassword__section1447731116414"><h4 class="sectiontitle">Example Requests</h4><p id="ResetPassword__p1747721124119">Resetting the password of the DCS instance by entering a new password</p>
<pre class="screen" id="ResetPassword__screen84788118411">POST https://{dcs_endpoint}/v2/{project_id}/instances/{instance_id}/password/reset
{
"new_password" : "xxxxxx",
"no_password_access" : false
}</pre>
</div>
<div class="section" id="ResetPassword__section124791811164111"><h4 class="sectiontitle">Example Responses</h4><p id="ResetPassword__p18479181154111"><strong id="ResetPassword__b194791811164114">Status code: 200</strong></p>
<p id="ResetPassword__p17479111114115">The password is changed successfully.</p>
<pre class="screen" id="ResetPassword__screen448091120414">{
"lock_time" : "0",
"lock_time_left" : "0",
"retry_times_left" : "5"
"code" : "1",
"message" : "success",
"ext_message" : null
}</pre>
</div>
<p id="ResetPassword__p1898804418456"><strong id="ResetPassword__b129881744184511">Status code: 400</strong></p>
<p id="ResetPassword__p898874414519">Invalid request.</p>
<pre class="screen" id="ResetPassword__screen598954419455">{
"error_code" : "DCS.4839",
"error_msg" : "is not support reset instance password."
}</pre>
<div class="section" id="ResetPassword__section848191154110"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="ResetPassword__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="ResetPassword__row84811111164118"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.10.2.1.3.1.1"><p id="ResetPassword__p1482161144111">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.10.2.1.3.1.2"><p id="ResetPassword__p16482711154118">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="ResetPassword__row7481151116419"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.10.2.1.3.1.1 "><p id="ResetPassword__p20482121114415">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.10.2.1.3.1.2 "><p id="ResetPassword__p24838114416">The password is changed successfully.</p>
</td>
</tr>
<tr id="ResetPassword__row1748110110412"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.10.2.1.3.1.1 "><p id="ResetPassword__p1483151194118">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.10.2.1.3.1.2 "><p id="ResetPassword__p5483811194119">Invalid request.</p>
</td>
</tr>
<tr id="ResetPassword__row24811011134111"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.10.2.1.3.1.1 "><p id="ResetPassword__p1848421120419">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.10.2.1.3.1.2 "><p id="ResetPassword__p10484201174117">Internal service error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="ResetPassword__section104849114416"><h4 class="sectiontitle">Error Codes</h4><p id="ResetPassword__p114853118415">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="InstanceManagement.html">Instance Management</a></div>
</div>
</div>