GithubHelp home page GithubHelp logo

isabella232 / marathon-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from medallia/marathon-client

0.0 0.0 0.0 93 KB

Java API client for Mesosphere's Marathon.

License: Apache License 2.0

Java 100.00%

marathon-client's Introduction

marathon-client Build Status

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.

Using marathon-client in your maven project

Add marathon-client as a dependency:

<dependency>
  <groupId>com.github.mohitsoni</groupId>
  <artifactId>marathon-client</artifactId>
  <version>0.4.2</version>
</dependency>

Please look at releases page for more versions.

Usage

Initialization

The following piece of code initializes the client. MarathonClient.getInstance() method expects the endpoint for marathon:

String endpoint = "<Marathon's endpoint>";
Marathon marathon = MarathonClient.getInstance(endpoint);

Getting all applications

The following will return all the applications that have been created:

GetAppsResponse appsResponse = marathon.getApps();

Create a new application

The following example demonstrates how a new application can be created:

App app = new App();
app.setId("echohisleepbye-app");
app.setCmd("echo hi; sleep 10; echo bye;");
app.setCpus(1.0);
app.setMem(16.0);
app.setInstances(1);
marathon.createApp(app);

Get details about an existing application

The following example, demostrates how to get details about an already created application:

GetAppResponse appGet = marathon.getApp("echohisleepbye-app");

Delete an application

The following example demostrate, how one can delete an existing application:

marathon.deleteApp("echohisleepbye-app");

Building

This project is built using Apache Maven.

Run the following command from the root of repository, to build the client JAR:

$ mvn clean install

Bugs

Bugs can be reported using Github issues.

marathon-client's People

Contributors

3750 avatar carlossg avatar connorgorman avatar ericbottard avatar kohsuke avatar milenkovicm avatar mohitsoni avatar mohitsoni-ebay avatar sunchanlee avatar vlatombe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.