列出聯合規則工作區
GET/v1/organizations/federation_rules/{federation_rule_id}/workspaces
需要具有 org:admin 範圍的 OAuth 存取權杖,可透過 ant auth login --scope org:admin 或工作負載身分聯合(workload identity federation)規則取得;不接受 Admin API 金鑰。請參閱使用 Admin API 管理 WIF。
列出已啟用此聯合規則的工作區。
在單一回應中傳回所有工作區啟用設定;limit 和 page 參數雖可接受但不會產生作用,且 next_page 一律為 null。僅傳回明確的個別工作區啟用設定;對於設定了 applies_to_all_workspaces 或舊版單一 workspace_id 的規則,請直接檢查規則本身的這些欄位。
Parameters
Returns
列出聯合規則工作區
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
page = client.beta.organization.federation.rules.workspaces.list(
federation_rule_id="federation_rule_id",
)
page = page.data[0]
print(page.created_by_actor_id)Response 200
{
"data": [
{
"created_at": "2024-10-30T23:58:27.427722Z",
"created_by_actor_id": "created_by_actor_id",
"federation_rule_id": "federation_rule_id",
"type": "federation_rule_workspace",
"workspace_id": "workspace_id",
"workspace_name": "workspace_name"
}
],
"next_page": "next_page"
}Returns Examples
Response 200
{
"data": [
{
"created_at": "2024-10-30T23:58:27.427722Z",
"created_by_actor_id": "created_by_actor_id",
"federation_rule_id": "federation_rule_id",
"type": "federation_rule_workspace",
"workspace_id": "workspace_id",
"workspace_name": "workspace_name"
}
],
"next_page": "next_page"
}