forked from googleapis/google-cloud-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
220 lines (200 loc) · 12.7 KB
/
index.html
File metadata and controls
220 lines (200 loc) · 12.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>gcloud</title>
<meta name="description" content="Java idiomatic client for Google Cloud services">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/github.min.css">
<link rel="stylesheet" href="css/site.css">
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono|Roboto:300,400,700,700italic,400italic|Open+Sans:300' rel='stylesheet' type='text/css'>
</head>
<body ng-app="gcloud-java">
<header class="page-header" role="banner">
<h1 class="logo"><img src="img/logo-full.svg" alt="Google Cloud Platform" /></h1>
<nav class="main-nav">
<div class="nav-current">Java</div>
<ul class="menu">
<li>
<a href="#" title="Java docs page">
<img src="img/icon-lang-java-duke-white.svg" alt="Java icon" class="menu-icon" width="24" height="24" />
Java
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-node/" title="Node.js docs page">
<img src="img/icon-lang-nodejs.svg" alt="Node.js icon" class="menu-icon" />
Node.js
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-python/" title="Python docs page">
<img src="img/icon-lang-python.svg" alt="Python icon" class="menu-icon" />
Python
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-ruby/" title="Ruby docs page">
<img src="img/icon-lang-ruby.svg" alt="Ruby icon" class="menu-icon" />
Ruby
</a>
</li>
</ul>
</nav><!-- end of .main-nav -->
</header><!-- end of .page-header -->
<article class="main" role="main">
<section class="hero-banner">
<div class="container clearfix">
<div class="col col-left">
<h1>gcloud</h1>
<p>Google Cloud Client Library for Java - an idiomatic, intuitive, and natural way for Java developers to integrate with Google Cloud Platform services, like Cloud Datastore and Cloud Storage.</p>
</div><!-- end of .col.col-left -->
<div class="col col-right">
<h2>Quickstart with Maven: Add gcloud to your pom.xml</h2>
<pre><dependency>
<groupId>com.google.gcloud</groupId>
<artifactId>gcloud-java</artifactId>
<version>{{SITE_VERSION}}</version>
</dependency></pre>
<p><i>As of April 12th, 2016, gcloud-java's group ID and base package were renamed to "com.google.cloud". If you haven't already, please update your dependencies.</i></p>
</div><!-- end of .col.col-right -->
</div><!-- end of .container -->
</section><!-- end of .hero-banner -->
<section class="block featuring">
<div class="container">
<ul class="featuring-links">
<li>
<a href="./apidocs/index.html" title="gcloud-java docs" class="btn btn-docs">
<img src="img/icon-lang-java-duke.svg" alt="Java icon" class="menu-icon" />
Read the Docs
</a>
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/gcloud-java" title="gcloud-java on Github" class="ext-link">
<img src="img/icon-link-github.svg" alt="Github icon" />
Github
</a>
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/gcloud-java/issues" title="gcloud-java issues on Github" class="ext-link">
<img src="img/icon-link-github.svg" alt="Github icon" />
Issues
</a>
</li>
<li>
<a href="http://stackoverflow.com/questions/tagged/gcloud-java" title="gcloud on StackOverflow" class="ext-link">
<img src="img/icon-link-stackoverflow.svg" alt="StackOverflow icon" />
StackOverflow
</a>
</li>
<li>
<a href="./project-info.html" title="Java package manager" class="ext-link">
<img src="img/icon-link-package-manager.svg" alt="Package Manager icon" />
Package Information
</a>
</li>
</ul>
</div><!-- end of .container -->
</section><!-- end of .featuring -->
<section class="block about">
<div class="container clearfix">
<div class="quote-box">
<h3 class="block-title">What is it?</h3>
<p><code>gcloud</code> 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 Java, 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.</p>
<p><code>gcloud</code> is configured to access Google Cloud Platform
services and authorize (OAuth 2.0) automatically on your behalf.
Add the <code>gcloud</code> dependency to your project and get a private key to be
up and ready to go. Better yet, if you are running on Google
App Engine or Compute Engine, the private key is automatically detected.
</div>
<div class="quote-box--supplementary">
<h4>Example: Retrieve Datastore Entries</h4>
<div class="code-sample-tabs" ng-init="selected = 'compute engine'">
<a ng-click="selected = 'compute engine'" ng-class="{selected: selected == 'compute engine'}" class="selected">Run in Compute/App Engine</a>
<a ng-click="selected = 'elsewhere'" ng-class="{selected: selected == 'elsewhere'}">Run elsewhere</a>
</div>
<div hljs="" language="java" ng-show="selected == 'compute engine'" class=""><pre>
<code class="hljs java">import com.google.gcloud.datastore.Datastore;
import com.google.gcloud.datastore.DatastoreOptions;
import com.google.gcloud.datastore.Entity;
import com.google.gcloud.datastore.Key;
import com.google.gcloud.datastore.KeyFactory;
// Authentication is automatic inside Google Compute Engine
// and Google App Engine.
Datastore datastore = DatastoreOptions.defaultInstance().service();
KeyFactory keyFactory = datastore.newKeyFactory().kind(<span class="hljs-string">KIND</span>);
Key key = keyFactory.newKey(keyName);
Entity entity = datastore.get(key);
</code></pre></div>
<div hljs="" language="java" ng-show="selected == 'elsewhere'" class=""><pre>
<code class="hljs java">import com.google.gcloud.AuthCredentials;
import com.google.gcloud.datastore.Datastore;
import com.google.gcloud.datastore.DatastoreOptions;
import com.google.gcloud.datastore.Entity;
import com.google.gcloud.datastore.Key;
import com.google.gcloud.datastore.KeyFactory;
DatastoreOptions options = DatastoreOptions.builder()
.projectId(<span class="hljs-string">PROJECT_ID</span>)
.authCredentials(AuthCredentials.createForJson(
new FileInputStream(<span class="hljs-string">PATH_TO_JSON_KEY</span>))).build();
Datastore datastore = options.service();
KeyFactory keyFactory = datastore.newKeyFactory().kind(<span class="hljs-string">KIND</span>);
Key key = keyFactory.newKey(keyName);
Entity entity = datastore.get(key);
</code></pre></div>
</div>
</div><!-- end of .container -->
</section><!-- end of .featuring -->
<section class="block examples">
<div class="container clearfix">
<h3 class="block-title">Examples</h3>
<ul>
<li>
<a href="https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf"><code>Bookshelf</code></a> - An App Engine app that manages a virtual bookshelf using gcloud-java libraries for Datastore and Storage.
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/managed_vms/datastore"><code>Flexible Environment/Datastore example</code></a> - A simple app that uses Cloud Datastore to list the last 10 IP addresses that visited your site. Read about how to run the application <a href="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/managed_vms/README.md">here</a>.
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/managed_vms/cloudstorage"><code>Flexible Environment/Storage example</code></a> - An app that uploads files to a public Cloud Storage bucket on the App Engine Flexible Environment runtime.
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/managed_vms/sparkjava"><code>SparkJava demo</code></a> - Uses gcloud-java with App Engine Flexible Environment, Datastore, and SparkJava.
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/datastore"><code>TaskList</code></a> - An command line app that manages a to-do list using Cloud Datastore.
</li>
</ul>
</div>
</section>
<section class="block faq">
<div class="container">
<h3 class="block-title">FAQ</h3>
<h4>What is the relationship between the gcloud-java library and the gcloud command-line tool?</h4>
<p>Both the gcloud command-line tool and gcloud-java library 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-java library is the Google Cloud Client Library for Java.</p>
<h4>What is the relationship between gcloud and the Google APIs Java Client?</h4>
<p>The <a href="https://github.com/google/google-api-java-client">Google APIs Java Client</a> is a client library for using the broad set of Google APIs. gcloud is built specifically for the Google Cloud Platform and is the recommended way to integrate Google Cloud APIs into your Java applications. If your application requires both Google Cloud Platform and other Google APIs, the 2 libraries may be used by your application.</p>
</div><!-- end of .container -->
</section><!-- end of .faq -->
</article><!-- end of .main -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/vendor/highlight.pack.js"></script>
<script src="js/main.js"></script>
</body>
</html>