Query Two-Factor Authentication
GET zstack/v1/twofactorauthentication/secrets/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/twofactorauthentication/secrets?q=uuid=d65b4896eee23175b19e1267ee39ec60curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/twofactorauthentication/secrets/83358cec65073cbc876ddefe3d9b69feQueryable Fields
Run the CLI tool, enter `` and press the Tab key to view all queryable fields and cross-table queryable resource names.
API Response
Response example
{
"inventories": [
{
"uuid": "16620c01d20b390891ae1a1bc072ac0b",
"secret": "ABCDEFGH12345678",
"userUuid": "264d446f00e43793a2b0dcd21c367aaf",
"userType": "AccountVO",
"status": "NewCreated"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 3.4.0 |
| inventories | List | For details, see inventories | 3.4.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 3.4.0 |
| description | String | A brief description of the error | 3.4.0 |
| details | String | The detailed error information | 3.4.0 |
| elaboration | String | Reserved field. Defaults to null | 3.4.0 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 3.4.0 |
| cause | ErrorCode | The root error, the cause of the current error. This field is null if there is no root error | 3.4.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID, uniquely identifying this resource | 3.4.0 |
| secret | String | Two-factor authentication secret | 3.4.0 |
| userUuid | String | User UUID | 3.4.0 |
| userType | String | 3.4.0 | |
| createDate | Timestamp | Creation time | 3.4.0 |
| lastOpDate | Timestamp | Last modification time | 3.4.0 |
| status | TwoFactorAuthenticationSecretStatus | For details, see status | 3.4.0 |
status
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 3.4.0 |
| ordinal | int | 3.4.0 |
SDK Examples
Java SDK
QueryTwoFactorAuthenticationAction action = new QueryTwoFactorAuthenticationAction();
action.conditions = asList("uuid=4875201ba7443dddb51e336f9a23a20e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTwoFactorAuthenticationAction.Result res = action.call();Python SDK
QueryTwoFactorAuthenticationAction action = QueryTwoFactorAuthenticationAction()
action.conditions = ["uuid=ccf0f6cdf5a73bf7b961869f9bd8ca25"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTwoFactorAuthenticationAction.Result res = action.call()