Giter Site home page Giter Site logo

chronos-client's Introduction

chronos-client

This project is a Java library for communicating with Chronos API. At this point this library supports version v1 of chronos API, please refer docs for more details.

Using chronos-client in your maven project

Add chronos-client as a dependency:

<dependency>
  <groupId>com.mesosphere</groupId>
  <artifactId>chronos-client</artifactId>
  <version>0.0.1</version>
</dependency>

Usage

Initialization

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

String endpoint = "<endpoint>";
Chronos chronos = ChronosClient.getInstance(endpoint);

for Basic Auth

String endpoint = "<endpoint>";
String username = "<username>";
String password = "<password>";
Chronos chronos = ChronosClient.getInstanceWithBasicAuth(endpoint,username,password);

Getting all jobs

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

GetJobsResponse jobsResponse = chronos.getJobs();

Create a new job

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

Job job = new Job();
job.setSchedule("R/2016-04-27T17:22:00Z/PT5M");
job.setName("dockerjob");
Container container = new Container();
container.setType("DOCKER");
container.setImage("libmesos/ubuntu");
job.setContainer(container);
job.setCpus(0.5);
job.setMem(512.0);
job.setCommand("echo hi; sleep 10; echo bye;");

chronos.createJob(job);

Get details about an existing job

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

GetJobsResponse jobGet = chronos.getJob("dockerjob");

Delete a job

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

chronos.deleteJob("dockerjob");

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.

chronos-client's People

Contributors

valantin avatar

Watchers

James Cloos avatar WeijieZheng 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.