google.cloud.forseti.common.gcp_api.servicemanagement module

Wrapper for Service Management API client.

class ServiceManagementClient(global_configs, **kwargs)[source]

Bases: object

Service Management Client.

get_enabled_apis(project_id)[source]

Gets the enabled APIs for a project.

Parameters:project_id (int) – The project id for a GCP project.
Returns:A list of ManagedService resource dicts. https://cloud.google.com/service-management/reference/rest/v1/services#ManagedService
{
“serviceName”: string, “producerProjectId”: string,

}

Return type:list
Raises:ApiExecutionError – ApiExecutionError is raised if the call to the GCP API fails.
class ServiceManagementRepositoryClient(quota_max_calls=None, quota_period=100.0, use_rate_limiter=True)[source]

Bases: google.cloud.forseti.common.gcp_api._base_repository.BaseRepositoryClient

ServiceManagement API Respository.

services

Returns a _ServiceManagementServicesRepository instance.

class _ServiceManagementServicesRepository(**kwargs)[source]

Bases: google.cloud.forseti.common.gcp_api.repository_mixins.ListQueryMixin, google.cloud.forseti.common.gcp_api._base_repository.GCPRepository

Implementation of Service Management Services repository.

static get_name(project_id)[source]

Format’s an organization_id to pass in to .get().

Parameters:project_id (str) – The project id to query, either just the id or the id prefixed with ‘projects/’.
Returns:The formatted resource name.
Return type:str