查询指定软件许可证信息
更新时间 2025-09-29 17:49:35
最近更新时间: 2025-09-29 17:49:35
本节主要介绍如何使用API查询指定软件许可证信息。
查询指定软件许可证的信息。信息包括软件许可证的record信息以及usage信息:
record信息:购买记录的信息。
usage信息:软件许可证在不同时间段内的对应的容量和状态信息。
请求语法
GET /rest/v1/system/license/licenseId?show=show HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Content-Length: length
Host: ip:port
Authorization: authorization请求参数
| 名称 | 类型 | 描述 | 是否必须 |
|---|---|---|---|
| licenseId | String | 软件许可证的ID。 | 否 |
| show | String | 查询的输出结果,record、usage。 如果不填写,就是默认两个信息都输出。 | 否 |
响应结果
| 名称 | 类型 | 描述 |
|---|---|---|
| licenseId | String | 软件许可证ID。 |
| account | String | 软件许可证所属的账号。 |
| customerName | String | 客户名称。 说明 如果申请许可证时未填写,不显示此字段。 |
| type | String | 软件许可证的购买类型:
|
| status | String | 软件许可证的状态:
如果软件许可证是Perpetual类型的,不存在过期状态。 |
| maximumLocalCapacity | Long | 当前时间允许的最大本地卷容量,单位TiB。如果不限容量,不返回此项。 |
| records | Array of record | 软件许可证的购买记录的集合,详见“表1 响应参数record说明”。 |
| usages | Array of usage | 软件许可证使用记录的集合,详见“表2 响应参数usage说明”。 |
表1 响应参数record说明
| 名称 | 类型 | 描述 |
|---|---|---|
| purchaseTime | Long | 记录购买的时间,unix时间戳(UTC),精确到毫秒。 |
| operationtype | String | 软件许可证的操作记录:
|
| localCapacity | Long | 本次购买对应的本地卷容量,单位TiB。如果不限容量,不返回此项。 |
| subscribeEffectiveTime | Long | 对于订阅模式的软件许可证,本次购买操作对应的软件许可证生效时间,unix时间戳(UTC),精确到毫秒。 |
| subscribeExpireTime | Long | 对于订阅模式的软件许可证,本次购买操作对应的软件许可证的过期时间,unix时间戳(UTC),精确到毫秒。 |
| maintenanceEffectiveTime | Long | 对于永久许可模式的软件许可证,本次购买操作对应的维保生效时间,unix时间戳(UTC),精确到毫秒。 |
| maintenanceExpireTime | Long | 对于永久许可模式的软件许可证,本次购买操作对应的维保的过期时间,unix时间戳(UTC),精确到毫秒。 |
| substatus | String | 本次购买操作的当前状态:
|
表2 响应参数usage说明
| 名称 | 类型 | 描述 |
|---|---|---|
| maximumLocalCapacity | Long | 对应时间段内允许的最大本地卷容量,单位TiB。如果不限容量,不返回此项。 |
| subscribeEffectiveTime | Long | 对于订阅模式的软件许可证,许可证对应的生效时间,unix时间戳(UTC),精确到毫秒。 |
| subscribeExpireTime | Long | 对于订阅模式的软件许可证,许可证对应的过期时间,unix时间戳(UTC),精确到毫秒。 |
| maintenanceEffectiveTime | Long | 对于永久许可模式的软件许可证,许可证对应的维保生效时间,unix时间戳(UTC),精确到毫秒。 |
| maintenanceExpireTime | Long | 对于永久许可模式的软件许可证,许可证对应的维保过期时间,unix时间戳(UTC),精确到毫秒。 |
| substatus | String | 对于订阅模式的软件许可证,表示对应时间段内许可证的状态;对于永久许可模式的软件许可证,表示对应时间段内许可证的维保状态:
|
请求示例1
订阅模式:查询软件许可证ID为ehc2b6a9-f3fb-4098-a6b3-3652a5d71232的软件许可证信息。
GET /rest/v1/system/license/ehc2b6a9-f3fb-4098-a6b3-3652a5d71232 HTTP/1.1
Date: Tue, 05 Aug 2025 02:40:01 GMT
Authorization: HBlock userName:signature
Host:192.168.0.66:1443响应示例1
HTTP/1.1 200 OK
x-hblock-request-id: e4a388cfebe24398a09ee6bdc5d22b2a
Connection: keep-alive
Content-Length: 518
Date: Tue, 05 Aug 2025 02:40:01 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"licenseId": "ehc2b6a9-f3fb-4098-a6b3-3652a5d71232",
"account": "testaccount1@ctyun.com",
"status": "Effective",
"type": "Subscription",
"maximumLocalCapacity": 1024,
"records": [
{
"purchaseTime": 1753857636859,
"operationtype": "New",
"localCapacity": 1024,
"subscribeEffectiveTime": 1753857636859,
"subscribeExpireTime": 1785393636859,
"substatus": "Effective"
}
],
"usages": [
{
"maximumLocalCapacity": 1024,
"subscribeEffectiveTime": 1753857636859,
"subscribeExpireTime": 1785393636859,
"substatus": "Effective"
}
]
}
}请求示例2
永久许可模式:查询软件许可证ID为qws2b6a9-f3fb-4098-a6b3-3652a5a76530的软件许可证信息。
GET /rest/v1/system/license/qws2b6a9-f3fb-4098-a6b3-3652a5a76530 HTTP/1.1
Date: Tue, 05 Aug 2025 02:17:13 GMT
Authorization: HBlock userName:signature
Host:192.168.0.65:1443响应示例2
HTTP/1.1 200 OK
x-hblock-request-id: 7b4ee400d293497bba0c9182b256e678
Connection: keep-alive
Content-Length: 518
Date: Tue, 05 Aug 2025 02:17:13 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"licenseId": "qws2b6a9-f3fb-4098-a6b3-3652a5a76530",
"account": "test@ctyun.cn",
"customerName": "Customer ABC",
"status": "Effective",
"type": "Perpetual",
"maximumLocalCapacity": 2048,
"records": [
{
"purchaseTime": 1754357667366,
"operationtype": "New",
"localCapacity": 2048,
"maintenanceEffectiveTime": 1754357667366,
"maintenanceExpireTime": 1785893667366,
"substatus": "Effective"
}
],
"usages": [
{
"maximumLocalCapacity": 2048,
"maintenanceEffectiveTime": 1754357667366,
"maintenanceExpireTime": 1785893667366,
"substatus": "Effective"
}
]
}
}