google.cloud.forseti.services.inventory.base.cai_gcp_client module

Cloud Asset and GCP API hybrid client fassade.

class CaiApiClientImpl(config, engine)[source]

Bases: google.cloud.forseti.services.inventory.base.gcp.ApiClientImpl

The gcp api client Implementation

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 186
_abc_registry = <_weakrefset.WeakSet object>
fetch_crm_folder(folder_id)[source]

Fetch Folder data from Cloud Asset data.

Parameters:folder_id (str) – id of the folder to query.
Returns:Folder resource.
Return type:dict
fetch_crm_folder_iam_policy(folder_id)[source]

Folder IAM policy in a folder from Cloud Asset data.

Parameters:folder_id (str) – id of the folder to get policy.
Returns:Folder IAM policy.
Return type:dict
fetch_crm_organization(org_id)[source]

Fetch Organization data from Cloud Asset data.

Parameters:org_id (str) – id of the organization to get.
Returns:Organization resource.
Return type:dict
fetch_crm_organization_iam_policy(org_id)[source]

Organization IAM policy from Cloud Asset data.

Parameters:org_id (str) – id of the organization to get policy.
Returns:Organization IAM policy.
Return type:dict
fetch_crm_project(project_number)[source]

Fetch Project data from Cloud Asset data.

Parameters:project_number (str) – id of the project to query.
Returns:Project resource.
Return type:dict
fetch_crm_project_iam_policy(project_number)[source]

Project IAM policy from Cloud Asset data.

Parameters:project_number (str) – id of the project to query.
Returns:Project IAM Policy.
Return type:dict
fetch_gae_app(project_id)[source]

Fetch the AppEngine App from Cloud Asset data.

Parameters:project_id (str) – id of the project to query
Returns:AppEngine App resource.
Return type:dict
fetch_storage_bucket_iam_policy(bucket_id)[source]

Bucket IAM policy Iterator from Cloud Asset data.

Parameters:bucket_id (str) – id of the bucket to query
Returns:Bucket IAM policy
Return type:dict
iter_crm_folders(parent_id)[source]

Iterate Folders from Cloud Asset data.

Parameters:parent_id (str) – id of the parent of the folder
Yields:dict – Generator of folders
iter_crm_projects(parent_type, parent_id)[source]

Iterate Projects from Cloud Asset data.

Parameters:
  • parent_type (str) – type of the parent, “folder” or “organization”.
  • parent_id (str) – id of the parent of the folder.
Yields:

dict – Generator of Project resources

iter_gae_services(project_id)[source]

Iterate gae services from Cloud Asset data.

Parameters:project_id (str) – id of the project to query
Yields:dict – Generator of AppEngine Service resources.
iter_gae_versions(project_id, service_id)[source]

Iterate gae versions from Cloud Asset data.

Parameters:
  • project_id (str) – id of the project to query
  • service_id (str) – id of the appengine service
Yields:

dict – Generator of AppEngine Version resources.

session

Return a thread local CAI read only session object.

Returns:A thread local Session.
Return type:object