google.cloud.forseti.common.gcp_api.cloudsql module

Wrapper for SQL API client.

class CloudSqlRepositoryClient(quota_max_calls=None, quota_period=1.0, use_rate_limiter=True)[source]

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

Cloud SQL Admin API Respository.

instances

Returns a _CloudSqlInstancesRepository instance.

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

Bases: object

CloudSQL Client.

get_instances(project_id)[source]

Gets all CloudSQL instances for a project.

Parameters:project_id (int) – The project id for a GCP project.
Returns:A list of database Instance resource dicts for a project_id. https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/instances
[{“kind”: “sql#instance”, “name”: “sql_instance1”, …}
{“kind”: “sql#instance”, “name”: “sql_instance2”, …}, {…}]
Return type:list
Raises:ApiExecutionError – ApiExecutionError is raised if the call to the GCP ClodSQL API fails
class _CloudSqlInstancesRepository(**kwargs)[source]

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

Implementation of CloudSql Instances repository.