# REST Resource: namespaces.routes

- [Resource: Route](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#Route)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#Route.SCHEMA_REPRESENTATION)
- [RouteSpec](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteSpec)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteSpec.SCHEMA_REPRESENTATION)
- [RouteStatus](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteStatus)
  - [JSON representation](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteStatus.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#METHODS_SUMMARY)

## Resource: Route

Route is responsible for configuring ingress over a collection of Revisions. Some of the Revisions a Route distributes traffic over may be specified by referencing the Configuration responsible for creating them; in these cases the Route is additionally responsible for monitoring the Configuration for "latest ready" revision changes, and smoothly rolling out latest revisions. Cloud Run currently supports referencing a single Configuration to automatically deploy the "latest ready" Revision from that Configuration.

| JSON representation |
|---|
| ``` { "apiVersion": string, "kind": string, "metadata": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/ObjectMeta`) }, "spec": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteSpec`) }, "status": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteStatus`) } } ``` |

| Fields ||
|---|---|
| `apiVersion` | `string` The API version for this call such as "serving.knative.dev/v1". |
| `kind` | `string` The kind of this resource, in this case always "Route". |
| `metadata` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/ObjectMeta`)`` Metadata associated with this Route, including name, namespace, labels, and annotations. |
| `spec` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteSpec`)`` Spec holds the desired state of the Route (from the client). |
| `status` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes#RouteStatus`)`` Status communicates the observed state of the Route (from the controller). |

## RouteSpec

RouteSpec holds the desired state of the Route (from the client).

| JSON representation |
|---|
| ``` { "traffic": [ { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/TrafficTarget`) } ] } ``` |

| Fields ||
|---|---|
| `traffic[]` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/TrafficTarget`)`` Traffic specifies how to distribute traffic over a collection of Knative Revisions and Configurations. Cloud Run currently supports a single configurationName. |

## RouteStatus

RouteStatus communicates the observed state of the Route (from the controller).

| JSON representation |
|---|
| ``` { "observedGeneration": integer, "conditions": [ { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/Condition`) } ], "traffic": [ { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/TrafficTarget`) } ], "url": string, "address": { object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/Addressable`) } } ``` |

| Fields ||
|---|---|
| `observedGeneration` | `integer` ObservedGeneration is the 'Generation' of the Route that was last processed by the controller. Clients polling for completed reconciliation should poll until observedGeneration = metadata.generation and the Ready condition's status is True or False. Note that providing a TrafficTarget that has latestRevision=True will result in a Route that does not increment either its metadata.generation or its observedGeneration, as new "latest ready" revisions from the Configuration are processed without an update to the Route's spec. |
| `conditions[]` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/Condition`)`` Conditions communicates information about ongoing/complete reconciliation processes that bring the "spec" inline with the observed state of the world. |
| `traffic[]` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/TrafficTarget`)`` Traffic holds the configured traffic distribution. These entries will always contain RevisionName references. When ConfigurationName appears in the spec, this will hold the LatestReadyRevisionName that was last observed. |
| `url` | `string` URL holds the url that will distribute traffic over the provided traffic targets. It generally has the form: `https://{route-hash}-{project-hash}-{cluster-level-suffix}.a.run.app` |
| `address` | ``object (`https://docs.cloud.google.com/run/docs/reference/rest/v1/Addressable`)`` Similar to url, information on where the service is available on HTTP. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes/get` | Get information about a route. |
| ### `https://docs.cloud.google.com/run/docs/reference/rest/v1/namespaces.routes/list` | List routes. |