Wrapper for SQL API client.
ContainerClient
(global_configs, **kwargs)[source]¶Bases: object
Cloud Kubernetes Engine Client.
get_clusters
(project_id, zone='-')[source]¶Gets the clusters and their node pools for a project and zone.
If zone is not specified, it lists clusters for all zones in the project.
Parameters: |
|
---|---|
Returns: | A list of Cluster dicts. https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters#Cluster |
Return type: | list |
An example return value:
- [
- {“name”: “cluster-1”, …} {“name”: “cluster-2”, …}, {…}
]
Raises: | ApiExecutionError – ApiExecutionError is raised if the call to the
GCP API fails |
---|
get_serverconfig
(project_id, zone=None, location=None)[source]¶Gets the serverconfig for a project and zone or location.
Requires either a zone or a location, if both are passed in, the location is used instead of the zone.
Parameters: |
|
---|---|
Returns: | A serverconfig for a given Compute Engine zone. https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/ServerConfig |
Return type: | dict |
An example return value:
- {
“defaultClusterVersion”: string, “validNodeVersions”: [
string], “defaultImageType”: string, “validImageTypes”: [
string], “validMasterVersions”: [
string],
}
Raises: |
|
---|
ContainerRepositoryClient
(quota_max_calls=None, quota_period=100.0, use_rate_limiter=True)[source]¶Bases: google.cloud.forseti.common.gcp_api._base_repository.BaseRepositoryClient
Cloud Kubernetes Engine API Respository.
projects_locations
¶Returns a _ContainerProjectsLocationsRepository instance.
projects_zones
¶Returns a _ContainerProjectsZonesRepository instance.
projects_zones_clusters
¶Returns a _ContainerProjectsZonesClustersRepository instance.
_ContainerProjectsLocationsRepository
(**kwargs)[source]¶Bases: google.cloud.forseti.common.gcp_api._base_repository.GCPRepository
Implementation of Container Projects.Locations repository.
get_serverconfig
(project_id, location, fields=None, **kwargs)[source]¶Get KE serverconfig for location.
Parameters: |
|
---|---|
Returns: | Response from the API. |
Return type: | dict |
Raises: |
|
_ContainerProjectsZonesClustersRepository
(**kwargs)[source]¶Bases: google.cloud.forseti.common.gcp_api.repository_mixins.ListQueryMixin
, google.cloud.forseti.common.gcp_api._base_repository.GCPRepository
Implementation of Container Projects.Zones.Clusters repository.
_ContainerProjectsZonesRepository
(**kwargs)[source]¶Bases: google.cloud.forseti.common.gcp_api._base_repository.GCPRepository
Implementation of Container Projects.Zones repository.
get_serverconfig
(project_id, zone, fields=None, **kwargs)[source]¶Get KE serverconfig for zone.
Parameters: |
|
---|---|
Returns: | Response from the API. |
Return type: | dict |
Raises: |
|