Get License Records

GET/zstack/v1/licenses/records

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-X GET http://localhost:8080/zstack/v1/licenses/records?limit=20.0&start=0.0&replyWithCount=true&count=false&sortBy=uploadDate&sortDirection=desc

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
limit (Optional)IntegerqueryMaximum number of records to return, similar to MySQL limit. Default value is 20 4.1.0
start (Optional)IntegerqueryStarting query record position, similar to MySQL offset. Used with limit to implement pagination 4.1.0
replyWithCount (Optional)booleanqueryCount query. Specifies whether to return the data record count along with the results. When set to true, the API returns both data records and the total count of records that match the query conditions 4.1.0
count (Optional)booleanqueryCount query, equivalent to the count() function in MySQL. When set to true, the API only returns the count of records that match the query conditions 4.1.0
sortBy (Optional)StringquerySort by field, equivalent to the sort by keyword in MySQL, for example sortBy=ip. Must be used with sortDirection 4.1.0
sortDirection (Optional)StringqueryField sort direction. Must be used with sortBy 4.1.0
systemTags (Optional)ListquerySystem tags 4.1.0
userTags (Optional)ListqueryUser tags 4.1.0

API Response

Response Example

{
  "inventories": [
    {
      "user": "example",
      "hostNum": 10.0,
      "licenseType": "Free",
      "issuedDate": "2017-01-19 14:31:06",
      "managementNodeUuid": "00898b3538e53e70bb7521e54ff80276",
      "expired": true
    }
  ],
  "total": 1.0
}
NameTypeDescriptionStarting Version
totalLongTotal license history authorization data count. This value is returned when count or replyWithCount is set to true4.1.0
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details4.1.0
inventoryLicenseInventorySee inventory for details4.1.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10014.1.0
descriptionStringA brief description of the error4.1.0
detailsStringThe detailed error information4.1.0
elaborationStringReserved field. Default is null4.1.0
opaqueLinkedHashMapReserved field. Default is null4.1.0
causeErrorCodeThe root error that caused the current error. If no root error exists, this field is null4.1.0

inventory

NameTypeDescriptionStarting Version
uuidString 4.1.0
licenseTypeString 4.1.0
expiredDateString 4.1.0
issuedDateString 4.1.0
uploadDateStringLicense upload time4.1.0
userString 4.1.0
prodInfoStringLicense product name4.1.0
hostNumInteger 4.1.0
cpuNumInteger 4.1.0
vmNumInteger 4.1.0
expiredboolean 4.1.0
managementNodeUuidString 4.1.0

SDK Examples

Java SDK

GetLicenseRecordsAction action = new GetLicenseRecordsAction();
action.limit = 20.0;
action.start = 0.0;
action.replyWithCount = true;
action.count = false;
action.sortBy = "uploadDate";
action.sortDirection = "desc";
GetLicenseRecordsAction.Result res = action.call();

Python SDK

GetLicenseRecordsAction action = GetLicenseRecordsAction()
action.limit = 20.0
action.start = 0.0
action.replyWithCount = true
action.count = false
action.sortBy = "uploadDate"
action.sortDirection = "desc"
GetLicenseRecordsAction.Result res = action.call()