# delete

Use `greymatter delete` to **delete a specific object and its configurations** from the Grey Matter mesh. Objects can be `zone`, `proxy`, `domain`, `route`, `shared_rules`, `cluster`, `catalog_zone`, and `catalog_cluster`.

## Usage

```bash
greymatter [GLOBAL OPTIONS] delete [OPTIONS] <object type> <object key>
```

### Sample Usage

```
$ greymatter delete domain domain-catalog
[info] 2019/07/10 03:47:57 Preferring --api.key for authentication
{
  "domain_key": "domain-catalog",
  "zone_key": "zone-default-zone",
  "name": "catalog",
  "port": 8080,
  "redirects": null,
  "gzip_enabled": false,
  "cors_config": null,
  "aliases": null,
  "force_https": false,
  "checksum": "82581e0c56c2ad385e84234fe118ccf8cf8deb1852a5aa318eab887e9a2717d2"
}
```

## Deep Delete

Use `greymatter delete --deep` to **delete a specific object, its configuration, and all connected objects & configurations** from the Grey Matter mesh. Objects can be `zones`, `proxies`, `domains`, `routes`, and `shared_rules`.

### Deep Delete Usage

`greymatter [GLOBAL OPTIONS] delete --deep <object type> <object key>`

After executing the initial command, the user will be given a list of the objects to be deleted and prompted as to whether they wish to follow through. By replying with "n", deep delete can be cancelled.

#### Deep Delete Sample Usage

```
$ greymatter delete --deep zone test-zone
Deep deletion will delete the following objects:
  Route(route-edge-jwt::0/jwt/)
  Route(edge-jwt-security-route::0/services/jwt-security/latest/)
  Route(edge-prometheus-route-slash::0/services/prometheus/latest)
  Route(route-control-api::0/)
  Route(edge-catalog-route::0/services/catalog/latest/)
  Route(route-data-internal::0/)
  Route(route-edge-jwt-slash::0/jwt)
  Route(route-edge::0/services/edge/latest/)
  Route(edge-control-api-route::0/services/control-api/latest/)
  Route(route-jwt-security::0/)
  Route(edge-prometheus-route::0/services/prometheus/latest/)
  Route(edge-slo-route::0/services/slo/latest/)
  Route(edge-slo-route-slash::0/services/slo/latest)
  Route(route-catalog::0/)
  Route(edge-dashboard-route-no-slash::0/)
  Route(edge-internal-jwt-security-route-slash::0/services/internal-jwt-security/latest)
  Route(catalog-internal-data-route::0/data/)
  Route(route-dashboard::0/)
  Route(edge-control-api-route-slash::0/services/control-api/latest)
  Route(catalog-internal-data-route-slash::0/data)
  Route(edge-data-internal-route-slash::0/services/data-internal/latest)
  Route(edge-dashboard-route::0/services/dashboard/latest/)
  Route(edge-internal-jwt-security-route::0/services/internal-jwt-security/latest/)
  Route(route-internal-jwt-security::0/)
  Route(edge-jwt-security-route-slash::0/services/jwt-security/latest)
  Route(route-data-internal-internal-jwt-slash::0/jwt/)
  Route(route-prometheus::0/)
  Route(edge-dashboard-route-slash::0/services/dashboard/latest)
  Route(edge-data-internal-route::0/services/data-internal/latest/)
  Route(route-slo::0/)
  Route(edge-catalog-route-slash::0/services/catalog/latest)
  Route(route-data-internal-internal-jwt::0/jwt)
  SharedRules(edge-dashboard-shared-rules:dashboard)
  SharedRules(edge-prometheus-shared-rules:prometheus)
  SharedRules(edge-data-internal-shared-rules:data-internal)
  SharedRules(edge-internal-jwt-security-shared-rules:internal-jwt-security)
  SharedRules(shared-rules-jwt-security:jwt-security)
  SharedRules(shared-rules-internal-jwt-security:internal-jwt-security)
  SharedRules(shared-rules-data-internal-to-internal-jwt:data-internal)
  SharedRules(shared-rules-catalog:catalog)
  SharedRules(edge-slo-shared-rules:slo)
  SharedRules(shared-rules-dashboard:dashboard)
  SharedRules(catalog-data-internal-shared-rules:data-internal)
  SharedRules(shared-rules-data-internal:data-internal)
  SharedRules(shared-rules-slo:slo)
  SharedRules(shared-rules-edge:edge)
  SharedRules(edge-jwt-security-shared-rules:jwt-security)
  SharedRules(edge-catalog-shared-rules:catalog)
  SharedRules(edge-control-api-shared-rules:control-api)
  SharedRules(shared-rules-control-api:control-api)
  SharedRules(shared-rules-prometheus:prometheus)
  Listener(listener-dashboard-egress:dashboard)
  Listener(listener-data-internal:data-internal)
  Listener(listener-jwt-security-egress:jwt-security)
  Listener(listener-prometheus-egress:prometheus)
  Listener(listener-prometheus:prometheus)
  Listener(listener-catalog-egress:catalog)
  Listener(listener-catalog:catalog)
  Listener(listener-internal-jwt-security:internal-jwt-security)
  Listener(listener-data-internal-egress:data-internal)
  Listener(listener-jwt-security:jwt-security)
  Listener(edge-listener:edge)
  Listener(edge-listener-egress:edge)
  Listener(listener-slo:slo)
  Listener(listener-dashboard:dashboard)
  Listener(listener-control-api:control-api)
  Listener(listener-control-api-egress:control-api)
  Listener(listener-internal-jwt-security-egress:internal-jwt-security)
  Listener(listener-slo-egress:slo)
  Proxy(proxy-prometheus:prometheus)
  Proxy(proxy-slo:slo)
  Proxy(proxy-data-internal:data-internal)
  Proxy(proxy-catalog:catalog)
  Proxy(proxy-jwt-security:jwt-security)
  Proxy(proxy-dashboard:dashboard)
  Proxy(proxy-internal-jwt-security:internal-jwt-security)
  Proxy(proxy-control-api:control-api)
  Proxy(edge-proxy:edge)
  Domain(domain-data-internal-egress:*:10909)
  Domain(domain-slo-egress:*:10909)
  Domain(domain-dashboard-egress:*:10909)
  Domain(domain-jwt-security-egress:*:10909)
  Domain(domain-catalog:*:10808)
  Domain(edge:*:10808)
  Domain(domain-prometheus:*:10808)
  Domain(domain-jwt-security:*:10808)
  Domain(domain-slo:*:10808)
  Domain(domain-control-api:*:10808)
  Domain(domain-control-api-egress:*:10909)
  Domain(domain-data-internal:*:10808)
  Domain(edge-egress:*:10909)
  Domain(domain-prometheus-egress:*:10909)
  Domain(domain-internal-jwt-security-egress:*:10909)
  Domain(domain-internal-jwt-security:*:10808)
  Domain(domain-catalog-egress:*:10909)
  Domain(domain-dashboard:*:10808)
  Cluster(cluster-control-api:control-api-service)
  Cluster(edge-to-control-api-cluster:control-api)
  Cluster(edge-to-catalog-cluster:catalog)
  Cluster(catalog-to-data-internal-cluster:data-internal)
  Cluster(data-internal-to-internal-jwt-cluster:internal-jwt-security)
  Cluster(edge-to-prometheus-cluster:prometheus)
  Cluster(cluster-catalog:catalog-service)
  Cluster(edge-to-slo-cluster:slo)
  Cluster(cluster-jwt-security:jwt-security-service)
  Cluster(edge-to-dashboard-cluster:dashboard)
  Cluster(edge-to-jwt-security-cluster:jwt-security)
  Cluster(cluster-edge:edge)
  Cluster(edge-to-data-internal-cluster:data-internal)
  Cluster(cluster-dashboard:dashboard-service)
  Cluster(cluster-prometheus:prometheus-service)
  Cluster(cluster-internal-jwt-security:internal-jwt-security-service)
  Cluster(edge-to-internal-jwt-security-cluster:internal-jwt-security)
  Cluster(cluster-data-internal:data-internal-service)
  Cluster(cluster-slo:slo-service)
  Zone(test-zone:test-zone)
Proceed? [y/N]:
```

#### Help

To list available commands run with the global help flag:

```bash
greymatter delete --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 %}
