Querying a Master Key

Description

This API is used to query a master key, including its usage, creation time, and remarks.

URL

GET https://ip:port/AIVAULT/v1/queryMK

Request Header

Table 1 Request header

Parameter

Type

Description

DomainID

UInt

Key domain ID, which indicates the domain of an application or a model. The value ranges from 1 to 500.

  1. Parameters in this request header are set by users.
  2. Domain IDs are used to differentiate applications or models. A maximum of 500 domains are supported.

Request Parameters

Table 2 Request parameters

Parameter

Mandatory/Optional

Type

Description

MKName

Optional

String

If the request does not contain MKname, the master key is queried based on the following requirements: The string contains 1 to 128 characters, allowing only digits, letters, underscores (_), and hyphens (-).

SortBy

Optional

String

The value can be CreateTime or MKName. (By default, the sorting is performed by installation time in descending order.)

SortMode

Optional

String

The value can be asc or desc (default). asc indicates sorting in ascending order, and desc indicates sorting in descending order.

Request Example

https://ip:port/AIVAULT/v1/queryMK?MKName=test

Response Description

Table 3 Responses

Level-1 Parameter

Level-2 Parameter

Type

Description

status

\

String

Error code

msg

\

String

Error message

data

\

Object

Packet list, which may contain multiple records.

\

CreateType

String

Creation type

\

MkID

Int

Master key ID

\

MKName

String

Master key name, which must be unique.

\

MKUsage

String

Usage of the master key. This parameter is used to control the master key.

\

MKRemarks

String

Remarks

\

CreatedAt

String

Creation time

Response Example

{
    "status": "00000000",
    "msg": "ok",
    "data": [
        {
            "MkID": 9,
            "MKName": "test",
            "CreateType": "AIVAULT",
            "MKUsage": "TEST",
            "MKRemarks": "test create",
            "CreatedAt": "2022-06-15T11:02:28.464218214+08:00"
          }
        ]
}

For details about the error codes, see Error Codes.

For details about the status codes, see Status Codes.