Get License Info (GetLicenseInfo)

API Request

URLs
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
Name Type Location Description Allowed Values Starting Version
additionSession (Optional) String query Additional information, a JSON string 4.1.0
systemTags (Optional) List query System tags 0.6
userTags (Optional) List query User tags 0.6
  • ZStack ZSphere 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": [] }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 0.6
inventory LicenseInventory See inventory for details 0.6
#error
Name Type Description Starting Version
code String The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 0.6
description String A brief description of the error 0.6
details String The detailed error information 0.6
elaboration String Reserved field. Default is null 0.6
opaque LinkedHashMap Reserved field. Default is null 0.6
cause ErrorCode The root error that caused the current error. If no root error exists, this field is null 0.6
#inventory
Name Type Description Starting Version
uuid String The UUID of the resource. Uniquely identifies the resource 4.1.0
licenseType String 0.6
licenseRequest String 0.6
expiredDate String 0.6
issuedDate String 0.6
user String 0.6
prodInfo String License product name 4.1.0
hostNum Integer 0.6
cpuNum Integer 0.6
vmNum Integer 4.1.0
availableHostNum Integer 0.6
availableCpuNum Integer 0.6
availableVmNum Integer 4.1.0
expired boolean 0.6
managementNodeUuid String 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()

Get License Records (GetLicenseRecords)

API Request

URLs
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
Name Type Location Description Allowed Values Starting Version
limit (Optional) Integer query Maximum number of records to return, similar to MySQL limit. Default value is 20 4.1.0
start (Optional) Integer query Starting query record position, similar to MySQL offset. Used with limit to implement pagination 4.1.0
replyWithCount (Optional) boolean query Count 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) boolean query Count 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) String query Sort by field, equivalent to the sort by keyword in MySQL, for example sortBy=ip. Must be used with sortDirection 4.1.0
sortDirection (Optional) String query Field sort direction. Must be used with sortBy 4.1.0
systemTags (Optional) List query System tags 4.1.0
userTags (Optional) List query User 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 }
Name Type Description Starting Version
total Long Total license history authorization data count. This value is returned when count or replyWithCount is set to true 4.1.0
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. See error for details 4.1.0
inventory LicenseInventory See inventory for details 4.1.0
#error
Name Type Description Starting Version
code String The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 4.1.0
description String A brief description of the error 4.1.0
details String The detailed error information 4.1.0
elaboration String Reserved field. Default is null 4.1.0
opaque LinkedHashMap Reserved field. Default is null 4.1.0
cause ErrorCode The root error that caused the current error. If no root error exists, this field 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 License upload time 4.1.0
user String 4.1.0
prodInfo String 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 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()

Get License Capabilities (GetLicenseCapabilities)

API Request

URLs
GET zstack/v1/licenses/capabilities
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/licenses/capabilities
Parameter List
Name Type Location Description Allowed Values Starting Version
systemTags (Optional) List query System tags 0.6
userTags (Optional) List query User tags 0.6

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains 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 Examples

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.
Cannot be empty.
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.