google-api-java-client
google-api-java-client copied to clipboard
Compute Engine samples need to be more comprehensive/updated
The sole sample at https://github.com/google/google-api-java-client-samples/tree/master/compute-engine-cmdline-sample covers listing instances, nothing else.
Can it be updated to cover other common cases like managing instance groups, autoscaling et al?
Also, the sample does not run with the latest version of your library. E.g. "com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;" that is in the import does not seem to exist anymore.
Documentation and samples are being built out other places: https://cloud.google.com/java/docs/ https://googlecloudplatform.github.io/google-cloud-java/ https://github.com/GoogleCloudPlatform/google-cloud-java
Well it's pretty difficult to navigate the sea of documentation and figure out what is deprecated and what is not, what is updated and what is not, when all I want to do is to invoke a simple Compute Engine API :)
E.g. your third URL https://github.com/GoogleCloudPlatform/google-cloud-java states that the Cloud Compute library is deprecated. It points me to https://cloud.google.com/compute/docs/api/libraries to check the recommended libraries for accessing compute. That page links to https://cloud.google.com/compute/docs/api/libraries#google_apis_java_client_library , with a single sample https://github.com/google/google-api-java-client-samples/tree/master/compute-engine-cmdline-sample which is the one mentioned above (5 years old)
It's a bit of a mess.
I came cross the same issue. Also I found the document of the google drive service has the same problem. It is a mess! Still hasn't find the alternative to AuthorizationCodeInstalledApp
There is a problem with credentials as well [1]. It points at oauth2 [2] which refers to GoogleCredential [3]. And that is listed as Deprecated.
Please somebody update to a non-deprecated example.
update: I created a new issue #1366
[1] https://developers.google.com/api-client-library/java/google-api-java-client/dev-guide [2] https://developers.google.com/api-client-library/java/google-api-java-client/oauth2 [3] https://googleapis.dev/java/google-api-client/latest/com/google/api/client/googleapis/auth/oauth2/GoogleCredential.html