Querying the Account Login Policy
Function
This API is used to query the account login policy.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| iam:securitypolicies:getLoginPolicyV5 | Read | - | - | - | - |
URI
GET /v5/login-policy
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| login_policy | login_policy object | Definition: Login authentication policy Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| user_validity_period | Integer | Definition: If an IAM user does not log in within the validity period (days) specified by this parameter, the user will be disabled. Range: N/A |
| custom_info_for_login | String | Definition: Login information. Range: N/A |
| lockout_duration | Integer | Definition: Account lockout duration (minute) for IAM users. Range: N/A |
| login_failed_times | Integer | Definition: Maximum number of invalid login attempts. Range: N/A |
| period_with_login_failures | Integer | Definition: Time limit (minutes). Range: N/A |
| session_timeout | Integer | Definition: Login session expiration time. Range: N/A |
| show_recent_login_info | Boolean | Definition: Whether to display the latest login information. Range: N/A |
| allow_address_netmasks | Array of allow_address_netmasks objects | Definition: IP address or network segment that can be accessed. Range: N/A |
| allow_ip_ranges | Array of allow_ip_ranges objects | Definition: IP address range from which access is allowed. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| address_netmask | String | Definition: IP address or CIDR block, for example, 192.168.0.1/24. Range: N/A |
| description | String | Definition: Description. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| ip_range | String | Definition: IP address range, for example, 0.0.0.0-255.255.255.255. Range: N/A |
| description | String | Definition: Description. Range: N/A |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition : Error code. For details, see Error Code. Range: The format is PAP5.XXXX, for example, PAP5.0012. |
| error_msg | String | Definition : Error message. For details, see Error Message. Range: N/A. |
| request_id | String | Definition: Unique identifier of an API request, which is used to locate API calling exceptions. Range: N/A |
| encoded_authorization_message | String | Definition : Encrypted details returned when the authentication fails, which are used to locate authentication problems. The STS5 decryption API can be used for decryption. For details, see API link. Range: N/A. |
Example Requests
Querying the account login policy
GET https://{endpoint}/v5/login-policy Example Responses
Status code: 200
Successful
{
"login_policy" : {
"user_validity_period" : 0,
"custom_info_for_login" : "info",
"lockout_duration" : 15,
"login_failed_times" : 5,
"period_with_login_failures" : 15,
"session_timeout" : 60,
"show_recent_login_info" : false,
"allow_sms_login" : true,
"allow_address_netmasks" : [ {
"address_netmask" : "192.168.0.1/24",
"description" : "description"
} ],
"allow_ip_ranges" : [ {
"ip_range" : "0.0.0.0-255.255.255.255",
"description" : "description"
} ]
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Successful |
| 403 | Forbidden |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot