You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Create a package named after each service in gcloud-java-examples
- Create a package snippet in each service's package to hold README's snippets
- Split Datastore Storage and ResourceManager examples in two
- Create a class for each snippet in the corresponding service package
- Add reference for the READMEs to the corresponding snippet class
- Update package-info.java accordingly
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
172
+
Here are two code snippets showing simple usage examples from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
173
+
174
+
The first snippet shows how to get a Datastore entity and create it if it does not exist. Complete
System.out.println("Updating access_time for " + entity.getString("name"));
197
216
entity = Entity.builder(entity)
198
217
.set("access_time", DateTime.now())
@@ -210,7 +229,8 @@ Google Cloud Resource Manager (Alpha)
210
229
#### Preview
211
230
212
231
Here is a code snippet showing a simple usage example. Note that you must supply Google SDK credentials forthis service, not other forms of authentication listedin the [Authentication section](#authentication).
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
267
+
Here are two code snippets showing simple usage examples from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
268
+
269
+
The first snippet shows how to get a Storage blob and create it if it does not exist. Complete
Copy file name to clipboardExpand all lines: gcloud-java-datastore/README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,7 +134,9 @@ Cloud Datastore relies on indexing to run queries. Indexing is turned on by defa
134
134
135
135
#### Complete source code
136
136
137
-
Here we put together all the code shown above into one program. This program assumes that you are running on Compute Engine or from your own desktop. To run this example on App Engine, move this code to your application's servlet class and print the query output to the webpage instead of `System.out`.
137
+
Here we put together all the code shown above into one program. This program assumes that you are running on Compute Engine or from your own desktop. To run this example on App Engine, move this code to your application's servlet class and print the query output to the webpage instead of `System.out`.
* System.out.println("Updating access_time for " + entity.getString("name"));
50
+
* entity = Entity.builder(entity)
51
+
* .set("access_time", DateTime.now())
52
+
* .build();
53
+
* datastore.update(entity);
54
+
* }} </pre>
49
55
* <p>When using gcloud-java from outside of App/Compute Engine, you have to <a
50
56
* href="https://github.com/GoogleCloudPlatform/gcloud-java#specifying-a-project-id">specify a
0 commit comments