{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/39532264","id":39532264,"diff_hunk":"@@ -0,0 +1,184 @@\n+Using the API\n+=============\n+\n+Authorization / Configuration\n+-----------------------------\n+\n+- Use :class:`Client <gcloud.dns.client.Client>` objects to configure\n+  your applications.\n+\n+- :class:`Client <gcloud.dns.client.Client>` objects hold both a ``project``\n+  and an authenticated connection to the PubSub service.\n+\n+- The authentication credentials can be implicitly determined from the\n+  environment or directly via\n+  :meth:`from_service_account_json <gcloud.dns.client.Client.from_service_account_json>`\n+  and\n+  :meth:`from_service_account_p12 <gcloud.dns.client.Client.from_service_account_p12>`.\n+\n+- After setting ``GOOGLE_APPLICATION_CREDENTIALS`` and ``GCLOUD_PROJECT``\n+  environment variables, create an instance of\n+  :class:`Client <gcloud.dns.client.Client>`.\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client()\n+\n+- Override the credentials inferred from the environment by passing explicit\n+  ``credentials`` to one of the alternative ``classmethod`` factories,\n+  `:meth:gcloud.dns.client.Client.from_service_account_json`:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client.from_service_account_json('/path/to/creds.json')\n+\n+  or `:meth:gcloud.dns.client.Client.from_service_account_p12`:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client.from_service_account_p12('/path/to/creds.p12', 'jrandom@example.com')\n+\n+\n+Projects\n+--------\n+\n+A project is the top-level container in the ``DNS`` API:  it is tied\n+closely to billing, and can provide default access control across all its\n+datasets.  If no ``project`` is passed to the client container, the library\n+attempts to infer a project using the environment (including explicit\n+environment variables, GAE, and GCE).\n+\n+To override the project inferred from the environment, pass an explicit\n+``project`` to the constructor, or to either of the alternative\n+``classmethod`` factories:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client(project='PROJECT_ID')\n+\n+Project Quotas\n+--------------\n+\n+Query the quotas for a given project:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client(project='PROJECT_ID')\n+     >>> quotas = client.quotas()  # API request\n+     >>> for key, value in sorted(quotas.items()):\n+     ...     print('%s: %s' % (key, value))\n+     managedZones: 10000\n+     resourceRecordsPerRrset: 100\n+     rrsetsPerManagedZone: 10000\n+     rrsetAdditionsPerChange: 100\n+     rrsetDeletionsPerChange: 100\n+     totalRrdataSizePerChange: 10000\n+\n+.. note::\n+\n+   See https://github.com/GoogleCloudPlatform/gcloud-python/issues/1136\n+   for whether to expose quotas.\n+\n+Project ACLs\n+~~~~~~~~~~~~\n+\n+Each project has an access control list granting reader / writer / owner\n+permission to one or more entities.  This list cannot be queried or set\n+via the API:  it must be managed using the Google Developer Console.\n+\n+\n+Managed Zones\n+-------------\n+\n+A \"managed zone\" is the container for DNS records for the same DNS name\n+suffix and has a set of name servers that accept and responds to queries:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client(project='PROJECT_ID')\n+     >>> zone = client.zone('acme-co', description='Acme Company zone',\n+     ...                    dns_name='example.com')\n+\n+     >>> zone.exists()  # API request\n+     False\n+     >>> zone.create()  # API request\n+     >>> zone.exists()  # API request\n+     True\n+\n+List the zones for a given project:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client(project='PROJECT_ID')\n+     >>> zones = client.list_zones()  # API request\n+     >>> [zone.name for zone in zones]\n+     ['acme-co'>]\n+\n+\n+Resource Record Sets\n+--------------------\n+\n+Each managed zone exposes a read-only set of resource records:\n+\n+  .. doctest::\n+\n+     >>> from gcloud import dns\n+     >>> client = dns.Client(project='PROJECT_ID')\n+     >>> zone = client.zone('acme-co')\n+     >>> records, page_token = zone.list_resources()  # API request\n+     >>> [(record.name, record.type, record.ttl, record.rrdatas) for record in records]\n+     [('example.com.', 'SOA', 21600, ['ns-cloud1.googlecomains.com dns-admin.google.com 1 21600 3600 1209600 300')]\n+\n+.. note::\n+\n+   The ``page_token`` returned from ``zone.list_resources()`` will be\n+   an opaque string if there are more resources than can be returned in a\n+   single request.  To enumerate them all, repeat calling\n+   ``zone.list_resources()``, passing the ``page_token``, until the token\n+   is None.\n+\n+Change requests\n+---------------\n+\n+Update the resource record set for a zone by creating a change request\n+bundling additions to or deletions from the set.\n+\n+  .. doctest::\n+\n+     >>> import time\n+     >>> from gcloud import dns\n+     >>> client = dns.Client(project='PROJECT_ID')\n+     >>> zone = client.zone('acme-co')\n+     >>> record = dns.ResourceRecord(name='www.example.com', type='CNAME')\n+     >>> change = zone.change_request(additions=[record])\n+     >>> change.begin()  # API request\n+     >>> while change.status != 'done':\n+     ...     print('Waiting for change to complete')\n+     ...     time.sleep(60)","path":"docs/dns-usage.rst","position":null,"original_position":164,"commit_id":"12c43ceb5be96f1324b89ea66c88b6f95c6c2c36","original_commit_id":"8c52477f694e481532c3002c527daa5203af5abb","user":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"body":"4f96df0ce7ee7b16ae89c17308827248bc52f299","created_at":"2015-09-15T16:29:05Z","updated_at":"2015-09-15T16:29:05Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1137#discussion_r39532264","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments/39532264"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1137#discussion_r39532264"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137","id":44966725,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1137","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1137.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1137.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1137","number":1137,"state":"open","locked":false,"title":"Document DNS developer experience","user":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-14T18:55:32Z","updated_at":"2015-09-15T16:29:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7959b7055b5ffb78b36e2ab3811e182a9fdb66c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1137/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/12c43ceb5be96f1324b89ea66c88b6f95c6c2c36","head":{"label":"tseaver:dns-document_devx","ref":"dns-document_devx","sha":"12c43ceb5be96f1324b89ea66c88b6f95c6c2c36","user":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"repo":{"id":23322104,"name":"gcloud-python","full_name":"tseaver/gcloud-python","owner":{"login":"tseaver","id":242750,"avatar_url":"https://avatars.githubusercontent.com/u/242750?v=3","gravatar_id":"","url":"https://api.github.com/users/tseaver","html_url":"https://github.com/tseaver","followers_url":"https://api.github.com/users/tseaver/followers","following_url":"https://api.github.com/users/tseaver/following{/other_user}","gists_url":"https://api.github.com/users/tseaver/gists{/gist_id}","starred_url":"https://api.github.com/users/tseaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseaver/subscriptions","organizations_url":"https://api.github.com/users/tseaver/orgs","repos_url":"https://api.github.com/users/tseaver/repos","events_url":"https://api.github.com/users/tseaver/events{/privacy}","received_events_url":"https://api.github.com/users/tseaver/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tseaver/gcloud-python","description":"Google Cloud Python Client Library","fork":true,"url":"https://api.github.com/repos/tseaver/gcloud-python","forks_url":"https://api.github.com/repos/tseaver/gcloud-python/forks","keys_url":"https://api.github.com/repos/tseaver/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tseaver/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tseaver/gcloud-python/teams","hooks_url":"https://api.github.com/repos/tseaver/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/tseaver/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/tseaver/gcloud-python/events","assignees_url":"https://api.github.com/repos/tseaver/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/tseaver/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/tseaver/gcloud-python/tags","blobs_url":"https://api.github.com/repos/tseaver/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tseaver/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tseaver/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/tseaver/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tseaver/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/tseaver/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/tseaver/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/tseaver/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/tseaver/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/tseaver/gcloud-python/subscription","commits_url":"https://api.github.com/repos/tseaver/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/tseaver/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/tseaver/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/tseaver/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/tseaver/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/tseaver/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tseaver/gcloud-python/merges","archive_url":"https://api.github.com/repos/tseaver/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tseaver/gcloud-python/downloads","issues_url":"https://api.github.com/repos/tseaver/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/tseaver/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/tseaver/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/tseaver/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tseaver/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/tseaver/gcloud-python/releases{/id}","created_at":"2014-08-25T17:19:33Z","updated_at":"2015-04-10T19:42:56Z","pushed_at":"2015-09-15T16:27:51Z","git_url":"git://github.com/tseaver/gcloud-python.git","ssh_url":"git@github.com:tseaver/gcloud-python.git","clone_url":"https://github.com/tseaver/gcloud-python.git","svn_url":"https://github.com/tseaver/gcloud-python","homepage":"http://googlecloudplatform.github.io/gcloud-python/","size":10016,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"b427bedb84a0cb3301deb06a6ee84b3457b2fd63","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":16316451,"name":"gcloud-python","full_name":"GoogleCloudPlatform/gcloud-python","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-python","description":"Google Cloud Client Library for Python","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/releases{/id}","created_at":"2014-01-28T15:51:47Z","updated_at":"2015-09-13T07:02:47Z","pushed_at":"2015-09-15T16:27:52Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-python.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-python.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-python.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-python","homepage":"https://googlecloudplatform.github.io/gcloud-python/","size":40189,"stargazers_count":198,"watchers_count":198,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":110,"mirror_url":null,"open_issues_count":86,"forks":110,"open_issues":86,"watchers":198,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-python/pull/1137"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1137"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/issues/1137/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/pulls/1137/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-python/statuses/12c43ceb5be96f1324b89ea66c88b6f95c6c2c36"}}}}