Queries the detailed information about a control policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:GetPolicy |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the bastion host to which the control policy to query belongs. Note
You can call the DescribeInstances operation to query the ID of the bastion host. |
bastionhost-cn-zvp2d3syb0g |
| RegionId |
string |
No |
The region ID of the bastion host to which the control policy to query belongs. Note
For more information about the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| PolicyId |
string |
Yes |
The ID of the control policy that you want to query. Note
You can call the ListPolicies operation to query the control policy ID. |
3 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Policy |
object |
The details of the control policy. |
|
| AccessTimeRangeConfig |
object |
The details of the logon period restrictions. |
|
| EffectiveTime |
array<object> |
The details of the periods during which logons are allowed. |
|
|
object |
|||
| Days |
array |
The days of a week on which logons are allowed. |
|
|
string |
The day of the week during which logons are allowed. Valid values:
|
[2] |
|
| Hours |
array |
The time periods during which logons are allowed. |
|
|
string |
The periods of the day during which logons are allowed. Valid values:
|
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23] |
|
| CommandConfig |
object |
The details of the command policy. |
|
| Approval |
object |
The details of the command approval settings. |
|
| Commands |
array |
An array of commands that can be run only after approval. |
|
|
string |
The command that can be run only after approval. |
ls |
|
| Deny |
object |
The details of the command control setting. |
|
| AclType |
string |
The type of command control. Valid values:
|
black |
| Commands |
array |
An array of controlled commands. |
|
|
string |
The controlled command. |
ls |
|
| Comment |
string |
The description of the control policy. |
comment |
| IPAclConfig |
object |
The access control settings on source IP addresses. |
|
| AclType |
string |
The mode of access control on source IP addresses. Valid values:
|
black |
| IPs |
array |
The IP addresses from which logons are not allowed. |
|
|
string |
The controlled IP addresses. |
[10.10.**.**] |
|
| PolicyName |
string |
The name of the control policy. |
test |
| PolicyId |
string |
The ID of the control policy. |
3 |
| Priority |
integer |
The priority of the control policy. A smaller value indicates a higher priority. |
1 |
| ProtocolConfig |
object |
The details of protocol control. |
|
| RDP |
object |
The configuration details of Remote Desktop Protocol (RDP) options. |
|
| ClipboardDownload |
string |
Indicates whether downloading from the clipboard is enabled. Valid values:
|
Enable |
| ClipboardUpload |
string |
Indicates whether file uploading from the clipboard is enabled. Valid values:
|
Enable |
| DiskRedirection |
string |
Indicates whether driver mapping is enabled. Valid values:
|
Enable |
| RecordKeyboard |
string |
Indicates whether keyboard recording is enabled. Valid values:
|
Enable |
| SSH |
object |
The configuration details of SSH and SSH File Transfer Protocol (SFTP) options. |
|
| ExecCommand |
string |
Indicates whether remote command execution is enabled. Valid values:
|
Enable |
| SFTPChannel |
string |
Indicates whether the SFTP channel option is enabled. Valid values:
|
Enable |
| SFTPDownloadFile |
string |
Indicates whether file downloading is enabled in SFTP-based O&M. Valid values:
|
Enable |
| SFTPMkdir |
string |
Indicates whether folder creation is enabled in SFTP-based O&M. Valid values:
|
Enable |
| SFTPRemoveFile |
string |
Indicates whether file deletion is enabled in SFTP-based O&M. Valid values:
|
Enable |
| SFTPRenameFile |
string |
Indicates whether file renaming is enabled in SFTP-based O&M. Valid values:
|
Enable |
| SFTPRmdir |
string |
Indicates whether folder deletion is enabled in SFTP-based O&M. Valid values:
|
Enable |
| SFTPUploadFile |
string |
Indicates whether file uploading is enabled in SFTP-based O&M. Valid values:
|
Enable |
| SSHChannel |
string |
Indicates whether the SSH channel option is enabled. Valid values:
|
Enable |
| X11Forwarding |
string |
Indicates whether X11 forwarding is enabled. Valid values:
|
Enable |
| ApprovalConfig |
object |
The O&M approval setting. |
|
| SwitchStatus |
string |
Indicates whether O&M approval is enabled in the control policy. Valid values:
|
Off |
| RequestId |
string |
The request ID. |
0D29F2C0-8B4B-5861-9474-F3F23D25594B |
Examples
Success response
JSON format
{
"Policy": {
"AccessTimeRangeConfig": {
"EffectiveTime": [
{
"Days": [
"[2]"
],
"Hours": [
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]"
]
}
]
},
"CommandConfig": {
"Approval": {
"Commands": [
"ls"
]
},
"Deny": {
"AclType": "black",
"Commands": [
"ls"
]
}
},
"Comment": "comment",
"IPAclConfig": {
"AclType": "black",
"IPs": [
"[10.10.**.**]"
]
},
"PolicyName": "test",
"PolicyId": "3",
"Priority": 1,
"ProtocolConfig": {
"RDP": {
"ClipboardDownload": "Enable",
"ClipboardUpload": "Enable",
"DiskRedirection": "Enable",
"RecordKeyboard": "Enable"
},
"SSH": {
"ExecCommand": "Enable",
"SFTPChannel": "Enable",
"SFTPDownloadFile": "Enable",
"SFTPMkdir": "Enable",
"SFTPRemoveFile": "Enable",
"SFTPRenameFile": "Enable",
"SFTPRmdir": "Enable",
"SFTPUploadFile": "Enable",
"SSHChannel": "Enable",
"X11Forwarding": "Enable"
}
},
"ApprovalConfig": {
"SwitchStatus": "Off"
}
},
"RequestId": "0D29F2C0-8B4B-5861-9474-F3F23D25594B"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The argument is invalid. | The argument is invalid. |
| 500 | InternalError | An unknown error occurred. | An unknown error occurred. |
| 404 | PolicyNotFound | The policy is not found. | The policy is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.