通过 API 分配许可证

此功能仅适用于 Incredibuild 的 Enterprise Plan

您可以使用此 API 向 Agent 分配许可证。该过程需要 API 密钥和企业许可证。

请求端点

发布 https://<coordinatorIP>:8000/api/license/setAgentLicense?coordinatorId=<coordinator ID>&version=<API version>

版本是 Incredibuild API 版本对于分配许可证 API,目前仅支持 1.3.0 版。

例如:

POST https://10.132.15.166:8000/api/license/setAgentLicense?coordinatorId=12345&version=1.3.0

请求格式:

标题:标题必须包含一个名为 client-api-key 的密钥和 API 密钥值字符串。

主体:请求主体是一个 Agent 数组,其中每个项目包含以下某些字段。这些字段必须按照下面指定的顺序排列。每个请求最多可以包含 100 个 Agent。

字段 数据类型 备注
agentName 必须与 Coordinator Manager Agent List 中的名称匹配 字符串

 

helperLicense {"none", "fixed", "floating"} 字符串

 

initiatorLicense {"none", "fixed", "floating"} 字符串

 

ciInitiatorLicense {"none", "fixed", "floating"} 字符串

 

requestedCores 整数 整数

用作 Helper 的最大内核数。

enableAgent

{"true", "false"}

布尔

Enable as helper

buildCache

{"true", "false"}

布尔

分配 Build Cache

主体示例

复制
{
  "agents": [
    {
      "agentName": "Agent1",
  "initiatorLicense": "Fixed"
      "helperLicense": "Fixed"
      "buildCache": true,   
      "enableAgent": true
    },
{
      "agentName": "Agent2",
      "ciInitiatorLicense":"Fixed",
      "helperLicense": "Floating"
      "requestedCores": 4,
      "buildCache": false,   
      "enableAgent": false
    },
{
      "agentName": "Agent3",
      "ciInitiatorLicense":"Floating",
      "helperLicense": "Fixed"
      "requestedCores": 8,  
      "enableAgent": true
    },
{
      "agentName": "Agent4",
      "ciInitiatorLicense":"None",
      "helperLicense": "None"
      "buildCache": false,   
      "enableAgent": false
    }
  ]
}