How to launch Google Compute instances programmatically? - google-compute-engine

In the AWS SDK, EC2 instances can be launched programmatically via the AmazonEC2Client. Does GCP in general or Compute Engine specifically just offer the CLI-based gcloud command for the equivalent operation? Or can GCE instances be controlled from Java/Python/Go/etc as well? Which SDK exists for those languages and where are the examples & docs for this?
I am looking for the equivalent of this in the GCP world:
client = new AmazonEC2Client(credentials);
client.runInstances(new RunInstancesRequest())

You're looking for the Google Cloud Client Libraries, of which gcloud-java is the Java implementation. There are also Client Libraries in Go, Node.js, Python, and Ruby.
Under the covers everything in Google Cloud is available via an API, so even if there isn't a client library for what you're trying to accomplish, it can be done programmatically by calling the API directly.
The documentation on launching instances has an API tab that shows both Client Library and REST API examples.

Looks like this is still in alpha but it is available on Github: here and here. There is an example for starting GCE instances in the java-docs-samples project.

Related

C/C++ interface for Google Cloud KMS API

I find it extraordinary that there isn't a PKCS#11 interface let alone the fact there is support for C#, Go, Java, Node.JS, PHP, Python and Ruby but no direct API support for C/C++. Did I miss something? Is it just a REST interface where you have to use one of Microsoft REST API library, Pistache or one of the other libraries out there?
In general, Google Cloud publishes languages and client libraries in 7 languages:
C# (.NET)
Go
Java
Node.js
PHP
Python
Ruby
And then you can always access the API directly via REST or gRPC.
If you'd like to learn more about PKCS#11 in Cloud KMS, please reach out to the team using any of the methods on this page.

How to get in-app menus to work reliably in the GUI on Google Compute Engine?

I'm having trouble using dropdown menus in-app on Google Compute Engine after connecting through VNC. I have a working GUI in place, but more often than not, it doesn't allow me to use the dropdown menus in-app.
I need the GUI to setup configuration files for my headless crawler as doing that manually using the command line is too cumbersome (40ish parameters).
Seems like the issue relies directly on the VNC Client you are using. I would recommend you file a FR using this Public Tracker to fix this behavior in the GCP GUI Cloud Console.
Please include as much information as possible such as: VNC version and provider and so on.

Web GIS application for ArcGIS users

Can I create a ArcGIS web application without ArcGIS server, using only ArcGIS online services?
Yes.
The only thing that ArcGIS server would be supplying to a web application is map services or geoprocessing services. These can be hosted on ArcGIS Online (AGOL) instead. For examples, look at the ArcGIS JavaScript API samples, almost all of which use AGOL map services in their implementation.
The application itself, if built in JavaScript, can be hosted on any web server and does not require an ArcGIS Server install.
Absolutely! You can easily upload your data to ArcGIS Online and create Hosted Feature Services, then add those to a web map, and then create an app based on that web map (no coding is even required unless you need something customized for your workflow). Good luck!
Yes, although currently MapServer service is not listed under supported types of hosted layers:
https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm
MapServer allows for delivering just map images for an individual service to the client and provides the feature data by request. Hosting it doesn't seem to be a option in ArcGIS Online in current implementation.

Web service API for DRMAA on SGE

Does anyone know of any project to expose the DRMAA API (job scheduling and maintenance API) from SGE (Sun Grid Engine) as a web service API? A RESTful API would be best.
I do not think there are any web service API for SGE. I found drmaa-python pretty easy implementing in python script that can be called from server side scripts like PHP.
There is nothing like this available at the moment, but:
The Open Grid Forum started a new standardization activity to define how DRMAAv2 can be exposed as RESTful API. The specification draft is publicly available.
Since more and more people ask for such a remote interface, implementations might be available pretty soon. They are most likely to be announced by the OGF OCCI working group, so follow them if you are still interested.
Mapping such an implementation to the DRMAAv1 library in GridEngine should be relatively straightforward.

Why do the terms API and an SDK seem to be used interchangeably?

What is the accepted definition of an API compared to the definition of an SDK? Both seem to be used interchangeably, so I'd imagine that some libraries dubbed APIs are in reality SDKs, and vice versa. Also, is there a reason for this distinction?
Thanks!
An API, or application programming interface, defines a set of classes, functions, and structures to be used by an application to make use of some library or subsystem. For example, both the windows multimedia subsystem, and windows sockets subsystem both have their own API. An API is not a concrete entity, you can't point at a file and say that the file itself is an API. An API is merely a specification for a communications protocol that a program needs to use to make use of a library or subsystem.
An SDK, or software development kit, contains tools, documentation, and needed files, to program against 1 or more APIs. Some SDKs, but by no means all, may contain sample code to demonstrate how an API can be used. 2 examples of an SDK are the Windows Platform SDK and the .NET Framework SDK.
The most likely reason the terms are used interchangeably is because sometimes an SDK only has the tools, documentation, and files for a single API, and both the API and SDK share the same name. An example of this would be the SDK for developing winamp plugins.
API - Application Programming Interface. This is what you write code to.
SDK - Software Development Kit. These are the libraries that you need so you can code. An SDK likely has many different api's contained in it.
None of the answers I've seen so far really capture it clearly and completely.
The two terms are not interchangeable and if someone uses them interchangeably, it indicates a lack of understanding or preciseness.
API - Application Programming Interface. Exposed by a class library. Utilized by an application. When you build an application that uses the library, this is the interface your code uses to connect to or call into the library. In other words the set of rules and conventions applications must follow to use the library. The API includes the classes, their methods, the parameter lists for the methods, and other supporting elements (like enumerations, constants and so on). An API is an abstract artifact: You cannot download an API, or install an API. You can describe an API, and you can use one. The library itself is the concrete realization of the API, the delivery mechanism.
SDK - Software Development Kit. This is a concrete thing. You can download an SDK, install it, store it. An SDK includes:
libraries, which, as you know, expose or provide APIs.
header files (if applicable)
documentation - readme files, help files, release notes, reference documentation, programming guides. Realized as .CHM files, pdf documents, etc.
tools - such as compilers, assemblers, linkers, profilers, debuggers, optmizers, test tools, and more.
sample code and sample apps - showing how to use the API
maybe some other stuff that doesn't fit into one of the above categories
A Concrete Example:
the Java SDK is a downloadable, versioned thing. It delivers libraries, tools (on windows: javac.exe, java.exe, jar.exe, etc), all the help files and API doc, and source code for the libraries.
the API for Java is the set of rules your code must follow to invoke the libraries; these rules are described in the API documentation.
An API is an Application Programming Interface -- its something your program can talk to. An SDK usually includes an API along with documentation for the API. An API is not required to contain documentation. An SDK may include the API Components, but will always include the documentation.
APIs can exist within SDKs but not vice versa. SDKs generally contain a complete specifiction of a framework or environment. For example the Java SDK contains a full specification of the Java language plus tools, external libraries and whatever else the vendor decides to throw in there. The java apis are simply the interface to those specifications.