Get License Info

GET/zstack/v1/licenses

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-X GET http://localhost:8080/zstack/v1/licenses

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
additionSession (Optional)StringqueryAdditional information, a JSON string 4.1.0
systemTags (Optional)ListquerySystem tags 0.6
userTags (Optional)ListqueryUser tags 0.6
  • ZSvirt supports retrieving the virtualization platform ID when getting license info. The SystemTags parameter adds the platformId option.
    • The option format is: platformId::{%s}. Where {%s} is the first 10 characters of the request code MD5 value.
    • For example: platformId::a95d3ee34r

API Response

Response Example

{
  "inventory": {
    "licenseType": "Free",
    "licenseRequest": "example request",
    "issuedDate": "2017-01-19 14:31:06",
    "user": "example",
    "hostNum": 10.0,
    "expired": true,
    "managementNodeUuid": "00898b3538e53e70bb7521e54ff80276"
  },
  "additions": []
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details0.6
inventoryLicenseInventorySee inventory for details0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringThe detailed error information0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. If no root error exists, this field is null0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource4.1.0
licenseTypeString 0.6
licenseRequestString 0.6
expiredDateString 0.6
issuedDateString 0.6
userString 0.6
prodInfoStringLicense product name4.1.0
hostNumInteger 0.6
cpuNumInteger 0.6
vmNumInteger 4.1.0
availableHostNumInteger 0.6
availableCpuNumInteger 0.6
availableVmNumInteger 4.1.0
expiredboolean 0.6
managementNodeUuidString 4.1.0

SDK Examples

Java SDK

GetLicenseInfoAction action = new GetLicenseInfoAction();
GetLicenseInfoAction.Result res = action.call();

Python SDK

GetLicenseInfoAction action = GetLicenseInfoAction()
GetLicenseInfoAction.Result res = action.call()