Class Gcloud
- java.lang.Object
-
- com.google.cloud.tools.appengine.operations.Gcloud
-
public class Gcloud extends Object
Operations that use gcloud.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Gcloud.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Gcloud.Builder
builder(CloudSdk sdk)
List<CloudSdkComponent>
getComponents()
Returns the list of Cloud SDK Components and their settings, reported by the current gcloud installation.CloudSdkConfig
getConfig()
Returns a representation of gcloud config, it makes a synchronous call to gcloud config list to do so.Auth
newAuth(ProcessHandler processHandler)
Deployment
newDeployment(ProcessHandler processHandler)
GenRepoInfoFile
newGenRepoInfo(ProcessHandler processHandler)
Versions
newVersions(ProcessHandler processHandler)
String
runCommand(List<String> args)
Run short lived gcloud commands.
-
-
-
Method Detail
-
newDeployment
public Deployment newDeployment(ProcessHandler processHandler)
-
newVersions
public Versions newVersions(ProcessHandler processHandler)
-
newAuth
public Auth newAuth(ProcessHandler processHandler)
-
newGenRepoInfo
public GenRepoInfoFile newGenRepoInfo(ProcessHandler processHandler)
-
getComponents
public List<CloudSdkComponent> getComponents() throws ProcessHandlerException, com.google.gson.JsonSyntaxException, CloudSdkNotFoundException, CloudSdkOutOfDateException, CloudSdkVersionFileException, IOException
Returns the list of Cloud SDK Components and their settings, reported by the current gcloud installation. Unlike other methods in this class that call gcloud, this method always uses a synchronous ProcessRunner and will block until the gcloud process returns.- Throws:
ProcessHandlerException
- when process runner encounters an errorcom.google.gson.JsonSyntaxException
- when the cloud SDK output cannot be parsedCloudSdkNotFoundException
- when the Cloud SDK is not installed where expectedCloudSdkOutOfDateException
- when the installed Cloud SDK is too oldCloudSdkVersionFileException
IOException
-
getConfig
public CloudSdkConfig getConfig() throws CloudSdkNotFoundException, CloudSdkOutOfDateException, CloudSdkVersionFileException, IOException, ProcessHandlerException
Returns a representation of gcloud config, it makes a synchronous call to gcloud config list to do so.
-
runCommand
public String runCommand(List<String> args) throws CloudSdkNotFoundException, IOException, ProcessHandlerException
Run short lived gcloud commands.- Parameters:
args
- the arguments to gcloud command (not including 'gcloud')- Returns:
- standard out collected as a single string
- Throws:
CloudSdkNotFoundException
IOException
ProcessHandlerException
-
builder
public static Gcloud.Builder builder(CloudSdk sdk)
-
-