Can I use Google API without Google Compute Engine? (Cloud SDK) - google-api

https://www.youtube.com/watch?v=chk2rRjSn5o
https://www.youtube.com/watch?v=nMY0qDg16y4&t=491s
These series of videos use Google Compute Engine to access Google Cloud vision API.
But, I only want to use Google cloud vision API on my local computer.
I found Cloud SDK is an option but I don't understand how it works.
Does it link my computer to Google Compute Engine?
Then, do I still have to pay for the Engine?
To Sum up the question.
Is there any way that I only pay for Google Cloud Vision API without paying for Google Compute Engine?

TL;DR - Yes you can - they are separate services and you can use them either independently or combine them if needed. You pay only for what you use.
Google Compute Engine
The first youtube video link you shared is for using Google Compute Engine (GCE), which is an IaaS (Infrastructure as a Service) option in Google Cloud. You can use this to set up VMs, custom networks, instance groups, load balancers and other infrastructure.
Google Cloud Vision
Google Cloud Vision is a more specific service which helps you with just Image analysis. It is a service independent of Google Compute Engine and you need not use Google Compute Engine to use the Cloud Vision APIs (although you can do that too if you wish in the future).
In other words - yes, you need not pay for Google Compute Engine to use just the Cloud Vision APIs.
Both Cloud Vision and Google Compute Engine are cloud services part of Google Cloud Platform. Both of them require first creating a project (using Google Cloud Console) and setting up billing before you can use either of those services (or in fact any of the Google Cloud services).
Trying the Cloud Vision API
Here is a quickstart tutorial with detailed steps to try Cloud Vision API directly in the browser.
If you prefer using Cloud SDK and the Cloud client libraries, here is a detailed example with steps.

Related

Google cloud vision API samplesfor ruby

I am using google-cloud-ruby client library, I don't see any samples related to current implementation of google cloud vision API. From where should I look out code samples of google cloud vision API for ruby client library.
It is hosted together with the rest of the google cloud ruby samples here

Ideas to divided bandwidth to clients in Google Cloud Platform

How to separate bandwidth to clients in SaaS plaform?
Example: wix separate in GB to each client type.
I use Laravel in Google compute engine, but any tip is valid
I believe If we talking about SaaS your have to find your solution from third-party tools since GCP mostly is a Infrastructure as a Service (IaaS) or Platform as a Service (PaaS).
Please take look at following document which outline Rate-limiting strategies and techniques in GCP
https://cloud.google.com/solutions/rate-limiting-strategies-techniques
and
https://stripe.com/blog/rate-limiters

Cloud Provider SLAs exposed via RESTful APIs

I was wondering if any of the major cloud providers (AWS, Azure, Google) exposed their SLAs for virtual machines via a RESTful API.
Basically, I am looking for the information available on these pages:
https://aws.amazon.com/compute/sla/
https://cloud.google.com/compute/sla
https://azure.microsoft.com/en-gb/support/legal/sla/virtual-machines/v1_8/
Does anyone know if this information is exposed by any of these providers via a RESTful API?
Many thanks.
I was informed by Azure Support that this service is not provided by them.
On Google Cloud Platform there is no way to check the information that you are asking via REST API.
Can you explain your use case and maybe we can find a workaround?
Best regards

Does Google Container Engine SDK/API exist?

I am planning to launch container cluster from an SDK/API. Presently, I am fine with any language, but I prefer NodeJS SDK. As far as I have seen, I could not find any Container engine SDK. Here is the NodeJS SDK for GCP which does not contain container engine. In fact it contains SDK only for very few GCP services.
I came across OAuth API for container engine but it involves human intervention to launch it. I am looking for service account based authentication for the SDK.
Are there container engine SDKs available ?
Update after discussion with Robert Lacok:
This is the code I tried to use for container APIs with API-key, it does not work. It expects Oauth 2 token, or some other credentials other than Service account. I tried API-key it didnt work. I dont know how to use Service account authentication with the API.
Here is my source code:
Here is the error:
I see a method for Application Default credentials. But I dont think so it will be useful for my use-case. I am trying to create container cluster from AWS Lambda. So, I cant use application default credentials. Is there any other options ?
The API for Google Container Engine is very limited at the moment as all the features are in Alpha status and because they can change not many people are incorporating them into the SDKs they are developing.
These are the current available APIs: https://cloud.google.com/sdk/gcloud/reference/container/
And here is the Alpha APIs: https://cloud.google.com/sdk/gcloud/reference/alpha/container/
What you probably want to do is making calls to the REST API and using the client library for OAuth2 authentication.
You can browse the API documentation and see that every method has a short how-to for a number of languages, NODE.JS being one of them. Have a look here for an example on how to create a container cluster.
You also mentioned service account authentication. The preferred way to do this is to use the application default credentials, you can have a little read about them here.
In short, you want to set an environment variable GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json which is a key to service account you generated in console.
Then the client library will take care of the rest (getting the OAuth tokens and what not).

Laravel: Google Cloud Storage and Google Compute Engine

I need to store user data to my google cloud storage bucket.
I'm running laravel on google compute engine.
Could someone assist with this?
I've found only tutorials for google app engine so far.
The Google Cloud Storage JSON API is a simple, JSON-backed interface for accessing and manipulating Google Cloud Storage projects in a programmatic way.
You will need to use Google APIs Client Library for PHP to send requests to the Google Cloud Storage JSON API. See the links below for more info and examples:
https://cloud.google.com/storage/docs/json_api/
https://cloud.google.com/storage/docs/json_api/v1/json-api-php-samples

Resources