tucked / yaas

Yet Another Ambari Shell
MIT License
0 stars 2 forks source link

yaas

Yet Another Ambari Shell

Installation

pip install yaas

Usage

env YAAS_SERVER=ambari.example.com yaas [options] [command options [...]]

Global Options

Commands

All API commands require setting these environment variables:

$ export YAAS_SERVER=ambari.example.com
$ yaas ...
$ env YAAS_SERVER=ambari.example.com yaas ...

blueprint

add

POST /api/v1/blueprints/:name

Store a blueprint on YAAS_SERVER.

$ yaas blueprint add blueprint1.json blueprint2.json
$ cat blueprint3.json | yaas blueprint add
Options
list

GET /api/v1/blueprints

Show blueprints that are stored on YAAS_SERVER.

$ yaas blueprint list
blueprint1
blueprint2
blueprint3
Options
show

GET /api/v1/blueprints/:name

Show details about a blueprint stored on YAAS_SERVER.

$ yaas blueprint show blueprint1
remove

DELETE /api/v1/blueprints/:name

Remove a blueprint stored on YAAS_SERVER.

$ yaas blueprint remove blueprint2
$ yaas blueprint list
blueprint1
blueprint3

cluster

create
$ yaas cluster create cluster1 --template=template1.json
$ cat template2.json | yaas cluster create cluster2
$ yaas cluster create cluster3
Options
list
$ yaas cluster list
cluster1
cluster2
cluster3
show
$ yaas cluster show cluster1 --format=blueprint > blueprint1.json
$ yaas cluster show cluster2
...
Options
destroy
$ yaas cluster destroy cluster2
$ yaas cluster list
cluster1
cluster3

host

list

GET /api/v1/hosts

Show hosts that are registered with YAAS_SERVER.

$ yaas host list
host1.example.com - cluster1
host2.example.com - cluster1
host3.example.com
Options
show
$ yaas host show [--hardware] host1.example.com host2.example.com ...
...
Options

repo

add
$ yaas repo add [--verify-baseurls=true] repo.json
list

See all configured repository URLs. Limit output by one or more of these parameters. Note that stack-version and stack-version must be specified together:

$ yaas repo list
HDP-2.2
  redhat5
    HDP: http://www.example.com/redhat5/HDP
    HDP-UTILS: http://www.example.com/redhat5/HDP
  redhat6
    HDP: http://www.example.com/redhat6/HDP
    HDP-UTILS: http://www.example.com/redhat6/HDP-UTILS-1.1.0.20
  ...
$ yaas repo list --stack-name=HDP --stack-version=2.2 --repo-name=HDP-UTILS
redhat5
  HDP: http://www.example.com/redhat5/HDP-UTILS
redhat6
  HDP: http://www.example.com/redhat6/HDP-UTILS
...
$ yaas repo list --stack-name=HDP --stack-version=2.2 --os-type=redhat6 --repo-name=HDP
http://www.example.com/redhat6/HDP
set
$ yaas repo set [--verify-baseurls=true] repo-changed.json
remove
$ yaas repo remove HDP 2.2

template

create
$ yaas template create [--blueprint=blueprint1] [--host_group=host1.example.com ...] > template1.json
$ cat clueprint2.json | yaas template create [--host_group=host1.example.com ...] > template2.json
WARNING: You have not specified enough hosts to satisfy the blueprint.