接口描述

设置子用户密码强度等策略

请求参数

Action
  • 类型:String
  • 必须:是
  • 描述:操作接口名,系统规定参数,取值:SetPasswordPolicy
MinimumPasswordLength
  • 类型:Integer
  • 必须:否
  • 描述:最小密码长度
RequireLowercaseCharacters
  • 类型:Boolean
  • 必须:否
  • 描述:必须含有小写字母
RequireUppercaseCharacters
  • 类型:Boolean
  • 必须:否
  • 描述:必须含有大写字母
RequireNumbers
  • 类型:Boolean
  • 必须:否
  • 描述:必须含有数字
RequireSymbols
  • 类型:Boolean
  • 必须:否
  • 描述:必须含有特殊字符

返回参数

PasswordPolicy

需要的权限

Action
ram:SetPasswordPolicy
Resource
acs:ram:*:${AccountId}:*

错误信息

InvalidParameter.MinimumPasswordLength.Range
  • HTTP Status:400
  • Error Message:The parameter - "MinimumPasswordLength" MUST be in the range of 8 and 32.

操作示例

请求示例

https://ram.aliyuncs.com/?Action=SetPasswordPolicy
&MinimumPasswordLength=12
&RequireLowercaseCharacters=true
&RequireUppercaseCharacters=true
&RequireNumbers=true
&RequireSymbols=true
&<公共请求参数>

返回示例

  • XML格式
    <SetPasswordPolicyResponse>
        <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
        <PasswordPolicy>
            <MinimumPasswordLength>12</MinimumPasswordLength>
            <RequireLowercaseCharacters>true</RequireLowercaseCharacters>
            <RequireUppercaseCharacters>true</RequireUppercaseCharacters>
            <RequireNumbers>true</RequireNumbers>
            <RequireSymbols>true</RequireSymbols>
        </PasswordPolicy>
    </SetPasswordPolicyResponse>
  • JSON格式
    {
        "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
        "PasswordPolicy": {
            "MinimumPasswordLength": 12,
            "RequireLowercaseCharacters": true,
            "RequireUppercaseCharacters": true,
            "RequireNumbers": true,
            "RequireSymbols": true
        }
    }