google.cloud.forseti.common.gcp_api.stackdriver_logging module

Wrapper for Stackdriver Logging API client.

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

Bases: object

Stackdriver Logging Client.

get_billing_account_sinks(account_id)[source]

Get information about billing_account sinks. :param account_id: The id of the billing account. :type account_id: str

Returns:The response of retrieving the billing_account sinks.
Return type:list
Raises:ApiExecutionError – ApiExecutionError is raised if the call to the GCP API fails.
get_folder_sinks(folder_id)[source]

Get information about folder sinks. :param folder_id: The id of the folder. :type folder_id: str

Returns:The response of retrieving the folder sinks.
Return type:list
Raises:ApiExecutionError – ApiExecutionError is raised if the call to the GCP API fails.
get_organization_sinks(org_id)[source]

Get information about organization sinks. :param org_id: The id of the organization. :type org_id: str

Returns:The response of retrieving the organization sinks.
Return type:list
Raises:ApiExecutionError – ApiExecutionError is raised if the call to the GCP API fails.
get_project_sinks(project_id)[source]

Get information about project sinks. :param project_id: The id of the project. :type project_id: str

Returns:The response of retrieving the project sinks.
Return type:list
Raises:ApiExecutionError – ApiExecutionError is raised if the call to the GCP API fails.
class StackdriverLoggingRepositoryClient(quota_max_calls=None, quota_period=1.0, use_rate_limiter=True)[source]

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

Stackdriver Logging API Respository.

billing_accounts_sinks

Returns a _LoggingBillingAccountsSinksRepository instance.

folders_sinks

Returns a _LoggingFoldersSinksRepository instance.

organizations_sinks

Returns a _LoggingOrganizationsSinksRepository instance.

projects_sinks

Returns a _LoggingProjectsSinksRepository instance.

class _LoggingBillingAccountsSinksRepository(**kwargs)[source]

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

Implementation of Logging BillingAccounts Sinks repository.

static get_name(account_id)[source]

Returns a formatted name field to pass in to the API. :param account_id: The id of the billing account to query. :type account_id: str

Returns:A formatted project name.
Return type:str
class _LoggingFoldersSinksRepository(**kwargs)[source]

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

Implementation of Logging Folders Sinks repository.

static get_name(folder_id)[source]

Returns a formatted name field to pass in to the API. :param folder_id: The id of the folder to query. :type folder_id: str

Returns:A formatted project name.
Return type:str
class _LoggingOrganizationsSinksRepository(**kwargs)[source]

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

Implementation of Logging Organizations Sinks repository.

static get_name(org_id)[source]

Returns a formatted name field to pass in to the API. :param org_id: The id of the organization to query. :type org_id: str

Returns:A formatted project name.
Return type:str
class _LoggingProjectsSinksRepository(**kwargs)[source]

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

Implementation of Logging Projects Sinks repository.

static get_name(project_id)[source]

Returns a formatted name field to pass in to the API. :param project_id: The id of the project to query. :type project_id: str

Returns:A formatted project name.
Return type:str