# Catalog

**Grey Matter Catalog** is one of Grey Matter's core microservices. It provides additional metadata about meshes and services to the Grey Matter Application. Catalog can be leveraged as an API to develop further visualizations of a service mesh.

The following API documentation is adapted from 3.0.0 of the Catalog OpenAPI specification.

## Summary

### `GET /summary`

Returns a summary of all meshes with services and metadata included. The included example is a subset of a summary of two meshes.

#### Response

```javascript
{
  "meshes": {
    "greymatter-core": {
      "mesh_id": "greymatter-core",
      "configuration": {
        "mesh_id": "greymatter-core",
        "mesh_type": "greymatter",
        "name": "Grey Matter Core",
        "sessions": {
          "default": {
            "url": "control.default.svc:50000",
            "zone": "zone-default-zone"
          }
        },
        "extensions": {
          "metrics": {
            "sessions": {
              "default": {
                "client_type": "nats",
                "connection_string": "REDACTED"
              }
            },
            "event_window_minutes": 5,
            "event_timeout_minutes": 2
          },
          "lad": {
            "url": "lad.default.svc:8080",
            "cert_path": "",
            "key_path": "",
            "ca_path": ""
          }
        },
        "labels": {},
        "external_links": [
          {
            "title": "Grey Matter Home Page",
            "url": "https://greymatter.io"
          }
        ]
      },
      "session_statuses": {
        "default": "OK"
      },
      "instance_counts": {
        "control-api": 1,
        "control-api-service": 1
      },
      "metadata": {
        "owners": [
          "Decipher"
        ],
        "capabilities": [
          "Mesh"
        ],
        "service_count": 1,
        "service_stable_count": 1,
        "service_warning_count": 0,
        "service_down_count": 0,
        "instance_count": 1
      },
      "services": {
        "control-api": {
          "service_id": "control-api",
          "mesh_id": "greymatter-core",
          "name": "Grey Matter Control API",
          "version": "1.5.4",
          "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
          "owner": "Decipher",
          "owner_url": "https://greymatter.io",
          "api_endpoint": "/services/control-api/latest/",
          "api_spec_endpoint": "/services/control-api/latest/",
          "capability": "Mesh",
          "runtime": "GO",
          "documentation": "/services/control-api/latest/",
          "prometheus_job": "control-api",
          "enable_instance_metrics": true,
          "enable_historical_metrics": true,
          "business_impact": "critical",
          "external_links": [
            {
              "title": "Grey Matter Documentation",
              "url": "https://docs.greymatter.io"
            }
          ],
          "mesh_type": "greymatter",
          "localities": [
            "zone-default-zone"
          ],
          "instances": [
            {
              "instance_id": "c40c38ce12bfb13099d2c350436aff6c",
              "address": "100.96.2.65:10808",
              "session": "default",
              "locality": "zone-default-zone",
              "metadata": {
                "gm_control_discovery": "true",
                "gm_k8s_host_ip": "10.1.44.148",
                "gm_k8s_namespace": "default",
                "gm_k8s_node_name": "ip-10-1-44-148.ec2.internal",
                "gm_k8s_pod_annotations": {
                  "kubernetes.io/limit-ranger": "LimitRanger%20plugin%20set:%20cpu%20request%20for%20container%20control-api"
                },
                "gm_k8s_pod_labels": {
                  "controller-revision-hash": "control-api-69bf68ff68",
                  "deployment": "control-api",
                  "greymatter": "fabric",
                  "statefulset.kubernetes.io/pod-name": "control-api-0"
                },
                "gm_k8s_pod_name": "control-api-0",
                "gm_k8s_pod_phase": "Running",
                "gm_k8s_pod_start_time": "2021-06-29%2018:06:27%20+0000%20UTC",
                "health_status": 1,
                "health_status_description": "HEALTHY",
                "metrics_port": "8081",
                "protocols": "mTLS/HTTP",
                "resolved_from": "100.96.2.65",
                "start_time": 1625065359148
              }
            }
          ],
          "extensions": {
            "lad_statuses": {
              "control-api": {
                "mode": "monitor",
                "num_anomalies": 0,
                "threshold": 0.06440397724509239
              },
              "sidecar": {
                "mode": "alarm",
                "num_anomalies": 0,
                "message": "1624988816.5867352 Exceeded anomaly speed limit: 15.04121220905773/10.0",
                "from_mode": "monitor"
              }
            }
          },
          "metadata": {
            "protocols": [
              "mTLS/HTTP"
            ],
            "k8s_namespace": "default",
            "k8s_service": "control-api"
          },
          "status": "stable",
          "health": {
            "status": "stable",
            "timestamp": 1628532555,
            "sidecar": {
              "status": "stable",
              "groups": {
                "discovery": {
                  "title": "Discovery",
                  "checks": [
                    {
                      "title": "Control Plane",
                      "description": "The control plane reports all instances to be healthy",
                      "metric_name": "discovery_controlplane_reports",
                      "severity": "stable",
                      "expected": 1,
                      "observed": 1
                    },
                    {
                      "title": "Instances",
                      "description": "All discovered instances have reported live in the last 5 minutes",
                      "metric_name": "discovery_instance_reports",
                      "severity": "stable",
                      "expected": 1,
                      "observed": 1
                    },
                    {
                      "title": "Health Monitor",
                      "description": "All discovered instances reported metrics on time.",
                      "metric_name": "discovery_healthmonitor_reports",
                      "severity": "stable",
                      "expected": "Less than 20 seconds ago",
                      "observed": "4 seconds ago"
                    }
                  ]
                }
              }
            },
            "outgoing": {
              "control-api-service": {
                "status": "stable",
                "groups": {
                  "connections": {
                    "title": "Connections",
                    "checks": [
                      {
                        "title": "Destroyed With Active Requests",
                        "description": "No recent connections to cluster control-api-service were destroyed with active requests over the past 5 minutes",
                        "metric_name": "upstream_cx_destroy_with_active_rq",
                        "severity": "stable",
                        "expected": "≤ 0",
                        "observed": 0
                      },
                      {
                        "title": "Failures",
                        "description": "Connection failures are within acceptable limits for requests to cluster control-api-service over the past 5 minutes",
                        "metric_name": "upstream_cx_connect_fail",
                        "severity": "stable",
                        "expected": "≤ 10",
                        "observed": 0
                      },
                      {
                        "title": "Protocol Errors",
                        "description": "An unremarkable number of protocol errors have occurred while communicating with cluster control-api-service over the past 5 minutes",
                        "metric_name": "upstream_cx_protocol_error",
                        "severity": "stable",
                        "expected": "≤ 1",
                        "observed": 0
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "istio-demo": {
      "mesh_id": "istio-demo",
      "configuration": {
        "mesh_id": "istio-demo",
        "mesh_type": "istio",
        "name": "Istio Mesh",
        "sessions": {
          "default": {
            "url": "istiod.istio-system.svc.cluster.local:15010"
          }
        },
        "extensions": {
          "metrics": {},
          "lad": {
            "url": "lad.default.svc:8080",
            "cert_path": "",
            "key_path": "",
            "ca_path": ""
          }
        },
        "labels": {
          "group_by_k8s_service": "false"
        },
        "external_links": [
          {
            "title": "Istio Homepage",
            "url": "https://istio.io"
          }
        ]
      },
      "session_statuses": {
        "default": "OK"
      },
      "instance_counts": {
        "details-v1:9080": 1
      },
      "metadata": {
        "owners": [
          "Istio"
        ],
        "capabilities": [
          "Details"
        ],
        "service_count": 1,
        "service_stable_count": 1,
        "service_warning_count": 0,
        "service_down_count": 0,
        "instance_count": 1
      },
      "services": {
        "details-v1:9080": {
          "service_id": "details-v1:9080",
          "mesh_id": "istio-demo",
          "name": "Details",
          "version": "1.0",
          "description": "An Istio details service. The details microservice contains book information.",
          "owner": "Istio",
          "owner_url": "https://istio.io",
          "api_endpoint": "",
          "api_spec_endpoint": "",
          "capability": "Details",
          "runtime": "GO",
          "documentation": "",
          "prometheus_job": "details-v1:9080",
          "enable_instance_metrics": false,
          "enable_historical_metrics": false,
          "business_impact": "low",
          "external_links": [
            {
              "title": "Istio Homepage",
              "url": "https://istio.io"
            }
          ],
          "mesh_type": "istio",
          "localities": [
            "us-east-1b.us-east-1"
          ],
          "instances": [
            {
              "instance_id": "66a4adf8083a9c21e0a83142b73a0d1f",
              "address": "100.96.3.235:9080",
              "session": "default",
              "locality": "us-east-1b.us-east-1",
              "metadata": {
                "health_status": 0,
                "health_status_description": "UNKNOWN",
                "istio_cluster": "outbound|9080||details.istio-services.svc.cluster.local",
                "k8s_deployment": "details-v1",
                "k8s_namespace": "istio-services",
                "k8s_service": "details"
              }
            }
          ],
          "extensions": {
            "lad_statuses": {
              "details": {
                "mode": "monitor",
                "num_anomalies": 0,
                "threshold": 0.09235392138361931
              },
              "istio-init": {
                "mode": "collect",
                "num_anomalies": 0,
                "collection_duration": 98807.18147158623,
                "collection_duration_target": 3600
              },
              "istio-proxy": {
                "mode": "monitor",
                "num_anomalies": 0,
                "threshold": 0.08729689568281174
              }
            }
          },
          "metadata": {},
          "status": "stable",
          "health": {
            "status": "stable",
            "timestamp": 1628532555,
            "sidecar": {
              "status": "stable",
              "groups": {
                "discovery": {
                  "title": "Discovery",
                  "checks": [
                    {
                      "title": "Control Plane",
                      "description": "The control plane reports all instances to be healthy",
                      "metric_name": "discovery_controlplane_reports",
                      "severity": "stable",
                      "expected": 1,
                      "observed": 1
                    }
                  ]
                }
              }
            },
            "outgoing": {}
          }
        }
      }
    }
  },
  "metadata": {
    "mesh_count": 2,
    "owners": [
      "Istio",
      "Decipher"
    ],
    "capabilities": [
      "Mesh",
      "Reviews"
    ],
    "service_count": 2,
    "service_stable_count": 2,
    "service_warning_count": 0,
    "service_down_count": 0,
    "instance_count": 2
  },
  "authorized": true
}
```

## Services

### `GET /services`

Returns a queried list of services. The included example is a short list with two services from different meshes.

#### Parameters

| Name                        | In    | Type   | Required | Description                                                              |
| --------------------------- | ----- | ------ | -------- | ------------------------------------------------------------------------ |
| service\_id                 | query | string | false    | Query for services with specific IDs.                                    |
| mesh\_id                    | query | string | false    | Query for services matching specific meshes.                             |
| mesh\_type                  | query | string | false    | Query for services matching specific mesh types.                         |
| name                        | query | string | false    | Query for services by names.                                             |
| version                     | query | string | false    | Query for services by versions.                                          |
| owner                       | query | string | false    | Query for services by owners.                                            |
| capability                  | query | string | false    | Query for services by capabilities.                                      |
| runtime                     | query | string | false    | Query for services by runtimes.                                          |
| prometheus\_job             | query | string | false    | Query for services by Prometheus job names.                              |
| business\_impact            | query | string | false    | Query for services by business impacts.                                  |
| enable\_instance\_metrics   | query | string | false    | Query for services for which instance metrics are enabled or disabled.   |
| enable\_historical\_metrics | query | string | false    | Query for services for which historical metrics are enabled or disabled. |
| status                      | query | string | false    | Query for services by statuses.                                          |
| localities                  | query | string | false    | Query for services by localities.                                        |
| protocols                   | query | string | false    | Query for Grey Matter services by protocols.                             |

#### Enums

| Parameter                   | Value    |
| --------------------------- | -------- |
| business\_impact            | low      |
| business\_impact            | medium   |
| business\_impact            | high     |
| business\_impact            | critical |
| enable\_instance\_metrics   | true     |
| enable\_instance\_metrics   | false    |
| enable\_historical\_metrics | true     |
| enable\_historical\_metrics | false    |
| status                      | stable   |
| status                      | warning  |
| status                      | down     |

<br>

#### Response

```javascript
[
  {
    "service_id": "control-api",
    "mesh_id": "greymatter-core",
    "name": "Grey Matter Control API",
    "version": "1.5.4",
    "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
    "owner": "Decipher",
    "owner_url": "https://greymatter.io",
    "api_endpoint": "/services/control-api/latest/",
    "api_spec_endpoint": "/services/control-api/latest/",
    "capability": "Mesh",
    "runtime": "GO",
    "documentation": "/services/control-api/latest/",
    "prometheus_job": "control-api",
    "enable_instance_metrics": true,
    "enable_historical_metrics": true,
    "business_impact": "critical",
    "external_links": [
      {
        "title": "Grey Matter Documentation",
        "url": "https://docs.greymatter.io"
      }
    ],
    "mesh_type": "greymatter",
    "localities": [
      "zone-default-zone"
    ],
    "instances": [
      {
        "instance_id": "c40c38ce12bfb13099d2c350436aff6c",
        "address": "100.96.2.65:10808",
        "session": "default",
        "locality": "zone-default-zone",
        "metadata": {
          "gm_control_discovery": "true",
          "gm_k8s_host_ip": "10.1.44.148",
          "gm_k8s_namespace": "default",
          "gm_k8s_node_name": "ip-10-1-44-148.ec2.internal",
          "gm_k8s_pod_annotations": {
            "kubernetes.io/limit-ranger": "LimitRanger%20plugin%20set:%20cpu%20request%20for%20container%20control-api"
          },
          "gm_k8s_pod_labels": {
            "controller-revision-hash": "control-api-69bf68ff68",
            "deployment": "control-api",
            "greymatter": "fabric",
            "statefulset.kubernetes.io/pod-name": "control-api-0"
          },
          "gm_k8s_pod_name": "control-api-0",
          "gm_k8s_pod_phase": "Running",
          "gm_k8s_pod_start_time": "2021-06-29%2018:06:27%20+0000%20UTC",
          "health_status": 1,
          "health_status_description": "HEALTHY",
          "metrics_port": "8081",
          "protocols": "mTLS/HTTP",
          "resolved_from": "100.96.2.65",
          "start_time": 1625065359148
        }
      }
    ],
    "extensions": {
      "lad_statuses": {
        "control-api": {
          "mode": "monitor",
          "num_anomalies": 0,
          "threshold": 0.06440397724509239
        },
        "sidecar": {
          "mode": "alarm",
          "num_anomalies": 0,
          "message": "1624988816.5867352 Exceeded anomaly speed limit: 15.04121220905773/10.0",
          "from_mode": "monitor"
        }
      }
    },
    "metadata": {
      "protocols": [
        "mTLS/HTTP"
      ],
      "k8s_namespace": "default",
      "k8s_service": "control-api"
    },
    "status": "stable",
    "health": {
      "status": "stable",
      "timestamp": 1628532555,
      "sidecar": {
        "status": "stable",
        "groups": {
          "discovery": {
            "title": "Discovery",
            "checks": [
              {
                "title": "Control Plane",
                "description": "The control plane reports all instances to be healthy",
                "metric_name": "discovery_controlplane_reports",
                "severity": "stable",
                "expected": 1,
                "observed": 1
              },
              {
                "title": "Instances",
                "description": "All discovered instances have reported live in the last 5 minutes",
                "metric_name": "discovery_instance_reports",
                "severity": "stable",
                "expected": 1,
                "observed": 1
              },
              {
                "title": "Health Monitor",
                "description": "All discovered instances reported metrics on time.",
                "metric_name": "discovery_healthmonitor_reports",
                "severity": "stable",
                "expected": "Less than 20 seconds ago",
                "observed": "4 seconds ago"
              }
            ]
          }
        }
      },
      "outgoing": {
        "control-api-service": {
          "status": "stable",
          "groups": {
            "connections": {
              "title": "Connections",
              "checks": [
                {
                  "title": "Destroyed With Active Requests",
                  "description": "No recent connections to cluster control-api-service were destroyed with active requests over the past 5 minutes",
                  "metric_name": "upstream_cx_destroy_with_active_rq",
                  "severity": "stable",
                  "expected": "≤ 0",
                  "observed": 0
                },
                {
                  "title": "Failures",
                  "description": "Connection failures are within acceptable limits for requests to cluster control-api-service over the past 5 minutes",
                  "metric_name": "upstream_cx_connect_fail",
                  "severity": "stable",
                  "expected": "≤ 10",
                  "observed": 0
                },
                {
                  "title": "Protocol Errors",
                  "description": "An unremarkable number of protocol errors have occurred while communicating with cluster control-api-service over the past 5 minutes",
                  "metric_name": "upstream_cx_protocol_error",
                  "severity": "stable",
                  "expected": "≤ 1",
                  "observed": 0
                }
              ]
            }
          }
        }
      }
    }
  },
  {
    "service_id": "productpage-v1:9080",
    "mesh_id": "istio-demo",
    "name": "Product Page",
    "version": "1.0",
    "description": "An Istio product page service. The productpage microservice calls the details and reviews microservices to populate the page.",
    "owner": "Istio",
    "owner_url": "https://istio.io",
    "api_endpoint": "",
    "api_spec_endpoint": "",
    "capability": "Product",
    "runtime": "GO",
    "documentation": "",
    "prometheus_job": "productpage-v1:9080",
    "enable_instance_metrics": false,
    "enable_historical_metrics": false,
    "business_impact": "low",
    "external_links": [
      {
        "title": "Istio Homepage",
        "url": "https://istio.io"
      }
    ],
    "mesh_type": "istio",
    "localities": [
      "us-east-1a.us-east-1"
    ],
    "instances": [
      {
        "instance_id": "b4054aeabcdaf96bac631f536352d6c2",
        "address": "100.96.2.222:9080",
        "session": "default",
        "locality": "us-east-1a.us-east-1",
        "metadata": {
          "health_status": 0,
          "health_status_description": "UNKNOWN",
          "istio_cluster": "outbound|9080||productpage.istio-services.svc.cluster.local",
          "k8s_deployment": "productpage-v1",
          "k8s_namespace": "istio-services",
          "k8s_service": "productpage"
        }
      }
    ],
    "extensions": {
      "lad_statuses": {
        "istio-init": {
          "mode": "collect",
          "num_anomalies": 0,
          "collection_duration": 97370.34004235268,
          "collection_duration_target": 3600
        },
        "istio-proxy": {
          "mode": "monitor",
          "num_anomalies": 0,
          "threshold": 0.03915725089609623
        },
        "productpage": {
          "mode": "refine",
          "num_anomalies": 0,
          "pending": true,
          "running": false,
          "error": false
        }
      }
    },
    "metadata": {},
    "status": "stable",
    "health": {
      "status": "stable",
      "timestamp": 1628532555,
      "sidecar": {
        "status": "stable",
        "groups": {
          "discovery": {
            "title": "Discovery",
            "checks": [
              {
                "title": "Control Plane",
                "description": "The control plane reports all instances to be healthy",
                "metric_name": "discovery_controlplane_reports",
                "severity": "stable",
                "expected": 1,
                "observed": 1
              }
            ]
          }
        }
      },
      "outgoing": {}
    }
  }
]
```

### `POST /services`

Adds a new service.

#### Request Body

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name | In   | Type   | Required | Description                          |
| ---- | ---- | ------ | -------- | ------------------------------------ |
| body | body | object | true     | Request body for creating a service. |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter-core",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "critical",
  "external_links": [
    {
      "title": "Grey Matter Documentation",
      "url": "https://docs.greymatter.io"
    }
  ]
}
```

### `GET /meshes/{mesh_id}/services/{service_id}`

Retrieves an existing service.

#### Parameters

| Name        | In   | Type   | Required | Description                                                    |
| ----------- | ---- | ------ | -------- | -------------------------------------------------------------- |
| mesh\_id    | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog.          |
| service\_id | path | string | true     | Specify a service ID that matches a known service in the mesh. |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ],
  "mesh_type": "greymatter",
  "localities": [
    "zone-default-zone"
  ],
  "instances": [
    {
      "instance_id": "1e4687d8677e028f044075400f3dbc11",
      "address": "100.96.2.105:10808",
      "session": "default",
      "locality": "zone-default-zone",
      "metadata": {
        "key1": "string",
        "key2": 2,
        "key3": true
      }
    }
  ],
  "extensions": {
    "lad_statuses": {
      "service": {
        "mode": "monitor",
        "num_anomalies": 0,
        "threshold": 0.06440397724509239
      },
      "sidecar": {
        "mode": "alarm",
        "num_anomalies": 10,
        "message": "1624988816.5867352 Exceeded anomaly speed limit: 15.04121220905773/10.0",
        "from_mode": "monitor"
      }
    }
  },
  "metadata": {
    "key1": "string",
    "key2": 2,
    "key3": true
  },
  "status": "stable",
  "health": {
    "status": "stable",
    "timestamp": 1616181075916,
    "sidecar": {
      "status": "stable",
      "groups": {
        "property1": {
          "title": "Connections",
          "checks": [
            {
              "title": "Control Plane",
              "description": "The control plane reports all instances to be healthy",
              "metric_name": "discovery_controlplane_reports",
              "severity": "stable",
              "expected": null,
              "observed": null
            }
          ]
        },
        "property2": {
          "title": "Connections",
          "checks": [
            {
              "title": "Control Plane",
              "description": "The control plane reports all instances to be healthy",
              "metric_name": "discovery_controlplane_reports",
              "severity": "stable",
              "expected": null,
              "observed": null
            }
          ]
        }
      }
    },
    "outgoing": {
      "property1": {
        "status": "stable",
        "groups": {
          "property1": {
            "title": "Connections",
            "checks": [
              {
                "title": "Control Plane",
                "description": "The control plane reports all instances to be healthy",
                "metric_name": "discovery_controlplane_reports",
                "severity": "stable",
                "expected": null,
                "observed": null
              }
            ]
          },
          "property2": {
            "title": "Connections",
            "checks": [
              {
                "title": "Control Plane",
                "description": "The control plane reports all instances to be healthy",
                "metric_name": "discovery_controlplane_reports",
                "severity": "stable",
                "expected": null,
                "observed": null
              }
            ]
          }
        }
      },
      "property2": {
        "status": "stable",
        "groups": {
          "property1": {
            "title": "Connections",
            "checks": [
              {
                "title": "Control Plane",
                "description": "The control plane reports all instances to be healthy",
                "metric_name": "discovery_controlplane_reports",
                "severity": "stable",
                "expected": null,
                "observed": null
              }
            ]
          },
          "property2": {
            "title": "Connections",
            "checks": [
              {
                "title": "Control Plane",
                "description": "The control plane reports all instances to be healthy",
                "metric_name": "discovery_controlplane_reports",
                "severity": "stable",
                "expected": null,
                "observed": null
              }
            ]
          }
        }
      }
    }
  }
}
```

### `PUT /meshes/{mesh_id}/services/{service_id}`

Replaces an existing service.

#### Request Body

```javascript
{
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name        | In   | Type   | Required | Description                                           |
| ----------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id    | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| service\_id | path | string | true     | The ID of the service to be modified.                 |
| body        | body | object | true     | Request body for updating a service.                  |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

### `PATCH /meshes/{mesh_id}/services/{service_id}`

Modifies individual fields within an existing service.

#### Request Body

```javascript
{
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name        | In   | Type   | Required | Description                                           |
| ----------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id    | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| service\_id | path | string | true     | The ID of the service to be modified.                 |
| body        | body | object | true     | Request body for updating a service.                  |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

### `DELETE /meshes/{mesh_id}/services/{service_id}`

Deletes an existing service.

#### Parameters

| Name        | In   | Type   | Required | Description                                           |
| ----------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id    | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| service\_id | path | string | true     | The ID of the service to be modified.                 |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

## Meshes

### `GET /meshes`

Returns a list of summaries for each mesh.

#### Parameters

| Name       | In    | Type   | Required | Description                                 |
| ---------- | ----- | ------ | -------- | ------------------------------------------- |
| mesh\_id   | query | string | false    | Query for meshes with specific IDs.         |
| mesh\_type | query | string | false    | Query for meshes of various types.          |
| name       | query | string | false    | Query for meshes with various names.        |
| labels.\*  | query | string | false    | Query for meshes that match various labels. |

#### Response

```javascript
[
  {
    "mesh_id": "greymatter-core",
    "configuration": {
      "mesh_id": "greymatter-core",
      "mesh_type": "greymatter",
      "name": "Grey Matter Core",
      "sessions": {
        "default": {
          "url": "control.default.svc:50000",
          "zone": "zone-default-zone"
        }
      },
      "extensions": {
        "metrics": {
          "sessions": {
            "default": {
              "client_type": "nats",
              "connection_string": "REDACTED"
            }
          },
          "event_window_minutes": 5,
          "event_timeout_minutes": 2
        },
        "lad": {
          "url": "lad.default.svc:8080",
          "cert_path": "",
          "key_path": "",
          "ca_path": ""
        }
      },
      "labels": {},
      "external_links": [
        {
          "title": "Grey Matter Home Page",
          "url": "https://greymatter.io"
        }
      ]
    },
    "session_statuses": {
      "default": "OK"
    },
    "instance_counts": {
      "Mongo": 0,
      "Mongo-local": 1,
      "catalog": 1,
      "catalog-service": 1,
      "control-api": 1,
      "control-api-service": 1,
      "dashboard": 1,
      "dashboard-service": 1,
      "default": 0,
      "edge": 1,
      "edge-oidc": 1,
      "edge-tls": 1,
      "fibonacci": 0,
      "jwt-security": 1,
      "jwt-security-service": 1,
      "lad": 1,
      "lass": 1,
      "mesh-redis": 1,
      "mesh-redis-local": 1,
      "mongo": 0,
      "mongodb": 1,
      "prometheus": 1,
      "prometheus-service": 1,
      "redis": 0,
      "service": 1,
      "slo": 2,
      "slo-service": 1
    },
    "metadata": {
      "owners": [
        "Decipher",
        "Grey Matter"
      ],
      "capabilities": [
        "Security",
        "Mesh",
        "Apps",
        "Experimental",
        "math",
        "Sense"
      ],
      "service_count": 11,
      "service_stable_count": 10,
      "service_warning_count": 0,
      "service_down_count": 1,
      "instance_count": 11
    }
  },
  {
    "mesh_id": "istio-demo",
    "configuration": {
      "mesh_id": "istio-demo",
      "mesh_type": "istio",
      "name": "Istio Mesh",
      "sessions": {
        "default": {
          "url": "istiod.istio-system.svc.cluster.local:15010"
        }
      },
      "extensions": {
        "metrics": {},
        "lad": {
          "url": "lad.default.svc:8080",
          "cert_path": "",
          "key_path": "",
          "ca_path": ""
        }
      },
      "labels": {
        "group_by_k8s_service": "false"
      },
      "external_links": [
        {
          "title": "Istio Homepage",
          "url": "https://istio.io"
        }
      ]
    },
    "session_statuses": {
      "default": "OK"
    },
    "instance_counts": {
      "details-v1:9080": 1,
      "istio-egressgateway:15443": 1,
      "istio-egressgateway:8080": 1,
      "istio-egressgateway:8443": 1,
      "istio-ingressgateway:15021": 1,
      "istio-ingressgateway:15443": 1,
      "istio-ingressgateway:31400": 1,
      "istio-ingressgateway:8080": 1,
      "istio-ingressgateway:8443": 1,
      "productpage-v1:9080": 1,
      "ratings-v1:9080": 1,
      "reviews-v1:9080": 1,
      "reviews-v2:9080": 1,
      "reviews-v3:9080": 1
    },
    "metadata": {
      "owners": [
        "Istio"
      ],
      "capabilities": [
        "Reviews",
        "Details",
        "Rating",
        "Product"
      ],
      "service_count": 6,
      "service_stable_count": 6,
      "service_warning_count": 0,
      "service_down_count": 0,
      "instance_count": 6
    }
  }
]
```

### `POST /meshes`

Adds a new mesh with the provided configuration.

#### Request Body

```javascript
{
  "mesh_id": "greymatter-core",
  "mesh_type": "greymatter",
  "name": "Grey Matter Mesh",
  "sessions": {
    "default": {
      "url": "control.default.svc:50000",
      "use_tls": true,
      "cert_path": "/etc/certs/server.crt",
      "key_path": "/etc/certs/server.key",
      "ca_path": "/etc/certs/ca.crt",
      "cluster": "",
      "region": "",
      "zone": "zone-default-zone",
      "sub_zone": ""
    }
  },
  "labels": {
    "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
    "zone_key": "zone-default-zone"
  },
  "extensions": {
    "metrics": {
      "sessions": {
        "default": {
          "client_type": "redis",
          "connection_string": "redis://username:password@redis.svc.local:6379",
          "cert_path": "/etc/certs/server.crt",
          "key_path": "/etc/certs/server.key",
          "ca_path": "/etc/certs/ca.crt"
        }
      },
      "event_window_minutes": 5,
      "event_timeout_minutes": 2
    },
    "lad": {
      "url": "lad.default.svc:8080",
      "use_tls": true,
      "cert_path": "/etc/certs/server.crt",
      "key_path": "/etc/certs/server.key",
      "ca_path": "/etc/certs/ca.crt"
    }
  },
  "external_links": [
    {
      "title": "Grey Matter Home Page",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name | In   | Type   | Required | Description                                    |
| ---- | ---- | ------ | -------- | ---------------------------------------------- |
| body | body | object | true     | Request body for creating or replacing a mesh. |

#### Response

```javascript
{
  "mesh_id": "greymatter_example",
  "configuration": {
    "mesh_id": "greymatter-core",
    "mesh_type": "greymatter",
    "name": "Grey Matter Mesh",
    "sessions": {
      "default": {
        "url": "control.default.svc:50000",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt",
        "cluster": "",
        "region": "",
        "zone": "zone-default-zone",
        "sub_zone": ""
      }
    },
    "labels": {
      "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
      "zone_key": "zone-default-zone"
    },
    "extensions": {
      "metrics": {
        "sessions": {
          "default": {
            "client_type": "redis",
            "connection_string": "redis://username:password@redis.svc.local:6379",
            "cert_path": "/etc/certs/server.crt",
            "key_path": "/etc/certs/server.key",
            "ca_path": "/etc/certs/ca.crt"
          }
        },
        "event_window_minutes": 5,
        "event_timeout_minutes": 2
      },
      "lad": {
        "url": "lad.default.svc:8080",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt"
      }
    },
    "external_links": [
      {
        "title": "Grey Matter Home Page",
        "url": "https://greymatter.io"
      }
    ]
  },
  "session_statuses": {
    "session1": "OK",
    "session2": "Pending",
    "session3": "Unable to connect",
    "session4": "Stream closed"
  },
  "instance_counts": {
    "service1": 1,
    "service2": 2
  },
  "metadata": {
    "owners": [
      "Decipher"
    ],
    "capabilities": [
      "Sense",
      "Apps",
      "Security",
      "Mesh"
    ],
    "service_count": 6,
    "service_stable_count": 6,
    "service_warning_count": 0,
    "service_down_count": 0,
    "instance_count": 6
  }
}
```

### `GET /meshes/{mesh_id}`

Returns a summary for a mesh.

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |

#### Response

```javascript
{
  "mesh_id": "greymatter_example",
  "configuration": {
    "mesh_id": "greymatter-core",
    "mesh_type": "greymatter",
    "name": "Grey Matter Mesh",
    "sessions": {
      "default": {
        "url": "control.default.svc:50000",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt",
        "cluster": "",
        "region": "",
        "zone": "zone-default-zone",
        "sub_zone": ""
      }
    },
    "labels": {
      "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
      "zone_key": "zone-default-zone"
    },
    "extensions": {
      "metrics": {
        "sessions": {
          "default": {
            "client_type": "redis",
            "connection_string": "redis://username:password@redis.svc.local:6379",
            "cert_path": "/etc/certs/server.crt",
            "key_path": "/etc/certs/server.key",
            "ca_path": "/etc/certs/ca.crt"
          }
        },
        "event_window_minutes": 5,
        "event_timeout_minutes": 2
      },
      "lad": {
        "url": "lad.default.svc:8080",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt"
      }
    },
    "external_links": [
      {
        "title": "Grey Matter Home Page",
        "url": "https://greymatter.io"
      }
    ]
  },
  "session_statuses": {
    "session1": "OK",
    "session2": "Pending",
    "session3": "Unable to connect",
    "session4": "Stream closed"
  },
  "instance_counts": {
    "service1": 1,
    "service2": 2
  },
  "metadata": {
    "owners": [
      "Decipher"
    ],
    "capabilities": [
      "Sense",
      "Apps",
      "Security",
      "Mesh"
    ],
    "service_count": 6,
    "service_stable_count": 6,
    "service_warning_count": 0,
    "service_down_count": 0,
    "instance_count": 6
  }
}
```

### `PUT /meshes/{mesh_id}`

Replaces the configuration for an existing mesh.

#### Request Body

```javascript
{
  "mesh_id": "greymatter-core",
  "mesh_type": "greymatter",
  "name": "Grey Matter Mesh",
  "sessions": {
    "default": {
      "url": "control.default.svc:50000",
      "use_tls": true,
      "cert_path": "/etc/certs/server.crt",
      "key_path": "/etc/certs/server.key",
      "ca_path": "/etc/certs/ca.crt",
      "cluster": "",
      "region": "",
      "zone": "zone-default-zone",
      "sub_zone": ""
    }
  },
  "labels": {
    "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
    "zone_key": "zone-default-zone"
  },
  "extensions": {
    "metrics": {
      "sessions": {
        "default": {
          "client_type": "redis",
          "connection_string": "redis://username:password@redis.svc.local:6379",
          "cert_path": "/etc/certs/server.crt",
          "key_path": "/etc/certs/server.key",
          "ca_path": "/etc/certs/ca.crt"
        }
      },
      "event_window_minutes": 5,
      "event_timeout_minutes": 2
    },
    "lad": {
      "url": "lad.default.svc:8080",
      "use_tls": true,
      "cert_path": "/etc/certs/server.crt",
      "key_path": "/etc/certs/server.key",
      "ca_path": "/etc/certs/ca.crt"
    }
  },
  "external_links": [
    {
      "title": "Grey Matter Home Page",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| body     | body | object | true     | Request body for creating or replacing a mesh.        |

#### Response

```javascript
{
  "mesh_id": "greymatter_example",
  "configuration": {
    "mesh_id": "greymatter-core",
    "mesh_type": "greymatter",
    "name": "Grey Matter Mesh",
    "sessions": {
      "default": {
        "url": "control.default.svc:50000",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt",
        "cluster": "",
        "region": "",
        "zone": "zone-default-zone",
        "sub_zone": ""
      }
    },
    "labels": {
      "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
      "zone_key": "zone-default-zone"
    },
    "extensions": {
      "metrics": {
        "sessions": {
          "default": {
            "client_type": "redis",
            "connection_string": "redis://username:password@redis.svc.local:6379",
            "cert_path": "/etc/certs/server.crt",
            "key_path": "/etc/certs/server.key",
            "ca_path": "/etc/certs/ca.crt"
          }
        },
        "event_window_minutes": 5,
        "event_timeout_minutes": 2
      },
      "lad": {
        "url": "lad.default.svc:8080",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt"
      }
    },
    "external_links": [
      {
        "title": "Grey Matter Home Page",
        "url": "https://greymatter.io"
      }
    ]
  },
  "session_statuses": {
    "session1": "OK",
    "session2": "Pending",
    "session3": "Unable to connect",
    "session4": "Stream closed"
  },
  "instance_counts": {
    "service1": 1,
    "service2": 2
  },
  "metadata": {
    "owners": [
      "Decipher"
    ],
    "capabilities": [
      "Sense",
      "Apps",
      "Security",
      "Mesh"
    ],
    "service_count": 6,
    "service_stable_count": 6,
    "service_warning_count": 0,
    "service_down_count": 0,
    "instance_count": 6
  }
}
```

### `PATCH /meshes/{mesh_id}`

Modifies individual configuration fields within an existing mesh.

#### Request Body

```javascript
{
  "name": "Grey Matter Mesh",
  "sessions": {
    "default": {
      "url": "control.default.svc:50000",
      "use_tls": true,
      "cert_path": "/etc/certs/server.crt",
      "key_path": "/etc/certs/server.key",
      "ca_path": "/etc/certs/ca.crt",
      "cluster": "",
      "region": "",
      "zone": "zone-default-zone",
      "sub_zone": ""
    }
  },
  "labels": {
    "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
    "zone_key": "zone-default-zone"
  },
  "extensions": {
    "metrics": {
      "sessions": {
        "default": {
          "client_type": "redis",
          "connection_string": "redis://username:password@redis.svc.local:6379",
          "cert_path": "/etc/certs/server.crt",
          "key_path": "/etc/certs/server.key",
          "ca_path": "/etc/certs/ca.crt"
        }
      },
      "event_window_minutes": 5,
      "event_timeout_minutes": 2
    },
    "lad": {
      "url": "lad.default.svc:8080",
      "use_tls": true,
      "cert_path": "/etc/certs/server.crt",
      "key_path": "/etc/certs/server.key",
      "ca_path": "/etc/certs/ca.crt"
    }
  },
  "external_links": [
    {
      "title": "Grey Matter Home Page",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| body     | body | object | true     | Request body for updating a mesh.                     |

#### Response

```javascript
{
  "mesh_id": "greymatter_example",
  "configuration": {
    "mesh_id": "greymatter-core",
    "mesh_type": "greymatter",
    "name": "Grey Matter Mesh",
    "sessions": {
      "default": {
        "url": "control.default.svc:50000",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt",
        "cluster": "",
        "region": "",
        "zone": "zone-default-zone",
        "sub_zone": ""
      }
    },
    "labels": {
      "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
      "zone_key": "zone-default-zone"
    },
    "extensions": {
      "metrics": {
        "sessions": {
          "default": {
            "client_type": "redis",
            "connection_string": "redis://username:password@redis.svc.local:6379",
            "cert_path": "/etc/certs/server.crt",
            "key_path": "/etc/certs/server.key",
            "ca_path": "/etc/certs/ca.crt"
          }
        },
        "event_window_minutes": 5,
        "event_timeout_minutes": 2
      },
      "lad": {
        "url": "lad.default.svc:8080",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt"
      }
    },
    "external_links": [
      {
        "title": "Grey Matter Home Page",
        "url": "https://greymatter.io"
      }
    ]
  },
  "session_statuses": {
    "session1": "OK",
    "session2": "Pending",
    "session3": "Unable to connect",
    "session4": "Stream closed"
  },
  "instance_counts": {
    "service1": 1,
    "service2": 2
  },
  "metadata": {
    "owners": [
      "Decipher"
    ],
    "capabilities": [
      "Sense",
      "Apps",
      "Security",
      "Mesh"
    ],
    "service_count": 6,
    "service_stable_count": 6,
    "service_warning_count": 0,
    "service_down_count": 0,
    "instance_count": 6
  }
}
```

### `DELETE /meshes/{mesh_id}`

Deletes an existing mesh and all its services from the Catalog.

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |

#### Response

```javascript
{
  "mesh_id": "greymatter_example",
  "configuration": {
    "mesh_id": "greymatter-core",
    "mesh_type": "greymatter",
    "name": "Grey Matter Mesh",
    "sessions": {
      "default": {
        "url": "control.default.svc:50000",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt",
        "cluster": "",
        "region": "",
        "zone": "zone-default-zone",
        "sub_zone": ""
      }
    },
    "labels": {
      "configuration_url": "https://greymatter.yourcompany.com/services/control-api/latest/v1.0/",
      "zone_key": "zone-default-zone"
    },
    "extensions": {
      "metrics": {
        "sessions": {
          "default": {
            "client_type": "redis",
            "connection_string": "redis://username:password@redis.svc.local:6379",
            "cert_path": "/etc/certs/server.crt",
            "key_path": "/etc/certs/server.key",
            "ca_path": "/etc/certs/ca.crt"
          }
        },
        "event_window_minutes": 5,
        "event_timeout_minutes": 2
      },
      "lad": {
        "url": "lad.default.svc:8080",
        "use_tls": true,
        "cert_path": "/etc/certs/server.crt",
        "key_path": "/etc/certs/server.key",
        "ca_path": "/etc/certs/ca.crt"
      }
    },
    "external_links": [
      {
        "title": "Grey Matter Home Page",
        "url": "https://greymatter.io"
      }
    ]
  },
  "session_statuses": {
    "session1": "OK",
    "session2": "Pending",
    "session3": "Unable to connect",
    "session4": "Stream closed"
  },
  "instance_counts": {
    "service1": 1,
    "service2": 2
  },
  "metadata": {
    "owners": [
      "Decipher"
    ],
    "capabilities": [
      "Sense",
      "Apps",
      "Security",
      "Mesh"
    ],
    "service_count": 6,
    "service_stable_count": 6,
    "service_warning_count": 0,
    "service_down_count": 0,
    "instance_count": 6
  }
}
```

## Service Template

### `GET /meshes/{mesh_id}/template`

Returns the service template for the mesh specified. This may be used as a schema for creating additional services, especially via the 'greymatter create' command in the Grey Matter CLI.

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

### `PUT /meshes/{mesh_id}/template`

Replaces the service template for the mesh specified.

#### Request Body

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| body     | body | object | true     | Request body for creating a service.                  |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

### `PATCH /meshes/{mesh_id}/template`

Modifies individual fields within the service template for the mesh specified.

#### Request Body

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

#### Parameters

| Name     | In   | Type   | Required | Description                                           |
| -------- | ---- | ------ | -------- | ----------------------------------------------------- |
| mesh\_id | path | string | true     | Specify a mesh ID that matches a mesh in the Catalog. |
| body     | body | object | true     | Request body for creating a service.                  |

#### Response

```javascript
{
  "service_id": "control-api",
  "mesh_id": "greymatter_example",
  "name": "Grey Matter Control API",
  "version": "1.5.4",
  "description": "The purpose of the Grey Matter Control API is to manage the configuration of all components of the Grey Matter Data Plane.",
  "owner": "Decipher",
  "owner_url": "https://greymatter.io",
  "api_endpoint": "/services/control-api/latest/",
  "api_spec_endpoint": "/services/control-api/latest/",
  "capability": "Mesh",
  "runtime": "GO",
  "documentation": "/services/control-api/latest/",
  "prometheus_job": "control-api",
  "enable_instance_metrics": true,
  "enable_historical_metrics": true,
  "business_impact": "low",
  "external_links": [
    {
      "title": "Grey Matter",
      "url": "https://greymatter.io"
    }
  ]
}
```

## Instance Metrics

### `GET /metrics/{instance_id}`

Returns Grey Matter metrics for a given instance when provided an instance ID.

#### Parameters

| Name         | In   | Type   | Required | Description                                      |
| ------------ | ---- | ------ | -------- | ------------------------------------------------ |
| instance\_id | path | string | true     | Corresponding to the 'name' field of an instance |

#### Response

```javascript
[
  {
    "grey-matter-metrics-version": "1.0.0",
    "Total/requests": 0,
    "HTTP/requests": 0,
    "HTTPS/requests": 0,
    "RPC/requests": 0,
    "RPC_TLS/requests": 0,
    "all/requests": 0,
    "all/routes": 0,
    "all/latency_ms.avg": 0,
    "all/latency_ms.count": 0,
    "all/latency_ms.max": 0,
    "all/latency_ms.min": 0,
    "all/latency_ms.sum": 0,
    "all/latency_ms.p50": 0,
    "all/latency_ms.p90": 0,
    "all/latency_ms.p95": 0,
    "all/latency_ms.p99": 0,
    "all/latency_ms.p9990": 0,
    "all/latency_ms.p9999": 0,
    "all/errors.count": 0,
    "all/in_throughput": 0,
    "all/out_throughput": 0,
    "go_metrics/runtime/num_goroutines": 14,
    "system/start_time": 1548167566942,
    "system/cpu.pct": 2.275601,
    "system/cpu_cores": 8,
    "os": "linux",
    "os_arch": "amd64",
    "system/memory/available": 17711955968,
    "system/memory/used": 8031883264,
    "system/memory/used_percent": 31.84562,
    "process/memory/used": 72808696
  }
]
```

## Logging

### `GET /logging`

Returns the current log level configured.

#### Response

```
"current log level = debug"
```

### `PUT /logging`

Configures a new logging level.

#### Parameters

| Name  | In    | Type   | Required | Description                 |
| ----- | ----- | ------ | -------- | --------------------------- |
| level | query | string | true     | The log level to configure. |

#### Enums

| Parameter | Value |
| --------- | ----- |
| level     | error |
| level     | info  |
| level     | debug |

<br>

#### Response

```
"current log level = info"
```
