# API

The Grey Matter Mesh is built out of a number of logical abstractions. The following table describes the logical abstractions, or objects, that make up the Grey Matter Mesh. The arrangement, connections, and configuration of these objects define the mesh and its behaviors.

![](/files/-M40dNn9cKch3JLfiF0d)

* [cluster](/grey-matter-documentation/usage/fabric/api/cluster.md)
* [domain](/grey-matter-documentation/usage/fabric/api/domain.md)
* [listener](/grey-matter-documentation/usage/fabric/api/listener.md)
* [proxy](/grey-matter-documentation/usage/fabric/api/proxy.md)
* [route](/grey-matter-documentation/usage/fabric/api/route.md)
* [shared\_rules](/grey-matter-documentation/usage/fabric/api/shared_rules.md)
* [zone](/grey-matter-documentation/usage/fabric/api/zone.md)

## Summary

| Object Name   | Description                                                                                                                                                             | Links To               | Links From                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------ |
| zone          | A logically isolated region of the mesh.  Zones are the highest level of organizational infrastructure. Zones contain all other objects.                                |                        | cluster, domain, listener, proxy, route, shared\_rules |
| domain        | The URL domains for which routes and clusters will be assigned within a proxy.  E.g. `www.deciphernow.com`, `localhost`, or `*`                                         | zone                   | listener, proxy, route                                 |
| listener      | The Envoy listener object that defines the host, port, and protocol for a proxy within the mesh.                                                                        | zone, domain           | proxy                                                  |
| proxy         | The Proxy object represents the aggregate objects that get mapped to each instance of the Grey Matter Proxy.                                                            | zone, domain, listener |                                                        |
| route         | A Route defines how a URL in a given domain is handled.  Route objects directly affect URI path matching, prefix rewriting, and redirects.                              | zone, domain           | shared\_rules                                          |
| shared\_rules | Shared\_rules define how requests are sent to clusters.  They can perform traffic splitting and shadowing.                                                              | zone                   | route                                                  |
| cluster       | Clusters represent collections of either hard-coded or discovered instances of a microservice.  Clusters handle health checks, circuit breaking, and outlier detection. | zone                   | shared\_rules                                          |

![](/files/-M6APVagrA-_9INlmES4)

## Detailed Descriptions

* [Zone](/grey-matter-documentation/usage/fabric/api/zone.md)
* [Listener](https://github.com/DecipherNow/gm-gitbook-sync/tree/b88085226e88844739eb923e6a3b5b82bf4294b6/usage/fabric/api/listener.md)
* [Proxy](/grey-matter-documentation/usage/fabric/api/proxy.md)
* [Domain](https://github.com/DecipherNow/gm-gitbook-sync/tree/b88085226e88844739eb923e6a3b5b82bf4294b6/usage/fabric/api/domain.md)
* [Route](https://github.com/DecipherNow/gm-gitbook-sync/tree/b88085226e88844739eb923e6a3b5b82bf4294b6/usage/fabric/api/route.md)
* [Shared Rules](https://github.com/DecipherNow/gm-gitbook-sync/tree/b88085226e88844739eb923e6a3b5b82bf4294b6/usage/fabric/api/shared_rules.md)
* [Cluster](https://github.com/DecipherNow/gm-gitbook-sync/tree/b88085226e88844739eb923e6a3b5b82bf4294b6/usage/fabric/api/cluster.md)

## Request Flow

1. **Listener**: A request from inside or outside the mesh is first sent to the host:port of a `listener`.
2. **Domain**: The request host:port is matched against the available domains, and redirected if need be, and sent to an attached set of `routes`.
3. **Route**: The request URI path portion is then passed through the `route` object for matching, rewriting, and redirecting to a `shared_rule`.
4. **Shared Rule**: The request is passed through the `shared_rules` to send, split, or shadow traffic to clusters.
5. **Cluster**: A `cluster` sends the final request to one of it's available instances; retrying and breaking connections as necessary.

![](/files/-M3fy6dJwfZRGCJEGnGu)

## Nested Objects

Each API Objects discussed above is made up of individual fields and nested structures. Some structures are unique to a given object, but some are re-used across multiple places. These are discussed below.

* [constraint](/grey-matter-documentation/usage/fabric/api/domain/header_constraint.md)
* [match](/grey-matter-documentation/usage/fabric/api/route/match.md)
* [response\_data](/grey-matter-documentation/usage/fabric/api/route/response_data.md)
* [rule](/grey-matter-documentation/usage/fabric/api/route/rule.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://greymatter.gitbook.io/grey-matter-documentation/usage/fabric/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
