diff --git a/.travis.yml b/.travis.yml
index 98519d01405b..800c6f5cf885 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,7 +12,7 @@ script:
- tox -e lint
- tox -e system-tests
- tox -e system-tests3
- - scripts/update_docs.sh
+ - scripts/update_json_docs.sh
after_success:
- tox -e coveralls
diff --git a/docs/json/home.html b/docs/json/home.html
new file mode 100644
index 000000000000..498547bc17b2
--- /dev/null
+++ b/docs/json/home.html
@@ -0,0 +1,130 @@
+
+
+ Both the The
+ Google APIs Python Client is a client library for
+ using the broad set of Google APIs.
+
+
+
+
+
+ Read the Docs
+
+
+ GitHub
+
+
+ Issues
+
+
+ StackOverflow
+
+
+ PyPI
+
+
+
+
+
+
+ What is it?
+
+ gcloud is a client library for accessing Google
+ Cloud Platform services that significantly reduces the boilerplate
+ code you have to write. The library provides high-level API
+ abstractions so they're easier to understand. It embraces
+ idioms of Python, works well with the standard library, and
+ integrates better with your codebase.
+ All this means you spend more time creating code that matters
+ to you.gcloud is configured to access Google Cloud Platform
+ services and authorize (OAuth 2.0) automatically on your behalf.
+ With a one-line install and a private key, you are up and ready
+ to go. Better yet, if you are running on a Google Compute Engine
+ instance, the one-line install is enough!
+
+ Retrieve Datastore Entities
+
+
+ from gcloud import datastore
+
+ client = datastore.Client()
+ product_key = client.key('Product', 123)
+ print(client.get(product_key))
+
+
+
+Examples
+
+
+
+ gcloud-python-expenses-demo - Use gcloud-python with the Datastore and Cloud Storage to manage expenses
+
+
+FAQ
+
+ What is the relationship between the
+ gcloud package
+ and the gcloud command-line tool?gcloud command-line tool and
+ gcloud package are a part of the Google Cloud SDK: a collection
+ of tools and libraries that enable you to easily create and manage
+ resources on the Google Cloud Platform. The gcloud command-line
+ tool can be used to manage both your development workflow and your
+ Google Cloud Platform resources while the gcloud package is the
+ Google Cloud Client Library for Python.What is the relationship between
+ gcloud
+ and the Google APIs Python Client?gcloud is built specifically for the Google Cloud Platform
+ and is the recommended way to integrate Google Cloud APIs into your
+ Python applications. If your application requires both Google Cloud Platform and
+ other Google APIs, the 2 libraries may be used by your application.
gcloud-pythonGCloud API access in idiomatic Python.
+The gcloud library is pip install-able:
+
+If you want to install gcloud-python from source,
+you can clone the repository from GitHub:
+
+Google Cloud Datastore is a fully managed, + schemaless database for storing non-relational data. +
+ ++Google Cloud Storage allows you to store data on Google infrastructure. +
+ +{{::param.parent}} ↳ {{::param.name}} |
|---|
{{::param.parent}} ↳ {{::param.name}} |
|---|
'),function(r,i,a,l){var c;if(e.isDefined(a.escape)?c=t(a.escape):e.isDefined(a.noEscape)&&(c=t("false")),l.init(i.find("code")),a.onhighlight&&l.highlightCallback(function(){r.$eval(a.onhighlight)}),(o||s)&&n(a)){var u;u=c&&!c(r)?s:o,l.highlight(u)}r.$on("$destroy",function(){l.release()})}}}}],o=function(t){return function(){return{require:"?hljs",restrict:"A",link:function(n,r,i,a){a&&i.$observe(t,function(t){e.isDefined(t)&&a.setLanguage(t)})}}}},a=function(e){return function(){return{require:"?hljs",restrict:"A",link:function(t,n,r,i){i&&t.$watch(r[e],function(e,n){(e||e!==n)&&i.setInterpolateScope(e?t:null)})}}}},s=function(e){return function(){return{require:"?hljs",restrict:"A",link:function(t,n,r,i){i&&t.$watch(r[e],function(e,t){e?i.highlight(e):i.clear()})}}}},l=function(t){return["$http","$templateCache","$q",function(n,r,i){return{require:"?hljs",restrict:"A",compile:function(a,o,s){var l=o[t];return function(t,a,o,s){var c=0;s&&t.$watch(l,function(t){var a=++c;if(t&&e.isString(t)){var o,l;o=r.get(t),o||(l=i.defer(),n.get(t,{cache:r,transformResponse:function(e,t){return e}}).success(function(e){a===c&&l.resolve(e)}).error(function(){a===c&&s.clear(),l.resolve()}),o=l.promise),i.when(o).then(function(t){t&&(e.isArray(t)?t=t[1]:e.isObject(t)&&(t=t.data),t=t.replace(/^(\r\n|\r|\n)/m,""),s.highlight(t))})}else s.clear()})}}}}]},function(t){t.directive("hljs",i),e.forEach(["interpolate","hljsInterpolate","compile","hljsCompile"],function(e){t.directive(e,a(e))}),e.forEach(["language","hljsLanguage"],function(e){t.directive(e,o(e))}),e.forEach(["source","hljsSource"],function(e){t.directive(e,s(e))}),e.forEach(["include","hljsInclude"],function(e){t.directive(e,l(e))})}(r),"hljs"}),/*! showdown 19-10-2015 */
+function(){function e(e){"use strict";var t={omitExtraWLInCodeBlocks:{"default":!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{"default":!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{"default":!1,describe:"Specify a prefix to generated header ids",type:"string"},headerLevelStart:{"default":!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{"default":!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{"default":!1,describe:"Turn on/off GFM autolink style",type:"boolean"},literalMidWordUnderscores:{"default":!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},strikethrough:{"default":!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{"default":!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{"default":!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{"default":!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{"default":!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{"default":!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"}};if(e===!1)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]["default"]);return n}function t(e,t){"use strict";var n=t?"Error in "+t+" extension->":"Error in unnamed extension",i={valid:!0,error:""};r.helper.isArray(e)||(e=[e]);for(var a=0;a[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=n.replace(/^ /gm,"~0"),n=n.replace(/~0/g,"")}),r.subParser("hashBlock")("\n"+a+"\n
",t,n)}),e=n.converter._dispatch("blockQuotes.after",e,t)}),r.subParser("codeBlocks",function(e,t,n){"use strict";e=n.converter._dispatch("codeBlocks.before",e,t),e+="~0";var i=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g;return e=e.replace(i,function(e,i,a){var o=i,s=a,l="\n";return o=r.subParser("outdent")(o),o=r.subParser("encodeCode")(o),o=r.subParser("detab")(o),o=o.replace(/^\n+/g,""),o=o.replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(l=""),o=""+o+l+"
",r.subParser("hashBlock")(o,t,n)+s}),e=e.replace(/~0/,""),e=n.converter._dispatch("codeBlocks.after",e,t)}),r.subParser("codeSpans",function(e,t,n){"use strict";return e=n.converter._dispatch("codeSpans.before",e,t),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,t,n,i){var a=i;return a=a.replace(/^([ \t]*)/g,""),a=a.replace(/[ \t]*$/g,""),a=r.subParser("encodeCode")(a),t+""+a+""}),e=n.converter._dispatch("codeSpans.after",e,t)}),r.subParser("detab",function(e){"use strict";return e=e.replace(/\t(?=\t)/g," "),e=e.replace(/\t/g,"~A~B"),e=e.replace(/~B(.+?)~A/g,function(e,t){for(var n=t,r=4-n.length%4,i=0;r>i;i++)n+=" ";return n}),e=e.replace(/~A/g," "),e=e.replace(/~B/g,"")}),r.subParser("encodeAmpsAndAngles",function(e){"use strict";return e=e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),e=e.replace(/<(?![a-z\/?\$!])/gi,"<")}),r.subParser("encodeBackslashEscapes",function(e){"use strict";return e=e.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),e=e.replace(/\\([`*_{}\[\]()>#+-.!])/g,r.helper.escapeCharactersCallback)}),r.subParser("encodeCode",function(e){"use strict";return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=r.helper.escapeCharacters(e,"*_{}[]\\",!1)}),r.subParser("encodeEmailAddress",function(e){"use strict";var t=[function(e){return""+e.charCodeAt(0)+";"},function(e){return""+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e="mailto:"+e,e=e.replace(/./g,function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else if(":"!==e){var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e}),e=''+e+"",e=e.replace(/">.+:/g,'">')}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(e){"use strict";var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;return e=e.replace(t,function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=r.helper.escapeCharacters(t,"\\`*_",!1)})}),r.subParser("githubCodeBlocks",function(e,t,n){"use strict";return t.ghCodeBlocks?(e=n.converter._dispatch("githubCodeBlocks.before",e,t),e+="~0",e=e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(e,i,a){var o=t.omitExtraWLInCodeBlocks?"":"\n";return a=r.subParser("encodeCode")(a),a=r.subParser("detab")(a),a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,""),a=""+a+o+"
",r.subParser("hashBlock")(a,t,n)}),e=e.replace(/~0/,""),e=n.converter._dispatch("githubCodeBlocks.after",e,t)):e}),r.subParser("hashBlock",function(e,t,n){"use strict";return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"}),r.subParser("hashElement",function(e,t,n){"use strict";return function(e,t){var r=t;return r=r.replace(/\n\n/g,"\n"),r=r.replace(/^\n/,""),r=r.replace(/\n+$/g,""),r="\n\n~K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}}),r.subParser("hashHTMLBlocks",function(e,t,n){"use strict";return e=e.replace(/\n/g,"\n\n"),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,r.subParser("hashElement")(e,t,n)),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside|address|audio|canvas|figure|hgroup|output|video)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,r.subParser("hashElement")(e,t,n)),e=e.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(e,t,n)),e=e.replace(/(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(e,t,n)),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(e,t,n)),e=e.replace(/\n\n/g,"\n")}),r.subParser("hashHTMLSpans",function(e,t,n){"use strict";for(var i=r.helper.matchRecursiveRegExp(e,"]*>","","gi"),a=0;a"+s+"";return r.subParser("hashBlock")(u,t,n)}),e=e.replace(l,function(e,a){var s=r.subParser("spanGamut")(a,t,n),l=t.noHeaderId?"":' id="'+i(a)+'"',c=o+1,u=""+s+" ";return r.subParser("hashBlock")(u,t,n)}),e=e.replace(/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm,function(e,a,s){var l=r.subParser("spanGamut")(s,t,n),c=t.noHeaderId?"":' id="'+i(s)+'"',u=o-1+a.length,d=""+l+" ";return r.subParser("hashBlock")(d,t,n)}),e=n.converter._dispatch("headers.after",e,t)}),r.subParser("images",function(e,t,n){"use strict";function i(e,t,i,a,o,s,l,c){var u=n.gUrls,d=n.gTitles,p=n.gDimensions;if(i=i.toLowerCase(),c||(c=""),""===a||null===a){if(""!==i&&null!==i||(i=t.toLowerCase().replace(/ ?\n/g," ")),a="#"+i,r.helper.isUndefined(u[i]))return e;a=u[i],r.helper.isUndefined(d[i])||(c=d[i]),r.helper.isUndefined(p[i])||(o=p[i].width,s=p[i].height)}t=t.replace(/"/g,"""),t=r.helper.escapeCharacters(t,"*_",!1),a=r.helper.escapeCharacters(a,"*_",!1);var m='
"}e=n.converter._dispatch("images.before",e,t);var a=/!\[(.*?)]\s?\([ \t]*()(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(['"])(.*?)\6[ \t]*)?\)/g,o=/!\[(.*?)][ ]?(?:\n[ ]*)?\[(.*?)]()()()()()/g;return e=e.replace(o,i),e=e.replace(a,i),e=n.converter._dispatch("images.after",e,t)}),r.subParser("italicsAndBold",function(e,t,n){"use strict";return e=n.converter._dispatch("italicsAndBold.before",e,t),t.literalMidWordUnderscores?(e=e.replace(/(^|\s|>|\b)__(?=\S)([^]+?)__(?=\b|<|\s|$)/gm,"$1$2"),e=e.replace(/(^|\s|>|\b)_(?=\S)([^]+?)_(?=\b|<|\s|$)/gm,"$1$2"),e=e.replace(/(\*\*)(?=\S)([^\r]*?\S[*]*)\1/g,"$2"),e=e.replace(/(\*)(?=\S)([^\r]*?\S)\1/g,"$2")):(e=e.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),e=e.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2")),e=n.converter._dispatch("italicsAndBold.after",e,t)}),r.subParser("lists",function(e,t,n){"use strict";function i(e,i){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n"),e+="~0";var a=/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+((\[(x| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,o=/\n[ \t]*\n(?!~0)/.test(e);return e=e.replace(a,function(e,i,a,s,l,c,u){u=u&&""!==u.trim();var d=r.subParser("outdent")(l,t,n),p="";return c&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x| )?]/m,function(){var e='"})),i||d.search(/\n{2,}/)>-1?(d=r.subParser("githubCodeBlocks")(d,t,n),d=r.subParser("blockGamut")(d,t,n)):(d=r.subParser("lists")(d,t,n),d=d.replace(/\n$/,""),d=o?r.subParser("paragraphs")(d,t,n):r.subParser("spanGamut")(d,t,n)),d="\n"+d+" \n"}),e=e.replace(/~0/g,""),n.gListLevel--,i&&(e=e.replace(/\s+$/,"")),e}function a(e,t,n){var r="ul"===t?/^ {0,2}\d+\.[ \t]/gm:/^ {0,2}[*+-][ \t]/gm,a=[],o="";if(-1!==e.search(r)){!function l(e){var a=e.search(r);-1!==a?(o+="\n\n<"+t+">"+i(e.slice(0,a),!!n)+""+t+">\n\n",t="ul"===t?"ol":"ul",r="ul"===t?/^ {0,2}\d+\.[ \t]/gm:/^ {0,2}[*+-][ \t]/gm,l(e.slice(a))):o+="\n\n<"+t+">"+i(e,!!n)+""+t+">\n\n"}(e);for(var s=0;s"+i(e,!!n)+""+t+">\n\n";return o}e=n.converter._dispatch("lists.before",e,t),e+="~0";var o=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return n.gListLevel?e=e.replace(o,function(e,t,n){var r=n.search(/[*+-]/g)>-1?"ul":"ol";return a(t,r,!0)}):(o=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,e=e.replace(o,function(e,t,n,r){var i=r.search(/[*+-]/g)>-1?"ul":"ol";return a(n,i)})),e=e.replace(/~0/,""),e=n.converter._dispatch("lists.after",e,t)}),r.subParser("outdent",function(e){"use strict";return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,"")}),r.subParser("paragraphs",function(e,t,n){"use strict";e=n.converter._dispatch("paragraphs.before",e,t),e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,"");for(var i=e.split(/\n{2,}/g),a=[],o=i.length,s=0;o>s;s++){var l=i[s];l.search(/~K(\d+)K/g)>=0?a.push(l):l.search(/\S/)>=0&&(l=r.subParser("spanGamut")(l,t,n),l=l.replace(/^([ \t]*)/g,""),l+="
",a.push(l))}for(o=a.length,s=0;o>s;s++)for(;a[s].search(/~K(\d+)K/)>=0;){var c=n.gHtmlBlocks[RegExp.$1];c=c.replace(/\$/g,"$$$$"),a[s]=a[s].replace(/~K\d+K/,c)}return e=n.converter._dispatch("paragraphs.after",e,t),a.join("\n\n")}),r.subParser("runExtension",function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var i=e.regex;!i instanceof RegExp&&(i=new RegExp(i,"g")),t=t.replace(i,e.replace)}return t}),r.subParser("spanGamut",function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t),e=r.subParser("codeSpans")(e,t,n),e=r.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=r.subParser("encodeBackslashEscapes")(e,t,n),e=r.subParser("images")(e,t,n),e=r.subParser("anchors")(e,t,n),e=r.subParser("autoLinks")(e,t,n),e=r.subParser("encodeAmpsAndAngles")(e,t,n),e=r.subParser("italicsAndBold")(e,t,n),e=r.subParser("strikethrough")(e,t,n),e=e.replace(/ +\n/g,"
\n"),e=n.converter._dispatch("spanGamut.after",e,t)}),r.subParser("strikethrough",function(e,t,n){"use strict";return t.strikethrough&&(e=n.converter._dispatch("strikethrough.before",e,t),e=e.replace(/(?:~T){2}([^~]+)(?:~T){2}/g,"$1"),e=n.converter._dispatch("strikethrough.after",e,t)),e}),r.subParser("stripBlankLines",function(e){"use strict";return e.replace(/^[ \t]+$/gm,"")}),r.subParser("stripLinkDefinitions",function(e,t,n){"use strict";var i=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*(\S+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=~0))/gm;return e+="~0",e=e.replace(i,function(e,i,a,o,s,l,c){return i=i.toLowerCase(),n.gUrls[i]=r.subParser("encodeAmpsAndAngles")(a),l?l+c:(c&&(n.gTitles[i]=c.replace(/"|'/g,""")),t.parseImgDimensions&&o&&s&&(n.gDimensions[i]={width:o,height:s}),"")}),e=e.replace(/~0/,"")}),r.subParser("tables",function(e,t,n){"use strict";var i=function(){var e,i={};return i.th=function(e,i){var a="";return e=e.trim(),""===e?"":(t.tableHeaderId&&(a=' id="'+e.replace(/ /g,"_").toLowerCase()+'"'),e=r.subParser("spanGamut")(e,t,n),i=i&&""!==i.trim()?' style="'+i+'"':"",""+e+" ")},i.td=function(e,i){var a=r.subParser("spanGamut")(e.trim(),t,n);return i=i&&""!==i.trim()?' style="'+i+'"':"",""+a+" "},i.ths=function(){var e="",t=0,n=[].slice.apply(arguments[0]),r=[].slice.apply(arguments[1]);for(t;t\n",e+=i.ths.apply(this,[t,n]),e+="\n",e+="\n"},i.tr=function(){var e,t=[].slice.apply(arguments[0]),n=[].slice.apply(arguments[1]);return e="\n",e+=i.tds.apply(this,[t,n]),e+=" \n"},e=function(e){var t,n,r=0,a=e.split("\n"),o=[];for(r;r"),n=t.substring(1,t.length-1).split("|"),0===c.length)for(u=0;u");t.trim().match(/^[|].*[|]$/);)t=t.trim(),s.push(i.tr.apply(this,[t.substring(1,t.length-1).split("|"),c])),t=a[++r];s.push(""),s.push(""),o.push(s.join("\n"));continue}t=a[--r]}o.push(t)}return o.join("\n")},{parse:e}};if(t.tables){e=n.converter._dispatch("tables.before",e,t);var a=i();e=a.parse(e),e=n.converter._dispatch("tables.after",e,t)}return e}),r.subParser("unescapeSpecialChars",function(e){"use strict";return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)})});var l=this;"undefined"!=typeof module&&module.exports?module.exports=r:"function"==typeof define&&define.amd?define("showdown",function(){"use strict";return r}):l.showdown=r}.call(this);
\ No newline at end of file
diff --git a/docs/json/src/vendor-d362a4bbd8.css b/docs/json/src/vendor-d362a4bbd8.css
new file mode 100644
index 000000000000..3801b81b4f87
--- /dev/null
+++ b/docs/json/src/vendor-d362a4bbd8.css
@@ -0,0 +1,2 @@
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}legend,td,th{padding:0}.hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.hljs,.hljs-subst{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-literal{color:#1f811f}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-comment{color:#888}.hljs-meta{color:#2b6ea1}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
\ No newline at end of file
diff --git a/docs/json/toc-all.json b/docs/json/toc-all.json
new file mode 100644
index 000000000000..1a0e445e9672
--- /dev/null
+++ b/docs/json/toc-all.json
@@ -0,0 +1,857 @@
+{
+ "overview": "overview.html",
+ "guides": [{
+ "title": "Authentication",
+ "id": "authentication",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authentication/readme.md",
+ "contents": [
+ "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/readme.md",
+ "authentication.md"
+ ]
+ }, {
+ "title": "FAQ",
+ "id": "faq",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/faq/readme.md",
+ "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/faq/readme.md"
+ }, {
+ "title": "Troubleshooting",
+ "id": "troubleshooting",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/troubleshooting/readme.md",
+ "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/troubleshooting/readme.md"
+ }, {
+ "title": "Contributing",
+ "id": "contributing",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/contributing/readme.md",
+ "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/contributing/readme.md"
+ }],
+ "services": [{
+ "title": "gcloud",
+ "type": "gcloud/gcloud",
+ "nav": [{
+ "title": "Client",
+ "type": "gcloud/client/client"
+ },{
+ "title": "Connection",
+ "type": "gcloud/connection/connection"
+ },{
+ "title": "Credentials",
+ "type": "gcloud/credentials"
+ },{
+ "title": "Environment Variables",
+ "type": "gcloud/environment_vars"
+ },{
+ "title": "Iterator",
+ "type": "gcloud/iterator"
+ }]
+ },{
+ "title": "BigQuery",
+ "implemented": ">=0.7.0",
+ "type": "gcloud/bigquery",
+ "nav": [
+ {
+ "type": "gcloud/bigquery/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/bigquery/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/bigquery/dataset/accessgrant",
+ "title": "AccessGrant"
+ },
+ {
+ "type": "gcloud/bigquery/dataset/dataset",
+ "title": "Dataset"
+ },
+ {
+ "type": "gcloud/bigquery/job/compression",
+ "title": "Compression"
+ },
+ {
+ "type": "gcloud/bigquery/job/copyjob",
+ "title": "CopyJob"
+ },
+ {
+ "type": "gcloud/bigquery/job/createdisposition",
+ "title": "CreateDisposition"
+ },
+ {
+ "type": "gcloud/bigquery/job/destinationformat",
+ "title": "DestinationFormat"
+ },
+ {
+ "type": "gcloud/bigquery/job/encoding",
+ "title": "Encoding"
+ },
+ {
+ "type": "gcloud/bigquery/job/extracttabletostoragejob",
+ "title": "ExtractTableToStorageJob"
+ },
+ {
+ "type": "gcloud/bigquery/job/loadtablefromstoragejob",
+ "title": "LoadTableFromStorageJob"
+ },
+ {
+ "type": "gcloud/bigquery/job/queryjob",
+ "title": "QueryJob"
+ },
+ {
+ "type": "gcloud/bigquery/job/querypriority",
+ "title": "QueryPriority"
+ },
+ {
+ "type": "gcloud/bigquery/job/sourceformat",
+ "title": "SourceFormat"
+ },
+ {
+ "type": "gcloud/bigquery/job/writedisposition",
+ "title": "WriteDisposition"
+ },
+ {
+ "type": "gcloud/bigquery/query/queryresults",
+ "title": "QueryResults"
+ },
+ {
+ "type": "gcloud/bigquery/table/schemafield",
+ "title": "SchemaField"
+ },
+ {
+ "type": "gcloud/bigquery/table/table",
+ "title": "Table"
+ }
+ ]
+ },{
+ "title": "BigTable",
+ "implemented": ">=0.12.0",
+ "type": "gcloud/bigtable",
+ "nav": [
+ {
+ "type": "gcloud/bigtable/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/bigtable/cluster/cluster",
+ "title": "Cluster"
+ },
+ {
+ "type": "gcloud/bigtable/cluster/operation",
+ "title": "Operation"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/columnfamily",
+ "title": "ColumnFamily"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/gcruleintersection",
+ "title": "GCRuleIntersection"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/gcruleunion",
+ "title": "GCRuleUnion"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/garbagecollectionrule",
+ "title": "GarbageCollectionRule"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/maxagegcrule",
+ "title": "MaxAgeGCRule"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/maxversionsgcrule",
+ "title": "MaxVersionsGCRule"
+ },
+ {
+ "type": "gcloud/bigtable/row/appendrow",
+ "title": "AppendRow"
+ },
+ {
+ "type": "gcloud/bigtable/row/conditionalrow",
+ "title": "ConditionalRow"
+ },
+ {
+ "type": "gcloud/bigtable/row/directrow",
+ "title": "DirectRow"
+ },
+ {
+ "type": "gcloud/bigtable/row/row",
+ "title": "Row"
+ },
+ {
+ "type": "gcloud/bigtable/row_data/cell",
+ "title": "Cell"
+ },
+ {
+ "type": "gcloud/bigtable/row_data/partialrowdata",
+ "title": "PartialRowData"
+ },
+ {
+ "type": "gcloud/bigtable/row_data/partialrowsdata",
+ "title": "PartialRowsData"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/applylabelfilter",
+ "title": "ApplyLabelFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/blockallfilter",
+ "title": "BlockAllFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/cellscolumnlimitfilter",
+ "title": "CellsColumnLimitFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/cellsrowlimitfilter",
+ "title": "CellsRowLimitFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/cellsrowoffsetfilter",
+ "title": "CellsRowOffsetFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/columnqualifierregexfilter",
+ "title": "ColumnQualifierRegexFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/columnrangefilter",
+ "title": "ColumnRangeFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/conditionalrowfilter",
+ "title": "ConditionalRowFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/familynameregexfilter",
+ "title": "FamilyNameRegexFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/passallfilter",
+ "title": "PassAllFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/rowfilter",
+ "title": "RowFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/rowfilterchain",
+ "title": "RowFilterChain"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/rowfilterunion",
+ "title": "RowFilterUnion"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/rowkeyregexfilter",
+ "title": "RowKeyRegexFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/rowsamplefilter",
+ "title": "RowSampleFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/sinkfilter",
+ "title": "SinkFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/stripvaluetransformerfilter",
+ "title": "StripValueTransformerFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/timestamprange",
+ "title": "TimestampRange"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/timestamprangefilter",
+ "title": "TimestampRangeFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/valuerangefilter",
+ "title": "ValueRangeFilter"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/valueregexfilter",
+ "title": "ValueRegexFilter"
+ },
+ {
+ "type": "gcloud/bigtable/table/table",
+ "title": "Table"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/batch/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/pool/connectionpool",
+ "title": "ConnectionPool"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/pool/noconnectionsavailable",
+ "title": "NoConnectionsAvailable"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/table/table",
+ "title": "Table"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/table",
+ "title": "Table"
+ }
+ ]
+ },{
+ "title": "Datastore",
+ "implemented": ">=0.3.0",
+ "type": "gcloud/datastore",
+ "nav": [
+ {
+ "type": "gcloud/datastore/batch/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/datastore/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/datastore/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/datastore/entity/entity",
+ "title": "Entity"
+ },
+ {
+ "type": "datastore/helpers",
+ "title": "Helpers"
+ },
+ {
+ "type": "gcloud/datastore/key/key",
+ "title": "Key"
+ },
+ {
+ "type": "gcloud/datastore/query/iterator",
+ "title": "Iterator"
+ },
+ {
+ "type": "gcloud/datastore/query/query",
+ "title": "Query"
+ },
+ {
+ "type": "gcloud/datastore/transaction/transaction",
+ "title": "Transaction"
+ }
+ ]
+ }, {
+ "title": "DNS",
+ "implemented": ">=0.8.0",
+ "type": "gcloud/dns",
+ "nav": [
+ {
+ "type": "gcloud/dns/changes/changes",
+ "title": "Changes"
+ },
+ {
+ "type": "gcloud/dns/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/dns/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/dns/resource_record_set/resourcerecordset",
+ "title": "ResourceRecordSet"
+ },
+ {
+ "type": "gcloud/dns/zone/managedzone",
+ "title": "ManagedZone"
+ }
+ ]
+ }, {
+ "title": "Exceptions",
+ "type": "gcloud/exceptions",
+ "nav": [
+ {
+ "type": "gcloud/exceptions/badrequest",
+ "title": "BadRequest"
+ },
+ {
+ "type": "gcloud/exceptions/clienterror",
+ "title": "ClientError"
+ },
+ {
+ "type": "gcloud/exceptions/conflict",
+ "title": "Conflict"
+ },
+ {
+ "type": "gcloud/exceptions/forbidden",
+ "title": "Forbidden"
+ },
+ {
+ "type": "gcloud/exceptions/gclouderror",
+ "title": "GCloudError"
+ },
+ {
+ "type": "gcloud/exceptions/internalservererror",
+ "title": "InternalServerError"
+ },
+ {
+ "type": "gcloud/exceptions/lengthrequired",
+ "title": "LengthRequired"
+ },
+ {
+ "type": "gcloud/exceptions/methodnotallowed",
+ "title": "MethodNotAllowed"
+ },
+ {
+ "type": "gcloud/exceptions/methodnotimplemented",
+ "title": "MethodNotImplemented"
+ },
+ {
+ "type": "gcloud/exceptions/movedpermanently",
+ "title": "MovedPermanently"
+ },
+ {
+ "type": "gcloud/exceptions/notfound",
+ "title": "NotFound"
+ },
+ {
+ "type": "gcloud/exceptions/notmodified",
+ "title": "NotModified"
+ },
+ {
+ "type": "gcloud/exceptions/preconditionfailed",
+ "title": "PreconditionFailed"
+ },
+ {
+ "type": "gcloud/exceptions/redirection",
+ "title": "Redirection"
+ },
+ {
+ "type": "gcloud/exceptions/requestrangenotsatisfiable",
+ "title": "RequestRangeNotSatisfiable"
+ },
+ {
+ "type": "gcloud/exceptions/resumeincomplete",
+ "title": "ResumeIncomplete"
+ },
+ {
+ "type": "gcloud/exceptions/servererror",
+ "title": "ServerError"
+ },
+ {
+ "type": "gcloud/exceptions/serviceunavailable",
+ "title": "ServiceUnavailable"
+ },
+ {
+ "type": "gcloud/exceptions/temporaryredirect",
+ "title": "TemporaryRedirect"
+ },
+ {
+ "type": "gcloud/exceptions/toomanyrequests",
+ "title": "TooManyRequests"
+ },
+ {
+ "type": "gcloud/exceptions/unauthorized",
+ "title": "Unauthorized"
+ },
+ {
+ "type": "gcloud/exceptions",
+ "title": "Exceptions"
+ }
+ ],
+ "credentials": [
+ {
+ "type": "gcloud/credentials",
+ "title": "Credentials"
+ }
+ ],
+ "datastore": [
+ {
+ "type": "gcloud/datastore/batch/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/datastore/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/datastore/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/datastore/entity/entity",
+ "title": "Entity"
+ },
+ {
+ "type": "gcloud/datastore/helpers",
+ "title": "Helpers"
+ },
+ {
+ "type": "gcloud/datastore/key/key",
+ "title": "Key"
+ },
+ {
+ "type": "gcloud/datastore/query/iterator",
+ "title": "Iterator"
+ },
+ {
+ "type": "gcloud/datastore/query/query",
+ "title": "Query"
+ },
+ {
+ "type": "gcloud/datastore/transaction/transaction",
+ "title": "Transaction"
+ }
+ ]
+ },
+ {
+ "title": "Logging",
+ "implemented": ">=0.12.0",
+ "type": "gcloud/logging",
+ "nav": [
+ {
+ "type": "gcloud/logging/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/logging/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/logging/entries/protobufentry",
+ "title": "ProtobufEntry"
+ },
+ {
+ "type": "gcloud/logging/entries/structentry",
+ "title": "StructEntry"
+ },
+ {
+ "type": "gcloud/logging/entries/textentry",
+ "title": "TextEntry"
+ },
+ {
+ "type": "gcloud/logging/logger/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/logging/logger/logger",
+ "title": "Logger"
+ },
+ {
+ "type": "gcloud/logging/metric/metric",
+ "title": "Metric"
+ },
+ {
+ "type": "gcloud/logging/sink/sink",
+ "title": "Sink"
+ }
+ ]
+ }, {
+ "title": "Monitoring",
+ "implemented": ">=0.12.0",
+ "type": "gcloud/monitoring",
+ "nav": [
+ {
+ "type": "gcloud/monitoring/index/aligner",
+ "title": "Aligner"
+ },
+ {
+ "type": "gcloud/monitoring/index/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/monitoring/index/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/monitoring/index/labeldescriptor",
+ "title": "LabelDescriptor"
+ },
+ {
+ "type": "gcloud/monitoring/index/labelvaluetype",
+ "title": "LabelValueType"
+ },
+ {
+ "type": "gcloud/monitoring/index/metric",
+ "title": "Metric"
+ },
+ {
+ "type": "gcloud/monitoring/index/metricdescriptor",
+ "title": "MetricDescriptor"
+ },
+ {
+ "type": "gcloud/monitoring/index/metrickind",
+ "title": "MetricKind"
+ },
+ {
+ "type": "gcloud/monitoring/index/point",
+ "title": "Point"
+ },
+ {
+ "type": "gcloud/monitoring/index/query",
+ "title": "Query"
+ },
+ {
+ "type": "gcloud/monitoring/index/reducer",
+ "title": "Reducer"
+ },
+ {
+ "type": "gcloud/monitoring/index/resource",
+ "title": "Resource"
+ },
+ {
+ "type": "gcloud/monitoring/index/resourcedescriptor",
+ "title": "ResourceDescriptor"
+ },
+ {
+ "type": "gcloud/monitoring/index/timeseries",
+ "title": "TimeSeries"
+ },
+ {
+ "type": "gcloud/monitoring/index/valuetype",
+ "title": "ValueType"
+ },
+ {
+ "type": "gcloud/monitoring/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/monitoring/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/monitoring/label/labeldescriptor",
+ "title": "LabelDescriptor"
+ },
+ {
+ "type": "gcloud/monitoring/label/labelvaluetype",
+ "title": "LabelValueType"
+ },
+ {
+ "type": "gcloud/monitoring/metric/metric",
+ "title": "Metric"
+ },
+ {
+ "type": "gcloud/monitoring/metric/metricdescriptor",
+ "title": "MetricDescriptor"
+ },
+ {
+ "type": "gcloud/monitoring/metric/metrickind",
+ "title": "MetricKind"
+ },
+ {
+ "type": "gcloud/monitoring/metric/valuetype",
+ "title": "ValueType"
+ },
+ {
+ "type": "gcloud/monitoring/query/aligner",
+ "title": "Aligner"
+ },
+ {
+ "type": "gcloud/monitoring/query/query",
+ "title": "Query"
+ },
+ {
+ "type": "gcloud/monitoring/query/reducer",
+ "title": "Reducer"
+ },
+ {
+ "type": "gcloud/monitoring/resource/resource",
+ "title": "Resource"
+ },
+ {
+ "type": "gcloud/monitoring/resource/resourcedescriptor",
+ "title": "ResourceDescriptor"
+ },
+ {
+ "type": "gcloud/monitoring/timeseries/point",
+ "title": "Point"
+ },
+ {
+ "type": "gcloud/monitoring/timeseries/timeseries",
+ "title": "TimeSeries"
+ }
+ ]
+ },{
+ "title": "Pub/Sub",
+ "implemented": ">=0.5.0",
+ "type": "gcloud/pubsub",
+ "nav": [
+ {
+ "type": "gcloud/pubsub/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/pubsub/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/pubsub/iam/policy",
+ "title": "Policy"
+ },
+ {
+ "type": "gcloud/pubsub/message/message",
+ "title": "Message"
+ },
+ {
+ "type": "gcloud/pubsub/subscription/subscription",
+ "title": "Subscription"
+ },
+ {
+ "type": "gcloud/pubsub/topic/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/pubsub/topic/topic",
+ "title": "Topic"
+ }
+ ]
+ }, {
+ "title": "Resource Manager",
+ "implemented": ">=0.8.0",
+ "type": "gcloud/resource_manager",
+ "nav": [
+ {
+ "type": "gcloud/resource_manager/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/resource_manager/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/resource_manager/project/project",
+ "title": "Project"
+ }
+ ]
+ }, {
+ "title": "Storage",
+ "type": "gcloud/storage",
+ "implemented": ">=0.3.0",
+ "nav": [
+ {
+ "type": "gcloud/storage/acl/acl",
+ "title": "ACL"
+ },
+ {
+ "type": "gcloud/storage/acl/bucketacl",
+ "title": "BucketACL"
+ },
+ {
+ "type": "gcloud/storage/acl/defaultobjectacl",
+ "title": "DefaultObjectACL"
+ },
+ {
+ "type": "gcloud/storage/acl/objectacl",
+ "title": "ObjectACL"
+ },
+ {
+ "type": "gcloud/storage/batch/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/storage/batch/mimeapplicationhttp",
+ "title": "MIMEApplicationHTTP"
+ },
+ {
+ "type": "gcloud/storage/batch/nocontent",
+ "title": "NoContent"
+ },
+ {
+ "type": "gcloud/storage/blob/blob",
+ "title": "Blob"
+ },
+ {
+ "type": "gcloud/storage/bucket/bucket",
+ "title": "Bucket"
+ },
+ {
+ "type": "gcloud/storage/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/storage/connection/connection",
+ "title": "Connection"
+ }
+ ]
+ }, {
+ "title": "Streaming",
+ "type": "gcloud/streaming",
+ "nav": [
+ {
+ "type": "gcloud/streaming/buffered_stream/bufferedstream",
+ "title": "BufferedStream"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/badstatuscodeerror",
+ "title": "BadStatusCodeError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/communicationerror",
+ "title": "CommunicationError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/error",
+ "title": "Error"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/httperror",
+ "title": "HttpError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/requesterror",
+ "title": "RequestError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/retryaftererror",
+ "title": "RetryAfterError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/transfererror",
+ "title": "TransferError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/transferinvaliderror",
+ "title": "TransferInvalidError"
+ },
+ {
+ "type": "gcloud/streaming/exceptions/transferretryerror",
+ "title": "TransferRetryError"
+ },
+ {
+ "type": "gcloud/streaming/http_wrapper/request",
+ "title": "Request"
+ },
+ {
+ "type": "gcloud/streaming/http_wrapper/response",
+ "title": "Response"
+ },
+ {
+ "type": "gcloud/streaming/http_wrapper",
+ "title": "Http_Wrapper"
+ },
+ {
+ "type": "gcloud/streaming/stream_slice/streamslice",
+ "title": "StreamSlice"
+ },
+ {
+ "type": "gcloud/streaming/transfer/download",
+ "title": "Download"
+ },
+ {
+ "type": "gcloud/streaming/transfer/upload",
+ "title": "Upload"
+ },
+ {
+ "type": "gcloud/streaming/util",
+ "title": "Util"
+ }
+ ]
+ }
+ ]
+}
diff --git a/docs/json/toc.json b/docs/json/toc.json
new file mode 100644
index 000000000000..32db1f7f0453
--- /dev/null
+++ b/docs/json/toc.json
@@ -0,0 +1,477 @@
+{
+ "overview": "overview.html",
+ "guides": [{
+ "title": "Authentication",
+ "id": "authentication",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/authentication/readme.md",
+ "contents": [
+ "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/readme.md",
+ "authentication.md"
+ ]
+ }, {
+ "title": "FAQ",
+ "id": "faq",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/faq/readme.md",
+ "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/faq/readme.md"
+ }, {
+ "title": "Troubleshooting",
+ "id": "troubleshooting",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/troubleshooting/readme.md",
+ "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/troubleshooting/readme.md"
+ }, {
+ "title": "Contributing",
+ "id": "contributing",
+ "edit": "https://github.com/GoogleCloudPlatform/gcloud-common/edit/master/contributing/readme.md",
+ "contents": "https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/contributing/readme.md"
+ }],
+ "services": [{
+ "title": "gcloud",
+ "type": "gcloud/gcloud",
+ "nav": [{
+ "title": "Client",
+ "type": "gcloud/client/client"
+ },{
+ "title": "Connection",
+ "type": "gcloud/connection/connection"
+ },{
+ "title": "Credentials",
+ "type": "gcloud/credentials"
+ },{
+ "title": "Environment Variables",
+ "type": "gcloud/environment_vars"
+ },{
+ "title": "Iterator",
+ "type": "gcloud/iterator"
+ }]
+ },{
+ "title": "BigQuery",
+ "implemented": ">=0.7.0",
+ "type": "gcloud/bigquery",
+ "nav": [
+ {
+ "type": "gcloud/bigquery/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/bigquery/dataset/dataset",
+ "title": "Dataset"
+ },
+ {
+ "type": "gcloud/bigquery/job/job",
+ "title": "Jobs"
+ },
+ {
+ "type": "gcloud/bigquery/table/table",
+ "title": "Table"
+ },
+ {
+ "type": "gcloud/bigquery/query/query",
+ "title": "Query"
+ }
+ ]
+ },{
+ "title": "BigTable",
+ "implemented": ">=0.12.0",
+ "type": "gcloud/bigtable",
+ "nav": [
+ {
+ "type": "gcloud/bigtable/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/bigtable/cluster/cluster",
+ "title": "Cluster"
+ },
+ {
+ "type": "gcloud/bigtable/column_family/columnfamily",
+ "title": "Column Families"
+ },
+ {
+ "type": "gcloud/bigtable/row/row",
+ "title": "Bigtable Row"
+ },
+ {
+ "type": "gcloud/bigtable/row_filters/rowfilter",
+ "title": "Bigtable Row Filter"
+ },
+ {
+ "type": "gcloud/bigtable/table/table",
+ "title": "Table"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/batch/batch",
+ "title": "HappyBase Batch"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/connection/connection",
+ "title": "HappyBase Connection"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/pool/connectionpool",
+ "title": "HappyBase Connection Pool"
+ },
+ {
+ "type": "gcloud/bigtable/happybase/table",
+ "title": "HappyBase Table"
+ }
+ ]
+ },{
+ "title": "Datastore",
+ "implemented": ">=0.3.0",
+ "type": "gcloud/datastore",
+ "nav": [
+ {
+ "type": "gcloud/datastore/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/datastore/entity/entity",
+ "title": "Entity"
+ },
+ {
+ "type": "gcloud/datastore/key/key",
+ "title": "Key"
+ },
+ {
+ "type": "gcloud/datastore/query/query",
+ "title": "Query"
+ },
+ {
+ "type": "gcloud/datastore/transaction/transaction",
+ "title": "Transaction"
+ },
+ {
+ "type": "gcloud/datastore/batch/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "datastore/helpers",
+ "title": "Helpers"
+ }
+ ]
+ }, {
+ "title": "DNS",
+ "implemented": ">=0.8.0",
+ "type": "gcloud/dns",
+ "nav": [
+ {
+ "type": "gcloud/dns/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/dns/zone/managedzone",
+ "title": "Managed Zones"
+ },
+ {
+ "type": "gcloud/dns/resource_record_set/resourcerecordset",
+ "title": "Resource Record Set"
+ },
+ {
+ "type": "gcloud/dns/changes/changes",
+ "title": "Change Sets"
+ }
+ ]
+ }, {
+ "title": "Exceptions",
+ "type": "gcloud/exceptions",
+ "nav": [
+ {
+ "type": "gcloud/exceptions/badrequest",
+ "title": "BadRequest"
+ },
+ {
+ "type": "gcloud/exceptions/clienterror",
+ "title": "ClientError"
+ },
+ {
+ "type": "gcloud/exceptions/conflict",
+ "title": "Conflict"
+ },
+ {
+ "type": "gcloud/exceptions/forbidden",
+ "title": "Forbidden"
+ },
+ {
+ "type": "gcloud/exceptions/gclouderror",
+ "title": "GCloudError"
+ },
+ {
+ "type": "gcloud/exceptions/internalservererror",
+ "title": "InternalServerError"
+ },
+ {
+ "type": "gcloud/exceptions/lengthrequired",
+ "title": "LengthRequired"
+ },
+ {
+ "type": "gcloud/exceptions/methodnotallowed",
+ "title": "MethodNotAllowed"
+ },
+ {
+ "type": "gcloud/exceptions/methodnotimplemented",
+ "title": "MethodNotImplemented"
+ },
+ {
+ "type": "gcloud/exceptions/movedpermanently",
+ "title": "MovedPermanently"
+ },
+ {
+ "type": "gcloud/exceptions/notfound",
+ "title": "NotFound"
+ },
+ {
+ "type": "gcloud/exceptions/notmodified",
+ "title": "NotModified"
+ },
+ {
+ "type": "gcloud/exceptions/preconditionfailed",
+ "title": "PreconditionFailed"
+ },
+ {
+ "type": "gcloud/exceptions/redirection",
+ "title": "Redirection"
+ },
+ {
+ "type": "gcloud/exceptions/requestrangenotsatisfiable",
+ "title": "RequestRangeNotSatisfiable"
+ },
+ {
+ "type": "gcloud/exceptions/resumeincomplete",
+ "title": "ResumeIncomplete"
+ },
+ {
+ "type": "gcloud/exceptions/servererror",
+ "title": "ServerError"
+ },
+ {
+ "type": "gcloud/exceptions/serviceunavailable",
+ "title": "ServiceUnavailable"
+ },
+ {
+ "type": "gcloud/exceptions/temporaryredirect",
+ "title": "TemporaryRedirect"
+ },
+ {
+ "type": "gcloud/exceptions/toomanyrequests",
+ "title": "TooManyRequests"
+ },
+ {
+ "type": "gcloud/exceptions/unauthorized",
+ "title": "Unauthorized"
+ },
+ {
+ "type": "gcloud/exceptions",
+ "title": "Exceptions"
+ }
+ ],
+ "credentials": [
+ {
+ "type": "gcloud/credentials",
+ "title": "Credentials"
+ }
+ ],
+ "datastore": [
+ {
+ "type": "gcloud/datastore/batch/batch",
+ "title": "Batch"
+ },
+ {
+ "type": "gcloud/datastore/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/datastore/connection/connection",
+ "title": "Connection"
+ },
+ {
+ "type": "gcloud/datastore/entity/entity",
+ "title": "Entity"
+ },
+ {
+ "type": "gcloud/datastore/helpers",
+ "title": "Helpers"
+ },
+ {
+ "type": "gcloud/datastore/key/key",
+ "title": "Key"
+ },
+ {
+ "type": "gcloud/datastore/query/iterator",
+ "title": "Iterator"
+ },
+ {
+ "type": "gcloud/datastore/query/query",
+ "title": "Query"
+ },
+ {
+ "type": "gcloud/datastore/transaction/transaction",
+ "title": "Transaction"
+ }
+ ]
+ },
+ {
+ "title": "Cloud Logging",
+ "implemented": ">=0.12.0",
+ "type": "gcloud/logging",
+ "nav": [
+ {
+ "type": "gcloud/logging/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/logging/logger/logger",
+ "title": "Logger"
+ },
+ {
+ "type": "gcloud/logging/entries",
+ "title": "Entries"
+ },
+ {
+ "type": "gcloud/logging/metric/metric",
+ "title": "Metric"
+ },
+ {
+ "type": "gcloud/logging/sink/sink",
+ "title": "Sink"
+ }
+ ]
+ }, {
+ "title": "Cloud Monitoring",
+ "implemented": ">=0.12.0",
+ "type": "gcloud/monitoring",
+ "nav": [
+ {
+ "type": "gcloud/monitoring/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/monitoring/metric/metricdescriptor",
+ "title": "Metric Descriptors"
+ },
+ {
+ "type": "gcloud/monitoring/index/labeldescriptor",
+ "title": "Label Descriptors"
+ },
+ {
+ "type": "gcloud/monitoring/index/metricdescriptor",
+ "title": "Metric Descriptors"
+ },
+ {
+ "type": "gcloud/monitoring/index/resourcedescriptor",
+ "title": "Monitored Resource Descriptors"
+ },
+ {
+ "type": "gcloud/monitoring/index/query",
+ "title": "Time Series Query"
+ },
+ {
+ "type": "gcloud/monitoring/timeseries/timeseries",
+ "title": "Time Series"
+ },
+ {
+ "type": "gcloud/monitoring/label/labeldescriptor",
+ "title": "Label Descriptors"
+ }
+ ]
+ },{
+ "title": "Pub/Sub",
+ "implemented": ">=0.5.0",
+ "type": "gcloud/pubsub",
+ "nav": [
+ {
+ "type": "gcloud/pubsub/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/pubsub/topic/topic",
+ "title": "Topic"
+ },
+ {
+ "type": "gcloud/pubsub/subscription/subscription",
+ "title": "Subscription"
+ },
+ {
+ "type": "gcloud/pubsub/message/message",
+ "title": "Message"
+ },
+ {
+ "type": "gcloud/pubsub/iam/policy",
+ "title": "Policy"
+ }
+ ]
+ }, {
+ "title": "Resource Manager",
+ "implemented": ">=0.8.0",
+ "type": "gcloud/resource_manager",
+ "nav": [
+ {
+ "type": "gcloud/resource_manager/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/resource_manager/project/project",
+ "title": "Project"
+ }
+ ]
+ }, {
+ "title": "Storage",
+ "type": "gcloud/storage",
+ "implemented": ">=0.3.0",
+ "nav": [
+ {
+ "type": "gcloud/storage/client/client",
+ "title": "Client"
+ },
+ {
+ "type": "gcloud/storage/blob/blob",
+ "title": "Blob"
+ },
+ {
+ "type": "gcloud/storage/bucket/bucket",
+ "title": "Bucket"
+ },
+ {
+ "type": "gcloud/storage/acl/acl",
+ "title": "ACL"
+ },
+ {
+ "type": "gcloud/storage/batch/batch",
+ "title": "Batch"
+ }
+ ]
+ }, {
+ "title": "Streaming",
+ "type": "gcloud/streaming",
+ "nav": [
+ {
+ "type": "gcloud/streaming/buffered_stream/bufferedstream",
+ "title": "Buffered Stream"
+ },
+ {
+ "type": "gcloud/streaming/http_wrapper/request",
+ "title": "Request"
+ },
+ {
+ "type": "gcloud/streaming/http_wrapper/response",
+ "title": "Response"
+ },
+ {
+ "type": "gcloud/streaming/stream_slice/streamslice",
+ "title": "Stream Slice"
+ },
+ {
+ "type": "gcloud/streaming/transfer/download",
+ "title": "Download"
+ },
+ {
+ "type": "gcloud/streaming/transfer/upload",
+ "title": "Upload"
+ },
+ {
+ "type": "gcloud/streaming/util",
+ "title": "Util"
+ }
+ ]
+ }
+ ]
+}
diff --git a/scripts/generate_json_docs.py b/scripts/generate_json_docs.py
new file mode 100644
index 000000000000..b868e6a1b79e
--- /dev/null
+++ b/scripts/generate_json_docs.py
@@ -0,0 +1,583 @@
+# Copyright 2016 Google Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import inspect
+import json
+import os
+import types
+
+import pdoc
+from parinx.parser import parse_docstring
+from parinx.errors import MethodParsingException
+
+from verify_included_modules import get_public_modules
+
+
+class Module(object):
+
+ def __init__(self, module_id, name, description=None,
+ examples=None, methods=None, source=None):
+ self.module_id = module_id
+ self.name = name
+ self.description = description
+ self.examples = examples or []
+ self.methods = methods
+ self.source = source
+
+ @classmethod
+ def from_module_name(cls, name, base_path):
+ module = pdoc.Module(pdoc.import_module(name), allsubmodules=True)
+ methods = module.functions() + module.variables()
+
+ mod = __import__(name)
+
+ examples = []
+
+ if '__init__' in name:
+ snippets = get_snippet_examples(name.split('.')[1],
+ os.path.join(base_path, 'docs'))
+ examples.extend(snippets)
+
+ source_path = clean_source_path(inspect.getsourcefile(mod))
+
+ return cls(module_id=name,
+ name=name.split('.')[-1].title(),
+ description=module.docstring,
+ examples=examples or [],
+ methods=[Method.from_pdoc(m) for m in methods],
+ source=source_path)
+
+ def to_dict(self):
+ return {'id': self.module_id,
+ 'name': self.name,
+ 'description': format_sphinx_doc(self.description),
+ 'examples': self.examples,
+ 'methods': [m.to_dict() for m in self.methods],
+ 'source': self.source}
+
+
+class Klass(object):
+ def __init__(self, module_id, name, refname=None, description=None,
+ examples=None, methods=None, source=None):
+ self.module_id = module_id
+ self.name = name
+ self.refname = refname
+ self.description = description
+ self.examples = examples or []
+ self.methods = methods
+ self.source = source
+
+ @classmethod
+ def from_class_name(cls, module, kls):
+ methods = kls.methods()
+
+ examples = []
+ source_module = __import__(module.name)
+ source_path = clean_source_path(inspect.getsourcefile(source_module))
+
+ return cls(module_id=kls.name,
+ name=kls.name.split('.')[-1].title(),
+ refname=module.refname,
+ description=module.docstring,
+ examples=examples,
+ methods=[Method.from_pdoc(m) for m in methods],
+ source=source_path)
+
+ def to_dict(self):
+ return {'id': '%s.%s' % (self.refname, self.name.lower()),
+ 'name': self.name,
+ 'description': format_sphinx_doc(self.description),
+ 'examples': self.examples,
+ 'methods': [m.to_dict() for m in self.methods],
+ 'source': self.source}
+
+
+class Method(object):
+
+ def __init__(self, method_id, name, is_class, examples=None, params=None,
+ exceptions=None, returns=None, source=None):
+ self.method_id = method_id
+ self.name = name
+ self.examples = examples or []
+ self.params = params or []
+ self.exceptions = exceptions or []
+ self.returns = returns or []
+ self.source = source or ''
+
+ if is_class:
+ self.type = 'constructor'
+ else:
+ self.type = 'instance'
+
+ def add_param(self, param):
+ self.params.append(param)
+
+ def add_example(self, example):
+ self.examples.append({'code': example})
+
+ def add_source_line(self, source_line):
+ self.source = source_line
+
+ def set_returns(self, return_types):
+ self.returns = [{'types': [return_types]}]
+
+ def to_dict(self):
+ return {'id': self.method_id,
+ 'name': self.name,
+ 'examples': self.examples,
+ 'source': self.source,
+ 'params': [p.to_dict() for p in self.params],
+ 'exceptions': self.exceptions,
+ 'returns': self.returns,
+ 'type': self.type}
+
+ @classmethod
+ def from_pdoc(cls, element):
+ is_class = isinstance(element, pdoc.Class)
+ method = cls(element.refname, element.name, is_class)
+ components = element.refname.split('.')
+
+ mod = __import__(components[0])
+
+ for comp in components[1:]:
+ mod = getattr(mod, comp)
+
+ build_source(mod, method)
+
+ if element.docstring:
+ if not isinstance(element, pdoc.Class) and element.cls:
+ cls = element.cls.cls
+ elif element.cls:
+ cls = element.cls
+ else:
+ cls = None
+
+ # Hack for old-style classes
+ if str(cls)[0] != '<':
+ cls = ''
+
+ try:
+ method_info = parse_docstring(element.docstring, cls)
+ except (MethodParsingException, IndexError):
+ return method
+
+ for name, data in method_info['arguments'].items():
+ param = Param.from_docstring_section(name, data)
+ method.add_param(param)
+
+ if method_info.get('example'):
+ method.add_example(method_info['example'])
+
+ if method_info.get('return'):
+ if len(method_info['return']['type_name']) > 0:
+ type_name = method_info.get('return').get('type_name')
+
+ type_type = 'instance'
+ if any(x.isupper() for x in type_name):
+ type_type = 'constructor'
+
+ type_markup = build_link_from_type(type_name, type_type)
+
+ method.set_returns(type_markup)
+
+ return method
+
+
+class Param(object):
+
+ def __init__(self, name, description=None, param_types=None, optional=None,
+ nullable=None):
+ self.name = name
+ self.description = description
+ self.param_types = param_types or []
+ self.optional = optional
+ self.nullable = nullable
+
+ def to_dict(self):
+ return {'name': self.name,
+ 'description': process_words(self.description),
+ 'types': build_link_from_list_of_types(self.param_types),
+ 'optional': self.optional,
+ 'nullable': self.nullable}
+
+ @classmethod
+ def from_docstring_section(cls, name, data):
+ param_types = build_link_from_type(data['type_name'])
+ return cls(name=name, description=data['description'],
+ param_types=[param_types])
+
+
+def clean_type_name(type_name):
+ if type_name.lower().startswith('list of'):
+ type_name = (type_name.replace('list of', '')
+ .replace('List of', ''))
+ type_name = (type_name.replace('`', '').replace('class', '')
+ .replace(':', ''))
+ return type_name
+
+
+def build_link_from_list_of_types(type_names, object_type=None):
+ processed_types = []
+ for type_link in type_names:
+ type_link = clean_type_name(type_link)
+ processed_types.append(build_link_from_type(type_link, object_type))
+ return processed_types
+
+
+def build_link_from_type(type_name, object_type=None):
+ type_name = clean_type_name(type_name)
+
+ if not type_name.startswith('gcloud'):
+ return type_name
+ doc_path = type_name
+
+ doc_path = '/'.join(doc_path.split('.')).lower()
+
+ type_markup = '%s' % type_name
+
+ return type_markup
+
+
+def build_source(mod, method):
+ if isinstance(mod, (types.ModuleType, types.ClassType,
+ types.MethodType, types.FunctionType,
+ types.TracebackType, types.FrameType,
+ types.CodeType, types.TypeType)):
+
+ line = inspect.getsourcelines(mod)[1]
+ source_path = clean_source_path(inspect.getsourcefile(mod))
+
+ if line:
+ source_path = source_path + '#L' + str(line)
+
+ method.add_source_line(source_path)
+
+ # Sketchy get examples from method docstring.
+ examples = []
+ for example in examples:
+ method.add_example(example)
+
+
+def build_toc_entry(title, toc_type):
+ return {
+ 'title': title,
+ 'type': toc_type
+ }
+
+
+def build_type(type_id, title, contents):
+ return {
+ 'id': type_id,
+ 'title': title,
+ 'contents': contents
+ }
+
+
+def clean_source_path(source):
+ source_path = ''
+ if 'gcloud-python' in source:
+ source_path = source.split('gcloud-python')[1]
+
+ return source_path[1:]
+
+
+def process_code_blocks(doc):
+ blocks = []
+ index = 0
+ for line in doc.splitlines(True):
+ if len(blocks) - 1 < index:
+ blocks.append('')
+
+ if line.strip():
+ blocks[index] += line
+ else:
+ index += 1
+
+ formatted_blocks = []
+ for block in blocks:
+ is_code = False
+ if block.splitlines()[0].startswith(' '):
+ is_code = True
+
+ if is_code:
+ block = {'code': '%s
' % block}
+
+ formatted_blocks.append(block)
+ return formatted_blocks
+
+
+def format_sphinx_doc(doc):
+ doc = process_code_blocks(doc)
+ example_lines = ""
+ for line in doc:
+ if isinstance(line, dict):
+ line = line['code']
+ else:
+ line = process_words(line)
+ example_lines = '%s\n%s' % (example_lines, line)
+ return example_lines
+
+
+def process_words(line):
+ processed_line = ''
+ for word in line.split():
+ end_sentence = False
+ if word.endswith('.'):
+ end_sentence = True
+ word = word[:-1]
+
+ if word.startswith('``') and word.endswith('``'):
+ word = word.replace('``', '')
+ word = '%s' % word
+
+ if word.startswith('**') and word.endswith('**'):
+ word = word.replace('**', '')
+ word = '%s' % word
+
+ if word.startswith(':class:'):
+ word = word.replace(':class:', '').replace('`', '')
+ word = build_link_from_type(word)
+
+ if word.startswith(':mod:'):
+ word = word.replace(':mod:', '').replace('`', '')
+ word = build_link_from_type(word)
+
+ if word.startswith(':meth:'):
+ word = word.replace(':meth:', '').replace('`', '')
+ word = build_link_from_type(word)
+
+ if word.startswith(':func:'):
+ word = word.replace(':func:', '').replace('`', '')
+ word = build_link_from_type(word)
+
+ word = word.replace('`', '')
+
+ if word.startswith('https://') or word.startswith('http://'):
+ word = '%s' % (word, word)
+
+ if end_sentence:
+ word += '.'
+
+ processed_line += ' %s' % word
+
+ processed_line = processed_line.replace('::', '')
+
+ return processed_line
+
+
+def write_docs_file(path, contents):
+ if not os.path.exists(os.path.dirname(path)):
+ try:
+ os.makedirs(os.path.dirname(path))
+ except OSError:
+ raise
+ with open(path, 'w') as output_file:
+ output_file.write(contents)
+
+
+def generate_doc_types_json(modules, types_file_path):
+ doc_types_list = [{
+ 'id': 'gcloud',
+ 'contents': 'index.json',
+ 'title': 'gcloud'
+ }]
+
+ for module_name in modules:
+ if module_name == 'gcloud.__init__':
+ continue
+
+ module_title = module_name.replace('.__init__', '').split('.')
+ module_contents = (module_name.replace('.', '/')
+ .replace('__init__', 'index'))
+
+ if len(module_name.split('.')) > 2:
+ module_id = module_name.replace('.', '/')
+ else:
+ module_id = (module_name.replace('.', '/'))
+
+ module_contents += '.json'
+
+ doc_type_object = build_type(module_id.replace('/__init__', ''),
+ module_title, module_contents)
+
+ doc_types_list.append(doc_type_object)
+
+ pdoc_module = pdoc.Module(pdoc.import_module(module_name),
+ allsubmodules=True)
+ for c in pdoc_module.classes():
+ generate_doc_types_classes_json(c, doc_types_list)
+
+ write_docs_file(types_file_path,
+ json.dumps(doc_types_list))
+
+
+def generate_doc_types_classes_json(klass, doc_types_list):
+
+ module_contents = (klass.refname.replace('.', '/')
+ .replace('__init__', 'index'))
+ module_contents += '.json'
+
+ doc_type_object = build_type(klass.refname.lower().replace('.', '/'),
+ klass.refname.split('.'),
+ module_contents.lower())
+
+ doc_types_list.append(doc_type_object)
+
+
+def generate_module_docs(modules, docs_path, real_base_path, toc):
+ for module_name in modules:
+ module = Module.from_module_name(module_name, real_base_path)
+ pdoc_module = pdoc.Module(pdoc.import_module(module_name),
+ allsubmodules=True)
+ for c in pdoc_module.classes():
+ generate_class_docs(pdoc_module, c, docs_path, toc)
+
+ module_path = (module_name.replace('.', '/')
+ .replace('__init__', 'index'))
+ module_docs_path = os.path.join(docs_path, module_path) + '.json'
+
+ if pdoc_module.functions():
+ toc_key = module_name.replace('gcloud.', '').split('.')[0]
+ toc_entry = build_toc_entry(module.name, module_path)
+ toc['services'][toc_key].append(toc_entry)
+
+ write_docs_file(module_docs_path,
+ json.dumps(module.to_dict(),
+ indent=2, sort_keys=True))
+
+
+def generate_class_docs(module, klass, base_path, toc):
+ kls = Klass.from_class_name(module, klass)
+
+ module_path = (module.refname.replace('.', '/')
+ .replace('__init__', 'index'))
+ module_docs_path = os.path.join(base_path, module_path,
+ klass.name.lower()) + '.json'
+ toc_key = module.name.replace('gcloud.', '').split('.')[0]
+
+ toc_entry = build_toc_entry(klass.name,
+ os.path.join(module_path,
+ klass.name.lower()))
+
+ toc['services'][toc_key].append(toc_entry)
+
+ write_docs_file(module_docs_path,
+ json.dumps(kls.to_dict(),
+ indent=2, sort_keys=True))
+
+
+def get_snippet_examples(module, json_docs_dir):
+ snippets_file_path = os.path.join(json_docs_dir,
+ module + '_snippets.py')
+ usage_rst_path = os.path.join(json_docs_dir, module + '-usage.rst')
+
+ snippet_labels = {}
+
+ if os.path.isfile(usage_rst_path):
+ with open(usage_rst_path, 'r') as snippet_labels_file:
+ usage_rst = snippet_labels_file.read().splitlines()
+ line_index = 0
+
+ include_string = '.. literalinclude:: %s_snippets.py'
+ for line in usage_rst:
+ if line.startswith(include_string % module):
+ label_key = (usage_rst[line_index + 1]
+ .replace(' :start-after: [START ', '')
+ .replace(']', ''))
+ snippet_labels[label_key] = usage_rst[line_index - 2]
+ line_index += 1
+
+ snippets = []
+
+ if os.path.isfile(snippets_file_path):
+ with open(snippets_file_path, 'r') as snippets_file:
+ snippets_string = snippets_file.read()
+ label = None
+ snippet = ''
+ for line in snippets_string.splitlines(True):
+ if line.strip().startswith('# [END'):
+ example = {
+ 'caption': snippet_labels.get(label),
+ 'code': snippet
+ }
+ snippets.append(example)
+
+ # Reset for next snippet
+ snippet = ''
+ label = None
+
+ if label:
+ snippet += line
+
+ if line.strip().startswith('# [START'):
+ label = (line.replace('# [START', '').replace(']', '')
+ .strip())
+ snippet = '# %s\n' % label
+ return snippets
+
+
+def main():
+ parser = argparse.ArgumentParser(description='Document Python modules.')
+ parser.add_argument('--tag', help='The version of the documentation.',
+ default='master')
+ parser.add_argument('--basepath', help='Path to the library.',
+ default=os.path.join(os.path.dirname(__file__), '..'))
+ parser.add_argument('--show-toc', help='Prints partial table of contents',
+ default=False)
+ args = parser.parse_args()
+
+ toc = {
+ 'services': {
+ '__init__': [],
+ 'gcloud': [],
+ 'bigquery': [],
+ 'bigtable': [],
+ 'client': [],
+ 'connection': [],
+ 'credentials': [],
+ 'datastore': [],
+ 'dns': [],
+ 'environment_vars': [],
+ 'exceptions': [],
+ 'iterator': [],
+ 'logging': [],
+ 'monitoring': [],
+ 'pubsub': [],
+ 'resource_manager': [],
+ 'storage': [],
+ 'streaming': [],
+ 'translate': []
+ }
+ }
+
+ BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+ JSON_DOCS_DIR = os.path.join(BASE_DIR, 'docs', '_build', 'json', args.tag)
+ LIB_DIR = os.path.abspath(args.basepath)
+
+ library_dir = os.path.join(LIB_DIR, 'gcloud')
+ public_mods = get_public_modules(library_dir, base_package='gcloud')
+
+ generate_module_docs(public_mods, JSON_DOCS_DIR, BASE_DIR, toc)
+ generate_doc_types_json(public_mods,
+ os.path.join(JSON_DOCS_DIR, 'types.json'))
+
+ if args.show_toc:
+ print json.dumps(toc, indent=4)
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/update_json_docs.sh b/scripts/update_json_docs.sh
new file mode 100755
index 000000000000..61556a03b334
--- /dev/null
+++ b/scripts/update_json_docs.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -e
+
+function pushDocs () {
+
+ PYTHONPATH=_testing python scripts/generate_json_docs.py --tag ${1}
+
+ if [[ ! -d "ghpages" ]]; then
+ git submodule add -f -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} ghpages
+ fi
+ mkdir -p ghpages/json/${1}
+ cp -R docs/_build/json/${1}/* ghpages/json/${1}
+ cp docs/json/toc.json ghpages/json/${1}
+ cp docs/json/index.json ghpages/json/${1}
+ cp docs/json/overview.html ghpages/json/${1}
+ cp docs/json/home.html ghpages/json/
+ cp -R docs/json/src ghpages
+ cp docs/json/manifest.json ghpages
+ cp docs/json/index.html ghpages
+ cd ghpages
+ git add .
+ if [[ -n "$(git status --porcelain)" ]]; then
+ git config user.name "travis-ci"
+ git config user.email "travis@travis-ci.org"
+ git commit -m "Updating docs for ${1}"
+ git status
+ git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages
+ else
+ echo "Nothing to commit."
+ fi
+ cd ..
+}
+
+function cleanSubmodule () {
+ echo "Cleaning up..."
+ git submodule deinit -f ghpages
+ git reset HEAD .gitmodules
+ git reset HEAD ghpages
+ rm -rf ghpages
+ rm -f .gitmodules
+ rm -rf .git/modules/ghpages
+}
+
+if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
+ pushDocs $TRAVIS_BRANCH
+ cleanSubmodule
+ echo "Done pushing docsite. See: https://googlecloudplatform.github.io/gcloud-python/"
+fi
+
+if [[ ! -z $TRAVIS_TAG ]]; then
+ pushDocs $TRAVIS_TAG
+ cleanSubmodule
+ echo "Done pushing docsite. See: https://googlecloudplatform.github.io/gcloud-python/"
+fi
diff --git a/tox.ini b/tox.ini
index a7c525cb9d78..10eee5f04c2c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -109,6 +109,19 @@ deps =
sphinx_rtd_theme
passenv = {[testenv:system-tests]passenv} SPHINX_RELEASE READTHEDOCS LOCAL_RTD
+[testenv:json-docs]
+basepython =
+ python2.7
+commands =
+ python -c "import shutil; shutil.rmtree('docs/_build/json', ignore_errors=True)"
+ python scripts/generate_json_docs.py
+deps =
+ parinx
+ pdoc
+ Sphinx
+setenv =
+ PYTHONPATH = {toxinidir}/_testing
+
[testenv:docs-rtd]
setenv =
PYTHONPATH = {toxinidir}/_testing