Download the PHP package chapi/chapi-client without Composer

On this page you can find all versions of the php package chapi/chapi-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chapi-client

chapi Build Status Scrutinizer Code Quality Code Coverage

Chronos and marathon api client for your console.

Description

Manage your Chronos and Marathon tasks like a git repository in your console:

It is possible to use either of the systems independently or both at once.

Requirements

Installation / Configuration

To install chapi you can download the latest release or clone this repository. If you clone the repository you need to run a composer install to install all necessary dependencies:

Before you use chapi the first time you have to setup your chronos api url and the path to your local task repository. You can use the configure command to setup your global settings:

Configuration file locations

Chapi attempts to read a global and a local configuration file, at least one of which must exist. Should both files exist, values found in the local configuration override those defined in the global one.

The global configuration file's location is

The local configuration searched for in your current working directory.

Profiles

You can switch between different profiles by using the global --profile[=PROFILE] option.

If no profile is set chapi will use default as active profile.

Configuration file contents

Both configuration files are in the yaml format.

The configuration is located in the profiles property. There you will find the parameters for each set profile.

default will be used if you don't use a explicit profile.

chronos_url

The chronos api url (inclusive port). See also configure command option -u.

chronos_http_username

The chronos http username. See also configure command option -un.

Necessary if the setting --http_credentials is activated in your Chronos instance.

chronos_http_password

The chronos http password. See also configure command option -un.

Necessary if the setting --http_credentials is activated in your Chronos instance.

repository_dir

Root path to your job files. See also configure command option -r.

marathon_url

The marathon api url (inclusive port). See also configure command option -mu.

marathon_http_username

The marathon http username. See also configure command option -mun.

marathon_http_password

The marathon http password. See also configure command option -mp.

repository_dir_marathon

Root path to your tasks folder. See also configure command option -mr.

cache_dir

Path to cache directory. See also configure command option -d.

Update notes

v0.9.0

Because of the new marathon support with v0.9.0 you need to update your configurations. The parameters.yml structure changed and renamed to .chapiconfig.

You need to recreate your config settings:

Disabling services

To disable Chronos support and only use Marathon, set all the Chronos parameters to '':

Ignoring jobs

You can specify pattern for each profile in your .chapiconfig file(s) and add a file to your job repositories to untrack jobs you want chapi to ignore.

Example content:

Usage

list

Display your tasks and filter them by failed

Options:
  -f, --onlyFailed      Display only failed jobs
  -d, --onlyDisabled    Display only disabled jobs
  --profile[=PROFILE]  Use a specific profile from your config file.

info

Display your task information from remote system

Arguments:
  jobName               selected job

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

The task name in case of marathon would be the full id for the task.

status

Show the working tree status

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

diff

Show changes between tasks and working tree, etc

Arguments:
  jobName               Show changes for specific job

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

add

Add task contents to the index

Arguments:
  jobnames              Jobs to add to the index

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

reset

Remove tasks from the index

Arguments:
  jobnames              Jobs to add to the index

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

pull

Pull tasks from remote system and add them to local repository

Arguments:
  jobnames              Jobnames to pull

Options:
  -f, --force           Force to overwrite local jobs 
  --profile[=PROFILE]  Use a specific profile from your config file.

commit

Submit changes to chronos or marathon

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

scheduling

Display upcoming jobs in a specified timeframe

Options:
  -s, --starttime[=STARTTIME]  Start time to display the jobs
  -e, --endtime[=ENDTIME]      End time to display the jobs
  --profile[=PROFILE]  Use a specific profile from your config file.

Note: Not applicable to marathon

configure

Configure application and add necessary configs

Options:
  -u, --chronos_url[=CHRONOS_URL]        The chronos url (inclusive port)
  -un, --chronos_http_username[=CHRONOS_HTTP_USERNAME]  The chronos username (HTTP credentials) [default: ""]
  -p, --chronos_http_password[=CHRONOS_HTTP_PASSWORD]   The chronos password (HTTP credentials) [default: ""]
  -d, --cache_dir[=CACHE_DIR]            Path to cache directory
  -r, --repository_dir[=REPOSITORY_DIR]  Root path to your job files
  --profile[=PROFILE]  Use a specific profile from your config file.

validate

Validate local jobs

Arguments:
  jobmames              Jobs to validate

Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

Example workflows

Add a new job to chronos

A typical workflow to add a new cronjob to your Chronos server via chapi can be:

  1. A pull request for a new cronjob (json definition) comes in a git repository (created by a colleague of you)
  2. Accept the pull request and switch to your local clone via cd ~/my/clone
  3. Update your local repository via git pull
  4. Check the current status via chapi status
  5. Validate everything via chapi validate .
  6. Add the new job via chapi add jobXy
  7. Apply the changes and update the Chronos server via chapi commit

Move jobs from chronos cluster A to cluster B successively

Chapi is able to support you if you need to move your tasks from a chronos cluster to another one.

  1. Setup your normal chapi config and local job repository

  2. Create a new empty folder which stands for your second chronos cluster repository:

  3. Add a local .chapiconfig file (see configuration) to the new folder:

  4. Edit the file and add the chronos_url and repository_dir parameters for your second chronos cluster:

  5. Open a second console and switch to the new folder where the .chapiconfig file is located:

  6. Now you are able to move job for job from your normal repository to the new repository:

  7. Chapi in console 1 will delete the jobs from the "old" cluster and chapi in the second console 2 will add the moved jobs to the new one.

Supported commands for either system

chronos marathon
list :white_check_mark: :white_check_mark:
info :white_check_mark: :white_check_mark:
status :white_check_mark: :white_check_mark:
diff :white_check_mark: :white_check_mark:
add :white_check_mark: :white_check_mark:
reset :white_check_mark: :white_check_mark:
pull :white_check_mark: :white_check_mark:
commit :white_check_mark: :white_check_mark:
scheduling :white_check_mark: n.a.
configure :white_check_mark: :white_check_mark:
validate :white_check_mark:

Special cases in marathon:

If you find any further issues or edge case, please create an issue.

Supported Chronos versions

Supported Marathon versions

Docker

You can run chapi also in a docker container. You will find the laster releases under dockerhub.

Prepare a config file for docker

Create a .chapiconfig_docker file with the following content:

Run docker

Run docker for development

Todos:

Marathon


All versions of chapi-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
symfony/console Version ~3.0
symfony/dependency-injection Version ~3.0
symfony/yaml Version ~3.0
symfony/filesystem Version ~3.0
symfony/config Version ~3.0
symfony/monolog-bridge Version ~3.0
symfony/event-dispatcher Version ~3.0
doctrine/cache Version ~1.6
guzzlehttp/guzzle Version ~6.2
psr/log Version ~1.0
webmozart/glob Version ~4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chapi/chapi-client contains the following files

Loading the files please wait ....