GetLicenseInfo

API Request

URLs
GET zstack/v1/licenses
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -X GET http://localhost:8080/zstack/v1/licenses?
Request Parameters
Name Type Location Description Optional Value Starting Version
additionSession String query Optional. The additional information. The value is a JSON-formatted string. 4.1.0
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6
  • ZStack Cloud allows you to obtain the ID of the Cloud by adding the platformId option to SystemTags.
    • Format of the platformId option: platformId::{%s}。{%s}represents the first 10 digits of the md5 value calculated using the request key of the Cloud.
    • Example:platformId::a95d3ee34r

API Response

Sample Response
{   "inventory": {     "licenseType": "Free",     "licenseRequest": "example request",     "issuedDate": "2017-01-19 14:31:06",     "user": "example",     "hostNum": 10.0,     "expired": true,     "managementNodeUuid": "00898b3538e53e70bb7521e54ff80276"   },   "additions": [] }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory LicenseInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
licenseType String 0.6
licenseRequest String 0.6
expiredDate String 0.6
issuedDate String 0.6
user String 0.6
prodInfo String The license product name. 4.1.0
hostNum Integer 0.6
cpuNum Integer 0.6
availableHostNum Integer 0.6
availableCpuNum Integer 0.6
expired boolean 0.6

SDK Sample

Java SDK
GetLicenseInfoAction action = new GetLicenseInfoAction(); GetLicenseInfoAction.Result res = action.call();
Python SDK
GetLicenseInfoAction action = GetLicenseInfoAction() GetLicenseInfoAction.Result res = action.call()

GetLicenseRecords

API Request

URLs
GET zstack/v1/licenses/records
Curl Sample
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
Request Parameters
Name Type Location Description Valid Value Starting Version
limit Integer query Optional. The maximum number of records that cab be retrieved. Default: 20. This parameter is similar to the limit parameter in MySQL. 4.1.0
start Integer query Optional. The position to start a query. You need to set this parameter if you specify thelimit parameter. This parameter is similar to the offset parameter in MySQL. 4.1.0
replyWithCount boolean query Optional. Specifies whether to return the number of records. If you set the value to true, the number of records are returned. 4.1.0
count boolean query Optional. Specifies whether to count the number of records that meet the specified conditions. This parameter is similar to the count() function. If you set the value to true, the number of records that meet the specified conditions is calculated and returned. 4.1.0
sortBy String query Optional. Specifies to start records by a key, for example sortBy=ip. You need to specify the sortDirection parameter if you specify this parameter. This parameter is similar to the sort by parameter in MySQL. 4.1.0
sortDirection String query Optional. The sort direction. You need to set this parameter if you specify the sortByparameter. 4.1.0
systemTags List query Optional. The system tags. 4.1.0
userTags List query Optional. The user tags. 4.1.0

API Response

Sample Response
{   "inventories": [     {       "user": "example",       "hostNum": 10.0,       "licenseType": "Free",       "issuedDate": "2017-01-19 14:31:06",       "managementNodeUuid": "00898b3538e53e70bb7521e54ff80276",       "expired": true     }   ],   "total": 1.0 }
Name Type Description Starting Version
total Long The total number of historic license authorizations. This parameter is returned if you set count or replyWithCount to true. 4.1.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.1.0
inventory LicenseInventory See inventory 4.1.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.1.0
description String The brief description of the error. 4.1.0
details String The details about the error. 4.1.0
elaboration String The reserved field. Default value: null. 4.1.0
opaque LinkedHashMap The reserved field. Default value: null. 4.1.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.1.0
#inventory
Name Type Description Starting Version
uuid String 4.1.0
licenseType String 4.1.0
expiredDate String 4.1.0
issuedDate String 4.1.0
uploadDate String The license update time. 4.1.0
user String 4.1.0
prodInfo String The license product name. 4.1.0
hostNum Integer 4.1.0
cpuNum Integer 4.1.0
vmNum Integer 4.1.0
expired boolean 4.1.0
managementNodeUuid String 4.1.0

SDK Sample

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()

GetLicenseCapabilities

API Request
URLs
GET zstack/v1/licenses/capabilities
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/licenses/capabilities
Request Parameters
Name Type Location Description Optional Value Starting Version
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{     "error": {         "code": "SYS.1001",         "description": "A message or a operation timeout",         "details": "Create VM on KVM timeout after 300s"     } }

SDK Sample

Java SDK
GetLicenseCapabilitiesAction action = new GetLicenseCapabilitiesAction(); action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; GetLicenseCapabilitiesAction.Result res = action.call();
Python SDK
GetLicenseCapabilitiesAction action = GetLicenseCapabilitiesAction() action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" GetLicenseCapabilitiesAction.Result res = action.call()





Archives

Download Document Archives

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.