(context)
return {'resources': resources}
Generate YAML resource configuration.
Generate YAML resource configuration.
Generate YAML resource configuration .
def GenerateConfig(context):
  """Generate YAML resource configuration."""

  resources = [{
      'name': context.env['name'],
      'type': 'compute.v1.instanceTemplate',
      'properties': {
          'properties': {
              'machineType': context.properties['machineType'],
              'disks': [{
                  'deviceName': 'boot',
                  'boot': True,
                  'type': 'PERSISTENT',
                  'autoDelete': True,
                  'mode': 'READ_WRITE',
                  'initializeParams': {
                      'sourceImage': context.properties['image']
                  }
              }],
              'networkInterfaces': [{
                  'accessConfigs': [{
                      'name': 'external-nat',
                      'type': 'ONE_TO_ONE_NAT'
                  }],
                  'network': 'global/networks/default',
              }],
              'metadata': {
                  'items': [{
                      'key': 'startup-script',
                      'value': ''.join(['#!/bin/bash\n',
                                        'python -m SimpleHTTPServer 8080'])
                  }]
              }
          }
      }
  }]

  return {'resources': resources}
def GenerateConfig ( context ) : resources = [ { 'name' : context . env [ 'name' ] , 'type' : 'compute.v1.instanceTemplate' , 'properties' : { 'properties' : { 'machineType' : context . properties [ 'machineType' ] , 'disks' : [ { 'deviceName' : 'boot' , 'boot' : True , 'type' : 'PERSISTENT' , 'autoDelete' : True , 'mode' : 'READ_WRITE' , 'initializeParams' : { 'sourceImage' : context . properties [ 'image' ] } } ] , 'networkInterfaces' : [ { 'accessConfigs' : [ { 'name' : 'external-nat' , 'type' : 'ONE_TO_ONE_NAT' } ] , 'network' : 'global/networks/default' , } ] , 'metadata' : { 'items' : [ { 'key' : 'startup-script' , 'value' : '' . join ( [ '#!/bin/bash\n' , 'python -m SimpleHTTPServer 8080' ] ) } ] } } } } ] return { 'resources' : resources }