-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json implemented in zfs CLI #3938
Conversation
Awesome, thanks for squashing the patch stack it will make it much easier to review. |
@goulvenriou @gwilson told me that you have libzfs_core extensions as part of the JSON changes. Where can I find those? |
@ryao , Hi , the libzfs_core isn't affected by the JSON implementation. |
Awesome! I've really been wanting to write a web interface for my box and this will make it way easier. 👍 |
@hadees Was one of the main goal : we think it will facilitate many new community projects based on openzfs ;-) Happy if it helps and please test, review, comment or create bug report if you find any. Thanks for your support. |
@yada is this live yet? How do I use it? |
@hadees The branch has been updated by our team (it is up to date now) and you check this readme file if you want to build : https://github.com/Alyseo/zfs/blob/json-0.6.5/json/install.md |
Is this part of the newly release zfs-0.6.5.4? |
@fractalram Still not, we will push again a new and fresh rebase to help core dev review and hope it will happen soon ;-) @behlendorf may have more info on timeframe ? |
New rebase done, hope it helps ;-) |
Hi, We understand it is a pretty disruptive append to the code base but at least it is not IMHO introduce disruptive changes. We are closed to the final step now, all commands have been implemented using two formats (json and ldjson), schemas descriptions are online (including orderly), we regularly push new rebase to help code review... So now we just need some love :) or in other words, we need to know if you guys (OpenZFS community) agree and get buy on the fundamental approach and give their approval for merging our code ? For infos (output and format...), see : BTW, we follow and like #3907 PS: Also posted to [OpenZFS Developer] Regards, |
new rebase and squash Done , your comments and reviews are welcome . the diff is available here : https://github.com/zfsonlinux/zfs/pull/3938/files |
70b96eb
to
b3c8794
Compare
The usual tests failed I guess, can you guys confirm we have nothing to fix on our side to improve this : @behlendorf ? |
@yada all the tests normally pass. It looks like your changes have accidentally introduced at least one change in behavior. It seems filebench is failing because the
|
@behlendorf : thanks for the info and issue fixed, all passed now and branch is up to date so happy review ;-) |
fcb2dd7
to
3fa363c
Compare
104942e
to
70eb170
Compare
d176b47
to
080f5ee
Compare
update zfs create for test suite
@yada how goes the process of adding test cases to verify the json output? |
@behlendorf Sorry, team been busy on big project... will find some spare time to work on it asap. |
Can you describe and explain your major issue !? What is missing from your point of view ? |
@denji
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test cases needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really only looked at the schema files as the plan is to add something to the tests to verify that that JSON output validates against the schema files. However, the errors in the files need to be fixed first... most of them appear to be copy-paste issues.
@yada any thoughts on a good tool to use for validating the JSON output against the schema files? There are a few tools (http://json-schema.org/implementations.html) but mileage varies greatly.
"items": | ||
{ | ||
"type":"object", | ||
"type": "type of volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type
seems to be a duplicate key here, and overrides the schema restriction. Should "type of volume" be a property instead?
"items": | ||
{ | ||
"type":"object", | ||
"type": "type of volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type
seems to be a duplicate key here, and overrides the schema restriction. Should "type of volume" be a property instead?
} | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erroneous markdown
"type":"object", | ||
"name": "zpool split -J", | ||
"version": "1.0", | ||
"description": "create a new pool by splitting a mirrored zfs storage poo"l, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid JSON, need to move the l
inside the quotes
"health": { | ||
"type":"string", | ||
"name": "health", | ||
"description": " The current health of the pool. Health can be "ONLINE", "DEGRADED", "FAULTED", " OFF‐LINE", "REMOVED", or "UNAVAIL"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot have double-quotes in values without escaping them with a backslash
} | ||
|
||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erroneous markdown
"items": | ||
{ | ||
"type":"object", | ||
"type": "type of volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type
seems to be a duplicate key here, and overrides the schema restriction. Should "type of volume" be a property instead?
"items": | ||
{ | ||
"type":"object", | ||
"type": "type of volume", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type
seems to be a duplicate key here, and overrides the schema restriction. Should "type of volume" be a property instead?
@@ -0,0 +1,27 @@ | |||
zfs destroy -J : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erroneous sring
} | ||
|
||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erroneous markdown
@yada I also believe there are errors in your schema files compared to what is generated. Using
However, according to the schema,
I imagine this is broken in a few places... Also, it appears you're using Draft3 of the JSON Schema, should this be updated to Draft4? One thing I noticed that has changed is the Finally, why did you use Orderly (the orderly-json.org site seems to be down) instead of straight JSON schema? I think the next step to creating tests would be to run commands and verify the output against the schema files, but currently too much is broken for this to work. Happy to help, but I need to better understand the design decisions here. |
Looks like this PR has been inactive for a while, @goulvenriou, @yada what's the status on this? |
@alek-p : Yep sorry guys but new job and no ressources anymore to move forward on this project. |
Hello. I've had to write some ugly Python to parse the output of I'm interested in continuing the work on this PR. Should I continue from the last commit on this PR, or is it better to start over? |
There was work done by ClusterHQ https://github.com/ClusterHQ/pyzfs which is worth looking at. |
We've made some progress on JSON output support for Since channel programmes got merged recently, I've dug out the JSON patch and am rebasing it, plus adding tests. Once that's done it will be put out for review in ZoL. |
Any news regarding |
I think you're asking about json output support for channel programs - that was implemented here #7281 |
Hi, in response to the pull request #3483 Alyseo's team has refactored the code to deliver single commit including all the jsonify code, the json output has been implements in all CLI commands.
Regards.
Goulven