open-nomad/website/content/docs/commands/quota/inspect.mdx
Juana De La Cuesta 47be374bbd
Add -json flag to quota inspect command (#16478)
* Added  and  flag to  command

* cli[style]: small refactor to avoid confussion with tmpl variable

* Update inspect.mdx

* cli: add changelog entry

* Update .changelog/16478.txt

Co-authored-by: James Rasell <jrasell@users.noreply.github.com>

* Update command/quota_inspect.go

Co-authored-by: James Rasell <jrasell@users.noreply.github.com>

---------

Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
2023-03-20 10:40:51 +01:00

124 lines
3.2 KiB
Plaintext

---
layout: docs
page_title: 'Commands: quota inspect'
description: >
The quota inspect command is used to view raw information about a particular
quota specification.
---
# Command: quota inspect
The `quota inspect` command is used to view raw information about a particular
quota. The default output is in JSON format.
~> Quota commands are new in Nomad 0.7 and are only available with Nomad
Enterprise.
## Usage
```plaintext
nomad quota inspect [options] <quota_name>
```
If ACLs are enabled, this command requires a token with the `quota:read`
capability and access to any namespaces that the quota is applied to.
## General Options
@include 'general_options.mdx'
## Inspect Options
- `-json`: Output the quota specifications in a JSON format.
- `-t`: Format and display the quota using a Go template.
## Examples
Inspect a quota specification:
```shell-session
$ nomad quota inspect default-quota
{
"Spec": {
"CreateIndex": 8,
"Description": "Limit the shared default namespace",
"Limits": [
{
"Hash": "NLOoV2WBU8ieJIrYXXx8NRb5C2xU61pVVWRDLEIMxlU=",
"Region": "global",
"RegionLimit": {
"CPU": 2500,
"DiskMB": 0,
"MemoryMB": 2000,
"Networks": null
}
}
],
"ModifyIndex": 56,
"Name": "default-quota"
},
"UsageLookupErrors": {},
"Usages": {
"global": {
"CreateIndex": 8,
"ModifyIndex": 56,
"Name": "default-quota",
"Used": {
"NLOoV2WBU8ieJIrYXXx8NRb5C2xU61pVVWRDLEIMxlU=": {
"Hash": "NLOoV2WBU8ieJIrYXXx8NRb5C2xU61pVVWRDLEIMxlU=",
"Region": "global",
"RegionLimit": {
"CPU": 500,
"DiskMB": 0,
"MemoryMB": 256,
"Networks": [
{
"CIDR": "",
"Device": "",
"DynamicPorts": null,
"IP": "",
"MBits": 0,
"Mode": "",
"ReservedPorts": null
}
]
}
}
}
}
}
}
```
The `-json` flag can be used to get the quota specs in json format:
```shell-session
$ nomad quota inspect -json default-quota
{
"CreateIndex": 8,
"Description": "Limit the shared default namespace",
"Limits": [
{
"Hash": "NLOoV2WBU8ieJIrYXXx8NRb5C2xU61pVVWRDLEIMxlU=",
"Region": "global",
"RegionLimit": {
"CPU": 2500,
"DiskMB": 0,
"MemoryMB": 2000,
"Networks": null
}
}
],
"ModifyIndex": 56,
"Name": "default-quota"
}
```
Or use the `-t` flag to format and display the quota specs using a Go template:
```shell-session
$ nomad quota inspect -t {{ .Description }} default-quota
Limit the shared default namespace
```