open-nomad/website/content/docs/commands/namespace/status.mdx
Juana De La Cuesta c235bafa3f
cli: Add -json and -t flags to namespace status command (#16442)
* cli: Add  and  flag to namespace status command

* Update command/namespace_status.go

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

* cli: update tests for namespace status command to use must

---------

Co-authored-by: James Rasell <jrasell@users.noreply.github.com>
2023-03-14 14:23:04 +01:00

74 lines
1.7 KiB
Plaintext

---
layout: docs
page_title: 'Commands: namespace status'
description: >
The namespace status command is used to view the status of a particular
namespace.
---
# Command: namespace status
The `namespace status` command is used to view the status of a particular
namespace.
~> Namespaces are open source in Nomad 1.0. Namespaces were Enterprise-only
when introduced in Nomad 0.7.
## Usage
```plaintext
nomad namespace status [options] <namespace_name>
```
If ACLs are enabled, this command requires a management ACL token or a token
that has a capability associated with the namespace.
## General Options
@include 'general_options_no_namespace.mdx'
## Status Options
- `-json` : Output the namespace status in its JSON format.
- `-t` : Format and display the namespace status using a Go template.
## Examples
View the status of a namespace:
```shell-session
$ nomad namespace status default
Name = api-prod
Description = Prod API servers
Quota = prod
EnabledDrivers = docker,exec
DisabledDrivers = raw_exec
Metadata
contact = platform-eng@example.com
Quota Limits
Region CPU Usage Memory Usage
global 500 / 2500 256 / 2000
```
The `-json` flag can be used to get the namespace status in json format:
```shell-session
$ nomad namespace status -json default
{
"Capabilities": null,
"CreateIndex": 1,
"Description": "Default shared namespace",
"Meta": null,
"ModifyIndex": 1,
"Name": "default",
"Quota": ""
}
Or use the `-t` flag to format and display the status using a Go template:
```shell-session
$ nomad namespace status -t {{.Description}} default
Default shared namespace
```