Repository: libcloud Updated Branches: refs/heads/trunk c7d67ef98 -> 9df384348
Google Cloud DNS documentation Signed-off-by: Quentin Pradet <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a0c4c832 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a0c4c832 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a0c4c832 Branch: refs/heads/trunk Commit: a0c4c832d2311e1699f660fd3fc193a6bb2029ad Parents: c7d67ef Author: Gareth Mcfarlane <[email protected]> Authored: Mon Apr 9 13:33:32 2018 +1000 Committer: Quentin Pradet <[email protected]> Committed: Thu Apr 12 22:40:37 2018 +0400 ---------------------------------------------------------------------- docs/dns/drivers/google.rst | 47 ++++++++++++++++++++ .../dns/google/dns_installed_application.py | 6 +++ docs/examples/dns/google/dns_internal_auth.py | 6 +++ docs/examples/dns/google/dns_service_account.py | 6 +++ 4 files changed, 65 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/a0c4c832/docs/dns/drivers/google.rst ---------------------------------------------------------------------- diff --git a/docs/dns/drivers/google.rst b/docs/dns/drivers/google.rst new file mode 100644 index 0000000..e7e7103 --- /dev/null +++ b/docs/dns/drivers/google.rst @@ -0,0 +1,47 @@ +Google DNS Driver Documentation +=================================== + +Google Cloud DNS is a scalable, reliable and managed authoritative +Domain Name System (DNS) service running on the same infrastructure as Google. + +.. figure:: /_static/images/provider_logos/gcp.png + :align: center + :width: 500 + :target: https://cloud.google.com/ + +Instantiating the driver +------------------------ + +The Google Cloud DNS driver supports three methods of authentication: +* Service accounts +* Installed Application +* Internal authentication + +To instantiate the driver, pass authentication tokens to the constructor as +shown below: + +1. Getting Driver with Service Account authentication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/dns/google/dns_service_account.py + +2. Getting Driver with Installed Application authentication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/dns/google/dns_installed_application.py + + +3. Using GCE Internal Authorization +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: /examples/dns/google/dns_internal_auth.py + + +API Docs +-------- + +.. autoclass:: libcloud.dns.drivers.google.GoogleDNSDriver + :members: + :inherited-members: + + http://git-wip-us.apache.org/repos/asf/libcloud/blob/a0c4c832/docs/examples/dns/google/dns_installed_application.py ---------------------------------------------------------------------- diff --git a/docs/examples/dns/google/dns_installed_application.py b/docs/examples/dns/google/dns_installed_application.py new file mode 100644 index 0000000..770f400 --- /dev/null +++ b/docs/examples/dns/google/dns_installed_application.py @@ -0,0 +1,6 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver('client ID', 'client secret', + project='project ID') http://git-wip-us.apache.org/repos/asf/libcloud/blob/a0c4c832/docs/examples/dns/google/dns_internal_auth.py ---------------------------------------------------------------------- diff --git a/docs/examples/dns/google/dns_internal_auth.py b/docs/examples/dns/google/dns_internal_auth.py new file mode 100644 index 0000000..1c2ce02 --- /dev/null +++ b/docs/examples/dns/google/dns_internal_auth.py @@ -0,0 +1,6 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver +# This example assumes you are running an instance within Google Compute Engine +# in which case you only need to provide the project ID. +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver('', '', project='project ID') http://git-wip-us.apache.org/repos/asf/libcloud/blob/a0c4c832/docs/examples/dns/google/dns_service_account.py ---------------------------------------------------------------------- diff --git a/docs/examples/dns/google/dns_service_account.py b/docs/examples/dns/google/dns_service_account.py new file mode 100644 index 0000000..418447f --- /dev/null +++ b/docs/examples/dns/google/dns_service_account.py @@ -0,0 +1,6 @@ +from libcloud.dns.types import Provider +from libcloud.dns.providers import get_driver + +DNSDriver = get_driver(Provider.GOOGLE) +driver = DNSDriver('service account email', 'keyfile location', + project='project ID')
