Skip to content

Commit

Permalink
feat: support full list tenant api
Browse files Browse the repository at this point in the history
  • Loading branch information
nannan00 committed Jan 2, 2025
1 parent b301ee4 commit d9cef2c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 62 deletions.
1 change: 1 addition & 0 deletions src/bk-user/bkuser/apis/open_v3/views/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@


class TenantListApi(OpenApiCommonMixin, generics.ListAPIView):
pagination_class = None
serializer_class = TenantListOutputSLZ
queryset = Tenant.objects.all()

Expand Down
44 changes: 13 additions & 31 deletions src/bk-user/support-files/apidocs/en/list_tenant.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,30 @@
### Description

Query the tenant list by pagination

### Parameters

| Name | Type | Required | Description |
|-----------|------|----------|-----------------------------------------|
| page | int | No | page number, default is 1 |
| page_size | int | No | number of pages per page, default is 10 |

### Request Example

```json5
// URL Query Parameters
page=1&page_size=10
```
Query the tenant list

### Response Example

```json5
{
"data": {
"count": 2,
"results": [
{
"id": "default",
"name": "Default",
"status": "enabled"
},
{
"id": "test",
"name": "Test",
"status": "disabled"
}
]
}
"data": [
{
"id": "default",
"name": "Default",
"status": "enabled"
},
{
"id": "test",
"name": "Test",
"status": "disabled"
}
]
}
```

### Response Parameters Description

| Name | Type | Description |
|--------|--------|------------------------------------------------------------|
| count | int | the total number of tenants |
| id | string | tenant ID |
| name | string | the name of tenant |
| status | string | the status of tenant, which can be `enabled` or `disabled` |
44 changes: 13 additions & 31 deletions src/bk-user/support-files/apidocs/zh/list_tenant.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,30 @@
### 描述

分页查询租户列表

### 输入参数

| 参数名称 | 参数类型 | 必选 | 描述 |
|-----------|------|----|-------------|
| page | int || 页数, 默认为 1 |
| page_size | int || 每页数量,默认为 10 |

### 请求示例

```json5
// URL Query 参数
page=1&page_size=10
```
查询租户列表

### 响应示例

```json5
{
"data": {
"count": 2,
"results": [
{
"id": "default",
"name": "Default",
"status": "enabled"
},
{
"id": "test",
"name": "Test",
"status": "disabled"
}
]
}
"data": [
{
"id": "default",
"name": "Default",
"status": "enabled"
},
{
"id": "test",
"name": "Test",
"status": "disabled"
}
]
}
```

### 响应参数说明

| 参数名称 | 参数类型 | 描述 |
|--------|--------|---------------------------------|
| count | int | 租户总数 |
| id | string | 租户 ID |
| name | string | 租户名 |
| status | string | 租户状态,enabled 表示启用,disabled 表示禁用 |

0 comments on commit d9cef2c

Please sign in to comment.