Google Compute

Google Cloud Engine (GCE) is an Infrastructure as a Service (IaaS) offering that allows clients to run workloads on Google's physical hardware. Google Compute Engine provides a scalable number of virtual machines (VMs) to serve as large compute clusters for that purpose.

Integration with LogicHub

Connecting with Google Compute

GCE Authentication

We can access Google compute using Google service account credentials. The following details are required for that:

  1. Google service account credentials file. This JSON file can be created/Downloaded from https://console.cloud.google.com/iam-admin/serviceaccounts.

To connect to Google Compute following details are required:

  • Label: Connection name.
  • Reference Values: Define variables here to templatize integration connections and actions. For example, you can use https://www.{{hostname}}.com where, hostname is a variable defined in this input. For more information on how to add data, see 'Add Data' Input Type for Integrations.
  • JSON Credentials: Copy the Google credentials content JSON file that you would like to use.

Actions with Google Compute

Launch Instance

Launch a compute instance with google compute. The following are the inputs needed to launch an instance:

  • Google Project Name: Name of your Google project.

  • Zone: Regional zone in which we want to launch the instance. Example: ‘asia-south1-c’

  • config: A JSON config with the instance configuration details. An example config looks like this: {'name': 'instance_name', 'machineType': 'zones/asia-south1-c/machineTypes/f1-micro', 'disks': [{'boot': True, 'autoDelete': True, 'initializeParams': {'sourceImage': 'https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-9-stretch-v20191014'}}], 'networkInterfaces': [{'network': 'global/networks/default', 'accessConfigs': [{'type': 'ONE_TO_ONE_NAT', 'name': 'External NAT'}]}], 'metadata': {'items': [{'key': 'url', 'value': 'http://storage.googleapis.com/gce-demo-input/photo.jpg'}, {'key': 'text', 'value': 'sample_value'}, {'key': 'bucket', 'value': 'bucket_name'}]}}

Sample Input

Sample Output

Stop Instance

Stop an instance with an instance name. The following are the inputs needed to stop an instance:

  • Google Project Name: Name of your Google project.

  • Zone: Regional zone in which we want to launch the instance. Example: ‘asia-south1-c’.

  • Instance Name: Name of the instance you wish to stop.

Sample Input

Sample Output


Did this page help you?