Todos os produtos
Search
Central de documentação

Bastionhost:GetPolicy

Última atualização: Jun 28, 2026

Obtém os detalhes de uma política de controle especificada.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

Nenhuma autorização necessária para esta operação. Se você encontrar problemas com esta operação, entre em contato com o suporte técnico.

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

InstanceId

string

Sim

O ID da instância do bastion host.

Nota

Você pode chamar a operação DescribeInstances para obter esse ID.

bastionhost-cn-zvp2d3syb0g

RegionId

string

Não

O ID da região da instância do bastion host.

Nota

Para obter mais informações sobre os IDs de região, consulte Regiões e zonas.

cn-hangzhou

PolicyId

string

Sim

O ID da política de controle que você deseja consultar.

Nota

Você pode chamar a operação ListPolicies para obter esse ID.

3

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

Policy

object

Os detalhes da política de controle.

AccessTimeRangeConfig

object

As configurações de controle de acesso baseado em tempo.

EffectiveTime

array<object>

The allowed access time slots.

object

Days

array

The days of the week when access is allowed.

string

The day of the week. Valid values:

  • 1: Monday

  • 2: Tuesday

  • 3: Wednesday

  • 4: Thursday

  • 5: Friday

  • 6: Saturday

  • 7: Sunday

[2]

Hours

array

The hours of the day when access is allowed.

string

The hour of the day. 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 00: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

A política de controle de comandos.

Approval

object

The command approval settings.

Commands

array

The commands that require approval.

string

A command that requires approval.

ls

Deny

object

The command control settings.

AclType

string

The command control mode. Valid values:

  • white: allowlist.

  • black: denylist.

black

Commands

array

The commands in the list.

string

The command.

ls

Comment

string

Os comentários sobre a política.

comment

IPAclConfig

object

As configurações de controle de acesso baseado no endereço IP de origem.

AclType

string

The source IP address-based access control mode. Valid values:

  • white: allowlist.

  • black: denylist.

black

IPs

array

The IP addresses in the ACL.

string

An IP address or CIDR block.

[10.10.**.**]

PolicyName

string

O nome da política de controle.

test

PolicyId

string

O ID da política de controle.

3

Priority

integer

A prioridade da política de controle. Um valor menor indica uma prioridade maior.

1

ProtocolConfig

object

As configurações de controle de protocolo.

RDP

object

The RDP security settings.

ClipboardDownload

string

Indicates whether clipboard download is enabled. Valid values:

  • Enable

  • Disable

Enable

ClipboardUpload

string

Indicates whether clipboard upload is enabled. Valid values:

  • Enable

  • Disable

Enable

DiskRedirection

string

Indicates whether drive redirection and printer mapping are 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 SSH and SFTP security settings.

ExecCommand

string

Indicates whether remote command execution is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPChannel

string

Indicates whether the SFTP channel is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPDownloadFile

string

Indicates whether file downloads over SFTP are enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPMkdir

string

Indicates whether directory creation over SFTP is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPRemoveFile

string

Indicates whether file deletion over SFTP is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPRenameFile

string

Indicates whether file renaming over SFTP is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPRmdir

string

Indicates whether directory deletion over SFTP is enabled. Valid values:

  • Enable

  • Disable

Enable

SFTPUploadFile

string

Indicates whether file uploads over SFTP are enabled. Valid values:

  • Enable

  • Disable

Enable

SSHChannel

string

Indicates whether the SSH channel 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

As configurações de aprovação de O&M.

SwitchStatus

string

Indicates whether O&M approval is enabled. Valid values:

  • On: O&M approval is enabled.

  • Off: O&M approval is disabled.

Off

RequestId

string

O ID da solicitação.

0D29F2C0-8B4B-5861-9474-F3F23D25594B

Exemplos

Resposta de sucesso

JSON formato

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

Códigos de erro

Código de status HTTP

Código de erro

Mensagem de erro

Descrição

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.

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.