Skip to content

Commit eb2b824

Browse files
Umer Saleembehlendorf
Umer Saleem
authored andcommitted
JSON output support for zpool get
This commit adds support for zpool get command to output the list of properties for ZFS Pools and VDEVS in JSON format using '-j' option. Man page for zpool get is updated to include '-j' option. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Ameer Hamza <[email protected]> Signed-off-by: Umer Saleem <[email protected]> Closes #16217
1 parent 5cbdd5e commit eb2b824

File tree

5 files changed

+287
-62
lines changed

5 files changed

+287
-62
lines changed

cmd/zfs/zfs_main.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,26 +1972,6 @@ fill_dataset_info(nvlist_t *list, zfs_handle_t *zhp, boolean_t as_int)
19721972
}
19731973
}
19741974

1975-
static int
1976-
zprop_collect_property(const char *name, zprop_get_cbdata_t *cbp,
1977-
const char *propname, const char *value, zprop_source_t sourcetype,
1978-
const char *source, const char *recvd_value, nvlist_t *nvl)
1979-
{
1980-
if (cbp->cb_json) {
1981-
if ((sourcetype & cbp->cb_sources) == 0)
1982-
return (0);
1983-
else {
1984-
return (zprop_nvlist_one_property(propname, value,
1985-
sourcetype, source, recvd_value, nvl,
1986-
cbp->cb_json_as_int));
1987-
}
1988-
} else {
1989-
zprop_print_one_property(name, cbp,
1990-
propname, value, sourcetype, source, recvd_value);
1991-
return (0);
1992-
}
1993-
}
1994-
19951975
/*
19961976
* zfs get [-rHp] [-j [--json-int]] [-o all | field[,field]...]
19971977
* [-s source[,source]...]

0 commit comments

Comments
 (0)