此操作用来导入软件许可证。
请求语法
POST /rest/v1/system/license HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Content-Length: length
Host: ip:port
Authorization: authorization
{
"key": "key"
}
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
key | String | 软件许可证密钥。 | 是 |
响应结果
名称 | 类型 | 描述 |
---|---|---|
licenseId | String | 软件许可证ID。 |
account | 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 | 对于订阅模式的软件许可证,表示对应时间段内许可证的状态;对于永久许可模式的软件许可证,表示对应时间段内许可证的维保状态:
|
请求示例
导入软件许可证
POST /rest/v1/system/license HTTP/1.1
Date: Thu, 17 Mar 2022 08: 26: 28 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 876
Host: 192.168.0.121: 1443
Authorization: HBlock userName:signature
{
"key": "xxxxxxxxxxxxxx"
}
响应示例
HTTP/1.1 200 OK
Date: Thu, 17 Mar 2022 08: 26: 28 GMT
Content-Length: 658
Connection: keep-alive
Content-Type: application/json; charset=utf-8
x-hblock-request-id: 24f2b6f45baf49a69fa9d0bfad1d76f3
Server: HBlock
{
"data": {
"licenseId": "ehc2b6a9-f3fb-4098-a6b3-3652a5d76269",
"account": "xxx@testcom.cn",
"status": "Effective",
"type": "Subscription",
"maximumLocalCapacity": 2048,
"records": [
{
"purchaseTime": 1647505314201,
"operationtype": "New",
"localCapacity": 2048,
"subscribeEffectiveTime": 1647505314201,
"subscribeExpireTime": 1655281314201,
"substatus": "Effective"
},
{
"purchaseTime": 1650097314201,
"operationtype": "Renew",
"localCapacity": 2048,
"subscribeEffectiveTime": 1655281314201,
"subscribeExpireTime": 1663057314201,
"substatus": "NotStart"
}
],
"usages": [
{
"maximumLocalCapacity": 2048,
"subscribeEffectiveTime": 1647505314201,
"subscribeExpireTime": 1663057314201,
"substatus": "Effective"
}
]
}
}