2010-07-08 08:16:13 +00:00
|
|
|
/*
|
2012-09-11 16:34:54 +05:30
|
|
|
Copyright (c) 2006-2012 Red Hat, Inc. <http://www.redhat.com>
|
|
|
|
|
This file is part of GlusterFS.
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2012-09-11 16:34:54 +05:30
|
|
|
This file is licensed to you under your choice of the GNU Lesser
|
|
|
|
|
General Public License, version 3 or any later version (LGPLv3 or
|
|
|
|
|
later), or the GNU General Public License, version 2 (GPLv2), in all
|
|
|
|
|
cases as published by the Free Software Foundation.
|
2010-07-08 08:16:13 +00:00
|
|
|
*/
|
|
|
|
|
#ifndef __CLI_H__
|
|
|
|
|
#define __CLI_H__
|
|
|
|
|
|
|
|
|
|
#include "rpc-clnt.h"
|
2018-11-29 14:08:06 -05:00
|
|
|
#include <glusterfs/quota-common-utils.h>
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2012-09-06 13:08:00 +05:30
|
|
|
#include "cli1-xdr.h"
|
|
|
|
|
|
2012-03-05 19:04:49 +05:30
|
|
|
#if (HAVE_LIB_XML)
|
|
|
|
|
#include <libxml/encoding.h>
|
|
|
|
|
#include <libxml/xmlwriter.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
#define DEFAULT_EVENT_POOL_SIZE 16384
|
|
|
|
|
#define CLI_GLUSTERD_PORT 24007
|
|
|
|
|
#define DEFAULT_CLI_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
|
|
|
|
|
#define CLI_VOL_STATUS_BRICK_LEN 43
|
|
|
|
|
#define CLI_TAB_LENGTH 8
|
|
|
|
|
#define CLI_BRICK_STATUS_LINE_LEN 78
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2020-11-02 11:18:01 +05:30
|
|
|
// Quotad pid path.
|
|
|
|
|
#define QUOTAD_PID_PATH "/var/run/gluster/quotad/quotad.pid"
|
|
|
|
|
|
2014-11-26 12:35:23 +05:30
|
|
|
/* Geo-rep command positional arguments' index */
|
2018-09-12 17:22:48 +05:30
|
|
|
#define GEO_REP_CMD_INDEX 1
|
|
|
|
|
#define GEO_REP_CMD_CONFIG_INDEX 4
|
2014-11-26 12:35:23 +05:30
|
|
|
|
2021-10-27 10:14:52 +03:00
|
|
|
/* Default RPC call timeout, in seconds. */
|
|
|
|
|
#define CLI_DEFAULT_CONN_TIMEOUT 120
|
|
|
|
|
|
|
|
|
|
/* Special timeout for volume profile, volume
|
|
|
|
|
heal and ganesha RPC calls, in seconds. */
|
|
|
|
|
#define CLI_TEN_MINUTES_TIMEOUT 600
|
|
|
|
|
|
2010-07-08 08:16:13 +00:00
|
|
|
enum argp_option_keys {
|
2018-09-12 17:22:48 +05:30
|
|
|
ARGP_DEBUG_KEY = 133,
|
|
|
|
|
ARGP_PORT_KEY = 'p',
|
2010-07-08 08:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
2015-09-10 20:15:35 +05:30
|
|
|
typedef enum {
|
2018-09-12 17:22:48 +05:30
|
|
|
COLD_BRICK_COUNT,
|
|
|
|
|
COLD_TYPE,
|
|
|
|
|
COLD_DIST_COUNT,
|
|
|
|
|
COLD_REPLICA_COUNT,
|
|
|
|
|
COLD_ARBITER_COUNT,
|
|
|
|
|
COLD_DISPERSE_COUNT,
|
|
|
|
|
COLD_REDUNDANCY_COUNT,
|
|
|
|
|
HOT_BRICK_COUNT,
|
|
|
|
|
HOT_TYPE,
|
|
|
|
|
HOT_REPLICA_COUNT,
|
|
|
|
|
MAX
|
2015-09-10 20:15:35 +05:30
|
|
|
} values;
|
|
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
#define GLUSTER_MODE_SCRIPT (1 << 0)
|
|
|
|
|
#define GLUSTER_MODE_ERR_FATAL (1 << 1)
|
|
|
|
|
#define GLUSTER_MODE_XML (1 << 2)
|
|
|
|
|
#define GLUSTER_MODE_WIGNORE (1 << 3)
|
|
|
|
|
#define GLUSTER_MODE_WIGNORE_PARTITION (1 << 4)
|
2018-10-26 17:51:38 +05:30
|
|
|
#define GLUSTER_MODE_GLFSHEAL_NOLOG (1 << 5)
|
2013-11-14 17:05:26 +05:30
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
#define GLUSTERD_GET_QUOTA_LIST_MOUNT_PATH(abspath, volname, path) \
|
|
|
|
|
do { \
|
|
|
|
|
snprintf(abspath, sizeof(abspath) - 1, \
|
|
|
|
|
DEFAULT_VAR_RUN_DIRECTORY "/%s_quota_list%s", volname, path); \
|
|
|
|
|
} while (0)
|
2013-11-25 15:16:23 +05:30
|
|
|
|
2010-07-08 08:16:13 +00:00
|
|
|
struct cli_state;
|
|
|
|
|
struct cli_cmd_word;
|
|
|
|
|
struct cli_cmd_tree;
|
2011-04-21 06:55:44 +00:00
|
|
|
struct cli_cmd;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2012-09-06 13:08:00 +05:30
|
|
|
extern char *cli_vol_status_str[];
|
2013-08-30 14:37:03 +05:30
|
|
|
extern char *cli_vol_task_status_str[];
|
2012-09-06 13:08:00 +05:30
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
typedef int(cli_cmd_cbk_t)(struct cli_state *state, struct cli_cmd_word *word,
|
|
|
|
|
const char **words, int wordcount);
|
|
|
|
|
typedef void(cli_cmd_reg_cbk_t)(struct cli_cmd *this);
|
2011-04-21 06:55:44 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
typedef int(cli_cmd_match_t)(struct cli_cmd_word *word);
|
|
|
|
|
typedef int(cli_cmd_filler_t)(struct cli_cmd_word *word);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
|
|
|
|
struct cli_cmd_word {
|
2018-09-12 17:22:48 +05:30
|
|
|
struct cli_cmd_tree *tree;
|
|
|
|
|
const char *word;
|
|
|
|
|
cli_cmd_filler_t *filler;
|
|
|
|
|
cli_cmd_match_t *match;
|
|
|
|
|
cli_cmd_cbk_t *cbkfn;
|
|
|
|
|
const char *desc;
|
|
|
|
|
const char *pattern;
|
|
|
|
|
int nextwords_cnt;
|
|
|
|
|
struct cli_cmd_word **nextwords;
|
2010-07-08 08:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct cli_cmd_tree {
|
2018-09-12 17:22:48 +05:30
|
|
|
struct cli_state *state;
|
|
|
|
|
struct cli_cmd_word root;
|
2010-07-08 08:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct cli_state {
|
2018-09-12 17:22:48 +05:30
|
|
|
int argc;
|
|
|
|
|
char **argv;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
char debug;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
/* for events dispatching */
|
|
|
|
|
glusterfs_ctx_t *ctx;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2021-09-22 13:34:10 +03:00
|
|
|
/* Client to perform RPC calls to glusterd. */
|
|
|
|
|
struct rpc_clnt *rpc;
|
|
|
|
|
|
|
|
|
|
/* Client to perform RPC calls to quotad.
|
|
|
|
|
May be NULL if quotad is not running. */
|
|
|
|
|
struct rpc_clnt *quotad_rpc;
|
|
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
/* registry of known commands */
|
|
|
|
|
struct cli_cmd_tree tree;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
/* the thread which "executes" the command in non-interactive mode */
|
|
|
|
|
/* also the thread which reads from stdin in non-readline mode */
|
|
|
|
|
pthread_t input;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
/* terminal I/O */
|
|
|
|
|
const char *prompt;
|
|
|
|
|
int rl_enabled;
|
|
|
|
|
int rl_async;
|
|
|
|
|
int rl_processing;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
/* autocompletion state */
|
|
|
|
|
char **matches;
|
|
|
|
|
char **matchesp;
|
2010-07-09 03:14:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
char *remote_host;
|
|
|
|
|
int remote_port;
|
|
|
|
|
int mode;
|
2023-03-21 06:59:52 +05:30
|
|
|
time_t await_connected;
|
2011-07-23 12:16:07 +02:00
|
|
|
|
2021-10-27 10:14:52 +03:00
|
|
|
time_t default_conn_timeout;
|
|
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
char *log_file;
|
|
|
|
|
gf_loglevel_t log_level;
|
cli,glusterd: Changes to cli-glusterd communication
Glusterd changes:
With this patch, glusterd creates a socket file in
DATADIR/run/glusterd.socket , and listen on it for cli requests. It
listens for 2 rpc programs on the socket file,
- The glusterd cli rpc program, for all cli commands
- A reduced glusterd handshake program, just for the 'system:: getspec'
command
The location of the socket file can be changed with the glusterd option
'glusterd-sockfile'.
To retain compatibility with the '--remote-host' cli option, glusterd
also listens for the cli requests on port 24007. But, for the sake of
security, it listens using a reduced cli rpc program on the port. The
reduced rpc program only contains read-only procs used for 'volume
(info|list|status)', 'peer status' and 'system:: getwd' cli commands.
CLI changes:
The gluster cli now uses the glusterd socket file for communicating with
glusterd by default. A new option '--gluster-sock' has been added to
allow specifying the sockfile used to connect. Using the '--remote-host'
option will make cli connect to the given host & port.
Tests changes:
cluster.rc has been modified to make use of socket files and use
different log files for each glusterd.
Some of the tests using cluster.rc have been fixed.
Change-Id: Iaf24bc22f42f8014a5fa300ce37c7fc9b1b92b53
BUG: 980754
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5280
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-07-03 16:31:22 +05:30
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
char *glusterd_sock;
|
2019-03-14 20:06:54 +05:30
|
|
|
char *address_family;
|
2010-07-08 08:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
2010-07-25 00:38:01 +00:00
|
|
|
struct cli_local {
|
2018-09-12 17:22:48 +05:30
|
|
|
struct {
|
|
|
|
|
char *volname;
|
|
|
|
|
int flags;
|
|
|
|
|
} get_vol;
|
|
|
|
|
|
|
|
|
|
dict_t *dict;
|
|
|
|
|
const char **words;
|
|
|
|
|
/* Marker for volume status all */
|
|
|
|
|
gf_boolean_t all;
|
2012-03-05 19:04:49 +05:30
|
|
|
#if (HAVE_LIB_XML)
|
2018-09-12 17:22:48 +05:30
|
|
|
xmlTextWriterPtr writer;
|
|
|
|
|
xmlDocPtr doc;
|
|
|
|
|
int vol_count;
|
2012-03-05 19:04:49 +05:30
|
|
|
#endif
|
2018-09-12 17:22:48 +05:30
|
|
|
gf_lock_t lock;
|
|
|
|
|
struct list_head dict_list;
|
2010-07-25 00:38:01 +00:00
|
|
|
};
|
|
|
|
|
|
2011-12-07 20:51:03 +05:30
|
|
|
struct cli_volume_status {
|
2018-09-12 17:22:48 +05:30
|
|
|
int port;
|
|
|
|
|
int rdma_port;
|
|
|
|
|
int online;
|
|
|
|
|
uint64_t block_size;
|
|
|
|
|
uint64_t total_inodes;
|
|
|
|
|
uint64_t free_inodes;
|
|
|
|
|
char *brick;
|
|
|
|
|
char *pid_str;
|
|
|
|
|
char *free;
|
|
|
|
|
char *total;
|
|
|
|
|
char *fs_name;
|
|
|
|
|
char *mount_options;
|
|
|
|
|
char *device;
|
|
|
|
|
char *inode_size;
|
2011-12-07 20:51:03 +05:30
|
|
|
};
|
|
|
|
|
|
2014-02-19 16:30:11 +05:30
|
|
|
struct snap_config_opt_vals_ {
|
2018-09-12 17:22:48 +05:30
|
|
|
char *op_name;
|
|
|
|
|
char *question;
|
2014-02-19 16:30:11 +05:30
|
|
|
};
|
|
|
|
|
|
2011-12-07 20:51:03 +05:30
|
|
|
typedef struct cli_volume_status cli_volume_status_t;
|
|
|
|
|
|
2010-07-25 00:38:01 +00:00
|
|
|
typedef struct cli_local cli_local_t;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2021-09-04 10:41:35 +03:00
|
|
|
typedef struct cli_state cli_state_t;
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2021-09-04 10:41:35 +03:00
|
|
|
typedef ssize_t (*cli_serialize_t)(struct iovec outmsg, void *args);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2020-07-06 16:19:08 -04:00
|
|
|
extern rpc_clnt_prog_t *cli_rpc_prog;
|
|
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
typedef const char *(*cli_selector_t)(void *wcon);
|
2011-05-11 02:39:14 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
void *
|
|
|
|
|
cli_getunamb(const char *tok, void **choices, cli_selector_t sel);
|
2011-05-11 02:39:14 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
int
|
|
|
|
|
cli_cmd_register(struct cli_cmd_tree *tree, struct cli_cmd *cmd);
|
|
|
|
|
int
|
|
|
|
|
cli_cmds_register(struct cli_state *state);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
int
|
|
|
|
|
cli_input_init(struct cli_state *state);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
int
|
|
|
|
|
cli_cmd_process(struct cli_state *state, int argc, char *argv[]);
|
|
|
|
|
int
|
|
|
|
|
cli_cmd_process_line(struct cli_state *state, const char *line);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
int
|
|
|
|
|
cli_rl_enable(struct cli_state *state);
|
|
|
|
|
int
|
|
|
|
|
cli_rl_out(struct cli_state *state, const char *fmt, va_list ap);
|
|
|
|
|
int
|
|
|
|
|
cli_rl_err(struct cli_state *state, const char *fmt, va_list ap);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
int
|
|
|
|
|
cli_usage_out(const char *usage);
|
2011-05-25 05:14:25 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
int
|
|
|
|
|
_cli_out(const char *fmt, ...);
|
|
|
|
|
int
|
|
|
|
|
_cli_err(const char *fmt, ...);
|
2011-05-25 05:14:25 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
#define cli_out(fmt...) \
|
|
|
|
|
do { \
|
|
|
|
|
FMT_WARN(fmt); \
|
|
|
|
|
\
|
|
|
|
|
_cli_out(fmt); \
|
|
|
|
|
\
|
|
|
|
|
} while (0)
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
#define cli_err(fmt...) \
|
|
|
|
|
do { \
|
|
|
|
|
FMT_WARN(fmt); \
|
|
|
|
|
\
|
|
|
|
|
_cli_err(fmt); \
|
|
|
|
|
\
|
2018-11-21 16:13:36 +05:30
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
#define usage() \
|
|
|
|
|
do { \
|
|
|
|
|
cli_out( \
|
|
|
|
|
" Usage: gluster [options] <help> <peer>" \
|
|
|
|
|
" <pool> <volume>\n" \
|
|
|
|
|
" Options:\n" \
|
|
|
|
|
" --help Shows the help information\n" \
|
|
|
|
|
" --version Shows the version\n" \
|
|
|
|
|
" --print-logdir Shows the log directory\n" \
|
|
|
|
|
" --print-statedumpdir Shows the state dump directory\n"); \
|
|
|
|
|
\
|
2018-09-12 17:22:48 +05:30
|
|
|
} while (0)
|
2012-04-23 11:11:43 +05:30
|
|
|
|
2010-07-08 08:16:13 +00:00
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_submit_request(struct rpc_clnt *rpc, void *req, call_frame_t *frame,
|
2022-04-13 18:33:36 +03:00
|
|
|
rpc_clnt_prog_t *prog, int procnum, xlator_t *this,
|
|
|
|
|
fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
|
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_create_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **options, char **bricks);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2010-10-03 02:41:29 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_reset_parse(const char **words, int wordcount, dict_t **opt);
|
2010-10-03 02:41:29 +00:00
|
|
|
|
2011-02-10 05:29:34 +00:00
|
|
|
int32_t
|
2019-07-31 11:34:19 +05:30
|
|
|
cli_cmd_gsync_set_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **opt, char **errstr);
|
2011-02-10 05:29:34 +00:00
|
|
|
|
2011-03-15 05:36:18 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_quota_parse(const char **words, int wordcount, dict_t **opt);
|
2015-03-10 15:04:59 +05:30
|
|
|
|
2015-04-30 16:50:47 +05:30
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_inode_quota_parse(const char **words, int wordcount, dict_t **opt);
|
2015-04-30 16:50:47 +05:30
|
|
|
|
2015-03-10 15:04:59 +05:30
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_bitrot_parse(const char **words, int wordcount, dict_t **opt);
|
2011-03-15 05:36:18 +00:00
|
|
|
|
2010-07-08 08:16:13 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_set_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **options, char **op_errstr);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
2017-10-16 14:24:29 +05:30
|
|
|
int32_t
|
|
|
|
|
cli_cmd_ganesha_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **options, char **op_errstr);
|
|
|
|
|
|
glusterd/cli: cli to get local state representation from glusterd
Currently there is no existing CLI that can be used to get the
local state representation of the cluster as maintained in glusterd
in a readable as well as parseable format.
The CLI added has the following usage:
# gluster get-state [daemon] [odir <path/to/output/dir>] [file <filename>]
This would dump data points that reflect the local state
representation of the cluster as maintained in glusterd (no other
daemons are supported as of now) to a file inside the specified
output directory. The default output directory and filename is
/var/run/gluster and glusterd_state_<timestamp> respectively. The
option for specifying the daemon name leaves room to add support for
other daemons in the future. Following are the data points captured
as of now to represent the state from the local glusterd pov:
* Peer:
- Primary hostname
- uuid
- state
- connection status
- List of hostnames
* Volumes:
- name, id, transport type, status
- counts: bricks, snap, subvol, stripe, arbiter, disperse,
redundancy
- snapd status
- quorum status
- tiering related information
- rebalance status
- replace bricks status
- snapshots
* Bricks:
- Path, hostname (for all bricks these info will be shown)
- port, rdma port, status, mount options, filesystem type and
signed in status for bricks running locally.
* Services:
- name, online status for initialised services
* Others:
- Base port, last allocated port
- op-version
- MYUUID
Change-Id: I4a45cc5407ab92d8afdbbd2098ece851f7e3d618
BUG: 1353156
Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
Reviewed-on: http://review.gluster.org/14873
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
2016-07-07 20:33:02 +05:30
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_get_state_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **options, char **op_errstr);
|
glusterd/cli: cli to get local state representation from glusterd
Currently there is no existing CLI that can be used to get the
local state representation of the cluster as maintained in glusterd
in a readable as well as parseable format.
The CLI added has the following usage:
# gluster get-state [daemon] [odir <path/to/output/dir>] [file <filename>]
This would dump data points that reflect the local state
representation of the cluster as maintained in glusterd (no other
daemons are supported as of now) to a file inside the specified
output directory. The default output directory and filename is
/var/run/gluster and glusterd_state_<timestamp> respectively. The
option for specifying the daemon name leaves room to add support for
other daemons in the future. Following are the data points captured
as of now to represent the state from the local glusterd pov:
* Peer:
- Primary hostname
- uuid
- state
- connection status
- List of hostnames
* Volumes:
- name, id, transport type, status
- counts: bricks, snap, subvol, stripe, arbiter, disperse,
redundancy
- snapd status
- quorum status
- tiering related information
- rebalance status
- replace bricks status
- snapshots
* Bricks:
- Path, hostname (for all bricks these info will be shown)
- port, rdma port, status, mount options, filesystem type and
signed in status for bricks running locally.
* Services:
- name, online status for initialised services
* Others:
- Base port, last allocated port
- op-version
- MYUUID
Change-Id: I4a45cc5407ab92d8afdbbd2098ece851f7e3d618
BUG: 1353156
Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
Reviewed-on: http://review.gluster.org/14873
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
2016-07-07 20:33:02 +05:30
|
|
|
|
2010-07-08 08:16:13 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_add_brick_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **options, int *type);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
|
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_remove_brick_parse(struct cli_state *state, const char **words,
|
|
|
|
|
int wordcount, dict_t **options,
|
|
|
|
|
int *question, int *brick_count,
|
|
|
|
|
int32_t *command);
|
2010-07-08 08:16:13 +00:00
|
|
|
|
|
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_replace_brick_parse(const char **words, int wordcount,
|
2010-07-08 08:16:13 +00:00
|
|
|
dict_t **options);
|
2010-07-25 00:38:01 +00:00
|
|
|
|
2016-08-22 13:22:03 -04:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_reset_brick_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2016-08-22 13:22:03 -04:00
|
|
|
|
2010-08-31 07:51:14 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_log_rotate_parse(const char **words, int wordcount, dict_t **options);
|
2010-08-31 07:51:14 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_log_locate_parse(const char **words, int wordcount, dict_t **options);
|
2010-08-31 07:51:14 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_log_filename_parse(const char **words, int wordcount, dict_t **options);
|
2010-08-31 07:51:14 +00:00
|
|
|
|
2011-09-05 14:33:43 +05:30
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_statedump_options_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2011-12-24 13:49:52 +05:30
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_clrlks_opts_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2011-09-05 14:33:43 +05:30
|
|
|
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_local_t *
|
2022-10-28 09:15:52 -04:00
|
|
|
cli_local_get(void);
|
2010-07-26 12:10:08 +00:00
|
|
|
|
2010-08-16 02:35:40 +00:00
|
|
|
void
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_local_wipe(cli_local_t *local);
|
2010-08-16 02:35:40 +00:00
|
|
|
|
2020-06-16 14:45:03 +03:00
|
|
|
gf_boolean_t
|
2022-10-28 09:15:52 -04:00
|
|
|
cli_cmd_connected(void);
|
2020-06-16 14:45:03 +03:00
|
|
|
|
2010-07-26 12:10:08 +00:00
|
|
|
int32_t
|
2023-04-05 19:24:15 +05:30
|
|
|
cli_cmd_await_connected(time_t timeout);
|
2010-07-26 12:10:08 +00:00
|
|
|
|
|
|
|
|
int32_t
|
2020-06-16 14:45:03 +03:00
|
|
|
cli_cmd_broadcast_connected(gf_boolean_t status);
|
2010-07-26 12:10:08 +00:00
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
|
|
|
|
|
void *data);
|
2011-04-25 03:10:01 +00:00
|
|
|
|
2011-03-10 02:20:39 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_profile_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2011-03-16 03:35:16 +00:00
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_top_parse(const char **words, int wordcount, dict_t **options);
|
2011-04-25 03:10:01 +00:00
|
|
|
|
|
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_log_level_parse(const char **words, int wordcount, dict_t **options);
|
2011-08-18 23:19:22 +05:30
|
|
|
|
|
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_status_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2011-08-18 23:19:22 +05:30
|
|
|
|
2012-02-16 21:30:47 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_heal_options_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2012-02-16 21:30:47 +05:30
|
|
|
|
2012-09-21 15:38:07 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_volume_defrag_parse(const char **words, int wordcount,
|
|
|
|
|
dict_t **options);
|
2012-09-21 15:38:07 +05:30
|
|
|
|
2011-08-18 23:19:22 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_print_brick_status(cli_volume_status_t *status);
|
2011-12-07 20:51:03 +05:30
|
|
|
|
|
|
|
|
void
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_print_detailed_status(cli_volume_status_t *status);
|
2011-12-07 20:51:03 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_get_detail_status(dict_t *dict, int i, cli_volume_status_t *status);
|
2011-08-18 23:19:22 +05:30
|
|
|
|
|
|
|
|
void
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_print_line(int len);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_str(char *op, char *str, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-03-05 19:04:49 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_dict(char *op, dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-03-05 19:04:49 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_top(dict_t *dict, int op_ret, int op_errno, char *op_errstr);
|
2012-03-05 19:04:49 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_profile(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_status_begin(cli_local_t *local, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-09-06 13:08:00 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_status_end(cli_local_t *local);
|
2012-09-06 13:08:00 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_status(cli_local_t *local, dict_t *dict);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_list(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_info_begin(cli_local_t *local, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_info_end(cli_local_t *local);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_info(cli_local_t *local, dict_t *dict);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_quota_limit_list_begin(cli_local_t *local, int op_ret,
|
|
|
|
|
int op_errno, char *op_errstr);
|
2015-02-03 05:01:38 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_quota_limit_list_end(cli_local_t *local);
|
2015-02-03 05:01:38 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_quota_list_xml_error(cli_local_t *local, char *path, char *errstr);
|
2015-02-03 05:01:38 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_quota_xml_output(cli_local_t *local, char *path, int64_t hl_str,
|
|
|
|
|
char *sl_final, int64_t sl_num, int64_t used,
|
|
|
|
|
int64_t avail, char *sl, char *hl, gf_boolean_t limit_set);
|
2012-08-13 18:57:20 +05:30
|
|
|
|
2015-03-18 23:17:23 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_quota_object_xml_output(cli_local_t *local, char *path, char *sl_str,
|
|
|
|
|
int64_t sl_val, quota_limits_t *limits,
|
|
|
|
|
quota_meta_t *used_space, int64_t avail, char *sl,
|
|
|
|
|
char *hl, gf_boolean_t limit_set);
|
2015-03-18 23:17:23 +05:30
|
|
|
|
2012-08-13 18:57:20 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_peer_status(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-02-15 16:18:25 +05:30
|
|
|
|
2012-09-06 13:08:00 +05:30
|
|
|
int
|
2022-05-13 12:02:29 +03:00
|
|
|
cli_xml_output_vol_rebalance(gf_defrag_type_t op, dict_t *dict, int op_ret,
|
2018-09-12 17:22:48 +05:30
|
|
|
int op_errno, char *op_errstr);
|
2012-09-06 13:08:00 +05:30
|
|
|
|
|
|
|
|
int
|
2019-04-22 19:50:19 +05:30
|
|
|
cli_xml_output_vol_remove_brick(gf_boolean_t status_op, dict_t *dict,
|
|
|
|
|
int op_ret, int op_errno, char *op_errstr,
|
|
|
|
|
const char *op);
|
2012-09-06 13:08:00 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_replace_brick(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-09-06 13:08:00 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_create(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-09-06 13:08:00 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_generic_volume(char *op, dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2012-11-20 15:17:06 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_gsync(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2013-09-24 17:01:46 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_status_tasks_detail(cli_local_t *local, dict_t *dict);
|
2012-11-14 19:25:14 +05:30
|
|
|
|
2015-08-26 08:28:59 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_snapshot_delete(cli_local_t *local, dict_t *dict, gf_cli_rsp *rsp);
|
2017-04-28 05:46:50 -04:00
|
|
|
|
2015-08-26 08:28:59 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_snapshot_begin_composite_op(cli_local_t *local);
|
2015-08-26 08:28:59 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_snapshot_end_composite_op(cli_local_t *local);
|
2015-08-26 08:28:59 +05:30
|
|
|
|
|
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_snap_delete_begin(cli_local_t *local, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2015-08-26 08:28:59 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_snap_delete_end(cli_local_t *local);
|
2015-08-26 08:28:59 +05:30
|
|
|
|
2014-05-05 13:37:34 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_snap_status_begin(cli_local_t *local, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2014-05-05 13:37:34 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_snap_status_end(cli_local_t *local);
|
2014-05-05 13:37:34 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_snapshot(int cmd_type, dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2014-07-23 18:08:08 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_snapshot_status_single_snap(cli_local_t *local, dict_t *dict,
|
|
|
|
|
char *key);
|
2014-02-19 16:30:11 +05:30
|
|
|
int32_t
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_cmd_snapshot_parse(const char **words, int wordcount, dict_t **options,
|
|
|
|
|
struct cli_state *state);
|
2014-02-19 16:30:11 +05:30
|
|
|
|
2014-06-30 10:33:25 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
cli_xml_output_vol_getopts(dict_t *dict, int op_ret, int op_errno,
|
|
|
|
|
char *op_errstr);
|
2015-03-18 23:17:23 +05:30
|
|
|
|
|
|
|
|
void
|
2018-09-12 17:22:48 +05:30
|
|
|
print_quota_list_header(int type);
|
2015-03-18 23:17:23 +05:30
|
|
|
|
|
|
|
|
void
|
2018-09-12 17:22:48 +05:30
|
|
|
print_quota_list_empty(char *path, int type);
|
2015-03-18 23:17:23 +05:30
|
|
|
|
2015-03-12 16:07:13 +05:30
|
|
|
int
|
2018-09-12 17:22:48 +05:30
|
|
|
gf_gsync_status_t_comparator(const void *p, const void *q);
|
2010-07-08 08:16:13 +00:00
|
|
|
#endif /* __CLI_H__ */
|