DNS Client#
Client for interacting with the Google Cloud DNS API.
-
class
gcloud.dns.client.Client(project=None, credentials=None, http=None)[source]# Bases:
gcloud.client.JSONClientClient to bundle configuration needed for API requests.
Parameters: - project (string) – the project which the client acts on behalf of. Will be passed when creating a zone. If not passed, falls back to the default inferred from the environment.
- credentials (
oauth2client.client.OAuth2CredentialsorNoneType) – The OAuth2 Credentials to use for the connection owned by this client. If not passed (and if nohttpobject is passed), falls back to the default inferred from the environment. - http (
httplib2.Httpor class that definesrequest().) – An optional HTTP object to make requests. If not passed, anhttpobject is created that is bound to thecredentialsfor the current object.
-
list_zones(max_results=None, page_token=None)[source]# List zones for the project associated with this client.
See: https://cloud.google.com/dns/api/v1/managedZones/list
Parameters: Return type: tuple, (list, str)
Returns: list of
gcloud.dns.zone.ManagedZone, plus a “next page token” string: if the token is not None, indicates that more zones can be retrieved with another call (pass that value aspage_token).
-
quotas()[source]# Return DNS quots for the project associated with this client.
See: https://cloud.google.com/dns/api/v1/projects/get
Return type: mapping Returns: keys for the mapping correspond to those of the quotasub-mapping of the project resource.
-
zone(name, dns_name=None, description=None)[source]# Construct a zone bound to this client.
Parameters: - name (string) – Name of the zone.
- dns_name (string or
NoneType) – DNS name of the zone. If not passed, then calls tozone.create()will fail. - description (string or
NoneType) – the description for the zone. If not passed, defaults to the value of ‘dns_name’.
Return type: Returns: a new
ManagedZoneinstance
Connection#
Create / interact with gcloud dns connections.
-
class
gcloud.dns.connection.Connection(credentials=None, http=None)[source]# Bases:
gcloud.connection.JSONConnectionA connection to Google Cloud DNS via the JSON REST API.
-
API_BASE_URL= 'https://www.googleapis.com'# The base of the API call URL.
-
API_URL_TEMPLATE= '{api_base_url}/dns/{api_version}{path}'# A template for the URL of a particular API call.
-
API_VERSION= 'v1'# The version of the API, used in building the API call’s URL.
-
SCOPE= ('https://www.googleapis.com/auth/ndev.clouddns.readwrite',)# The scopes required for authenticating as a Cloud DNS consumer.
-