Google Cloud Compute Engine Service
This service is google.golang.org/api/compute/v1/compute.Service proxy
To check all supported method run
endly -s='gcp/compute'
To check method contract run endly -s="gc/compute" -a=methodName
endly -s="gc/compute" -a='instancesGet'
References:
Usage:
Starting instance
endly -r=start
@start.yaml
init:
instanceId: 11230632249892XXXXX
pipeline:
start:
info:
action: gcp/compute:instancesGet
logging: false
credentials: gc
zone: us-central1-f
instance: $instanceId
print:
action: print
message: Instance $instanceId is $info.Status
check:
when: $info.Status = 'RUNNING'
action: exit
instanceUp:
when: $info.Status = 'TERMINATED'
action: gcp/compute:instancesStart
logging: false
zone: us-central1-f
instance: $instanceId
waitForStart:
action: nop
logging: false
sleepTimeMs: 5000
gotoStart:
action: goto
task: start
Stoping instance
init:
instanceId: 11230632249892XXXXX
stop:
info:
action: gcp/compute:instancesGet
logging: false
credentials: gc
zone: us-central1-f
instance: $instanceId
print:
action: print
message: Instance $instanceId is $info.Status
check:
when: $info.Status = 'TERMINATED'
action: exit
instanceDown:
when: $info.Status = 'RUNNING'
action: gc/compute:instancesStop
credentials: gc
zone: us-central1-f
instance: $instanceId
waitForStop:
action: nop
logging: false
sleepTimeMs: 5000
gotoStop:
action: goto
task: stop