# Method: projects.locations.global.hubs.listSpokes

- [HTTP request](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.request_body)
- [Response body](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.ListHubSpokesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#body.aspect)
- [SpokeView](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#SpokeView)
- [Try it!](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#try-it)

Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.

### HTTP request

`GET https://networkconnectivity.googleapis.com/v1/{name=projects/*/locations/global/hubs/*}:listSpokes`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The name of the hub. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `networkconnectivity.hubs.listSpokes` |

### Query parameters

| Parameters ||
|---|---|
| `spokeLocations[]` | `string` A list of locations. Specify one of the following: `[global]`, a single region (for example, `[us-central1]`), or a combination of values (for example, `[global, us-central1, us-west1]`). If the spokeLocations field is populated, the list of results includes only spokes in the specified location. If the spokeLocations field is not populated, the list of results includes spokes in all locations. |
| `pageSize` | `integer` The maximum number of results to return per page. |
| `pageToken` | `string` The page token. |
| `filter` | `string` An expression that filters the list of results. |
| `orderBy` | `string` Sort the results by name or createTime. |
| `view` | ``enum (`https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#SpokeView`)`` The view of the spoke to return. The view that you use determines which spoke fields are included in the response. |

### Request body

The request body must be empty.

### Response body

The response for `https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.hubs/listSpokes#google.cloud.networkconnectivity.v1.HubService.ListHubSpokes`.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "spokes": [ { object (`https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/Shared.Types/Spoke`) } ], "nextPageToken": string, "unreachable": [ string ] } ``` |

| Fields ||
|---|---|
| `spokes[]` | ``object (`https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/Shared.Types/Spoke`)`` The requested spokes. The spoke fields can be partially populated based on the `view` field in the request message. |
| `nextPageToken` | `string` The token for the next page of the response. To see more results, use this value as the pageToken for your next request. If this value is empty, there are no more results. |
| `unreachable[]` | `string` Locations that could not be reached. |

### Authorization scopes

Requires the following OAuth scope:

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

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

## SpokeView

Enum that controls which spoke fields are included in the response.

| Enums ||
|---|---|
| `SPOKE_VIEW_UNSPECIFIED` | The spoke view is unspecified. When the spoke view is unspecified, the API returns the same fields as the `BASIC` view. |
| `BASIC` | Includes `name`, `createTime`, `hub`, `uniqueId`, `state`, `reasons`, and `spokeType`. This is the default value. |
| `DETAILED` | Includes all spoke fields except `labels`. You can use the `DETAILED` view only when you set the `spokeLocations` field to `[global]`. |