Tareq Assi
Tareq Assi

Reputation: 157

managing app engine versions through API calls

Is there anyway that I can manage the appengine versions and instances through API calls?

What I mean by managing is to start/stop/delete versions deployed to the appengine through API calls.

Is that possible by using gcloud sdk commands from command line ?

Another question , does google provide APIs (or commands) to check the status of running instances ? check if the instance is idle or not and how long its being idle

Upvotes: 3

Views: 269

Answers (2)

sowoli
sowoli

Reputation: 21

2020 UPDATE: You can do it using the apps.services.versions api. You can stop/start a version with the PATCH method, setting the mask to "servingStatus" and in the body set the "servingStatus" field to "STOPPED"/"SERVING".

Similarly, you can use the delete/create methods to launch and remove new versions

Reference: https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch

Upvotes: 1

E. Anderson
E. Anderson

Reputation: 3493

There is a beta API for managing versions and services here:

https://cloud.google.com/appengine/docs/admin-api/

The API is still beta because it's under active development; there are still a few methods and fields which aren't implemented. Shortly after those are complete, the API will be marked "v1", though v1beta4 and v1beta5 will continue to be supported for several months in transition.

For example, the API doesn't yet include operations on instances, but I expect that List/Get/Delete will be available fairly soon. Since App Engine automatically creates instances for you, there is no create instance API.

I just noticed that the most recent documentation re-skin seems to have hidden the documentation for the REST interface, so I'll drop that link there so you that you can find the currently implemented methods. (Version.Update is also implemented for a few fields, so that documentation update should be coming out very soon.)

Upvotes: 1

Related Questions