License
License
为了与许可证端点进行交互,您需要以管理员身份进行身份验证.
GET /licenses
- 如果许可证已过期,则使用历史最大活动用户数(
historical_max
). - 如果许可证尚未过期,则使用当前活动用户数.
Returns:
200 OK
,响应包含 JSON 格式的许可证. 如果没有许可证,这将是一个空的 JSON 数组.403 Forbidden
如果当前用户不允许阅读许可证,403 Forbidden
.
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/license?license=eyJkYXRhIjoiMHM5Q...S01Udz09XG4ifQ=="
Returns:
201 Created
如果成功添加许可证,则201 Created
.400 Bad Request
如果无法添加许可证),并附有一条错误消息,说明原因.
Attribute | Type | Required | Description |
---|---|---|---|
id |
integer | yes | GitLab 许可证的 ID. |
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/license/:id"
Returns:
204 No Content
如果成功删除了许可证,则204 No Content
.403 Forbidden
如果当前用户不允许删除许可证,则禁止.