nquery

Crates.ionquery
lib.rsnquery
version0.3.1
sourcesrc
created_at2020-10-20 01:36:22.211122
updated_at2020-11-16 01:25:34.811786
descriptionQuery your Nomad clusters
homepagehttps://github.io/sparkmeter/nquery
repositoryhttps://github.com/sparkmeter/nquery
max_upload_size
id303223
size55,163
Aru Sahni (arusahni)

documentation

README

Build Latest version

nquery

Query and explore jobs on your Nomad clusters from the comfort of the command line.

The output is raw JSON, to facilitate integration with tooling such as jq.

Usage

# Get all jobs with IDs starting with 'redis' as pretty-printed JSON
$ nquery --pretty redis
[
  {
    "ID": "redis",
    "Name": "redis",
    "Namespace": "default",
    "ParameterizedJob": null,
    # ...
    "TaskGroups": [
      {
        # ...
        "Tasks": [
           {
              # ...
              "Meta": null,
              "Name": "redis",
           }
        ]
      }
    ]
  }
]


# Get the ID and task data-source fields of all parameterized jobs starting with etl
$ nquery --pretty --parameterized -f Meta.data-source etl
[
  {
    "ID": "etl-cluster-1"
    "Meta.data-source": "db-cluster-1",
  },
  {
    "ID": "etl-cluster-2"
    "Meta.data-source": "db-cluster-2",
  }
]

# Count the number of ETL tasks
$ nquery --parameterized -f Meta.data-source etl | jq '. | length'

Installation

Download the latest binary for your platform from the releases page.

or, with Cargo:

cargo install nquery

Debugging

To get helpful debugging information, run nquery with the NQUERY_LOG=nquery environment variable set.

Commit count: 41

cargo fmt