def list(cluster): with cluster: rows = [] for name, (configuration, stat) in administration.fetch_sets(cluster): rows.append(( name, configuration.database.dsn, FormattedSequence([t.name for t in configuration.tables]), administration.get_version(configuration), )) # TODO: Bring back pluggable formatters. click.echo(tabulate(sorted(rows), headers=('name', 'database', 'table', 'version')))
def inspect(cluster, name): with cluster: data, stat = cluster.zookeeper.get(cluster.get_set_path(name)) configuration = BinaryCodec(ReplicationSetConfiguration).decode(data) click.echo(TextCodec(ReplicationSetConfiguration).encode(configuration)) click.echo('version: %s' % (administration.get_version(configuration)), err=True)