dcos-labs/marathon-validate

Name: marathon-validate

Owner: DC/OS Labs

Description: A tiny command line tool to validate application or group configuration files for Marathon

Created: 2016-06-16 19:09:03.0

Updated: 2017-12-01 09:48:20.0

Pushed: 2017-05-08 12:37:44.0

Homepage: null

Size: 16

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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

install -g marathon-validate

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

rathon-validate --version
3
Usage
rathon-validate --help

age: marathon-validate [options] <file>

tions:

-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

rathon-validate -a application.json

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

rathon-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):

rathon-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):

rathon-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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.