azure.graphrbac.operations module

class azure.graphrbac.operations.SignedInUserOperations(client, config, serializer, deserializer)[source]

Bases: object

SignedInUserOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

get(custom_headers=None, raw=False, **operation_config)[source]

Gets the details for the currently logged-in user.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

User or ClientRawResponse if raw=true

Return type:

User or ClientRawResponse

Raises:

GraphErrorException

list_owned_objects(custom_headers=None, raw=False, **operation_config)[source]

Get the list of directory objects that are owned by the user.

Parameters:
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DirectoryObject

Return type:

DirectoryObjectPaged[DirectoryObject]

Raises:

GraphErrorException

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.ApplicationsOperations(client, config, serializer, deserializer)[source]

Bases: object

ApplicationsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

add_owner(application_object_id, url, additional_properties=None, custom_headers=None, raw=False, **operation_config)[source]

Add an owner to an application.

Parameters:
  • application_object_id (str) – The object ID of the application to which to add the owner.
  • url (str) – A owner object URL, such as “https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd”, where “0b1f9851-1bf0-433f-aec3-cb9272f093dc” is the tenantId and “f260bbc4-c254-447b-94cf-293b5ec434dd” is the objectId of the owner (user, application, servicePrincipal, group) to be added.
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

create(parameters, custom_headers=None, raw=False, **operation_config)[source]

Create a new application.

Parameters:
  • parameters (ApplicationCreateParameters) – The parameters for creating an application.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Application or ClientRawResponse if raw=true

Return type:

Application or ClientRawResponse

Raises:

GraphErrorException

delete(application_object_id, custom_headers=None, raw=False, **operation_config)[source]

Delete an application.

Parameters:
  • application_object_id (str) – Application object ID.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

get(application_object_id, custom_headers=None, raw=False, **operation_config)[source]

Get an application by object ID.

Parameters:
  • application_object_id (str) – Application object ID.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Application or ClientRawResponse if raw=true

Return type:

Application or ClientRawResponse

Raises:

GraphErrorException

list(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Lists applications by filter parameters.

Parameters:
  • filter (str) – The filters to apply to the operation.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Application

Return type:

ApplicationPaged[Application]

Raises:

GraphErrorException

list_key_credentials(application_object_id, custom_headers=None, raw=False, **operation_config)[source]

Get the keyCredentials associated with an application.

Parameters:
  • application_object_id (str) – Application object ID.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of KeyCredential

Return type:

KeyCredentialPaged[KeyCredential]

Raises:

GraphErrorException

list_owners(application_object_id, custom_headers=None, raw=False, **operation_config)[source]

Directory objects that are owners of the application.

The owners are a set of non-admin users who are allowed to modify this object.

Parameters:
  • application_object_id (str) – The object ID of the application for which to get owners.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DirectoryObject

Return type:

DirectoryObjectPaged[DirectoryObject]

Raises:

GraphErrorException

list_password_credentials(application_object_id, custom_headers=None, raw=False, **operation_config)[source]

Get the passwordCredentials associated with an application.

Parameters:
  • application_object_id (str) – Application object ID.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PasswordCredential

Return type:

PasswordCredentialPaged[PasswordCredential]

Raises:

GraphErrorException

patch(application_object_id, parameters, custom_headers=None, raw=False, **operation_config)[source]

Update an existing application.

Parameters:
  • application_object_id (str) – Application object ID.
  • parameters (ApplicationUpdateParameters) – Parameters to update an existing application.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

remove_owner(application_object_id, owner_object_id, custom_headers=None, raw=False, **operation_config)[source]

Remove a member from owners.

Parameters:
  • application_object_id (str) – The object ID of the application from which to remove the owner.
  • owner_object_id (str) – Owner object id
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

update_key_credentials(application_object_id, value, custom_headers=None, raw=False, **operation_config)[source]

Update the keyCredentials associated with an application.

Parameters:
  • application_object_id (str) – Application object ID.
  • value (list[KeyCredential]) – A collection of KeyCredentials.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

update_password_credentials(application_object_id, value, custom_headers=None, raw=False, **operation_config)[source]

Update passwordCredentials associated with an application.

Parameters:
  • application_object_id (str) – Application object ID.
  • value (list[PasswordCredential]) – A collection of PasswordCredentials.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.DeletedApplicationsOperations(client, config, serializer, deserializer)[source]

Bases: object

DeletedApplicationsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

hard_delete(application_object_id, custom_headers=None, raw=False, **operation_config)[source]

Hard-delete an application.

Parameters:
  • application_object_id (str) – Application object ID.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

list(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Gets a list of deleted applications in the directory.

Parameters:
  • filter (str) – The filter to apply to the operation.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Application

Return type:

ApplicationPaged[Application]

Raises:

GraphErrorException

restore(object_id, custom_headers=None, raw=False, **operation_config)[source]

Restores the deleted application in the directory.

Parameters:
  • object_id (str) – Application object ID.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Application or ClientRawResponse if raw=true

Return type:

Application or ClientRawResponse

Raises:

GraphErrorException

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.GroupsOperations(client, config, serializer, deserializer)[source]

Bases: object

GroupsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

add_member(group_object_id, url, additional_properties=None, custom_headers=None, raw=False, **operation_config)[source]

Add a member to a group.

Parameters:
  • group_object_id (str) – The object ID of the group to which to add the member.
  • url (str) – A member object URL, such as “https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd”, where “0b1f9851-1bf0-433f-aec3-cb9272f093dc” is the tenantId and “f260bbc4-c254-447b-94cf-293b5ec434dd” is the objectId of the member (user, application, servicePrincipal, group) to be added.
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

add_owner(object_id, url, additional_properties=None, custom_headers=None, raw=False, **operation_config)[source]

Add an owner to a group.

Parameters:
  • object_id (str) – The object ID of the application to which to add the owner.
  • url (str) – A owner object URL, such as “https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd”, where “0b1f9851-1bf0-433f-aec3-cb9272f093dc” is the tenantId and “f260bbc4-c254-447b-94cf-293b5ec434dd” is the objectId of the owner (user, application, servicePrincipal, group) to be added.
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

create(parameters, custom_headers=None, raw=False, **operation_config)[source]

Create a group in the directory.

Parameters:
  • parameters (GroupCreateParameters) – The parameters for the group to create.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ADGroup or ClientRawResponse if raw=true

Return type:

ADGroup or ClientRawResponse

Raises:

GraphErrorException

delete(object_id, custom_headers=None, raw=False, **operation_config)[source]

Delete a group from the directory.

Parameters:
  • object_id (str) – The object ID of the group to delete.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

get(object_id, custom_headers=None, raw=False, **operation_config)[source]

Gets group information from the directory.

Parameters:
  • object_id (str) – The object ID of the user for which to get group information.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ADGroup or ClientRawResponse if raw=true

Return type:

ADGroup or ClientRawResponse

Raises:

GraphErrorException

get_group_members(object_id, custom_headers=None, raw=False, **operation_config)[source]

Gets the members of a group.

Parameters:
  • object_id (str) – The object ID of the group whose members should be retrieved.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DirectoryObject

Return type:

DirectoryObjectPaged[DirectoryObject]

Raises:

GraphErrorException

get_member_groups(object_id, security_enabled_only, additional_properties=None, custom_headers=None, raw=False, **operation_config)[source]

Gets a collection of object IDs of groups of which the specified group is a member.

Parameters:
  • object_id (str) – The object ID of the group for which to get group membership.
  • security_enabled_only (bool) – If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked.
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of str

Return type:

StrPaged[str]

Raises:

GraphErrorException

is_member_of(parameters, custom_headers=None, raw=False, **operation_config)[source]

Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the specified group.

Parameters:
  • parameters (CheckGroupMembershipParameters) – The check group membership parameters.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

CheckGroupMembershipResult or ClientRawResponse if raw=true

Return type:

CheckGroupMembershipResult or ClientRawResponse

Raises:

GraphErrorException

list(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Gets list of groups for the current tenant.

Parameters:
  • filter (str) – The filter to apply to the operation.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of ADGroup

Return type:

ADGroupPaged[ADGroup]

Raises:

GraphErrorException

list_owners(object_id, custom_headers=None, raw=False, **operation_config)[source]

Directory objects that are owners of the group.

The owners are a set of non-admin users who are allowed to modify this object.

Parameters:
  • object_id (str) – The object ID of the group for which to get owners.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DirectoryObject

Return type:

DirectoryObjectPaged[DirectoryObject]

Raises:

GraphErrorException

remove_member(group_object_id, member_object_id, custom_headers=None, raw=False, **operation_config)[source]

Remove a member from a group.

Parameters:
  • group_object_id (str) – The object ID of the group from which to remove the member.
  • member_object_id (str) – Member object id
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

remove_owner(object_id, owner_object_id, custom_headers=None, raw=False, **operation_config)[source]

Remove a member from owners.

Parameters:
  • object_id (str) – The object ID of the group from which to remove the owner.
  • owner_object_id (str) – Owner object id
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.ServicePrincipalsOperations(client, config, serializer, deserializer)[source]

Bases: object

ServicePrincipalsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

create(parameters, custom_headers=None, raw=False, **operation_config)[source]

Creates a service principal in the directory.

Parameters:
  • parameters (ServicePrincipalCreateParameters) – Parameters to create a service principal.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ServicePrincipal or ClientRawResponse if raw=true

Return type:

ServicePrincipal or ClientRawResponse

Raises:

GraphErrorException

delete(object_id, custom_headers=None, raw=False, **operation_config)[source]

Deletes a service principal from the directory.

Parameters:
  • object_id (str) – The object ID of the service principal to delete.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

get(object_id, custom_headers=None, raw=False, **operation_config)[source]

Gets service principal information from the directory. Query by objectId or pass a filter to query by appId.

Parameters:
  • object_id (str) – The object ID of the service principal to get.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

ServicePrincipal or ClientRawResponse if raw=true

Return type:

ServicePrincipal or ClientRawResponse

Raises:

GraphErrorException

list(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Gets a list of service principals from the current tenant.

Parameters:
  • filter (str) – The filter to apply to the operation.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of ServicePrincipal

Return type:

ServicePrincipalPaged[ServicePrincipal]

Raises:

GraphErrorException

list_key_credentials(object_id, custom_headers=None, raw=False, **operation_config)[source]

Get the keyCredentials associated with the specified service principal.

Parameters:
  • object_id (str) – The object ID of the service principal for which to get keyCredentials.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of KeyCredential

Return type:

KeyCredentialPaged[KeyCredential]

Raises:

GraphErrorException

list_owners(object_id, custom_headers=None, raw=False, **operation_config)[source]

Directory objects that are owners of this service principal.

The owners are a set of non-admin users who are allowed to modify this object.

Parameters:
  • object_id (str) – The object ID of the service principal for which to get owners.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DirectoryObject

Return type:

DirectoryObjectPaged[DirectoryObject]

Raises:

GraphErrorException

list_password_credentials(object_id, custom_headers=None, raw=False, **operation_config)[source]

Gets the passwordCredentials associated with a service principal.

Parameters:
  • object_id (str) – The object ID of the service principal.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of PasswordCredential

Return type:

PasswordCredentialPaged[PasswordCredential]

Raises:

GraphErrorException

update(object_id, parameters, custom_headers=None, raw=False, **operation_config)[source]

Updates a service principal in the directory.

Parameters:
  • object_id (str) – The object ID of the service principal to delete.
  • parameters (ServicePrincipalUpdateParameters) – Parameters to update a service principal.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

update_key_credentials(object_id, value, custom_headers=None, raw=False, **operation_config)[source]

Update the keyCredentials associated with a service principal.

Parameters:
  • object_id (str) – The object ID for which to get service principal information.
  • value (list[KeyCredential]) – A collection of KeyCredentials.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

update_password_credentials(object_id, value, custom_headers=None, raw=False, **operation_config)[source]

Updates the passwordCredentials associated with a service principal.

Parameters:
  • object_id (str) – The object ID of the service principal.
  • value (list[PasswordCredential]) – A collection of PasswordCredentials.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.UsersOperations(client, config, serializer, deserializer)[source]

Bases: object

UsersOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

create(parameters, custom_headers=None, raw=False, **operation_config)[source]

Create a new user.

Parameters:
  • parameters (UserCreateParameters) – Parameters to create a user.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

User or ClientRawResponse if raw=true

Return type:

User or ClientRawResponse

Raises:

GraphErrorException

delete(upn_or_object_id, custom_headers=None, raw=False, **operation_config)[source]

Delete a user.

Parameters:
  • upn_or_object_id (str) – The object ID or principal name of the user to delete.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

get(upn_or_object_id, custom_headers=None, raw=False, **operation_config)[source]

Gets user information from the directory.

Parameters:
  • upn_or_object_id (str) – The object ID or principal name of the user for which to get information.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

User or ClientRawResponse if raw=true

Return type:

User or ClientRawResponse

Raises:

GraphErrorException

get_member_groups(object_id, security_enabled_only, additional_properties=None, custom_headers=None, raw=False, **operation_config)[source]

Gets a collection that contains the object IDs of the groups of which the user is a member.

Parameters:
  • object_id (str) – The object ID of the user for which to get group membership.
  • security_enabled_only (bool) – If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked.
  • additional_properties (dict[str, object]) – Unmatched properties from the message are deserialized this collection
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of str

Return type:

StrPaged[str]

Raises:

GraphErrorException

list(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Gets list of users for the current tenant.

Parameters:
  • filter (str) – The filter to apply to the operation.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of User

Return type:

UserPaged[User]

Raises:

GraphErrorException

update(upn_or_object_id, parameters, custom_headers=None, raw=False, **operation_config)[source]

Updates a user.

Parameters:
  • upn_or_object_id (str) – The object ID or principal name of the user to update.
  • parameters (UserUpdateParameters) – Parameters to update an existing user.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

None or ClientRawResponse if raw=true

Return type:

None or ClientRawResponse

Raises:

GraphErrorException

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.ObjectsOperations(client, config, serializer, deserializer)[source]

Bases: object

ObjectsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

get_objects_by_object_ids(parameters, custom_headers=None, raw=False, **operation_config)[source]

Gets the directory objects specified in a list of object IDs. You can also specify which resource collections (users, groups, etc.) should be searched by specifying the optional types parameter.

Parameters:
  • parameters (GetObjectsParameters) – Objects filtering parameters.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of DirectoryObject

Return type:

DirectoryObjectPaged[DirectoryObject]

Raises:

CloudError

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.DomainsOperations(client, config, serializer, deserializer)[source]

Bases: object

DomainsOperations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

get(domain_name, custom_headers=None, raw=False, **operation_config)[source]

Gets a specific domain in the current tenant.

Parameters:
  • domain_name (str) – name of the domain.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Domain or ClientRawResponse if raw=true

Return type:

Domain or ClientRawResponse

Raises:

CloudError

list(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Gets a list of domains for the current tenant.

Parameters:
  • filter (str) – The filter to apply to the operation.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

An iterator like instance of Domain

Return type:

DomainPaged[Domain]

Raises:

CloudError

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>
class azure.graphrbac.operations.OAuth2Operations(client, config, serializer, deserializer)[source]

Bases: object

OAuth2Operations operations.

Parameters:
  • client – Client for service requests.
  • config – Configuration of service client.
  • serializer – An object model serializer.
  • deserializer – An object model deserializer.
Variables:

api_version – Client API version. Constant value: “1.6”.

get(filter=None, custom_headers=None, raw=False, **operation_config)[source]

Queries OAuth2 permissions for the relevant SP ObjectId of an app.

Parameters:
  • filter (str) – This is the Service Principal ObjectId associated with the app
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Permissions or ClientRawResponse if raw=true

Return type:

Permissions or ClientRawResponse

Raises:

CloudError

grant(body=None, custom_headers=None, raw=False, **operation_config)[source]

Grants OAuth2 permissions for the relevant resource Ids of an app.

Parameters:
  • body (Permissions) – The relevant app Service Principal Object Id and the Service Principal Objecit Id you want to grant.
  • custom_headers (dict) – headers that will be added to the request
  • raw (bool) – returns the direct response alongside the deserialized response
  • operation_configOperation configuration overrides.
Returns:

Permissions or ClientRawResponse if raw=true

Return type:

Permissions or ClientRawResponse

Raises:

CloudError

models = <module 'azure.graphrbac.models' from '/usr/lib/python3/dist-packages/azure/graphrbac/models/__init__.py'>