Print Email PDF

QQ CLI: Get Started

IN THIS ARTICLE

Outlines how to use the Qumulo Core CLI using a remote machine, locally on the cluster or via the Web UI

REQUIREMENTS

  • Cluster running Qumulo Core
  • Command line (CLI) tools installed via API & Tools tab

Reference the article QQ CLI: Install Command-Line Tools for additional details.

DETAILS

QQ CLI on a Remote Machine

You will first need to download the CLI .zip file, which you can get by clicking on the APIs & Tools tab from the main dashboard on the Qumulo Web UI. You'll see a link to download the CLI at the top of the page.

The first command you will need to execute is login, which authenticates you with your Qumulo cluster. You will also need to pass a --host parameter with the IP address or hostname of one of the nodes in your cluster. In the example below, 192.168.1.1 is the IP address of one of my Qumulo nodes.

qq --host 192.168.1.1 login -u admin -p xyz

Once authenticated, you can execute one of the many commands that are part of the CLI. Let's try and see how many nodes the cluster is comprised of by executing the following:

qq --host 192.168.1.1 nodes_list

Example output:

[
{
"id": 1,
"label": "f4:52:14:54:e8:c0",
"model_number": "Q0626",
"node_name": "qumulo-1",
"node_status": "online",
"uuid": "b52e1680-2e47-4ff1-9804-5d4eac76be55"
},
{
"id": 2,
"label": "f4:52:14:54:e8:90",
"model_number": "Q0626",
"node_name": "qumulo-2",
"node_status": "online",
"uuid": "3d538c6d-f918-4d3d-bb60-3785f26c2303"
},
{
"id": 3,
"label": "f4:52:14:54:e8:a0",
"model_number": "Q0626",
"node_name": "qumulo-3",
"node_status": "online",
"uuid": "11bc1408-f5e1-4edd-9bf6-6d4d909529bc"
},
{
"id": 4,
"label": "f4:52:14:54:e8:b0",
"model_number": "Q0626",
"node_name": "qumulo-4",
"node_status": "online",
"uuid": "968236f1-2d2a-4fe8-8211-6e8eed4616b5"
}
]

Another useful command to know is version, which returns the current version of Qumulo Core running on your cluster, for example

qq --host 192.168.1.1 version

Example output:

{
"build_date": "2020-02-10T19:50:58Z",
"build_id": "163341.1.6",
"flavor": "release",
"revision_id": "Qumulo Core 3.0.1"
}

You can also interact directly with the file-system. For example, this command lists the contents of /:

qq --host 192.168.1.1 fs_read_dir --path /

Example output:

{
"child_count": 2,
"files": [
{
"blocks": "0",
"change_time": "2015-02-04T19:29:48.136708478Z",
"child_count": 2,
"creation_time": "2015-02-04T19:29:16.846825314Z",
"file_number": "4",
"group": "513",
"id": "4",
"mode": "0777",
"modification_time": "2015-02-04T19:29:48.136708478Z",
"name": "foo",
"num_links": 2,
"owner": "500",
"path": "/foo/",
"size": "1024",
"type": "FS_FILE_TYPE_DIRECTORY"
},
{
"blocks": "0",
"change_time": "2015-02-04T19:34:17.113793299Z",
"child_count": 1,
"creation_time": "2015-02-04T19:24:12.201732558Z",
"file_number": "3",
"group": "513",
"id": "3",
"mode": "0777",
"modification_time": "2015-02-04T19:34:17.113793299Z",
"name": "bar",
"num_links": 2,
"owner": "500",
"path": "/bar/",
"size": "512",
"type": "FS_FILE_TYPE_DIRECTORY"
}
],
"id": "2",
"paging": {
"next": "",
"prev": ""
},
"path": "/"
}

You can even write a file to the cluster. The command below writes the file/qinstall.qimg based on the contents of /var/tmp/qinstall.qimg:

qq --host 192.168.1.1 fs_write --path /qinstall.qimg \
--create --file /var/tmp/qinstall.qimg

Example output:

{
"blocks": "139355",
"change_time": "2015-02-04T00:28:50.778788345Z",
"child_count": 0,
"creation_time": "2015-02-04T00:28:50.766408341Z",
"file_number": "6981",
"group": "2",
"id": "6981",
"mode": "0644",
"modification_time": "2015-02-04T00:29:32.967968707Z",
"name": "",
"num_links": 1,
"owner": "500",
"path": "/qinstall.qimg",
"size": "570798080",
"type": "FS_FILE_TYPE_FILE"
}

You can get a complete list of the CLI commands by using the --help argument.

qq --help

Note: Some of these commands are meant for debugging purposes. Use them with Care.

QQ CLI from a Node

To use the CLI from one your nodes, simply ssh into it and run as root.

Note: You can run as the Linux admin user, but you will need to authenticate via the login command.

root@qumulo-1:~# qq network_conf_get

This example outputs the network configuration of the cluster:

{
"assigned_by": "STATIC",
"dns_search_domains": [
"test.lan"
],
"dns_servers": [
"192.168.9.11",
"192.168.9.12"
],
"floating_ip_ranges": [
"192.168.1.10-20"
],
"gateway": "192.168.9.1",
"ip_ranges": [
"192.168.1.1-4"
],
"netmask": "255.255.255.0"
}

Interactive API in the Web UI

The last method is to use the interactive API directly from your cluster's Web UI. Again, you will have to navigate to APIs & Tools from your main dashboard. You must login to authenticate your session against the cluster. The screenshot below illustrates how to do that.

web_api.png

Once authenticated, you can simply execute any of the available commands. The tool will execute the command and display the JSON payload sent on both the HTTP request and response, which is handy for those thinking of using our API programatically. That is the true power of the API—to create your own scripts and tools that leverage these APIs. 

RESOLUTION

You should now be able to successfully use the QQ CLI in Qumulo Core 

ADDITIONAL RESOURCES

QQ CLI: Install Command-Line Tools

QQ CLI: Comprehensive List of Commands

 

Like what you see? Share this article with your network!

Was this article helpful?
0 out of 0 found this helpful

Comments

1 comment

  • In the second example

    ./qq --host 192.168.1.1 nodes_list -u admin -p xyz

    there is no need to pass username and password after logging in.

    ./qq --host 192.168.1.1 nodes_list 

    will work.

     

    0

Please sign in to leave a comment.

Have more questions?
Open a Case
Share it, if you like it.