Retrieves the details of a specified control policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-bastionhost:GetPolicy |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID of the bastion host to which the control policy belongs. Note
You can invoke the DescribeInstances operation to obtain this parameter. |
bastionhost-cn-zvp2d3syb0g |
| RegionId |
string |
No |
The region ID of the bastion host instance to which the control policy belongs. Note
For the mapping between region IDs and region names, see Regions and zones. |
cn-hangzhou |
| PolicyId |
string |
Yes |
The ID of the control policy to query. Note
You can call the ListPolicies operation to obtain this parameter. |
3 |
| ProjectId |
integer |
No |
The project ID. |
3 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Policy |
object |
The details of the control policy. |
|
| AccessTimeRangeConfig |
object |
The logon time range restriction details. |
|
| EffectiveTime |
array<object> |
The details of the allowed logon time ranges. |
|
|
object |
|||
| Days |
array |
The allowed logon days. |
|
|
string |
The day of the week on which logon is allowed. Valid values:
|
[2] |
|
| Hours |
array |
The allowed logon hours. |
|
|
string |
The hour of the day during which logon is 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 command policy details. |
|
| Approval |
object |
The command approval configuration details. |
|
| Commands |
array |
The array of commands. |
|
|
string |
The details of commands that require approval. |
ls |
|
| Deny |
object |
The command control configuration details. |
|
| AclType |
string |
The command control type. Valid values:
|
black |
| Commands |
array |
The array of commands. |
|
|
string |
The command details. |
ls |
|
| Comment |
string |
The description of the control policy. |
comment |
| IPAclConfig |
object |
The source IP restriction configuration details. |
|
| AclType |
string |
The source IP restriction mode. Valid values:
|
black |
| IPs |
array |
The IP address information for logon restriction. |
|
|
string |
The list of restricted IP addresses. |
[10.10.**.**] |
|
| PolicyName |
string |
The Policy 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 protocol control details. |
|
| RDP |
object |
The RDP option configuration details. |
|
| ClipboardDownload |
string |
The clipboard download configuration. Valid values:
|
Enable |
| ClipboardUpload |
string |
The clipboard upload configuration. Valid values:
|
Enable |
| DiskRedirection |
string |
The drive/printer mapping configuration. Valid values:
|
Enable |
| RecordKeyboard |
string |
The keyboard recording configuration. Valid values:
|
Enable |
| DiskRedirectionUpload |
string |
The RDP disk upload control. |
Enable |
| DiskRedirectionDownload |
string |
The RDP disk download control. |
Enable |
| SSH |
object |
The SSH and SFTP option configuration details. |
|
| ExecCommand |
string |
The remote command execution configuration. Valid values:
|
Enable |
| SFTPChannel |
string |
The SFTP channel configuration. Valid values:
|
Enable |
| SFTPDownloadFile |
string |
The SFTP file download configuration. Valid values:
|
Enable |
| SFTPMkdir |
string |
The SFTP folder creation configuration. Valid values:
|
Enable |
| SFTPRemoveFile |
string |
The SFTP file deletion configuration. Valid values:
|
Enable |
| SFTPRenameFile |
string |
The SFTP file rename configuration. Valid values:
|
Enable |
| SFTPRmdir |
string |
The SFTP folder deletion configuration. Valid values:
|
Enable |
| SFTPUploadFile |
string |
The SFTP file upload configuration. Valid values:
|
Enable |
| SSHChannel |
string |
The SSH channel configuration. Valid values:
|
Enable |
| AllowDirectTcp |
string |
Specifies whether to allow TCP tunneling. |
Enable |
| X11Forwarding |
string |
The X11 forwarding configuration. Valid values:
|
Enable |
| TcpForwarding |
string |
Specifies whether to allow TCP forwarding. |
Enable |
| AllowTcpForwarding |
string |
Specifies whether to allow TCP forwarding. |
Enable |
| ApprovalConfig |
object |
The O&M approval configuration details. |
|
| SwitchStatus |
string |
The O&M approval configuration in the control policy. Valid values:
|
Off |
| RequestId |
string |
The unique request ID generated by Alibaba Cloud for this request. |
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",
"DiskRedirectionUpload": "Enable",
"DiskRedirectionDownload": "Enable"
},
"SSH": {
"ExecCommand": "Enable",
"SFTPChannel": "Enable",
"SFTPDownloadFile": "Enable",
"SFTPMkdir": "Enable",
"SFTPRemoveFile": "Enable",
"SFTPRenameFile": "Enable",
"SFTPRmdir": "Enable",
"SFTPUploadFile": "Enable",
"SSHChannel": "Enable",
"AllowDirectTcp": "Enable",
"X11Forwarding": "Enable",
"TcpForwarding": "Enable",
"AllowTcpForwarding": "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.