How do they differ? and what is the use case for each?
Is it possible for me to use one exclusively, such as if I'm more familiar with .NET I could do everything using the Client Library (for .NET) that I could with python and the SDK?
Google Cloud SDK https://cloud.google.com/sdk/docs/
Google Cloud Client Libraries https://cloud.google.com/apis/docs/cloud-client-libraries
The Cloud SDK is a set of command line tools (gcloud, gsutil, and bq). The use of the term 'SDK' here seems to be misleading and they should probably be called Google Cloud Tools or Google Cloud CLI.
The Cloud Client Libraries are the latest set of libraries available in various languages that you can program against.
There's also an older set of client libraries called the Google API Client Libraries. They're autogenerated from Google service interfaces and are simple wrappers to REST calls. You should probably use the newer Cloud Client Libraries if you can as they are more idiomatic and provide better abstraction.
Jarmod's answer is excellent.
Could I do everything using the Client Library (for .NET) that I could
with python and the SDK?
Almost everything. Exceptions I know:
.NET code can't run on good ole Google App Engine Standard. You can still run your .NET code in Google Compute Engine (on Windows) or Google App Engine Flexible Environment (.NET core code on Linux.)
Tensorflow only has a Python API.
Bigtable doesn't have a .NET API.
https://github.com/GoogleCloudPlatform/dotnet-docs-samples shows how to call many, but not all of the Google Cloud APIs.
Related
I am setting up a new API and Google Cloud Endpoints Frameworks looks like a good candidate to use with an AppEngine standard handler. The API handler is to accesses BigQuery in the backend - This seems to prefer newer cloud-api-client libraries.
Python 2.7 is deprecated at the start of 2020. I can't find any guidance on whether Google is going to update endpoints to support GAE on Python3.x or removed (replaced with some other product perhaps?)
App Engine now supports Python 3.x.
Should I be considering cloud endpoints framework for a new project?
You're right, Endpoints Frameworks do not support Python 3.x yet.
A possible solution would be to use Cloud Endpoints on App Engine flexible environment.
I am using Google Cloud Storage and I want to serve scaled images from it, Python 2 version of Google App Engine supported it via Images API but with Python3, they removed that API.
https://cloud.google.com/appengine/docs/standard/python3/python-differences
Cannot understand the intension behind removing such an import feature, upgrading to Python3 in Google Cloud environment sounds like a downgrade to me.
As you said, the proprietary App Engine APIs are not available in Python3.7. The main reason is because GCP is unbundling App Engine and now, you are no longer dependent on these APIs.
Currently, there are some third parties alternative solutions. In your specific case, and based on GCP documentation, I think that you can try to use Imgix or Rethumb.
Seems like Google is planning on adding it back to Python 3:
https://cloud.google.com/appengine/docs/standard/python3/services/access
To reduce runtime migration complexity, Google Cloud now supports a set of App Engine bundled services and their associated APIs on second-generation runtimes, which include Python 3, Java 11, and Go 1.12 or higher. Your app can call bundled services APIs for second-generation runtimes through language-idiomatic libraries.
When writing a Go App Engine Standard app, it used to be the case that you had to use the App Engine SDK to access the data store. However, these days (since Go 1.11?), it seems to work if you just use the Cloud Datastore Client Library.
Is there a downside of using the Cloud Datastore Client Library on App Engine Standard for accessing the datastore? (apart from a bit of extra configuration to make the dev appserver use the emulator). The advantage is that it enables code reuse for other environments.
App Engine Standard for Go1.11 runs on the new, second generation (beta) runtime which doesn't have the limitations of the 1st generation and is capable of running any framework, library, or binary. On the other hand, App Engine no longer modifies the Go toolchain to include the appengine package and it is strongly recommended to use the Google Cloud client library or third party libraries instead of the App Engine-specific APIs.
For more details about this, I recommend to have a look at the doc here about the differences between both generations and how to handle them.
Newbie to Datastore. I found two tutorials on the GCP site to use Datastore on App Engine. Which one should I use?
There are subtle differences in how the APIs work.
https://cloud.google.com/datastore/docs/datastore-api-tutorial
uses package (import com.google.appengine.api.datastore.Entity;)
vs.
https://cloud.google.com/appengine/docs/standard/java/building-app/cloud-datastore
uses package (import com.google.cloud.datastore.Entity)
Question: Is there a preferred package to use and call the datastore API while on App Engine - com.google.cloud.datastore.Entity vs. com.google.appengine.api.datastore.Entity?
The library with this package com.google.appengine.api.datastore (aka "Datastore API for Java") is intended for use by Java 7 and Java 8 applications which run on AppEngine.
The library with this package com.google.cloud.datastore (aka "Cloud Datastore client library") is intended for use by any Java 8 application regardless of where it is deployed (GKE, GCE, on-premises etc)
From the docs:
Datastore API for Java is a low-level Datastore API built into the App Engine SDK to provide direct access to all Datastore features and is described throughout the App Engine Datastore documentation for Java.
Cloud Datastore client library is a library that can be used by apps in the App Engine standard Java 8 runtime, by applications in the App Engine flexible environment, and by non App Engine applications as well.
So, according to Google, both are valid choices subject to these limitations ...
If you are running Java 7 then you cannot use Cloud Datastore client library
If your application is not deployed to AppEngine then you cannot use Datastore API for Java
These limitations describe the scenarios in which one or other of these libraries cannot be used. Google offers no advice on which one should be used. This is because the two libraries are functionally equivalent so, assuming that the limitations described above do not apply to your usage, the choice is probably moot.
I want to write a desktop application that interacts with a GAE-based web service. For Android and Web clients there is the possibility to generate client libraries automatically. Is there a way to generate client libraries for C or C++? I would settle for Python as well.
Theoretically all the Google APIs Client libraries allow accessing any Discovery-based API as long as the discovery document is available (which is the case for cloud endpoints) even though the functionality isn't very well documented in most cases.
See https://developers.google.com/discovery/libraries for a list of currently available client libraries.
As example of how you can use the python client library with cloud endpoints:
service = build("your_api", "your_api_version", http=http,
discoveryServiceUrl=("https://yourapp.appspot.com/_ah/api/discovery/v1/"
"apis/{api}/{apiVersion}/rest"))
result = service.resource().method([parameters]).execute()
Currently, Google App Engine Cloud Endpoints only supports generating client libraries for Android (Java), iOS (Objective-C) and JavaScript. See https://developers.google.com/appengine/docs/java/endpoints/overview.
Of course you may still develop your application using GAE for your web service and write the web service interface libraries yourself in any language you choose.