All Products
Search
Document Center

Bastionhost:ListApproveCommands

Last Updated:Oct 25, 2024

Queries commands to be reviewed.

Operation description

You can call this operation to query commands to be reviewed by a Bastionhost administrator.

You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-bastionhost:ListApproveCommandsget
  • Instance
    acs:yundun-bastionhost:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the bastion host.

Note You can call the DescribeInstances operation to query the ID of the bastion host.
bastionhost-cn-zvp2xvysf08
RegionIdstringNo

The region ID of the bastion host.

Note For more information about the mapping between region IDs and region names, see Regions and zones.
cn-beijing
PageNumberstringYes

The number of the page. Default value: 1.

1
PageSizestringYes

The number of entries per page.
Maximum value: 1000. Default value: 20. If you leave this parameter empty, 20 entries are returned on each page.

Note We recommend that you do not leave this parameter empty.
20

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

ApproveCommandsarray<object>

The commands to be reviewed.

itemobject

The returned data.

ApproveCommandIdstring

The ID of the command to be reviewed.

1
AssetAccountNamestring

The username of the asset account that is used for O&M.

root
AssetIpstring

The IP address of the asset for O&M.

10.167.XX.XX
AssetNamestring

The name of the asset.

poros-test
ClientIpstring

The source IP address from which the application is submitted.

172.18.XX.XX
ClientUserstring

The Bastionhost user who submitted the O&M application.

test
Commandstring

The command to be reviewed.

/bin/bash
CreateTimestring

The time when the O&M application was submitted. The value is a UNIX timestamp. Unit: seconds.

1679393152
ProtocolNamestring

The O&M protocol.

SSH
SessionIdstring

The ID of the O&M session that triggered the review.

95f873ab64a76d5b0000000000004d5e
Statestring

The status of the review. Valid values: Wait: The command is pending review.

Wait
RequestIdstring

The request ID.

E3EF7711-766D-5888-997B-EFBA76809229
TotalCountlong

The total number of commands to be reviewed.

15

Examples

Sample success responses

JSONformat

{
  "ApproveCommands": [
    {
      "ApproveCommandId": "1",
      "AssetAccountName": "root",
      "AssetIp": "10.167.XX.XX",
      "AssetName": "poros-test",
      "ClientIp": "172.18.XX.XX",
      "ClientUser": "test",
      "Command": "/bin/bash",
      "CreateTime": "1679393152",
      "ProtocolName": "SSH",
      "SessionId": "95f873ab64a76d5b0000000000004d5e",
      "State": "Wait"
    }
  ],
  "RequestId": "E3EF7711-766D-5888-997B-EFBA76809229",
  "TotalCount": 15
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe argument is invalid.The argument is invalid.
500InternalErrorAn unknown error occurred.An unknown error occurred.

For a list of error codes, visit the Service error codes.