Skip to content

Instantly share code, notes, and snippets.

@krisis
Last active March 28, 2017 08:48
Show Gist options
  • Save krisis/98f4171e12bed9e9c022cd79b74db754 to your computer and use it in GitHub Desktop.
Save krisis/98f4171e12bed9e9c022cd79b74db754 to your computer and use it in GitHub Desktop.
Proposal for `mc admin` subcommands

Modified proposal after comments

  1. mc admin service { start | restart } ALIAS

    • remains as is
  2. mc admin info ALIAS

    • remains as is
  3. mc admin credentials [access_key] [secret_key] ALIAS

    • renamed from password
    • if keys are not supplied returns currently used keys for server
    • use creds a command alias.
  4. mc admin config { get | set } ALIAS

    • remains as is
  5. mc admin heal [--fake] ALIAS/PATH

    • remove list; use --fake to achieve the same
  6. mc admin locks { list | clear --force} ALIAS/PATH

    • added --force to avoid accidental clearing of locks
    • similar to mc rm -r --force in principle

Summary of changes

tl;dr

  1. mc admin service info
  • Previously, mc admin info
  1. mc admin credentials access_key secret_key ALIAS
  • Previously, mc admin password ALIAS access_key secret_key.
  • credentials is how we refer to access_key, secret_key pair in docs and code.
  1. We can hide mc admin locks from usage text of mc admin.
  • Not recommended usually (or lightly).
  • Meant only for dire situations where the consequences are well understood.

Proposed command structure

A consistent command structure allows users to guess command arguments without looking up documentation.

mc admin COMMAND [OPTIONS] { SUBCOMMAND1 | SUBCOMMAND2 } ALIAS
  1. mc admin service {info | status | restart} ALIAS
  • Moved info under service subcommand.
  1. mc admin credentials access_key secret_key ALIAS
  • Changed the order of arguments to keep ALIAS at the end
  • To be consistent with other commands (incl. non-admin subcommands).
  1. mc admin config {get | set} ALIAS
  • Same as now
  1. mc admin heal [--fake] ALIAS/PATH
  • As suggested in #general discussion
@vadmeste
Copy link

  1. I suggest to hide lock command
  2. Change password name to credentials

@krisis
Copy link
Author

krisis commented Mar 28, 2017

Comments from discussion on #general with AB.

  • Remove period at the end of usage message for commands
  • s/"info Get information of a Minio server"/"info Get minio server information"
  • mc admin creds [ak] [sk] ALIAS - if you only give server, it shows what the keys are, if not you can set it
  • Next we can look at mc admin stats
    • some of the internal instrumentation for detecting leaks will be useful here.
    • can also show network and disk throughput. We can run a fast benchmark (server side)
    • we can also break them into smaller commands like
      mc admin perf
      mc admin stat
      mc admin diag
    
    • perf | bench; benchmark (alias bench), perf is also good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment