azure.graphrbac.operations module

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 objec model deserializer.
Variables:

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

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

Gets the details for the currently logged-in user.

Parameters:
Return type:

AADObject

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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

Gets AD group membership for the specified AD object IDs.

Parameters:
Return type:

AADObjectPaged

Raises:

CloudError

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 objec 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 application.

Parameters:
Return type:

Application

Return type:

ClientRawResponse if raw=true

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.
Return type:

None

Return type:

ClientRawResponse if raw=true

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.
Return type:

Application

Return type:

ClientRawResponse if raw=true

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.
Return type:

ApplicationPaged

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.
Return type:

KeyCredentialPaged

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.
Return type:

PasswordCredentialPaged

Raises:

GraphErrorException

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

Update an existing application.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

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 of 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.
Return type:

None

Return type:

ClientRawResponse if raw=true

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 of 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.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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 objec model deserializer.
Variables:

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

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

Add a member to a group.

Parameters:
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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

Create a group in the directory.

Parameters:
  • display_name (str) – Group display name
  • mail_nickname (str) – Mail nickname
  • 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.
Return type:

ADGroup

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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

Delete a group from the directory.

Parameters:
  • group_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.
Return type:

None

Return type:

ClientRawResponse if raw=true

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.
Return type:

ADGroup

Return type:

ClientRawResponse if raw=true

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.
Return type:

AADObjectPaged

Raises:

GraphErrorException

get_member_groups(object_id, security_enabled_only, 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.
  • 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.
Return type:

StrPaged

Raises:

GraphErrorException

is_member_of(group_id, member_id, 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:
  • group_id (str) – The object ID of the group to check.
  • member_id (str) – The object ID of the contact, group, user, or service principal to check for membership in the specified group.
  • 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.
Return type:

CheckGroupMembershipResult

Return type:

ClientRawResponse if raw=true

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.
Return type:

ADGroupPaged

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.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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 objec 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:
Return type:

ServicePrincipal

Return type:

ClientRawResponse if raw=true

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.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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

Gets service principal information from the directory.

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.
Return type:

ServicePrincipal

Return type:

ClientRawResponse if raw=true

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.
Return type:

ServicePrincipalPaged

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.
Return type:

KeyCredentialPaged

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.
Return type:

PasswordCredentialPaged

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 of 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.
Return type:

None

Return type:

ClientRawResponse if raw=true

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 of 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.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

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 objec 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:
Return type:

User

Return type:

ClientRawResponse if raw=true

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.
Return type:

None

Return type:

ClientRawResponse if raw=true

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.
Return type:

User

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException

get_member_groups(object_id, security_enabled_only, 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.
  • 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.
Return type:

StrPaged

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.
Return type:

UserPaged

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.
Return type:

None

Return type:

ClientRawResponse if raw=true

Raises:

GraphErrorException