Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
ee8f4f48
Commit
ee8f4f48
authored
Sep 21, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add JSON support for the CLI "status" command.
parent
7e070837
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+12
-1
b00004.vtc
bin/varnishtest/tests/b00004.vtc
+4
-0
No files found.
bin/varnishd/mgt/mgt_child.c
View file @
ee8f4f48
...
...
@@ -679,8 +679,19 @@ mch_cli_server_status(struct cli *cli, const char * const *av, void *priv)
VCLI_Out
(
cli
,
"Child in state %s"
,
ch_state
[
child_state
]);
}
static
void
v_matchproto_
(
cli_func_t
)
mch_cli_server_status_json
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
(
void
)
priv
;
VCLI_JSON_begin
(
cli
,
2
,
av
);
VCLI_Out
(
cli
,
", "
);
VCLI_JSON_str
(
cli
,
ch_state
[
child_state
]);
VCLI_JSON_end
(
cli
);
}
static
struct
cli_proto
cli_mch
[]
=
{
{
CLICMD_SERVER_STATUS
,
""
,
mch_cli_server_status
},
{
CLICMD_SERVER_STATUS
,
""
,
mch_cli_server_status
,
mch_cli_server_status_json
},
{
CLICMD_SERVER_START
,
""
,
mch_cli_server_start
},
{
CLICMD_SERVER_STOP
,
""
,
mch_cli_server_stop
},
{
CLICMD_PANIC_SHOW
,
""
,
mch_cli_panic_show
},
...
...
bin/varnishtest/tests/b00004.vtc
View file @
ee8f4f48
...
...
@@ -7,7 +7,11 @@ server s1 {
varnish v1 -vcl+backend { }
varnish v1 -start
varnish v1 -cliexpect "running" status
varnish v1 -clijson "status -j"
varnish v1 -stop
varnish v1 -cliexpect "stopped" status
varnish v1 -clijson "status -j"
varnish v1 -start
varnish v1 -stop
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment