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

Crawler implementation for gcp resources.

class AppEngineApp(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for AppEngine App.

class AppEngineAppIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for AppEngineApp

iter()[source]

Resource iterator.

Yields:Resource – AppEngineApp created
class AppEngineInstance(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for AppEngine Instance.

class AppEngineInstanceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for AppEngineInstance

iter()[source]

Resource iterator.

Yields:Resource – AppEngineInstance created
class AppEngineService(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for AppEngine Service.

class AppEngineServiceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for AppEngineService

iter()[source]

Resource iterator.

Yields:Resource – AppEngineService created
class AppEngineVersion(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for AppEngine Version.

class AppEngineVersionIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for AppEngineVersion

iter()[source]

Resource iterator.

Yields:Resource – AppEngineVersion created
class BigqueryDataSet(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Bigquery DataSet.

_set_cache(field_name, value)[source]

Manually set a cache value if it isn’t already set.

Parameters:
  • field_name (str) – The name of the attribute to cache.
  • value (str) – The value to cache.
get_dataset_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class BigqueryDataSetIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Bigquery Dataset.

class BigqueryTable(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for bigquery table.

class BigqueryTableIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Bigquery Table.

class BillingAccount(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for BillingAccount.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

key()[source]

Get key of this resource.

Returns:key of this resource.
Return type:str
class BillingAccountIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Billing Account.

class CloudSqlInstance(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for CloudSQL Instance.

class CloudSqlInstanceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for CloudSQL Instance.

class ComputeAutoscaler(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Autoscaler.

class ComputeAutoscalerIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Autoscaler.

class ComputeBackendBucket(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Backend Bucket.

class ComputeBackendBucketIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute BackendBucket.

class ComputeBackendService(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Backend Service.

class ComputeBackendServiceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute BackendService.

class ComputeDisk(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Disk.

class ComputeDiskIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Disk.

class ComputeFirewall(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Firewall.

class ComputeFirewallIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Firewall.

class ComputeForwardingRule(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Forwarding Rule.

class ComputeForwardingRuleIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute ForwardingRule.

class ComputeHealthCheck(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute HealthCheck.

class ComputeHealthCheckIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute HealthCheck.

class ComputeHttpHealthCheck(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute HTTP HealthCheck.

class ComputeHttpHealthCheckIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute HttpHealthCheck.

class ComputeHttpsHealthCheck(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute HTTPS HealthCheck.

class ComputeHttpsHealthCheckIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute HttpsHealthCheck.

class ComputeImage(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Image.

class ComputeImageIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Image.

class ComputeInstance(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Instance.

class ComputeInstanceGroup(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute InstanceGroup.

class ComputeInstanceGroupIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for Compute InstanceGroup.

iter()[source]

Compute InstanceGroup iterator.

Yields:Resource – Compute InstanceGroup resource.
class ComputeInstanceGroupManager(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute InstanceGroupManager.

class ComputeInstanceGroupManagerIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute InstanceGroupManager.

class ComputeInstanceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Instance.

class ComputeInstanceTemplate(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute InstanceTemplate.

class ComputeInstanceTemplateIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute InstanceTemplate.

class ComputeLicense(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute License.

class ComputeLicenseIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute License.

class ComputeNetwork(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Network.

class ComputeNetworkIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Network.

class ComputeProject(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Project.

class ComputeProjectIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Project.

class ComputeRouter(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Router.

class ComputeRouterIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Router.

class ComputeSnapshot(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Snapshot.

class ComputeSnapshotIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Snapshot.

class ComputeSslCertificate(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute SSL Certificate.

class ComputeSslCertificateIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute SSL Certificate.

class ComputeSubnetwork(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute Subnetwork.

class ComputeSubnetworkIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute Subnetwork.

class ComputeTargetHttpProxy(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetHttpProxy.

class ComputeTargetHttpProxyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetHttpProxy.

class ComputeTargetHttpsProxy(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetHttpsProxy.

class ComputeTargetHttpsProxyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetHttpsProxy.

class ComputeTargetInstance(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetInstance.

class ComputeTargetInstanceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetInstance.

class ComputeTargetPool(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetPool.

class ComputeTargetPoolIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetPool.

class ComputeTargetSslProxy(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetSslProxy.

class ComputeTargetSslProxyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetSslProxy.

class ComputeTargetTcpProxy(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetTcpProxy.

class ComputeTargetTcpProxyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetTcpProxy.

class ComputeTargetVpnGateway(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute TargetVpnGateway.

class ComputeTargetVpnGatewayIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute TargetVpnGateway.

class ComputeUrlMap(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute UrlMap.

class ComputeUrlMapIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute UrlMap.

class ComputeVpnTunnel(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Compute VpnTunnel.

class ComputeVpnTunnelIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Compute VpnTunnel.

class DataprocCluster(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Dataproc Cluster.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class DataprocClusterIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Cloud Dataproc Cluster.

class DnsManagedZone(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Cloud DNS ManagedZone.

class DnsManagedZoneIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Cloud DNS ManagedZone.

class DnsPolicy(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Cloud DNS Policy.

class DnsPolicyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Cloud DNS Policy.

class GsuiteGroup(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for GSuite User.

should_dispatch()[source]

GSuite Groups should always dispatch to another thread.

Returns:Always returns True.
Return type:bool
class GsuiteGroupIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for Gsuite Group

iter()[source]

Resource iterator.

Yields:Resource – GsuiteGroup created
class GsuiteGroupMember(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for GSuite User.

class GsuiteMemberIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for Gsuite Member

iter()[source]

Resource iterator.

Yields:Resource – GsuiteUserMember or GsuiteGroupMember created
class GsuiteUser(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for GSuite User.

class GsuiteUserIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for Gsuite User

iter()[source]

Resource iterator.

Yields:Resource – GsuiteUser created
class GsuiteUserMember(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for GSuite User.

class IamCuratedRole(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for IAM Curated Roles.

parent()[source]

Curated roles have no parent.

class IamOrganizationCuratedRoleIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Organization Curated Role.

class IamOrganizationRoleIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for IAM Organization Role.

class IamProjectRoleIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for IAM Project Role.

class IamRole(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for IAM Roles.

class IamServiceAccount(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for IAM ServiceAccount.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class IamServiceAccountIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for IAM ServiceAccount.

class IamServiceAccountKey(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for IAM ServiceAccountKey.

key()[source]

Get key of this resource.

Key name is in the format:
projects/{project_id}/serviceAccounts/{service_account}/keys/{key_id}
Returns:id key of this resource
Return type:str
class IamServiceAccountKeyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for IAM ServiceAccount Key.

class KmsCryptoKey(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for KMS CryptoKey.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class KmsCryptoKeyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for KMS CryptoKey.

class KmsCryptoKeyVersion(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for KMS CryptoKeyVersion.

class KmsCryptoKeyVersionIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for KMS CryptoKeyVersion.

class KmsKeyRing(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for KMS KeyRing.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class KmsKeyRingIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for KMS KeyRing.

class KubernetesCluster(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Kubernetes Cluster.

get_kubernetes_service_config(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

location()[source]

Get KubernetesCluster location.

Returns:KubernetesCluster location.
Return type:str
zone()[source]

Get KubernetesCluster zone.

Returns:KubernetesCluster zone.
Return type:str
class KubernetesClusterIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Kubernetes Cluster.

class LoggingBillingAccountSinkIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Logging Billing Account Sink.

class LoggingFolderSinkIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Logging Folder Sink.

class LoggingOrganizationSinkIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Logging Organization Sink

class LoggingProjectSinkIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Logging Project Sink.

class LoggingSink(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Stackdriver Logging sink.

key()[source]

Get key of this resource.

Returns:key of this resource
Return type:str
class PubsubSubscription(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for PubSub Subscription.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class PubsubSubscriptionIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for PubSub Subscription.

class PubsubTopic(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for PubSub Topic.

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class PubsubTopicIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for PubSub Topic.

class Resource(data, root=False, contains=None, **kwargs)[source]

Bases: object

The base Resource class.

__getitem__(key)[source]

Get Item.

Parameters:key (str) – key of this resource.
Returns:data of this resource.
Return type:str
Raises:KeyError – ‘key: {}, data: {}’
__repr__()[source]

String Representation.

Returns:Resource representation.
Return type:str
__setitem__(key, value)[source]

Set the value of an item.

Parameters:
  • key (str) – key of this resource.
  • value (str) – value to set on this resource.
static _utcnow()[source]

Wrapper for datetime.datetime.now() injection.

Returns:the datetime.
Return type:datatime
accept(visitor, stack=None)[source]

Accept of resource in visitor pattern.

Parameters:
  • visitor (Crawler) – visitor instance.
  • stack (list) – resource hierarchy stack.
add_warning(warning)[source]

Add warning on this resource.

Parameters:warning (str) – warning to be added.
data()[source]

Get data on this resource.

Returns:raw data.
Return type:str
get_billing_info(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_cloudsql_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_dataset_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_enabled_apis(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_gcs_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_group_members(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_kubernetes_service_config(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_timestamp()[source]

Template for timestamp when the resource object.

Returns:a string timestamp when the resource object was created.
Return type:str
get_warning()[source]

Get warning on this resource.

Returns:warning message.
Return type:str
inventory_key()[source]

Gets the inventory key for this resource, if set.

Returns:The unique id for the resource in storage.
Return type:int
key()[source]

Get key of this resource.

Raises:NotImplementedError – key method not implemented.
parent()[source]

Get parent of this resource.

Returns:parent of this resource.
Return type:Resource
set_inventory_key(key)[source]

Set the inventory unique id for the resource.

Parameters:key (int) – The unique id for the resource from the storage.
should_dispatch()[source]

Whether resources should run in parallel threads.

Returns:whether this resource should run in parallel threads.
Return type:bool
stack()[source]

Get resource hierarchy stack of this resource.

Returns:resource hierarchy stack of this resource.
Return type:list
Raises:Exception – ‘Stack not initialized yet’.
try_accept(visitor, stack=None)[source]

Handle exceptions on the call the accept.

Parameters:
  • visitor (object) – The class implementing the visitor pattern.
  • stack (list) – The resource stack from the root to immediate parent of this resource.
static type()[source]

Get type of this resource.

Raises:NotImplementedError – method not implemented.
visitor()[source]

Get visitor on this resource.

Returns:visitor on this resource.
Return type:Crawler
Raises:Exception – ‘Visitor not initialized yet’.
class ResourceFactory(attributes)[source]

Bases: object

ResourceFactory for visitor pattern.

create_new(data, root=False)[source]

Create a new instance of a Resource type.

Parameters:
  • data (str) – raw data.
  • root (Resource) – root of this resource.
Returns:

Resource instance.

Return type:

Resource

class ResourceIterator(resource, client)[source]

Bases: object

The Resource iterator template.

iter()[source]

Resource iterator.

Raises:NotImplementedError – Abstract class method not implemented.
class ResourceManagerFolder(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Folder.

classmethod fetch(client, resource_key)[source]

Get Folder.

Parameters:
  • client (object) – GCP API client.
  • resource_key (str) – resource key to fetch.
Returns:

Folder resource.

Return type:

Folder

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

key()[source]

Get key of this resource.

Returns:key of this resource.
Return type:str
should_dispatch()[source]

Folder resources should run in parallel threads.

Returns:whether folder resources should run in parallel threads.
Return type:bool
class ResourceManagerFolderIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Resource Manager Folder.

class ResourceManagerFolderOrgPolicyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for CRM Folder Org Policies.

class ResourceManagerLien(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Resource Manager Lien.

key()[source]

Get key of this resource.

Returns:key of this resource
Return type:str
class ResourceManagerOrgPolicy(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Resource Manager Organization Policy.

key()[source]

Get key of this resource.

Returns:key of this resource
Return type:str
class ResourceManagerOrganization(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Organization.

classmethod fetch(client, resource_key)[source]

Get Organization.

Saves ApiExecutionErrors as warnings.

Parameters:
  • client (object) – GCP API client.
  • resource_key (str) – resource key to fetch.
Returns:

Organization resource.

Return type:

Organization

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

has_directory_resource_id()[source]

Whether this organization has a directoryCustomerId.

Returns:True if the data exists, else False.
Return type:bool
key()[source]

Get key of this resource.

Returns:key of this resource.
Return type:str
class ResourceManagerOrganizationOrgPolicyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator for CRM Organization Org Policies.

class ResourceManagerProject(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Project.

bigquery_api_enabled()[source]

Check if the bigquery api is enabled.

Returns:if this API service is enabled on the project.
Return type:bool
billing_enabled()[source]

Check if billing is configured.

Returns:if billing is enabled on the project.
Return type:bool
compute_api_enabled()[source]

Check if the compute api is enabled.

Returns:if this API service is enabled on the project.
Return type:bool
container_api_enabled()[source]

Check if the container api is enabled.

Returns:if this API service is enabled on the project.
Return type:bool
enumerable()[source]

Check if this project is enumerable.

Returns:if this project is enumerable.
Return type:bool
classmethod fetch(client, resource_key)[source]

Get Project.

Parameters:
  • client (object) – GCP API client.
  • resource_key (str) – resource key to fetch.
Returns:

created project.

Return type:

Project

get_billing_info(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_enabled_apis(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

is_api_enabled(service_name)[source]

Returns True if the API service is enabled on the project.

Parameters:service_name (str) – The API service name to check.
Returns:whether a service api is enabled
Return type:bool
should_dispatch()[source]

Project resources should run in parallel threads.

Returns:whether project resources should run in parallel threads.
Return type:bool
storage_api_enabled()[source]

whether storage api is enabled.

Returns:if this API service is enabled on the project.
Return type:bool
class ResourceManagerProjectIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIterator

The Resource iterator implementation for Resource Manager Project.

iter()[source]

Resource iterator.

Yields:Resource – Project created
class ResourceManagerProjectLienIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Resource Manager Lien.

class ResourceManagerProjectOrgPolicyIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for CRM Project Org Policies.

class SpannerDatabase(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Spanner Database.

class SpannerDatabaseIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Cloud DNS ManagedZone.

class SpannerInstance(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Spanner Instance.

class SpannerInstanceIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Cloud DNS Policy.

class StorageBucket(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Storage Bucket.

get_gcs_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

get_iam_policy(**kwargs)[source]

Function wrapper to perform caching.

Parameters:
  • *args – args to be passed to the function.
  • **kwargs – kwargs to be passed to the function.
Returns:

Results of executing f.

Return type:

object

class StorageBucketIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Storage Bucket.

class StorageObject(data, root=False, contains=None, **kwargs)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceSubclass

The Resource implementation for Storage Object.

get_gcs_policy(client=None)[source]

Full projection returns GCS policy with the resource.

Parameters:client (object) – GCP API client.
Returns:Object acl.
Return type:dict
class StorageObjectIterator(resource, client)[source]

Bases: google.cloud.forseti.services.inventory.base.resources.ResourceIteratorSubclass

The Resource iterator implementation for Storage Object.

cached(field_name)[source]

Decorator to perform caching.

Parameters:field_name (str) – The name of the attribute to cache.
Returns:Function wrapper to perform caching.
Return type:wrapper
compute_iter_class_factory(api_method_name, resource_name)[source]

Factory function to generate ResourceIterator subclasses for Compute.

Parameters:
  • api_method_name (str) – The method to call on the API client class to iterate resources.
  • resource_name (str) – The name of the resource to create from the resource factory.
Returns:

A new class object.

Return type:

class

from_root_id(client, root_id)[source]

Start the crawling from root if the root type is supported.

Parameters:
  • client (object) – GCP API client.
  • root_id (str) – id of the root.
Returns:

the root resource instance.

Return type:

Resource

Raises:

Exception – Unsupported root id.

resource_class_factory(resource_type, key_field, hash_key=False)[source]

Factory function to generate Resource subclasses.

Parameters:
  • resource_type (str) – The static resource type for this subclass.
  • key_field (str) – The field in the resource data to use as the resource unique key.
  • hash_key (bool) – If true, use a hash of the key field data instead of the value of the key field.
Returns:

A new class object.

Return type:

class

resource_iter_class_factory(api_method_name, resource_name, api_method_arg_key=None, additional_arg_keys=None, resource_validation_method_name=None, **kwargs)[source]

Factory function to generate ResourceIterator subclasses.

Parameters:
  • api_method_name (str) – The method to call on the API client class to iterate resources.
  • resource_name (str) – The name of the resource to create from the resource factory.
  • api_method_arg_key (str) – An optional key from the resource dict to lookup for the value to send to the api method.
  • additional_arg_keys (list) – An optional list of additional keys from the resource dict to lookup for the values to send to the api method.
  • resource_validation_method_name (str) – An optional method name to call to validate that the resource supports iterating resources of this type.
  • **kwargs (dict) – Additional keyword args to send to the api method.
Returns:

A new class object.

Return type:

class

size_t_hash(key)[source]

Hash the key using size_t.

Parameters:key (str) – The key to hash.
Returns:The hashed key.
Return type:str