Skip to content

Commit

Permalink
Use appassembler for Compute and Dns examples (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-philippe-martin authored and mziccard committed Jun 14, 2016
1 parent a17c1ff commit e7ca841
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 31 deletions.
26 changes: 13 additions & 13 deletions gcloud-java-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ To run examples from your command line:
Before running the example, go to the [Google Developers Console][developers-console] to ensure
that Compute API is enabled.
```
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.compute.ComputeExample" -Dexec.args="create image-disk us-central1-a test-disk debian-cloud debian-8-jessie-v20160329"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.compute.ComputeExample" -Dexec.args="create instance us-central1-a test-instance n1-standard-1 test-disk default"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.compute.ComputeExample" -Dexec.args="add-access-config us-central1-a test-instance nic0 NAT"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.compute.ComputeExample" -Dexec.args="delete instance us-central1-a test-instance"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.compute.ComputeExample" -Dexec.args="delete disk us-central1-a test-disk"
target/appassembler/bin/ComputeExample create image-disk us-central1-a test-disk debian-cloud debian-8-jessie-v20160329
target/appassembler/bin/ComputeExample create instance us-central1-a test-instance n1-standard-1 test-disk default
target/appassembler/bin/ComputeExample add-access-config us-central1-a test-instance nic0 NAT
target/appassembler/bin/ComputeExample delete instance us-central1-a test-instance
target/appassembler/bin/ComputeExample delete disk us-central1-a test-disk
```
* Here's an example run of `DatastoreExample`.
Expand All @@ -91,14 +91,14 @@ To run examples from your command line:
You will need to replace the domain name `elaborateexample.com` with your own domain name with [verified ownership] (https://www.google.com/webmasters/verification/home).
Also, note that the example creates and deletes record sets of type A only. Operations with other record types are not implemented in the example.
```
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="create some-sample-zone elaborateexample.com. description"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="list"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="list some-sample-zone records"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="add-record some-sample-zone www.elaborateexample.com. 12.13.14.15 69"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="get some-sample-zone"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="delete-record some-sample-zone www.elaborateexample.com. 12.13.14.15 69"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="list some-sample-zone changes ascending"
mvn exec:java -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample" -Dexec.args="delete some-sample-zone"
target/appassembler/bin/DnsExample create some-sample-zone elaborateexample.com. description
target/appassembler/bin/DnsExample list
target/appassembler/bin/DnsExample list some-sample-zone records
target/appassembler/bin/DnsExample add-record some-sample-zone www.elaborateexample.com. 12.13.14.15 69
target/appassembler/bin/DnsExample get some-sample-zone
target/appassembler/bin/DnsExample delete-record some-sample-zone www.elaborateexample.com. 12.13.14.15 69
target/appassembler/bin/DnsExample list some-sample-zone changes ascending
target/appassembler/bin/DnsExample delete some-sample-zone
```
* Here's an example run of `ResourceManagerExample`.
Expand Down
8 changes: 8 additions & 0 deletions gcloud-java-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<mainClass>com.google.cloud.examples.bigquery.BigQueryExample</mainClass>
<name>BigQueryExample</name>
</program>
<program>
<mainClass>com.google.cloud.examples.compute.ComputeExample</mainClass>
<name>ComputeExample</name>
</program>
<program>
<mainClass>com.google.cloud.examples.datastore.DatastoreExample</mainClass>
<name>DatastoreExample</name>
Expand All @@ -63,6 +67,10 @@
<mainClass>com.google.cloud.examples.nio.Stat</mainClass>
<name>Stat</name>
</program>
<program>
<mainClass>com.google.cloud.examples.dns.DnsExample</mainClass>
<name>DnsExample</name>
</program>
<program>
<mainClass>com.google.cloud.examples.nio.CountBytes</mainClass>
<name>CountBytes</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,9 @@
*
* <p>This example demonstrates a simple/typical Compute usage.
*
* <p>Steps needed for running the example:
* <ol>
* <li>login using gcloud SDK - {@code gcloud auth login}.</li>
* <li>compile using maven - {@code mvn compile}</li>
* <li>run using maven -
* <pre>{@code mvn exec:java -Dexec.mainClass="com.google.cloud.examples.compute.ComputeExample"
* -Dexec.args="[<project_id>]
* <p>See the README for the steps needed for compiling and running the example.
* <p>Possible command-line arguments are:
* <pre>{@code [<project_id>]
* list networks |
* list region-operations <region> |
* list instances <zone>? |
Expand Down Expand Up @@ -152,8 +148,6 @@
* reset <zone> <instance> |
* set-tags <zone> <instance> <tag>* |
* set-metadata <zone> <instance> <key value>*"}</pre>
* </li>
* </ol>
*
* <p>The first parameter is an optional {@code project_id} (logged-in project will be used if not
* supplied). Second parameter is a Compute operation and can be used to demonstrate its usage. For
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,16 @@
* <p>This example creates, deletes, gets, and lists zones. It also creates and deletes
* record sets of type A, and lists record sets.
*
* <p>Steps needed for running the example:
* <ol>
* <li>login using gcloud SDK - {@code gcloud auth login}.</li>
* <li>compile using maven - {@code mvn compile}</li>
* <li>run using maven - {@code mvn exec:java
* -Dexec.mainClass="com.google.cloud.examples.dns.DnsExample"
* -Dexec.args="[<project_id>]
* <p>See the README for steps needed for running the example.
* <p>The command-line arguments can be:
* <pre>{@code [<project_id>]
* create <zone_name> <dns_name> <description> |
* get <zone_name> |
* delete <zone_name> |
* list [<zone_name> [changes [descending | ascending] | records]] |
* add-record <zone_name> <record_name> <ip> <ttl> |
* delete-record <zone_name> <record_name> <ip> [<ttl>] |
* quota}</li>
* </ol>
* quota}</pre>
*
* <p>The first parameter is an optional {@code project_id}. The project specified in the Google
* Cloud SDK configuration (see {@code gcloud config list}) will be used if the project ID is not
Expand Down

0 comments on commit e7ca841

Please sign in to comment.