Files
podman/docs/source/markdown/podman-network-ls.1.md.in
Ed Santiago 4334135491 [CI:DOCS] man-page checker: include --format (Go templates)
Very belated successor to #14046.

I don't know why this is so important to me. Probably because we're
doing a halfhearted sloppy job of documenting, and new options get
added, and not documented, and that's just wrong.

I've given up on documenting internal structs. This iteration
has a $Format_Exceptions table defined at the top of the xref
script, enumerating a hardcoded defined set of podman commands
and fields that should remain undocumented.

This iteration also forgives completely-undocumented formats.
If podman-foo has a --format, but podman-foo.1.md does not
list *any* valid fields, the script warns but does not fail.
This at least is better than documenting a random mix of fields.

This version of the xref script is much slower: 10s vs 4. I
think we can live with that in a CI-only script.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-02-08 15:33:45 -07:00

114 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

% podman-network-ls 1
## NAME
podman\-network\-ls - Display a summary of networks
## SYNOPSIS
**podman network ls** [*options*]
## DESCRIPTION
Displays a list of existing podman networks.
## OPTIONS
#### **--filter**, **-f**=*filter=value*
Provide filter values.
The *filters* argument format is of `key=value`. If there is more than one *filter*, then pass multiple OPTIONS: **--filter** *foo=bar* **--filter** *bif=baz*.
Supported filters:
| **Filter** | **Description** |
| ---------- | ------------------------------------------------------------------------------------------------ |
| driver | Filter by driver type. |
| id | Filter by full or partial network ID. |
| label | Filter by network with (or without, in the case of label!=[...] is used) the specified labels. |
| name | Filter by network name (accepts `regex`). |
| until | Filter by networks created before given timestamp. |
| dangling | Filter by networks with no containers attached. |
The `driver` filter accepts values: `bridge`, `macvlan`, `ipvlan`.
The `label` *filter* accepts two formats. One is the `label`=*key* or `label`=*key*=*value*, which shows images with the specified labels. The other format is the `label!`=*key* or `label!`=*key*=*value*, which shows images without the specified labels.
The `until` *filter* can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the machines time.
The `dangling` *filter* accepts values `true` or `false`.
#### **--format**=*format*
Change the default output format. This can be of a supported type like 'json'
or a Go template.
Valid placeholders for the Go template are listed below:
| **Placeholder** | **Description** |
|--------------------|-------------------------------------------|
| .ID | Network ID |
| .Name | Network name |
| .Driver | Network driver |
| .Labels | Network labels |
| .Options | Network options |
| .IPAMOptions | Network ipam options |
| .Created | Timestamp when the network was created |
| .Internal | Network is internal (boolean) |
| .IPv6Enabled | Network has ipv6 subnet (boolean) |
| .DNSEnabled | Network has dns enabled (boolean) |
| .NetworkDNSServers | Array of DNS servers used in this network |
| .NetworkInterface | Name of the network interface on the host |
| .Subnets | List of subnets on this network |
#### **--no-trunc**
Do not truncate the network ID.
@@option noheading
#### **--quiet**, **-q**
The `quiet` option will restrict the output to only the network names.
## EXAMPLE
Display networks
```
$ podman network ls
NETWORK ID NAME DRIVER
88a7120ee19d podman bridge
6dd508dbf8cd podman6 bridge
8e35c2cd3bf6 podman5 macvlan
```
Display only network names
```
$ podman network ls -q
podman
podman2
outside
podman9
```
Display name of network which support bridge plugin
```
$ podman network ls --filter driver=bridge --format {{.Name}}
podman
podman2
podman9
```
List networks with their subnets
```
$ podman network ls --format "{{.Name}}: {{range .Subnets}}{{.Subnet}} {{end}}"
podman: 10.88.0.0/16
podman3: 10.89.30.0/24 fde4:f86f:4aab:e68f::/64
macvlan:
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-network(1)](podman-network.1.md)**, **[podman-network-inspect(1)](podman-network-inspect.1.md)**, **[podman-network-create(1)](podman-network-create.1.md)**
## HISTORY
August 2021, Updated with the new network format by Paul Holzinger <pholzing@redhat.com>
August 2019, Originally compiled by Brent Baude <bbaude@redhat.com>