Query Two-Factor Authentication

GET/zstack/v1/twofactorauthentication/secrets
GET zstack/v1/twofactorauthentication/secrets/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl 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=d65b4896eee23175b19e1267ee39ec60
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/twofactorauthentication/secrets/83358cec65073cbc876ddefe3d9b69fe

Queryable 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"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error3.4.0
inventoriesListFor details, see inventories3.4.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.10013.4.0
descriptionStringA brief description of the error3.4.0
detailsStringThe detailed error information3.4.0
elaborationStringReserved field. Defaults to null3.4.0
opaqueLinkedHashMapReserved field. Defaults to null3.4.0
causeErrorCodeThe root error, the cause of the current error. This field is null if there is no root error3.4.0

inventories

NameTypeDescriptionStarting Version
uuidStringThe resource UUID, uniquely identifying this resource3.4.0
secretStringTwo-factor authentication secret3.4.0
userUuidStringUser UUID3.4.0
userTypeString 3.4.0
createDateTimestampCreation time3.4.0
lastOpDateTimestampLast modification time3.4.0
statusTwoFactorAuthenticationSecretStatusFor details, see status3.4.0

status

NameTypeDescriptionStarting Version
nameStringResource name3.4.0
ordinalint 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()