Name: marathon-client
Owner: CloudBees
Description: Java API client for Mesosphere's Marathon.
Created: 2015-07-21 16:32:01.0
Updated: 2016-01-18 09:47:06.0
Pushed: 2016-06-23 09:07:50.0
Size: 117
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This project is a Java library for communicating with Marathon API. At this point this library supports version v2 of Marathon API, please refer docs for more details.
Add marathon-client as a dependency:
endency>
roupId>com.github.mohitsoni</groupId>
rtifactId>marathon-client</artifactId>
ersion>0.4.2</version>
pendency>
Please look at releases page for more versions.
The following piece of code initializes the client. `MarathonClient.getInstance()
` method expects the endpoint for marathon:
ng endpoint = "<Marathon's endpoint>";
thon marathon = MarathonClient.getInstance(endpoint);
The following will return all the applications that have been created:
ppsResponse appsResponse = marathon.getApps();
The following example demonstrates how a new application can be created:
app = new App();
setId("echohisleepbye-app");
setCmd("echo hi; sleep 10; echo bye;");
setCpus(1.0);
setMem(16.0);
setInstances(1);
thon.createApp(app);
The following example, demostrates how to get details about an already created application:
ppResponse appGet = marathon.getApp("echohisleepbye-app");
The following example demostrate, how one can delete an existing application:
thon.deleteApp("echohisleepbye-app");
This project is built using Apache Maven.
Run the following command from the root of repository, to build the client JAR:
n clean install
Bugs can be reported using Github issues.