Configures the password policy for RAM users.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ram:SetPasswordPolicy | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
MinimumPasswordLength | integer | No | The minimum number of characters in the password. Valid values: 8 to 32. Default value: 8. | 8 |
RequireLowercaseCharacters | boolean | No | Specifies whether the password must contain lowercase letters. Default value: false. Valid values:
| false |
RequireUppercaseCharacters | boolean | No | Specifies whether the password must contain uppercase letters. Default value: false. Valid values:
| false |
RequireNumbers | boolean | No | Specifies whether the password must contain digits. Default value: false. Valid values:
| false |
RequireSymbols | boolean | No | Specifies whether the password must contain special characters. Default value: false. Valid values:
| false |
HardExpire | boolean | No | Specifies whether to disable logon after the password expires. Valid values:
| false |
MaxLoginAttemps | integer | No | The maximum number of password retries. If you enter the wrong passwords for the specified consecutive times, the account is locked for one hour. Valid values: 0 to 32. The default value is 0, which indicates that the password retries are not limited. | 0 |
PasswordReusePrevention | integer | No | The policy for password history check. The previous N passwords cannot be reused. Valid values of N: 0 to 24. The default value is 0, which indicates that RAM users can reuse previous passwords. | 0 |
MaxPasswordAge | integer | No | The validity period of the password. Valid values: 0 to 1095. Unit: days. The default value is 0, which indicates that the password never expires. | 0 |
MinimumPasswordDifferentCharacter | integer | No | The minimum number of unique characters in the password. Valid values: 0 to 8. The default value is 0, which indicates that no limits are imposed on the number of unique characters in a password. | 0 |
PasswordNotContainUserName | boolean | No | Specifies whether to exclude the username from the password. Valid values:
| false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "3FB5551F-B2ED-40D4-8392-1E4AC2384EFD",
"PasswordPolicy": {
"RequireNumbers": false,
"RequireLowercaseCharacters": false,
"PasswordReusePrevention": 0,
"RequireSymbols": false,
"PasswordNotContainUserName": false,
"MinimumPasswordDifferentCharacter": 0,
"MaxPasswordAge": 0,
"HardExpire": false,
"MinimumPasswordLength": 8,
"RequireUppercaseCharacters": false,
"MaxLoginAttemps": 0
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|