public abstract class MarathonBuilder extends Object
MarathonClients from Jenkins, file system, and JSON pieces.
This allows the construction of the final payload as well as sending it to the target Marathon instance.| Constructor and Description |
|---|
MarathonBuilder() |
| Modifier and Type | Method and Description |
|---|---|
abstract MarathonBuilder |
build()
Compose the builder.
|
static MarathonBuilder |
getBuilder(AppConfig config)
Create a new builder instance from config.
|
abstract net.sf.json.JSONObject |
getJson() |
abstract MarathonBuilder |
read()
Read in default file (marathon.json) as JSON.
|
abstract MarathonBuilder |
read(String filename)
Read in filename as JSON.
|
abstract MarathonBuilder |
setConfig(AppConfig config)
Set the Application Configuration to config.
|
abstract MarathonBuilder |
setEnvVars(hudson.EnvVars vars)
Set the Jenkins Environment Variables to vars.
|
abstract MarathonBuilder |
setJson(net.sf.json.JSONObject json)
Set the JSON for this builder to json.
|
abstract MarathonBuilder |
setWorkspace(hudson.FilePath ws)
Set the Jenkins workspace to ws.
|
abstract MarathonBuilder |
toFile()
Write the JSON that will be sent to the target Marathon instance to the default file
(marathon-rendered-${BUILD_NUMBER}.json).
|
abstract MarathonBuilder |
toFile(String filename)
Write the JSON that will be sent to the target Marathon instance to filename.
|
abstract MarathonBuilder |
update()
Update the Marathon application.
|
public static MarathonBuilder getBuilder(AppConfig config)
config - Application configurationpublic abstract MarathonBuilder update() throws mesosphere.marathon.client.utils.MarathonException
mesosphere.marathon.client.utils.MarathonExceptionpublic abstract MarathonBuilder read(String filename) throws IOException, InterruptedException, MarathonFileMissingException, MarathonFileInvalidException
filename - Path to the JSON fileIOExceptionInterruptedExceptionMarathonFileMissingExceptionMarathonFileInvalidExceptionpublic abstract MarathonBuilder read() throws IOException, InterruptedException, MarathonFileMissingException, MarathonFileInvalidException
IOExceptionInterruptedExceptionMarathonFileMissingExceptionMarathonFileInvalidExceptionread(String)public abstract MarathonBuilder setJson(net.sf.json.JSONObject json)
read(String).json - The JSON value to use for this builderpublic abstract net.sf.json.JSONObject getJson()
public abstract MarathonBuilder setEnvVars(hudson.EnvVars vars)
vars - Jenkins environment variablespublic abstract MarathonBuilder setConfig(AppConfig config)
config - application configurationpublic abstract MarathonBuilder setWorkspace(hudson.FilePath ws)
ws - Jenkins workspacepublic abstract MarathonBuilder build()
MarathonClientpublic abstract MarathonBuilder toFile(String filename) throws InterruptedException, MarathonFileInvalidException, IOException
filename - File to write rendered JSONInterruptedExceptionMarathonFileInvalidExceptionIOExceptionpublic abstract MarathonBuilder toFile() throws InterruptedException, IOException, MarathonFileInvalidException
InterruptedExceptionIOExceptionMarathonFileInvalidExceptiontoFile(String)Copyright © 2004-2016. All Rights Reserved.