# 建立規格

Availability-note[測試版](https://help.talend.com/r/en-US/Cloud/labels-on-talend-help-center/availability-beta)

搶鮮版內容

在此情境中，您使用 Talend API 來建立規格，以提升專案品質。

## 關於此任務

以下是關於 API 呼叫的一些詳細資訊：

```
Method: POST
endpoint: api/v1/projects/quality/specifications
payload:[
  {
    "name": "string",
    "description": "string",
    "rules": [
      "string"
    ],
    "threshold": {
      "operator": "string",
      "value": 0,
      "type": "Percentage"
    }
  }
]
```

![已選取 API 以取得所有規格。](https://help.qlik.com/Resources/Images/qlik-talend-cloud-migration-toolkit-user-guide/tcmp-specs-api.png)

## 程序

1. 呼叫 GET /api/v1/projects/quality/rules 端點以取得所有規則。
2. 記下您要新增至要建立之新規格的規則 ID。
3. 呼叫 POST /api/v1/projects/quality/specifications 端點以建立規格。
4. 在 主體 區域中，輸入下列資訊：
   | 參數名稱 | 值 |
   | --- | --- |
   | 名稱 | 輸入規則名稱。 |
   | 描述 | 輸入規則的描述。 |
   | 規則 | 輸入一個或多個規則 ID。 |
   | 運算子 | 指定用於與閾值比較的<br>閾值：&lt;=、<br>\&gt;=、<br>=、<br>\&gt;= |
   | 值 | 輸入閾值的值。此值設定一個限制或邊界，在其之上或之下應觀察到某種情況。此欄位接受從 0 開始的數值。 |
   | 類型 | 輸入下列其中一種閾值類型：<br>百分比 或<br>數值。 |

   範例：
   ```
   {
     "name": "cloud-migration", 
     "description": "This specification contains rules related best practices for Talend Cloud Migration", 
     "rules": [
         "30599ac4-09b0-4abd", "30599ac4-09b0-4abc" 
         ], 
         "threshold": {
             "operator": "=", 
             "value": 0, 
             "type": "PERCENTAGE" 
          }
   }
   ```
5. 按一下 執行 以發出您的呼叫。

## 結果

規格已建立。