RoleAssignments interface
表示 RoleAssignments 的接口。
方法
方法详细信息
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
角色分配的参数。
选项参数。
返回
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
角色分配的参数。
选项参数。
返回
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。
选项参数。
返回
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>
选项参数。
返回
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>
选项参数。
返回
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>
参数
选项参数。