# list

Use `greymatter list` to **list objects and their configurations** in the Grey Matter mesh. Objects can be `zone`, `proxy`, `domain`, `route`, `shared_rules`, `cluster`, `catalog_zone`, and `catalog_cluster`.

## Usage

```bash
greymatter [GLOBAL OPTIONS] list [OPTIONS] <object type> [field_name=field_value]...
```

### Sample Usage

```bash
$ greymatter list cluster
[info] 2019/07/10 03:24:43 Preferring --api.key for authentication
[
  {
    "cluster_key": "cluster-dashboard",
    "zone_key": "zone-default-zone",
    "name": "dashboard",
    "instances": [
      {
        "host": "dashboard",
        "port": 1337,
        "metadata": null
      }
    ],
    "circuit_breakers": null,
    "outlier_detection": null,
    "health_checks": null,
    "checksum": "52ff049a34702c34f5262d2be15e921b3a14ca6a2dc88849707035da8d7c6588"
  },
  {
    "cluster_key": "cluster-catalog",
    "zone_key": "zone-default-zone",
    "name": "catalog",
    "instances": [
      {
        "host": "catalog",
        "port": 8080,
        "metadata": null
      }
    ],
    "circuit_breakers": null,
    "outlier_detection": null,
    "health_checks": null,
    "checksum": "5dd9355e9ebbe59b7ef3782263f5ab58029eb2246114e39662dee65242bd69da"
  },
  {
    "cluster_key": "cluster-example-service",
    "zone_key": "zone-default-zone",
    "name": "example-service",
    "instances": [
      {
        "host": "example-service",
        "port": 3000,
        "metadata": null
      }
    ],
    "circuit_breakers": null,
    "outlier_detection": null,
    "health_checks": null,
    "checksum": "0508a23ae92afea8b5d6a3a9e8c9b3fce60f1f5e0a76c76412fa70ddc12d9304"
  }
]
```

#### Filter

Use `greymatter list [...] <attribute type>=<attribute value>` to list objects with specified attribute values.

```bash
$ greymatter list --format=summary shared_rules name=catalog
SharedRulesKey            Name    Zone
shared-rules-catalog      catalog test-zone
edge-catalog-shared-rules catalog test-zone

$ greymatter list --format=summary listener zone_key=test-zone
ListenerKey                           Name                  IP:Port         Protocol  ActiveNetworkFilters ActiveHttpFilters Zone
listener-control-api-egress           control-api           127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-data-internal                data-internal         0.0.0.0:10808   http_auto 0                    2                 test-zone
listener-slo                          slo                   0.0.0.0:10808   http_auto 0                    2                 test-zone
listener-dashboard                    dashboard             0.0.0.0:10808   http_auto 0                    2                 test-zone
listener-internal-jwt-security-egress internal-jwt-security 127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-jwt-security                 jwt-security          0.0.0.0:10808   http_auto 0                    2                 test-zone
listener-slo-egress                   slo                   127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-jwt-security-egress          jwt-security          127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-prometheus-egress            prometheus            127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-prometheus                   prometheus            0.0.0.0:10808   http_auto 0                    2                 test-zone
listener-dashboard-egress             dashboard             127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-data-internal-egress         data-internal         127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-internal-jwt-security        internal-jwt-security 0.0.0.0:10808   http_auto 0                    2                 test-zone
edge-listener                         edge                  0.0.0.0:10808   http_auto 0                    5                 test-zone
edge-listener-egress                  edge                  127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-catalog-egress               catalog               127.0.0.1:10909 http_auto 0                    0                 test-zone
listener-catalog                      catalog               0.0.0.0:10808   http_auto 0                    2                 test-zone
listener-control-api                  control-api           0.0.0.0:10808   http_auto 0                    2                 test-zone
```

**Options**

Use `greymatter list --show-filter-fields` to list filterable object attributes.

```bash
$ greymatter list --show-filter-fields listener
Listing results may be filtered by setting attributes of a service.ListenerFilter

The filterable attribute names and their types:
    NAME          TYPE
    proxy_key     string
    listener_key  string
    name          string
    domain_keys   slice<string>
    zone_key      string
    org_key       string
```

#### Help

To list available commands run with the global help flag:

```bash
greymatter list --help
```

## Questions

{% hint style="success" %}
**Need help with the CLI?**

Create an account at [Grey Matter Support](https://support.greymatter.io/support/home) to reach our team.
{% endhint %}
