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

RoleAssignments interface

表示 RoleAssignments 的接口。

方法

create(string, string, RoleAssignmentCreateParameters, RoleAssignmentsCreateOptionalParams)

按范围和名称创建或更新角色分配。

createById(string, RoleAssignmentCreateParameters, RoleAssignmentsCreateByIdOptionalParams)

按 ID 创建或更新角色分配。

delete(string, string, RoleAssignmentsDeleteOptionalParams)

按范围和名称删除角色分配。

deleteById(string, RoleAssignmentsDeleteByIdOptionalParams)

按 ID 删除角色分配。

get(string, string, RoleAssignmentsGetOptionalParams)

按范围和名称获取角色分配。

getById(string, RoleAssignmentsGetByIdOptionalParams)

按 ID 获取角色分配。

listForResource(string, string, string, string, RoleAssignmentsListForResourceOptionalParams)

列出应用于资源的所有角色分配。

listForResourceGroup(string, RoleAssignmentsListForResourceGroupOptionalParams)

列出应用于资源组的所有角色分配。

listForScope(string, RoleAssignmentsListForScopeOptionalParams)

列出应用于范围的所有角色分配。

listForSubscription(RoleAssignmentsListForSubscriptionOptionalParams)

列出应用于订阅的所有角色分配。

方法详细信息

create(string, string, RoleAssignmentCreateParameters, RoleAssignmentsCreateOptionalParams)

按范围和名称创建或更新角色分配。

function create(scope: string, roleAssignmentName: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsCreateOptionalParams): Promise<RoleAssignment>

参数

scope

string

作或资源的范围。 有效范围包括:订阅(格式:'/subscriptions/{subscriptionId}')、资源组(格式:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'或资源(格式:'/subscriptions/{subscriptionId}/resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

roleAssignmentName

string

角色分配的名称。 它可以是任何有效的 GUID。

parameters
RoleAssignmentCreateParameters

角色分配的参数。

options
RoleAssignmentsCreateOptionalParams

选项参数。

返回

Promise<RoleAssignment>

createById(string, RoleAssignmentCreateParameters, RoleAssignmentsCreateByIdOptionalParams)

按 ID 创建或更新角色分配。

function createById(roleAssignmentId: string, parameters: RoleAssignmentCreateParameters, options?: RoleAssignmentsCreateByIdOptionalParams): Promise<RoleAssignment>

参数

roleAssignmentId

string

角色分配的完全限定 ID,包括范围、资源名称和资源类型。 格式:/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}。 示例:/subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

parameters
RoleAssignmentCreateParameters

角色分配的参数。

options
RoleAssignmentsCreateByIdOptionalParams

选项参数。

返回

Promise<RoleAssignment>

delete(string, string, RoleAssignmentsDeleteOptionalParams)

按范围和名称删除角色分配。

function delete(scope: string, roleAssignmentName: string, options?: RoleAssignmentsDeleteOptionalParams): Promise<RoleAssignment>

参数

scope

string

作或资源的范围。 有效范围包括:订阅(格式:'/subscriptions/{subscriptionId}')、资源组(格式:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'或资源(格式:'/subscriptions/{subscriptionId}/resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

roleAssignmentName

string

角色分配的名称。 它可以是任何有效的 GUID。

options
RoleAssignmentsDeleteOptionalParams

选项参数。

返回

Promise<RoleAssignment>

deleteById(string, RoleAssignmentsDeleteByIdOptionalParams)

按 ID 删除角色分配。

function deleteById(roleAssignmentId: string, options?: RoleAssignmentsDeleteByIdOptionalParams): Promise<RoleAssignment>

参数

roleAssignmentId

string

角色分配的完全限定 ID,包括范围、资源名称和资源类型。 格式:/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}。 示例:/subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

options
RoleAssignmentsDeleteByIdOptionalParams

选项参数。

返回

Promise<RoleAssignment>

get(string, string, RoleAssignmentsGetOptionalParams)

按范围和名称获取角色分配。

function get(scope: string, roleAssignmentName: string, options?: RoleAssignmentsGetOptionalParams): Promise<RoleAssignment>

参数

scope

string

作或资源的范围。 有效范围包括:订阅(格式:'/subscriptions/{subscriptionId}')、资源组(格式:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'或资源(格式:'/subscriptions/{subscriptionId}/resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

roleAssignmentName

string

角色分配的名称。 它可以是任何有效的 GUID。

options
RoleAssignmentsGetOptionalParams

选项参数。

返回

Promise<RoleAssignment>

getById(string, RoleAssignmentsGetByIdOptionalParams)

按 ID 获取角色分配。

function getById(roleAssignmentId: string, options?: RoleAssignmentsGetByIdOptionalParams): Promise<RoleAssignment>

参数

roleAssignmentId

string

角色分配的完全限定 ID,包括范围、资源名称和资源类型。 格式:/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}。 示例:/subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>

options
RoleAssignmentsGetByIdOptionalParams

选项参数。

返回

Promise<RoleAssignment>

listForResource(string, string, string, string, RoleAssignmentsListForResourceOptionalParams)

列出应用于资源的所有角色分配。

function listForResource(resourceGroupName: string, resourceProviderNamespace: string, resourceType: string, resourceName: string, options?: RoleAssignmentsListForResourceOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

参数

resourceGroupName

string

资源组的名称。 名称不区分大小写。

resourceProviderNamespace

string

资源提供程序的命名空间。

resourceType

string

资源类型名称。 例如,Web 应用的类型名称为“sites”(来自 Microsoft.Web/sites)。

resourceName

string

资源名称。

返回

listForResourceGroup(string, RoleAssignmentsListForResourceGroupOptionalParams)

列出应用于资源组的所有角色分配。

function listForResourceGroup(resourceGroupName: string, options?: RoleAssignmentsListForResourceGroupOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

参数

resourceGroupName

string

资源组的名称。 名称不区分大小写。

返回

listForScope(string, RoleAssignmentsListForScopeOptionalParams)

列出应用于范围的所有角色分配。

function listForScope(scope: string, options?: RoleAssignmentsListForScopeOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

参数

scope

string

作或资源的范围。 有效范围包括:订阅(格式:'/subscriptions/{subscriptionId}')、资源组(格式:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'或资源(格式:'/subscriptions/{subscriptionId}/resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

返回

listForSubscription(RoleAssignmentsListForSubscriptionOptionalParams)

列出应用于订阅的所有角色分配。

function listForSubscription(options?: RoleAssignmentsListForSubscriptionOptionalParams): PagedAsyncIterableIterator<RoleAssignment, RoleAssignment[], PageSettings>

参数

返回