你当前正在访问 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

筛选器参数允许筛选名称或显示名称字段。 可以在名称字段(例如名称 eq'{entityName}')上检查是否相等,并且可以检查名称字段或显示名称字段上的子字符串(例如 contains(name,'{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

视图参数允许客户端筛选 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。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

GetEntities

示例请求

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

示例响应

{
  "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-0000000000000

properties.displayName

string

管理组的友好名称。

properties.inheritedPermissions

Permissions

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

properties.numberOfChildGroups

integer

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

properties.numberOfChildren

integer

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

properties.numberOfDescendants

integer

后代数

properties.parent

EntityParentGroupInfo

家长
(可选)父管理组的 ID。

properties.parentDisplayNameChain

string[]

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

properties.parentNameChain

string[]

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

properties.permissions

Permissions

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

properties.tenantId

string

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

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

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

值 说明
noaccess
view
edit
delete