org.jclouds.googlecomputeengine.compute.options
Class GoogleComputeEngineTemplateOptions

java.lang.Object
  extended by org.jclouds.compute.options.RunScriptOptions
      extended by org.jclouds.compute.options.TemplateOptions
          extended by org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions
All Implemented Interfaces:
Cloneable

public class GoogleComputeEngineTemplateOptions
extends org.jclouds.compute.options.TemplateOptions

Instance options specific to Google Compute Engine.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclouds.compute.options.TemplateOptions
org.jclouds.compute.options.TemplateOptions.Builder, org.jclouds.compute.options.TemplateOptions.ImmutableTemplateOptions
 
Nested classes/interfaces inherited from class org.jclouds.compute.options.RunScriptOptions
org.jclouds.compute.options.RunScriptOptions.ImmutableRunScriptOptions
 
Field Summary
 
Fields inherited from class org.jclouds.compute.options.TemplateOptions
blockUntilRunning, inboundPorts, networks, nodeNames, NONE, privateKey, publicKey, script, securityGroups, tags, userMetadata
 
Fields inherited from class org.jclouds.compute.options.RunScriptOptions
authenticateSudo, blockOnComplete, loginPassword, loginPrivateKey, loginUser, port, runAsRoot, seconds, taskName, wrapInInitScript
 
Constructor Summary
GoogleComputeEngineTemplateOptions()
           
 
Method Summary
 GoogleComputeEngineTemplateOptions addDisk(InstanceTemplate.PersistentDisk disk)
           
 GoogleComputeEngineTemplateOptions addServiceAccount(Instance.ServiceAccount serviceAccout)
           
 GoogleComputeEngineTemplateOptions authorizePublicKey(String publicKey)
          
 GoogleComputeEngineTemplateOptions blockOnComplete(boolean blockOnComplete)
          
 GoogleComputeEngineTemplateOptions blockOnPort(int port, int seconds)
          
 GoogleComputeEngineTemplateOptions blockUntilRunning(boolean blockUntilRunning)
          
 GoogleComputeEngineTemplateOptions bootDiskSize(Long bootDiskSize)
           
 GoogleComputeEngineTemplateOptions clone()
           
 void copyTo(org.jclouds.compute.options.TemplateOptions to)
           
 GoogleComputeEngineTemplateOptions disks(Set<InstanceTemplate.PersistentDisk> disks)
           
 GoogleComputeEngineTemplateOptions dontAuthorizePublicKey()
          
 GoogleComputeEngineTemplateOptions enableNat(boolean enableNat)
           
 com.google.common.base.Optional<Long> getBootDiskSize()
           
 Set<InstanceTemplate.PersistentDisk> getDisks()
           
 com.google.common.base.Optional<URI> getNetwork()
           
 com.google.common.base.Optional<String> getNetworkName()
           
 Set<Instance.ServiceAccount> getServiceAccounts()
           
 GoogleComputeEngineTemplateOptions inboundPorts(int... ports)
          
 GoogleComputeEngineTemplateOptions installPrivateKey(String privateKey)
          
 boolean isEnableNat()
           
 GoogleComputeEngineTemplateOptions keepBootDisk(boolean keepBootDisk)
           
 GoogleComputeEngineTemplateOptions nameTask(String name)
          
 GoogleComputeEngineTemplateOptions network(String networkName)
          Deprecated. See TemplateOptions#networks
 GoogleComputeEngineTemplateOptions network(URI network)
           
 GoogleComputeEngineTemplateOptions networks(Iterable<String> networks)
          
 GoogleComputeEngineTemplateOptions networks(String... networks)
          
 GoogleComputeEngineTemplateOptions nodeNames(Iterable<String> nodeNames)
          
 GoogleComputeEngineTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)
          
 GoogleComputeEngineTemplateOptions overrideLoginCredentials(org.jclouds.domain.LoginCredentials overridingCredentials)
          
 GoogleComputeEngineTemplateOptions overrideLoginPassword(String password)
          
 GoogleComputeEngineTemplateOptions overrideLoginPrivateKey(String privateKey)
          
 GoogleComputeEngineTemplateOptions overrideLoginUser(String loginUser)
          
 GoogleComputeEngineTemplateOptions runAsRoot(boolean runAsRoot)
          
 GoogleComputeEngineTemplateOptions runScript(org.jclouds.scriptbuilder.domain.Statement script)
          
 GoogleComputeEngineTemplateOptions runScript(String script)
          
 GoogleComputeEngineTemplateOptions serviceAccounts(Set<Instance.ServiceAccount> serviceAccounts)
           
 boolean shouldKeepBootDisk()
           
 GoogleComputeEngineTemplateOptions tags(Iterable<String> tags)
          
 GoogleComputeEngineTemplateOptions userMetadata(Map<String,String> userMetadata)
          
 GoogleComputeEngineTemplateOptions userMetadata(String key, String value)
          
 GoogleComputeEngineTemplateOptions wrapInInitScript(boolean wrapInInitScript)
          
 
Methods inherited from class org.jclouds.compute.options.TemplateOptions
as, equals, getGroups, getInboundPorts, getNetworks, getNodeNames, getPrivateKey, getPublicKey, getRunScript, getTags, getUserMetadata, hashCode, securityGroups, securityGroups, shouldBlockUntilRunning, string
 
Methods inherited from class org.jclouds.compute.options.RunScriptOptions
getLoginPassword, getLoginPrivateKey, getLoginUser, getPort, getSeconds, getTaskName, hasLoginPassword, hasLoginPasswordOption, hasLoginPrivateKey, hasLoginPrivateKeyOption, shouldAuthenticateSudo, shouldBlockOnComplete, shouldRunAsRoot, shouldWrapInInitScript, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GoogleComputeEngineTemplateOptions

public GoogleComputeEngineTemplateOptions()
Method Detail

clone

public GoogleComputeEngineTemplateOptions clone()
Overrides:
clone in class org.jclouds.compute.options.TemplateOptions

copyTo

public void copyTo(org.jclouds.compute.options.TemplateOptions to)
Overrides:
copyTo in class org.jclouds.compute.options.TemplateOptions

network

@Deprecated
public GoogleComputeEngineTemplateOptions network(String networkName)
Deprecated. See TemplateOptions#networks

See Also:
getNetworkName()

network

public GoogleComputeEngineTemplateOptions network(URI network)
See Also:
getNetwork()

addServiceAccount

public GoogleComputeEngineTemplateOptions addServiceAccount(Instance.ServiceAccount serviceAccout)
See Also:
getServiceAccounts(), Instance.ServiceAccount

serviceAccounts

public GoogleComputeEngineTemplateOptions serviceAccounts(Set<Instance.ServiceAccount> serviceAccounts)
See Also:
getServiceAccounts(), Instance.ServiceAccount

addDisk

public GoogleComputeEngineTemplateOptions addDisk(InstanceTemplate.PersistentDisk disk)
See Also:
getDisks(), InstanceTemplate.PersistentDisk

disks

public GoogleComputeEngineTemplateOptions disks(Set<InstanceTemplate.PersistentDisk> disks)
See Also:
getDisks(), InstanceTemplate.PersistentDisk

enableNat

public GoogleComputeEngineTemplateOptions enableNat(boolean enableNat)
See Also:
isEnableNat()

bootDiskSize

public GoogleComputeEngineTemplateOptions bootDiskSize(Long bootDiskSize)
See Also:
getBootDiskSize()

keepBootDisk

public GoogleComputeEngineTemplateOptions keepBootDisk(boolean keepBootDisk)
See Also:
shouldKeepBootDisk()

blockOnPort

public GoogleComputeEngineTemplateOptions blockOnPort(int port,
                                                      int seconds)

Overrides:
blockOnPort in class org.jclouds.compute.options.TemplateOptions

inboundPorts

public GoogleComputeEngineTemplateOptions inboundPorts(int... ports)

Overrides:
inboundPorts in class org.jclouds.compute.options.TemplateOptions

authorizePublicKey

public GoogleComputeEngineTemplateOptions authorizePublicKey(String publicKey)

Overrides:
authorizePublicKey in class org.jclouds.compute.options.TemplateOptions

installPrivateKey

public GoogleComputeEngineTemplateOptions installPrivateKey(String privateKey)

Overrides:
installPrivateKey in class org.jclouds.compute.options.TemplateOptions

blockUntilRunning

public GoogleComputeEngineTemplateOptions blockUntilRunning(boolean blockUntilRunning)

Overrides:
blockUntilRunning in class org.jclouds.compute.options.TemplateOptions

dontAuthorizePublicKey

public GoogleComputeEngineTemplateOptions dontAuthorizePublicKey()

Overrides:
dontAuthorizePublicKey in class org.jclouds.compute.options.TemplateOptions

nameTask

public GoogleComputeEngineTemplateOptions nameTask(String name)

Overrides:
nameTask in class org.jclouds.compute.options.TemplateOptions

runAsRoot

public GoogleComputeEngineTemplateOptions runAsRoot(boolean runAsRoot)

Overrides:
runAsRoot in class org.jclouds.compute.options.TemplateOptions

runScript

public GoogleComputeEngineTemplateOptions runScript(org.jclouds.scriptbuilder.domain.Statement script)

Overrides:
runScript in class org.jclouds.compute.options.TemplateOptions

overrideLoginCredentials

public GoogleComputeEngineTemplateOptions overrideLoginCredentials(org.jclouds.domain.LoginCredentials overridingCredentials)

Overrides:
overrideLoginCredentials in class org.jclouds.compute.options.TemplateOptions

overrideLoginPassword

public GoogleComputeEngineTemplateOptions overrideLoginPassword(String password)

Overrides:
overrideLoginPassword in class org.jclouds.compute.options.TemplateOptions

overrideLoginPrivateKey

public GoogleComputeEngineTemplateOptions overrideLoginPrivateKey(String privateKey)

Overrides:
overrideLoginPrivateKey in class org.jclouds.compute.options.TemplateOptions

overrideLoginUser

public GoogleComputeEngineTemplateOptions overrideLoginUser(String loginUser)

Overrides:
overrideLoginUser in class org.jclouds.compute.options.TemplateOptions

overrideAuthenticateSudo

public GoogleComputeEngineTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo)

Overrides:
overrideAuthenticateSudo in class org.jclouds.compute.options.TemplateOptions

userMetadata

public GoogleComputeEngineTemplateOptions userMetadata(Map<String,String> userMetadata)

Overrides:
userMetadata in class org.jclouds.compute.options.TemplateOptions

userMetadata

public GoogleComputeEngineTemplateOptions userMetadata(String key,
                                                       String value)

Overrides:
userMetadata in class org.jclouds.compute.options.TemplateOptions

nodeNames

public GoogleComputeEngineTemplateOptions nodeNames(Iterable<String> nodeNames)

Overrides:
nodeNames in class org.jclouds.compute.options.TemplateOptions

networks

public GoogleComputeEngineTemplateOptions networks(Iterable<String> networks)

Overrides:
networks in class org.jclouds.compute.options.TemplateOptions

networks

public GoogleComputeEngineTemplateOptions networks(String... networks)

Overrides:
networks in class org.jclouds.compute.options.TemplateOptions

tags

public GoogleComputeEngineTemplateOptions tags(Iterable<String> tags)

Overrides:
tags in class org.jclouds.compute.options.TemplateOptions

wrapInInitScript

public GoogleComputeEngineTemplateOptions wrapInInitScript(boolean wrapInInitScript)

Overrides:
wrapInInitScript in class org.jclouds.compute.options.TemplateOptions

runScript

public GoogleComputeEngineTemplateOptions runScript(String script)

Overrides:
runScript in class org.jclouds.compute.options.TemplateOptions

blockOnComplete

public GoogleComputeEngineTemplateOptions blockOnComplete(boolean blockOnComplete)

Overrides:
blockOnComplete in class org.jclouds.compute.options.TemplateOptions

getServiceAccounts

public Set<Instance.ServiceAccount> getServiceAccounts()
Returns:
the ServiceAccounts to enable in the instances.

getDisks

public Set<InstanceTemplate.PersistentDisk> getDisks()
Returns:
the PersistentDisks for this instance.

getNetwork

public com.google.common.base.Optional<URI> getNetwork()
Returns:
the URI of an existing network the instances will be attached to. If no network URI or network name are provided a new network will be created for the project.

getNetworkName

public com.google.common.base.Optional<String> getNetworkName()
Returns:
the name of an existing network the instances will be attached to, the network is assumed to belong to user's project. If no network URI network name are provided a new network will be created for the project. Note that this is now pulling from the first element in the networks field from TemplateOptions.

isEnableNat

public boolean isEnableNat()
Returns:
whether an AccessConfig with Type ONE_TO_ONE_NAT should be enabled in the instances. When true instances will have a NAT address that will be publicly accessible.

getBootDiskSize

public com.google.common.base.Optional<Long> getBootDiskSize()
Returns:
the boot disk size, if specified. Defaults to 10gb.

shouldKeepBootDisk

public boolean shouldKeepBootDisk()
Returns:
whether we should keep the boot disk around when deleting the instance. Defaults to false.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.