google.cloud.forseti.common.gcp_type.role module

A Role Resource. See: https://cloud.google.com/iam/reference/rest/

class Role(role_id, data=None, display_name=None, parent=None)[source]

Bases: google.cloud.forseti.common.gcp_type.resource.Resource

Role resource.

RESOURCE_NAME_FMT = 'roles/%s'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 199
_abc_registry = <_weakrefset.WeakSet object>
classmethod from_json(parent, json_string)[source]

Create a role from a JSON string.

Parameters:
  • parent (Resource) – resource this role belongs to.
  • json_string (str) – JSON string of a IAM API response.
Returns:

role resource.

Return type:

Role

get_permissions()[source]

Get permissions of the role. :returns: Permissions list of the role. :rtype: list

_get_res_id_from_role_id(role_id)[source]

Get role’s ID from its given GCP ID.

Parameters:role_id (str) – resource ID (in inventory) of role.
Returns:role ID; None if the given resource ID is incorrect.
Return type:str