GoogleCloudPlatform / node-red-contrib-google-cloud

Node-RED nodes for Google Cloud Platform
Apache License 2.0
90 stars 57 forks source link

Feature: GCE Instance Node - Basic Operations #109

Closed arivictor closed 2 years ago

arivictor commented 2 years ago

Hi All,

I've made an attempt at creating a GCE Instance node for performing basic operations:

The node can be configured explicitly via the node UI or it can be dynamically configured via a previous node using msg.payload.

msg.payload = {
    projectId: "string", // GCP project ID
    zone: "string", // instance zone e.g. us-central1-a
    instance: "string", // instance name
    operation: "string", // get, list, start, stop, reset, delete, create
    template: "JSON String or Object", // as per https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert#request-body
}

The node outputs the direct response from GCP into msg.payload.

There is an included example flow that shows a use case for scheduling the start and stop of instances. After feedback, critique, and if I should continue with this node. I'm hoping to continue adding features and other operations as well as help develop other GCE based nodes (disk, snapshots, etc).

Thanks, Ari

example2 example1
arivictor commented 2 years ago

Theres still some outstanding items: