You can call this operation to query the number of times that a client has connected to Alibaba Cloud through a specific Smart Access Gateway (SAG) instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeUserOnlineClientStatistics

The operation that you want to perform.

Set the value to DescribeUserOnlineClientStatistics.

RegionId String Yes cn-shanghai

The region where the SAG APP instance is deployed.

UserNames.N RepeatList Yes doctest

The list of usernames of the client accounts. Separate multiple usernames with commas (,). You can query a maximum of 50 clients at a time.

SmartAGId String No sag-sfjg*****

The ID of the SAG APP instance.

Response parameters

Parameter Type Example Description
RequestId String 14846A6A-2192-4F6A-B272-B8BD68EBC89B

The ID of the request.

UserStatistics Array

The connection status of the specified clients.

UserName String doctest

The username of the client account.

OnlineCount String 2

The number of clients that are connected to Alibaba Cloud.

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeUserOnlineClientStatistics
&RegionId=cn-shanghai
&UserNames.1=doctest
&<Common request parameters>

Sample success responses

XML format

<DescribeUserOnlineClientStatisticsResponse>
      <RequestId>14846A6A-2192-4F6A-B272-B8BD68EBC89B</RequestId>
      <UserStatistics>
            <Statistics>
                  <UserName>doctest</UserName>
                  <OnlineCount>0</OnlineCount>
            </Statistics>
      </UserStatistics>
    </DescribeUserOnlineClientStatisticsResponse>

JSON format

{
    "RequestId": "14846A6A-2192-4F6A-B272-B8BD68EBC89B", 
    "UserStatistics": {
        "Statistics": [
            {
                "UserName": "doctest", 
                "OnlineCount": 0
            }
        ]
    }
}

Error codes

HttpCode Error code Error message Description
400 ClientUser.NameEmpty You must specify UserName. The error message returned because the username is not specified.
400 ClientUser.NameInvalid The specified UserName is invalid. The error message returned because the format of the username is invalid.
400 SAG.InstanceIdEmpty You must specify the SAG instance ID. The error message returned because the ID of the SAG instance is not specified.
400 SAG.InstanceNoFound The specified SAG instance does not exist. The error message returned because the specified SAG instance does not exist.

For a list of error codes, visit the API Error Center.