Now that we have shared support working with "command json" we attempt
a minimal conversion, using aliases where appropriate, to the
new commands.Response type.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
For users who need to know the pools (by name) as well as the files
systems, we add ListFileSystems which is similar to 'ceph fs ls', rather
than the existing ListVolumes as that function is simlar to 'ceph fs
volume ls' and that does not return pool information.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Return not implemented errors when "older" versions of ceph return
formatted text for output instead of JSON, even tho we asked for json.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Previously, I was sort of abusing the build tags system to just get our
tests working. That was incorrect because you could be building go-ceph
against nautilus libs but using an octopus server and vice versa. In
addition, I've learned that some of the snapshot and clone behaviors are
being changed as items are backported in ceph. This means that build
tags themselves are not good indicators of what a particular version of
ceph supports.
This patch is the first step to removing these restrictions and making
cephfs admin work more smoothly across more versions of ceph.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The response type simplifies the error handling as a "pipeline" of
checks that are applied one after another.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The EnumerateVolumes function returns a list of Name & ID pairs,
to identify the file systems in the cluster. The enumeration is based
on `ceph fs dump` like JSON, but for implementation only. The dump
feature itself is not currently exported in a raw form.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Removes some old reminder comments.
Adds doc comments with the keyword "Similar To" followed by block quoted
text that shows a cli command the function will behave similarly to.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The volume status command does not appear to be able to return JSON
on nautilus. Disable it on anything other than octopus for now.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add type to parse the pool info from the volume status response.
Use new general response unmarshal function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Adds the central admin type `FSAdmin` and some helper functions.
Adds basic volume list and info functions.
Adds tests for the volume functions and common fsadmin functions.
Signed-off-by: John Mulligan <jmulligan@redhat.com>