All Products
Search
Document Center

Bastionhost:GetPolicy

Last Updated:Jun 10, 2026

Mendapatkan detail kebijakan kontrol yang ditentukan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID instance bastion host.

Catatan

Anda dapat memanggil operasi DescribeInstances untuk mendapatkan ID ini.

bastionhost-cn-zvp2d3syb0g

RegionId

string

No

ID region instance bastion host.

Catatan

Untuk informasi lebih lanjut tentang ID region, lihat Region dan zona.

cn-hangzhou

PolicyId

string

Yes

ID kebijakan kontrol yang ingin Anda kueri.

Catatan

Anda dapat memanggil operasi ListPolicies untuk mendapatkan ID ini.

3

Elemen respons

Element

Type

Description

Example

object

Policy

object

Detail kebijakan kontrol.

AccessTimeRangeConfig

object

Pengaturan kontrol akses berbasis waktu.

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:

  • 1: Monday.

  • 2: Tuesday.

  • 3: Wednesday.

  • 4: Thursday.

  • 5: Friday.

  • 6: Saturday.

  • 7: Sunday.

[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: 00:00 to 01:00.

  • 1: 01:00 to 02:00.

  • 2: 02:00 to 03:00.

  • 3: 03:00 to 04:00.

  • 4: 04:00 to 05:00.

  • 5: 05:00 to 06:00.

  • 6: 06:00 to 07:00.

  • 7: 07:00 to 08:00.

  • 8: 08:00 to 09:00.

  • 9: 09:00 to 10:00.

  • 10: 10:00 to 11:00.

  • 11: 11:00 to 12:00.

  • 12: 12:00 to 13:00.

  • 13: 13:00 to 14:00.

  • 14: 14:00 to 15:00.

  • 15: 15:00 to 16:00.

  • 16: 16:00 to 17:00.

  • 17: 17:00 to 18:00.

  • 18: 18:00 to 19:00.

  • 19: 19:00 to 20:00.

  • 20: 20:00 to 21:00.

  • 21: 21:00 to 22:00.

  • 22: 22:00 to 23:00.

  • 23: 23:00 to 24:00.

[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

Kebijakan kontrol perintah.

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:

  • white: whitelist mode.

  • black: blacklist mode.

black

Commands

array

An array of controlled commands.

string

The controlled command.

ls

Comment

string

Keterangan pada kebijakan.

comment

IPAclConfig

object

Pengaturan kontrol akses berbasis alamat IP sumber.

AclType

string

The mode of access control on source IP addresses. Valid values:

  • white: whitelist mode.

  • black: blacklist mode.

black

IPs

array

The IP addresses from which logons are not allowed.

string

The controlled IP addresses.

[10.10.**.**]

PolicyName

string

Nama kebijakan kontrol.

test

PolicyId

string

ID kebijakan kontrol.

3

Priority

integer

Prioritas kebijakan kontrol. Nilai yang lebih kecil menunjukkan prioritas yang lebih tinggi.

1

ProtocolConfig

object

Pengaturan kontrol protokol.

RDP

object

The configuration details of Remote Desktop Protocol (RDP) options.

ClipboardDownload

string

Indicates whether downloading from the clipboard is enabled. Valid values:

  • Enable

  • Disable

Enable

ClipboardUpload

string

Indicates whether file uploading from the clipboard is enabled. Valid values:

  • Enable

  • Disable

Enable

DiskRedirection

string

Indicates whether driver mapping is enabled. Valid values:

  • Enable

  • Disable

Enable

RecordKeyboard

string

Indicates whether keyboard recording is enabled. Valid values:

  • Enable

  • Disable

Enable

DiskRedirectionUpload

string

Enable

DiskRedirectionDownload

string

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

  • Disable

Enable

SFTPChannel

string

Indicates whether the SFTP channel option is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPDownloadFile

string

Indicates whether file downloading is enabled in SFTP-based O&M. Valid values:

  • Enable

  • Disable

Enable

SFTPMkdir

string

Indicates whether folder creation is enabled in SFTP-based O&M. Valid values:

  • Enable

  • Disable

Enable

SFTPRemoveFile

string

Indicates whether file deletion is enabled in SFTP-based O&M. Valid values:

  • Enable

  • Disable

Enable

SFTPRenameFile

string

Indicates whether file renaming is enabled in SFTP-based O&M. Valid values:

  • Enable

  • Disable

Enable

SFTPRmdir

string

Indicates whether folder deletion is enabled in SFTP-based O&M. Valid values:

  • Enable

  • Disable

Enable

SFTPUploadFile

string

Indicates whether file uploading is enabled in SFTP-based O&M. Valid values:

  • Enable

  • Disable

Enable

SSHChannel

string

Indicates whether the SSH channel option is enabled. Valid values:

  • Enable

  • Disable

Enable

AllowDirectTcp

string

Enable

X11Forwarding

string

Indicates whether X11 forwarding is enabled. Valid values:

  • Enable

  • Disable

Enable

TcpForwarding

string

Enable

AllowTcpForwarding

string

Enable

ApprovalConfig

object

Pengaturan persetujuan O&M.

SwitchStatus

string

Indicates whether O&M approval is enabled in the control policy. Valid values:

  • On: O&M approval is enabled.

  • Off: O&M approval is disabled.

Off

RequestId

string

ID permintaan.

0D29F2C0-8B4B-5861-9474-F3F23D25594B

Contoh

Respons sukses

JSONformat

{
  "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"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidParameter The argument is invalid.
500 InternalError An unknown error occurred.
404 PolicyNotFound The policy is not found.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.