你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Entities - List

列出已通过身份验证的用户的所有实体(管理组、订阅等)。

POST https://management.azure.com/providers/Microsoft.Management/getEntities?api-version=2020-05-01
POST https://management.azure.com/providers/Microsoft.Management/getEntities?api-version=2020-05-01&$skiptoken={$skiptoken}&$skip={$skip}&$top={$top}&$select={$select}&$search={$search}&$filter={$filter}&$view={$view}&groupName={groupName}

URI 参数

名称 必需 类型 说明
api-version
query True

string

要与客户端请求一起使用的 API 的版本。 当前版本为 2018-01-01-preview。

$filter
query

string

使用 filter 参数可以筛选名称字段或显示名称字段。 可以在名称字段 (例如 name eq “{entityName}”) )上检查相等,并且可以检查名称字段或显示名称字段上的子字符串 (例如,包含 (名称、“{substringToSearch}”) 、contains (displayName、'{substringToSearch') ) 。 请注意,“{entityName}”和“{substringToSearch}”字段不区分大小写。

$search
query

string

$search 参数与 $filter 参数结合使用,根据传入的参数返回三个不同的输出。 使用 $search=AllowedParents 时,API 将返回请求的实体能够根据用户权限确定的所有组的实体信息。 使用 $search=AllowedChildren,API 将返回可添加为所请求实体子级的所有实体的实体信息。 使用 $search=ParentAndFirstLevelChildren,API 将返回用户直接访问或通过其一个后代间接访问的父级和第一级子级。 使用 $search=ParentOnly 时,如果用户至少有权访问该组的一个后代,则 API 将仅返回该组。 使用 $search=ChildrenOnly 时,API 将仅返回$filter中指定的组实体信息的第一级子级。 用户必须具有对子实体或其子实体之一的直接访问权限,才能显示在结果中。

$select
query

string

此参数指定要包含在响应中的字段。 可以包括 Name、DisplayName、Type、ParentDisplayNameChain、ParentChain 的任意组合,例如“$select=Name,DisplayName,Type,ParentDisplayNameChain,ParentNameChain”。 指定后,$select参数可以替代$skipToken中的选择。

$skip
query

integer

检索结果时要跳过的实体数。 传入此项将覆盖$skipToken。

$skiptoken
query

string

仅当上一个操作返回部分结果时,才使用页面延续标记。 如果以前的响应包含 nextLink 元素,则 nextLink 元素的值将包含一个标记参数,该参数指定要用于后续调用的起点。

$top
query

integer

检索结果时要返回的元素数。 传入此项将覆盖$skipToken。

$view
query

string

view 参数允许客户端筛选 getEntities 调用返回的数据类型。

groupName
query

string

一个筛选器,允许获取实体调用专注于特定组 (即“$filter=name eq 'groupName'”)

请求头

名称 必需 类型 说明
Cache-Control

string

指示请求不应使用任何缓存。

响应

名称 类型 说明
200 OK

EntityListResult

确定

Other Status Codes

ErrorResponse

错误

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

GetEntities

Sample Request

POST https://management.azure.com/providers/Microsoft.Management/getEntities?api-version=2020-05-01

Sample Response

{
  "value": [
    {
      "id": "/providers/Microsoft.Management/managementGroups/20000000-0001-0000-0000-000000000000",
      "type": "Microsoft.Management/managementGroups",
      "name": "20000000-0001-0000-0000-000000000000",
      "properties": {
        "tenantId": "20000000-0000-0000-0000-000000000000",
        "displayName": "Group 1 Tenant 2",
        "parent": {
          "id": "/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"
        },
        "permissions": "view",
        "inheritedPermissions": "view",
        "parentDisplayNameChain": [
          "Tenant Root Group",
          "Group 1 Tenant 2 Parent"
        ],
        "parentNameChain": [
          "TenantRootGroup",
          "Group1Tenant2Parent"
        ],
        "numberOfDescendants": 3,
        "numberOfChildren": 2,
        "numberOfChildGroups": 1
      }
    },
    {
      "id": "/providers/Microsoft.Management/managementGroups/20000000-0004-0000-0000-000000000000",
      "type": "Microsoft.Management/managementGroups",
      "name": "20000000-0004-0000-0000-000000000000",
      "properties": {
        "tenantId": "20000000-0000-0000-0000-000000000000",
        "displayName": "Group 4 Tenant 2",
        "parent": {
          "id": "/providers/Microsoft.Management/managementGroups/20000000-0000-0000-0000-000000000000"
        },
        "permissions": "delete",
        "inheritedPermissions": "delete",
        "parentDisplayNameChain": [
          "Tenant Root Group",
          "Group 4 Tenant 2 Parent"
        ],
        "parentNameChain": [
          "TenantRootGroup",
          "Group4 Tenant2Parent"
        ],
        "numberOfDescendants": 0,
        "numberOfChildren": 0,
        "numberOfChildGroups": 0
      }
    }
  ],
  "nextLink": null
}

定义

名称 说明
EntityInfo

实体。

EntityListResult

描述请求查看实体的结果。

EntityParentGroupInfo

(可选) 父管理组的 ID。

ErrorDetails

错误的详细信息。

ErrorResponse

错误对象。

Permissions

用户对此项目的特定权限。

EntityInfo

实体。

名称 类型 说明
id

string

实体的完全限定 ID。 例如,/providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000

name

string

实体的名称。 例如,00000000-0000-0000-0000-000000000000

properties.displayName

string

管理组的友好名称。

properties.inheritedPermissions

Permissions

继承的权限
用户对此项目的特定权限。

properties.numberOfChildGroups

integer

子组数
子级数是当前组下一个级别的组数。

properties.numberOfChildren

integer

子级数
子级数是恰好在当前组下一个级别的组和订阅数。

properties.numberOfDescendants

integer

后代数

properties.parent

EntityParentGroupInfo

Parent
(可选) 父管理组的 ID。

properties.parentDisplayNameChain

string[]

从根组到直接父组的父显示名称链

properties.parentNameChain

string[]

父名称链从根组到直接父级

properties.permissions

Permissions

权限
用户对此项目的特定权限。

properties.tenantId

string

与实体关联的 AAD 租户 ID。 例如,00000000-0000-0000-0000-000000000000

type

string

资源类型。 例如,Microsoft.Management/managementGroups

EntityListResult

描述请求查看实体的结果。

名称 类型 说明
count

integer

与筛选器匹配的记录总数

nextLink

string

用于获取下一组结果的 URL。

value

EntityInfo[]

实体列表。

EntityParentGroupInfo

(可选) 父管理组的 ID。

名称 类型 说明
id

string

父管理组的完全限定 ID。 例如,/providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000

ErrorDetails

错误的详细信息。

名称 类型 说明
code

string

服务器定义的一组错误代码中的一个。

details

string

错误详细信息的可读表示形式。

message

string

错误的用户可读表示形式。

ErrorResponse

错误对象。

名称 类型 说明
error

ErrorDetails

错误
错误的详细信息。

Permissions

用户对此项目的特定权限。

名称 类型 说明
delete

string

edit

string

noaccess

string

view

string