Skip to content
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

Document examples of the NNA SQL-like API usage #305

Open
pjeli opened this issue Jan 5, 2021 · 0 comments
Open

Document examples of the NNA SQL-like API usage #305

pjeli opened this issue Jan 5, 2021 · 0 comments
Assignees
Labels
documentation Documentation needed

Comments

@pjeli
Copy link
Collaborator

pjeli commented Jan 5, 2021

Just a reminder issue to provide some examples around how to use the SQL page. The following are some example calls:

Some documentation already exists here, but no examples.

Example SQLs to try on your /sql.html endpoint of your NNA instance:

SELECT * FROM files WHERE fileSize = 0 LIMIT 100 -- Example call to find and list 100 random empty files. Return value is a list of file paths.

SELECT * FROM files WHERE fileSize = 0 AND user != pjeli AND group = engineers -- List all empty files not owned by user 'pjeli' and owned by group 'engineers'. Return value is a list of file paths.

SELECT MAX(diskspaceConsumed) FROM files WHERE path LIKE '/tmp/%' AND user != pjeli -- Returns the single biggest files total diskspace consumed under path '/tmp' that is not owned by user 'pjeli'. Return value is an integer.

SELECT user,COUNT(*) FROM files WHERE fileSize = 0 GROUP BY user -- Returns a CSV list of usernames and their respective counts of empty files.

@pjeli pjeli added the documentation Documentation needed label Jan 5, 2021
@pjeli pjeli self-assigned this Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation needed
Projects
None yet
Development

No branches or pull requests

1 participant