RoleAssignmentsOperations Class

RoleAssignmentsOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
RoleAssignmentsOperations

Constructor

RoleAssignmentsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

create

Create a role assignment.

create_by_id

Creates a role assignment by ID.

delete

Delete a role assignment.

delete_by_id

Delete a role assignment.

get

Get the specified role assignment.

get_by_id

Gets a role assignment by ID.

list

Gets all role assignments for the subscription.

list_for_resource

List role assignments for a resource.

list_for_resource_group

List role assignments for a resource group.

list_for_scope

Gets role assignments for a scope.

create

Create a role assignment.

async create(scope: str, role_assignment_name: str, parameters: azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignmentCreateParameters, **kwargs: Any) -> azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignment

Parameters

scope
str
Required

The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' for a resource.

role_assignment_name
str
Required

The name of the role assignment to create. It can be any valid GUID.

parameters
RoleAssignmentCreateParameters
Required

Parameters for the role assignment.

cls
callable

A custom type or function that will be passed the direct response

Returns

RoleAssignment, or the result of cls(response)

Return type

Exceptions

create_by_id

Creates a role assignment by ID.

async create_by_id(role_id: str, parameters: azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignmentCreateParameters, **kwargs: Any) -> azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignment

Parameters

role_id
str
Required

The ID of the role assignment to create.

parameters
RoleAssignmentCreateParameters
Required

Parameters for the role assignment.

cls
callable

A custom type or function that will be passed the direct response

Returns

RoleAssignment, or the result of cls(response)

Return type

Exceptions

delete

Delete a role assignment.

async delete(scope: str, role_assignment_name: str, tenant_id: Optional[str] = None, **kwargs: Any) -> Optional[azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignment]

Parameters

scope
str
Required

The scope of the role assignment to delete.

role_assignment_name
str
Required

The name of the role assignment to delete.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

RoleAssignment, or the result of cls(response)

Return type

Exceptions

delete_by_id

Delete a role assignment.

async delete_by_id(role_id: str, tenant_id: Optional[str] = None, **kwargs: Any) -> Optional[azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignment]

Parameters

role_id
str
Required

The ID of the role assignment to delete.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

RoleAssignment, or the result of cls(response)

Return type

Exceptions

get

Get the specified role assignment.

async get(scope: str, role_assignment_name: str, tenant_id: Optional[str] = None, **kwargs: Any) -> azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignment

Parameters

scope
str
Required

The scope of the role assignment.

role_assignment_name
str
Required

The name of the role assignment to get.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

RoleAssignment, or the result of cls(response)

Return type

Exceptions

get_by_id

Gets a role assignment by ID.

async get_by_id(role_id: str, tenant_id: Optional[str] = None, **kwargs: Any) -> azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignment

Parameters

role_id
str
Required

The ID of the role assignment to get.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

RoleAssignment, or the result of cls(response)

Return type

Exceptions

list

Gets all role assignments for the subscription.

list(filter: Optional[str] = None, tenant_id: Optional[str] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignmentListResult]

Parameters

filter
str
default value: None

The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either RoleAssignmentListResult or the result of cls(response)

Return type

Exceptions

list_for_resource

List role assignments for a resource.

list_for_resource(resource_group_name: str, resource_provider_namespace: str, parent_resource_path: str, resource_type: str, resource_name: str, filter: Optional[str] = None, tenant_id: Optional[str] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignmentListResult]

Parameters

resource_group_name
str
Required

The name of the resource group. The name is case insensitive.

resource_provider_namespace
str
Required

The namespace of the resource provider.

parent_resource_path
str
Required

The parent resource identity.

resource_type
str
Required

The resource type of the resource.

resource_name
str
Required

The name of the resource to get role assignments for.

filter
str
default value: None

The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either RoleAssignmentListResult or the result of cls(response)

Return type

Exceptions

list_for_resource_group

List role assignments for a resource group.

list_for_resource_group(resource_group_name: str, filter: Optional[str] = None, tenant_id: Optional[str] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignmentListResult]

Parameters

resource_group_name
str
Required

The name of the resource group. The name is case insensitive.

filter
str
default value: None

The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either RoleAssignmentListResult or the result of cls(response)

Return type

Exceptions

list_for_scope

Gets role assignments for a scope.

list_for_scope(scope: str, filter: Optional[str] = None, tenant_id: Optional[str] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.authorization.v2020_04_01_preview.models._models_py3.RoleAssignmentListResult]

Parameters

scope
str
Required

The scope of the role assignments.

filter
str
default value: None

The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal.

tenant_id
str
default value: None

Tenant ID for cross-tenant request.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either RoleAssignmentListResult or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.authorization.v2020_04_01_preview.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\authorization\\v2020_04_01_preview\\models\\__init__.py'>