单元管理接口
列举企业组织根单元
接口描述
查看指定的企业组织的根单元信息。当前每个企业组织仅包含一个根单元。
请求结构
1GET /v1/organization/{organizationId}/root HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
名称 | 类型 | 描述 |
---|---|---|
units | List<OrganizationUnit> | 单元的的列表 |
请求示例
1GET /v1/organization/{organizationId}/root HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "root unit",
8 "id": "25fc10b3bc61437aa72b35f76515b375",
9 "createTime": "2018-08-29T12:02:23Z",
10 "name": "root"
11}
创建企业组织单元
接口描述
创建企业组织单元。
请求结构
1POST /v1/organization/{organizationId}/unit HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "name": "name",
7 "description": "description"
8}
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
name | String | RequestBody参数 | 企业组织名称 | 是 |
parentId | String | RequestBody参数 | 上级单元的ID,未指定时默认为根单元 | 否 |
description | String | RequestBody参数 | 企业组织描述 | 否 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
请求示例
1POST /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
4
5{"name":"testUnit", "description":"test"}
响应示例
1HTTP/1.1 201 Created
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "test",
8 "id": "a6ed8b858a094187b3e3cb95da73b415",
9 "createTime": "2019-09-23T11:55:44Z",
10 "name": "testUnit"
11}
删除企业组织单元
接口描述
删除企业组织单元。
说明:删除单元前需要将全部成员从单元内移除,并解除所有权限策略的关联。
请求结构
1DELETE /v1/organization/{organizationId}/unit/{unitId} HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
unitId | String | URL参数 | 单元ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
无。
请求示例
1DELETE /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit/56071515f49a49a0aea628e80ebebfde
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 204 No Content
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
查看企业组织单元
接口描述
查看指定的企业组织单元。
请求结构
1GET /v1/organization/{organizationId}/unit/{unitId} HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
unitId | String | URL参数 | 单元ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
请求示例
1GET /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit/a6ed8b858a094187b3e3cb95da73b415
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "test",
8 "id": "a6ed8b858a094187b3e3cb95da73b415",
9 "createTime": "2019-09-23T11:55:44Z",
10 "name": "testUnit"
11}
更新企业组织单元
接口描述
更新指定的企业组织单元。
请求结构
1PUT /v1/organization/{organizationId}/unit/{unitId} HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
4
5{"name":"name", "description":"description"}
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
unitId | String | URL参数 | 单元ID | 是 |
name | String | RequestBody参数 | 企业组织名称 | 否 |
description | String | RequestBody参数 | 企业组织描述 | 否 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
请求示例
1PUT /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit/a6ed8b858a094187b3e3cb95da73b415
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
4
5{"name":"testunit", "description":"test description"}
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "test description",
8 "id": "a6ed8b858a094187b3e3cb95da73b415",
9 "createTime": "2019-09-23T11:55:44Z",
10 "name": "testunit"
11}
列举单元账户
接口描述
列举指定企业组织单元中的成员账户,不包括子单元的成员。
请求结构
1GET /v1/organization/{organizationId}/unit/{unitId}/account HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
unitId | String | URL参数 | 单元ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
名称 | 类型 | 描述 |
---|---|---|
accounts | List<Account> | 账户的的列表 |
请求示例
1GET /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit/25fc10b3bc61437aa72b35f76515b375/account
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6[
7 {
8 "mobile": "+86********243",
9 "status": "ACTIVE",
10 "description": "",
11 "id": "a7409103bba94b0c8edf446a22c72bf7",
12 "name": "bceaccount123"
13 },
14 {
15 "mobile": "+86********243",
16 "status": "ACTIVE",
17 "description": "test organization account",
18 "id": "bfdbd1e6316b4729ab49f2cb25710068",
19 "name": "accountasdx"
20 }
21]
列举单元子单元
接口描述
列举指定企业组织单元中的成员子单元,不包括子单元的成员。
请求结构
1GET /v1/organization/{organizationId}/unit/{unitId}/unit HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
unitId | String | URL参数 | 单元ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
名称 | 类型 | 描述 |
---|---|---|
units | List<OrganizationUnit> | 单元的的列表 |
请求示例
1GET /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit/25fc10b3bc61437aa72b35f76515b375/unit
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6[
7 {
8 "description": "test description",
9 "id": "a6ed8b858a094187b3e3cb95da73b415",
10 "createTime": "2019-09-23T11:55:44Z",
11 "name": "testunit"
12 }
13]
列举单元上级
接口描述
列举指定企业组织单元的直接上级。
请求结构
1GET /v1/organization/{organizationId}/unit/{unitId}/parent HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
unitId | String | URL参数 | 单元ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
请求示例
1GET /v1/organization/25fc10b3bc61437aa72b35f76515b375/unit/a6ed8b858a094187b3e3cb95da73b415/parent
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "root unit",
8 "id": "25fc10b3bc61437aa72b35f76515b375",
9 "createTime": "2018-08-29T12:02:23Z",
10 "name": "root"
11}
列举账户上级
接口描述
列举指定账户的直接上级。
请求结构
1GET /v1/organization/{organizationId}/account/{accountId}/parent HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
accountId | String | URL参数 | 账户ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
请求示例
1GET /v1/organization/25fc10b3bc61437aa72b35f76515b375/account/bfdbd1e6316b4729ab49f2cb25710068/parent
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "root unit",
8 "id": "25fc10b3bc61437aa72b35f76515b375",
9 "createTime": "2018-08-29T12:02:23Z",
10 "name": "root"
11}
移动账户
接口描述
将指定的账户,从原有单元移动到新的单元(或根单元)。
请求结构
1PUT /v1/organization/{organizationId}/account/{accountId}?parent HTTP/1.1
2Host: organization.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "sourceUnitId": "source unit id",
7 "destinationUnitId": "destination unit id"
8}
请求头域
除公共头域外,无其它特殊头域。
请求参数
名称 | 类型 | 位置 | 描述 | 是否必须 |
---|---|---|---|---|
organizationId | String | URL参数 | 企业组织ID | 是 |
accountId | String | URL参数 | 账户ID | 是 |
sourceUnitId | String | RequestBody参数 | 原有父单元ID | 是 |
destinationUnitId | String | RequestBody参数 | 新的父单元ID | 是 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
OrganizationUnit对象,新的父单元信息。
请求示例
1PUT /v1/organization/25fc10b3bc61437aa72b35f76515b375/account/bfdbd1e6316b4729ab49f2cb25710068?parent
2host: organization.bj.baidubce.com
3Authorization: AuthorizationString
响应示例
1HTTP/1.1 200 OK
2Content-Type: application/json;charset=UTF-8
3X-Bce-Request-Id: fc96771d-f2a3-4b1a-8ed2-ea7665461baf
4Server: BWS
5
6{
7 "description": "test description",
8 "id": "a6ed8b858a094187b3e3cb95da73b415",
9 "createTime": "2019-09-23T11:55:44Z",
10 "name": "testunit"
11}