Help Center> Bare Metal Server> API Reference> BMS APIs> BMS Password Management> Resetting the BMS Password with a Few Clicks
Updated on 2024-01-31 GMT+08:00

Resetting the BMS Password with a Few Clicks

Function

This API is used to reset the password of the BMS management account (root or Administrator) when one-click password reset is supported.

You can use the Querying Whether One-Click Password Reset Is Supported API to check whether one-click password reset is supported.

Constraints

  • There is no password complexity check that meets security requirements. No error message is displayed after a non-security password is entered.
  • Before using this API, you must install password reset plug-ins. For details about how to download and install the password reset plug-ins, see Installing the One-Click Password Reset Plug-in in Bare Metal Server User Guide.
  • If the password reset function fails to take effect, this API does not report an error.
  • A new password takes effect after the BMS is started or restarted.

URI

PUT /v1/{project_id}/baremetalservers/{server_id}/os-reset-password

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

server_id

Yes

Specifies the BMS ID.

You can obtain the BMS ID from the BMS console or by calling the Querying BMSs (Native OpenStack API).

Request Parameters

Parameter

Mandatory

Type

Description

reset-password

Yes

Object

Provides reset-password details. For details, see Table 2.

Table 2 reset-password field data structure description

Parameter

Mandatory

Type

Description

new_password

Yes

String

Specifies the new BMS password.

This API does not check password security. Ensure that the password complexity complies with the password rules.

The password must comply with the following rules:

  • Consists of 8 to 26 characters.
  • Contains at least three of the following character types:
    • Uppercase letters
    • Lowercase letters
    • Digits
    • Special characters:

      Windows: !@$%-_=+[]:./?

      Linux: !@%^-_=+[]{}:,./?

  • Cannot contain the username or the username in reverse.
  • Cannot contain more than two characters in the same sequence as they appear in the username. (This requirement applies only to Windows BMSs.)

Example Request

Resetting the password of a BMS (ID: 77616c78-0bc4-4156-b24b-4286586ac350) to Fusion@123 with a few clicks
1
PUT https://{BMS Endpoint}/v1/2e62dec99940499d93717c2789759015/baremetalservers/77616c78-0bc4-4156-b24b-4286586ac350/os-reset-password
1
2
3
4
5
{
    "reset-password": {
        "new_password": "Fusion@123"
    }
}

Response

N/A

Returned Values

Normal values

Return Value

Description

204

The server has processed the request but did not return any content.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.