Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparkmeter/nquery
Query and explore your Nomad clusters
https://github.com/sparkmeter/nquery
cli hacktoberfest hashicorp nomad rust
Last synced: 7 days ago
JSON representation
Query and explore your Nomad clusters
- Host: GitHub
- URL: https://github.com/sparkmeter/nquery
- Owner: sparkmeter
- License: mit
- Created: 2020-10-06T01:31:01.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T22:46:22.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T11:40:30.525Z (14 days ago)
- Topics: cli, hacktoberfest, hashicorp, nomad, rust
- Language: Rust
- Homepage:
- Size: 62.5 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![Build](https://github.com/sparkmeter/nquery/workflows/CI/badge.svg)](https://github.com/sparkmeter/nquery/actions?query=workflow%3ACI)
[![Latest version](https://img.shields.io/crates/v/nquery.svg?style=flat)](https://crates.io/crates/nquery)# 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`](https://stedolan.github.io/jq/).## Usage
```bash
# 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](https://github.com/sparkmeter/nquery/releases).
or, with Cargo:
```bash
cargo install nquery
```## Debugging
To get helpful debugging information, run nquery with the `NQUERY_LOG=nquery`
environment variable set.