# Method: projects.locations.zones.routers.diagnose

- [HTTP request](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#body.request_body)
- [Response body](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#body.DiagnoseRouterResponse.SCHEMA_REPRESENTATION)
- [Authorization Scopes](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#body.aspect)
- [RouterStatus](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#RouterStatus)
  - [JSON representation](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#RouterStatus.SCHEMA_REPRESENTATION)
- [BgpPeerStatus](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpPeerStatus)
  - [JSON representation](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpPeerStatus.SCHEMA_REPRESENTATION)
- [BgpStatus](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpStatus)
- [PrefixCounter](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#PrefixCounter)
  - [JSON representation](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#PrefixCounter.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/distributed-cloud/connected/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#try-it)

Get the diagnostics of a single router resource.

### HTTP request

`GET https://edgenetwork.googleapis.com/v1/{name=projects/*/locations/*/zones/*/routers/*}:diagnose`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of the router resource. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains data with the following structure:
DiagnoseRouterResponse contains the current status for a specific router.

| JSON representation |
|---|
| ``` { "updateTime": string, "result": { object (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#RouterStatus`) } } ``` |

| Fields ||
|---|---|
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` The time when the router status was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `result` | ``object (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#RouterStatus`)`` The network status of a specific router. |

### Authorization Scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).

## RouterStatus

Describing the current status of a router.

| JSON representation |
|---|
| ``` { "network": string, "bgpPeerStatus": [ { object (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpPeerStatus`) } ] } ``` |

| Fields ||
|---|---|
| `network` | `string` The canonical name of the network to which this router belongs. |
| `bgpPeerStatus[]` | ``object (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpPeerStatus`)`` A list of BgpPeerStatus objects, describing all BGP peers related to this router. |

## BgpPeerStatus

Status of a BGP peer.

| JSON representation |
|---|
| ``` { "name": string, "ipAddress": string, "peerIpAddress": string, "status": enum (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpStatus`), "state": string, "uptime": string, "uptimeSeconds": string, "prefixCounter": { object (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#PrefixCounter`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Name of this BGP peer. Unique within the Routers resource. |
| `ipAddress` | `string` IP address of the local BGP interface. |
| `peerIpAddress` | `string` IP address of the remote BGP interface. |
| `status` | ``enum (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#BgpStatus`)`` The current status of BGP. |
| `state` | `string` BGP state as specified in RFC1771. |
| `uptime` | `string` Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds |
| `uptimeSeconds` | `string (https://developers.google.com/discovery/v1/type-format format)` Time this session has been up, in seconds. |
| `prefixCounter` | ``object (`https://docs.cloud.google.com/distributed-cloud/edge/1.6.0/docs/reference/network/rest/v1/projects.locations.zones.routers/diagnose#PrefixCounter`)`` A collection of counts for prefixes. |

## BgpStatus

Status of the BGP peer: {UP, DOWN}

| Enums ||
|---|---|
| `UNKNOWN` | The default status indicating BGP session is in unknown state. |
| `UP` | The UP status indicating BGP session is established. |
| `DOWN` | The DOWN state indicating BGP session is not established yet. |

## PrefixCounter

PrefixCounter contains a collection of prefixes related counts.

| JSON representation |
|---|
| ``` { "advertised": string, "denied": string, "received": string, "sent": string, "suppressed": string, "withdrawn": string } ``` |

| Fields ||
|---|---|
| `advertised` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of prefixes advertised. |
| `denied` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of prefixes denied. |
| `received` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of prefixes received. |
| `sent` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of prefixes sent. |
| `suppressed` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of prefixes suppressed. |
| `withdrawn` | `string (https://developers.google.com/discovery/v1/type-format format)` Number of prefixes withdrawn. |