文档列表
本页内容

API接口参考:组织管理

Organization Endpoints

Organization(组织)用于将多个tenant统一管理在同一实体下。

Get Organization

获取tenant所属organization的信息。

Endpoint: GET /tenant/{tenantId}/organization

参数说明:

名称类型位置必填说明
tenantIdstringpathtenant唯一标识

返回结果:

{
	"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
	"displayName": "Acme Corporation",
	"createdAt": "2023-06-01T00:00:00Z"
}

Get Organization Statistics

获取organization下汇总统计数据。

Endpoint: GET /tenant/{tenantId}/organization/statistics

参数说明:

名称类型位置必填说明
tenantIdstringpathtenant唯一标识

返回结果:

{
	"tenantCount": 5,
	"totalProcessCount": 42,
	"totalDatasetCount": 18,
	"totalUserCount": 25,
	"totalStorageUsedBytes": 5368709120
}

List Organization Tenants

获取organization下所有tenant列表。

Endpoint: GET /tenant/{tenantId}/organization/tenants

参数说明:

名称类型位置必填说明
tenantIdstringpathtenant唯一标识

返回结果:

[
	{
		"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
		"displayName": "Sales Department",
		"createdAt": "2024-01-01T00:00:00Z"
	},
	{
		"id": "d4e5f6a7-b8c9-0123-def4-567890123456",
		"displayName": "Operations",
		"createdAt": "2024-02-15T00:00:00Z"
	}
]

Create Tenant

在organization中创建新的tenant。

Endpoint: POST /tenant/{tenantId}/organization/tenants

参数说明:

名称类型位置必填说明
tenantIdstringpathorganization下现有tenant的唯一标识

请求体示例:

{
	"shortName": "sales-team",
	"displayName": "Sales Team",
	"description": "销售部门tenant"
}
字段类型必填说明
shortNamestringURL友好标识(小写、可包含短横线)
displayNamestringtenant显示名称
descriptionstringtenant描述信息

返回结果: 返回新创建的tenant对象。


Delete Tenant

从organization中删除指定tenant。

Endpoint: DELETE /tenant/{tenantId}/organization/tenants/{targetTenantId}

参数说明:

名称类型位置必填说明
tenantIdstringpathorganization下现有tenant的唯一标识
targetTenantIdstringpath待删除tenant唯一标识

返回结果:

{
	"success": true
}

warning

删除tenant会永久移除所有process、数据集及用户分配,无法恢复。当前认证所用tenant无法删除。


Organization Users Endpoints

List Organization Users

获取organization下所有用户信息。

Endpoint: GET /tenant/{tenantId}/organization/users

参数说明:

名称类型位置必填说明
tenantIdstringpathtenant唯一标识

返回结果:

[
	{
		"id": "e5f6a7b8-c9d0-1234-efa5-678901234567",
		"email": "admin@example.com",
		"firstName": "Jane",
		"lastName": "Smith",
		"createdAt": "2023-06-01T00:00:00Z",
		"lastLoginAt": "2024-03-01T10:00:00Z",
		"organizationId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
		"isActiveInOrganization": true,
		"isAdminInOrganization": true
	}
]

Update Organization User

更新用户在organization里的权限。

Endpoint: PUT /tenant/{tenantId}/organization/users

请求体示例:

{
	"userId": "e5f6a7b8-c9d0-1234-efa5-678901234567",
	"organizationId": "c3d4e5f6-a7b8-9012-cdef-345678901234",
	"isActiveInOrganization": true,
	"isAdminInOrganization": true
}
字段类型必填说明
userIdstring用户唯一标识
organizationIdstringorganization唯一标识
isActiveInOrganizationboolean是否激活
isAdminInOrganizationboolean是否为organization管理员

返回结果:

{
	"message": "User organization settings updated."
}

Remove Organization User

彻底从organization移除指定用户。

Endpoint: DELETE /tenant/{tenantId}/organization/users

请求体示例:

{
	"userId": "e5f6a7b8-c9d0-1234-efa5-678901234567",
	"organizationId": "c3d4e5f6-a7b8-9012-cdef-345678901234"
}
字段类型必填说明
userIdstring待移除用户唯一标识
organizationIdstringorganization唯一标识

返回结果:

{
	"message": "User removed from organization."
}

warning

移除用户后,将撤销其访问organization下全部tenant的权限。