Is it possible to create google API KEY programmatically? - google-api

I'm trying to automate the process of creating and managing my projects on Google Cloud Platform. I want to create new project and generate API keys for it and use them.
I am unable to find any API to create API KEYS. Is there any solution ?
Thanks

You may not be able to create API keys programmatically, but you can create service accounts. Service accounts can do all the things on API keys can, and are much more secure than API keys. And you can create them via API calls!
Here's the API reference for creating service accounts, and for creating service account keys (which have a public/private keypair).
Here's the API reference for creating projects.
You should be able to do whatever you were trying to accomplish with these tools. But for most simple use-cases using the UI is recommended.

From My little experience you can't . You have to use Google API Console

❯ gcloud alpha services api-keys create --display-name=NAME
See: https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/create

Related

Google Cloud API Key permissions

I'm using Google's API Key on one of the projects I'm running in the cloud.
I tried to find the permissions that API Key has: does it have write-only?
Or other types of permissions like read?
I couldn't find anything in Google's documentation to prove this, beyond the restrictions I could put on the key, such as restricting HTTP or the API that only the developer could work with.

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).

How do I create a StorageController in Node js for Azure File Sync?

If i wish to create a StorageController to generate the SAS tokens inorder to make the Azure File Syncing work with Xamarin forms, is that possible ? All the documentation that I have seen only mention a way to do it in ASP.NET.
Reference :
https://azure.microsoft.com/en-us/blog/file-management-with-azure-mobile-apps/
It seems I can create a SAS token in Node js, but how do I tie it up the /table endpoint ?
http://azure.github.io/azure-storage-node/
There is significant work involved in creating the equivalent of a StorageController for the Node.js backend. You could create a simple custom API endpoint that generates SAS tokens and consume those from your client application, i.e. interacting directly with Azure Storage rather than using the file sync plugin for Azure Mobile Apps.

Is there an API to the AppHarbor management domain?

For example, if my app needed to add a new domain name to my application via an API call how would I accomplish that?
AppHarbor has an API that lets you accomplish most management functions including creating hostnames. Documentation is here:
Overview
Create hostname

How to create time-driven triggers in a google API service account

One of our Java applications uses a google API service account to process all the Google Drive Documents shared to it. As at the moment there is no REST API for manipulating the content of the documents, I plan to use a Google Apps Script with a time driven trigger for that purpose.
Could not find how to set up such a trigger for a google API service account. Needing some help. Thanks.
Sanjay
According to the Documentation, Time-Driven Triggers execute under the trigger owner identity. So it is not important which account type uses your Java Applications.
There is no special trigger for google API service accounts Setting up a trigger is the same for any account. Have a look at the documentation on triggers for more information

Resources