Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reorganize cli tools and introduce riak-cs-admin #839

Merged
merged 1 commit into from
May 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
reorganize cli tools and introduce riak-cs-admin
  • Loading branch information
ksauzz committed May 14, 2014
commit 4fb05035de99986cc73cb0cdd13a06f8f143215a
4 changes: 2 additions & 2 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ case UseEEDeps of
{package_install_user, \"riakcs\"}.
{package_install_group, \"riak\"}.
{package_install_user_desc, \"Riak CS user\"}.
{package_commands, {list, [[{name, \"riak-cs\"}], [{name, \"riak-cs-access\"}], [{name, \"riak-cs-gc\"}], [{name, \"riak-cs-storage\"}], [{name, \"riak-cs-stanchion\"}], [{name, \"riak-cs-cinfo\"}], [{name, \"riak-cs-debug\"}]]}}.
{package_commands, {list, [[{name, \"riak-cs\"}], [{name, \"riak-cs-access\"}], [{name, \"riak-cs-gc\"}], [{name, \"riak-cs-storage\"}], [{name, \"riak-cs-stanchion\"}], [{name, \"riak-cs-debug\"}], [{name, \"riak-cs-admin\"}]]}}.
{package_shortdesc, \"Riak CS\"}.
{package_patch_dir, \"basho-patches\"}.
{package_desc, \"Riak CS\"}.
Expand Down Expand Up @@ -61,7 +61,7 @@ case UseEEDeps of
{package_install_user, \"riakcs\"}.
{package_install_group, \"riak\"}.
{package_install_user_desc, \"Riak CS user\"}.
{package_commands, {list, [[{name, \"riak-cs\"}], [{name, \"riak-cs-access\"}], [{name, \"riak-cs-gc\"}], [{name, \"riak-cs-storage\"}], [{name, \"riak-cs-stanchion\"}], [{name, \"riak-cs-cinfo\"}], [{name, \"riak-cs-debug\"}]]}}.
{package_commands, {list, [[{name, \"riak-cs\"}], [{name, \"riak-cs-access\"}], [{name, \"riak-cs-gc\"}], [{name, \"riak-cs-storage\"}], [{name, \"riak-cs-stanchion\"}], [{name, \"riak-cs-debug\"}], [{name, \"riak-cs-admin\"}]]}}.
{package_shortdesc, \"Riak CS\"}.
{package_patch_dir, \"basho-patches\"}.
{package_desc, \"Riak CS\"}.
Expand Down
25 changes: 1 addition & 24 deletions rel/files/riak-cs-access
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
#!/bin/sh

# Pull environment for this install
. "{{runner_base_dir}}/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user $@

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Check the first argument for instructions
case "$1" in
flush)
# Make sure the local node IS running
node_up_check

shift

$NODETOOL rpc riak_cs_access_console flush $@
;;
*)
echo "Usage: $SCRIPT { flush }"
exit 1
;;
esac
{{runner_script_dir}}/riak-cs-admin access "$@"
100 changes: 100 additions & 0 deletions rel/files/riak-cs-admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/sh
# -*- tab-width:4;indent-tabs-mode:nil -*-
# ex: ts=4 sw=4 et

# Pull environment for this install
. "{{runner_base_dir}}/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user "$@"

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Identify the script name
SCRIPT=`basename $0`

usage() {
echo "Usage: $SCRIPT { gc | access | storage | stanchion | cluster-info }"
}

# Check the first argument for instructions
case "$1" in
gc)
shift
case "$1" in
batch|status|pause|resume|cancel|set-interval|set-leeway)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_gc_console "$@"
;;
*)
echo "Usage: $SCRIPT gc { batch [<leeway_seconds>] | status | pause | resume | cancel |"
echo " set-interval <interval_seconds> | set-leeway <leeway_seconds> }"
exit 1
;;
esac
;;
storage)
shift
case "$1" in
batch|status|pause|resume|cancel)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_storage_console "$@"
;;
*)
echo "Usage: $SCRIPT storage $1 { batch | status | pause | resume | cancel }"
exit 1
;;
esac
;;
access)
shift
case "$1" in
flush)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_access_console flush "$@"
;;
*)
echo "Usage: $SCRIPT access $1 { flush }"
exit 1
;;
esac
;;
stanchion)
shift
case "$1" in
switch|show)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_stanchion_console "$@"
;;
*)
echo "Usage: $SCRIPT stanchion $1 { switch HOST PORT | show }"
exit 1
;;
esac
;;
cluster[_-]info)
if [ $# -lt 2 ]; then
echo "Usage: $SCRIPT $1 <output_file>"
exit 1
fi
shift

# Make sure the local node is running
node_up_check

$NODETOOL rpc_infinity riak_cs_console cluster_info "$@"
;;
*)
usage
exit 1
;;
esac
30 changes: 0 additions & 30 deletions rel/files/riak-cs-cinfo

This file was deleted.

6 changes: 3 additions & 3 deletions rel/files/riak-cs-debug
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,13 @@ if [ 1 -eq $get_riakcmds ]; then

dump riak_cs_ping "$cs_bin_dir"/riak-cs ping
dump riak_cs_version "$cs_bin_dir"/riak-cs version
dump riak_cs_gc_status "$cs_bin_dir"/riak-cs-gc status
dump riak_cs_storage_status "$cs_bin_dir"/riak-cs-storage status
dump riak_cs_gc_status "$cs_bin_dir"/riak-cs-admin gc status
dump riak_cs_storage_status "$cs_bin_dir"/riak-cs-admin storage status

CI=`pwd`/cluster-info.html
touch $CI
chmod 666 $CI
dump cluster-info "$cs_bin_dir"/riak-cs-cinfo $CI
dump cluster-info "$cs_bin_dir"/riak-cs-admin cluster-info $CI
chmod 444 $CI
fi

Expand Down
24 changes: 1 addition & 23 deletions rel/files/riak-cs-gc
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
#!/bin/sh

# Pull environment for this install
. "{{runner_base_dir}}/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user $@

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Check the first argument for instructions
case "$1" in
batch|status|pause|resume|cancel|set-interval|set-leeway)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_gc_console $@
;;
*)
echo "Usage: $SCRIPT { batch [<leeway_seconds>]|status|pause|resume|cancel|" \
"set-interval <interval_seconds>|set-leeway <leeway_seconds> }"
exit 1
;;
esac
{{runner_script_dir}}/riak-cs-admin gc "$@"
23 changes: 1 addition & 22 deletions rel/files/riak-cs-stanchion
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
#!/bin/sh

# Pull environment for this install
. "{{runner_base_dir}}/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user $@

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Check the first argument for instructions
case "$1" in
switch|show)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_stanchion_console $@
;;
*)
echo "Usage: $SCRIPT { switch HOST PORT | show }"
exit 1
;;
esac
{{runner_script_dir}}/riak-cs-admin stanchion "$@"
23 changes: 1 addition & 22 deletions rel/files/riak-cs-storage
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
#!/bin/sh

# Pull environment for this install
. "{{runner_base_dir}}/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user $@

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Check the first argument for instructions
case "$1" in
batch|status|pause|resume|cancel)
# Make sure the local node IS running
node_up_check

$NODETOOL rpc riak_cs_storage_console $@
;;
*)
echo "Usage: $SCRIPT { batch|status|pause|resume|cancel }"
exit 1
;;
esac
{{runner_script_dir}}/riak-cs-admin storage "$@"
2 changes: 1 addition & 1 deletion rel/reltool.config
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
{template, "files/riak-cs-storage", "bin/riak-cs-storage"},
{template, "files/riak-cs-gc", "bin/riak-cs-gc"},
{template, "files/riak-cs-stanchion", "bin/riak-cs-stanchion"},
{template, "files/riak-cs-cinfo", "bin/riak-cs-cinfo"},
{template, "files/riak-cs-debug", "bin/riak-cs-debug"},
{template, "files/riak-cs-admin", "bin/riak-cs-admin"},
{mkdir, "lib/basho-patches"}
]}.