予算
REST API を使用して予算情報を取得します。
重要
以下の要求本文スキーマに必須フィールドがありません。
budget_scopeがuserされている場合は、予算が適用されるuserユーザー名に設定されたGitHubフィールドも含める必要があります。 このフィールドを省略すると、API は HTTP 400: Missing required fields: budget_entity_name返します。 ユーザー スコープの予算の場合、 budget_entity_name は空の文字列にすることができます。
次の例では、1 人のユーザーの毎月の CopilotAI credits を $30 USD に制限するユーザー スコープの予算を作成します。
{
"budget_amount": 30,
"prevent_further_usage": true,
"budget_scope": "user",
"budget_entity_name": "",
"budget_type": "BundlePricing",
"budget_product_sku": "ai_credits",
"budget_alerting": {
"will_alert": false,
"alert_recipients": []
},
"user": "USERNAME"
}
Get all budgets for an organization
Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager. Each page returns up to 100 budgets.
"Get all budgets for an organization" のきめ細かいアクセス トークン
このエンドポイントは、次の粒度の細かいトークンの種類で動作します:
粒度の細かいトークンには次のアクセス許可セットが設定されている必要があります:
- "Administration" organization permissions (read)
"Get all budgets for an organization" のパラメーター
| 名前, タイプ, 説明 |
|---|
accept string Setting to |
| 名前, タイプ, 説明 |
|---|
org string 必須The organization name. The name is not case sensitive. |
| 名前, タイプ, 説明 |
|---|
page integer The page number of the results to fetch. デフォルト: |
per_page integer The number of results per page (max 100). デフォルト: |
scope string Filter budgets by scope type.
次のいずれかにできます: |
user string Filter consumed amount details for budgets by the specified user login. |
"Get all budgets for an organization" の HTTP 応答状態コード
| 状態コード | 説明 |
|---|---|
200 | Response when getting all budgets |
403 | Forbidden |
404 |