Git Product home page Git Product logo

marathon-validate's Introduction

Warning: This tool is not up-to-date with the current marathon version

marathon-validate

A tiny command line tool to validate application or group configuration files for Marathon and DC/OS.

Purpose

If you're running a Mesos or DC/OS cluster and build custom applications for if, most of the time you'll have to create either a Marathon app definition JSON file, or a group definition JSON file.

As the structure of these files can get a little complicated, marathon-validate was created to be able to do a quick sanity check of these files from the command line.

Therefore, marathon-validate will use the JSON schema files contained in the Marathon GitHub project to validate the input file against.

Installation

To be able to use marathon-validate, you need to have Node.js (and NPM) installed on your system. Then you can use

npm install -g marathon-validate

to install it globally. You can verify the correct installation by issuing

$ marathon-validate --version
0.3.3

Usage

$ marathon-validate --help

  Usage: marathon-validate [options] <file>

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -a, --app                  Check an App JSON
    -g, --group                Check a Group JSON
    -d, --describe <property>  Describe a property. Has to be used with either -a (app schema) or -g (group schema)
    -m, --marathon <version>   Use schema of specific Marathon version
    -t, --tags                 Get a list of tags for the Marathon project

Validate apps and groups

If you want validate your application.json file in the current folder against the master version of the JSON schema, you can do a

$ marathon-validate -a application.json

To validate your application.json against a specific release version (e.g. v1.3.6), you can use

$ marathon-validate -a -m v1.3.6 application.json

This should work with all tags from the Marathon project.

Query tags

You can also get the list of tags like this (output is shortened):

$ marathon-validate -t
--> List of tags:
     * v1.5.0-SNAPSHOT
     * v1.4.3
     * v1.4.2
     * v1.4.2-snapshot5
     * v1.4.2-snapshot4
     * v1.4.2-snapshot3
     * v1.4.2-snapshot2
     * v1.4.2-SNAPSHOT1
     * v1.4.1
     * v1.4.0
...

Search for field description

You can search the JSON schema for a field's description like this (in this example, the type field):

$ marathon-validate -a -d type
 --> Loading remote schema: https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/AppDefinition.json
 --> Found 2 matches for 'type':
     * '.container.type': Container engine type. Supported engine types at the moment are DOCKER and MESOS.
     * '.container.volumes.persistent.type': The type of mesos disk resource to use; defaults to root

By using the -a or -g flags, you can specify if you want to query the app or group JSON schema.

marathon-validate's People

Contributors

aem-zz avatar joerg84 avatar tobilg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

marathon-validate's Issues

Group json schema moved and changed to RAML

Hi @tobilg,

Thanks for this neat little tool, very handy. I noticed that the group type validation wasn't working so I dug in to what all changed. It looks like the Group json schema was removed from marathon at some point in favor of RAML type definition. I decided to see if I could get this library to work by parsing the group.raml but it is throwing RangeError: Maximum call stack size exceeded unless I increase my local stack size. Even after that it gets a segmentation fault error but I stopped digging in to it at that point. I will most likely open an issue with that team to dig deeper in to it.

Anyways, just wanted to let others know incase they run in to this as well. cheers.

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.