# Method: projects.locations.nodes.getGuestAttributes

- [HTTP request](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.GetGuestAttributesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#body.aspect_1)
- [GuestAttributes](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributes)
  - [JSON representation](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributes.SCHEMA_REPRESENTATION)
- [GuestAttributesValue](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesValue)
  - [JSON representation](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesValue.SCHEMA_REPRESENTATION)
- [GuestAttributesEntry](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesEntry)
  - [JSON representation](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesEntry.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#try-it)

Retrieves the guest attributes for the node.

### HTTP request

`POST https://tpu.googleapis.com/v2/{name=projects/*/locations/*/nodes/*}:getGuestAttributes`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "queryPath": string, "workerIds": [ string ] } ``` |

| Fields ||
|---|---|
| `queryPath` | `string` The guest attributes path to be queried. |
| `workerIds[]` | `string` The 0-based worker ID. If it is empty, all workers' GuestAttributes will be returned. |

### Response body

Response for `https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#google.cloud.tpu.v2.Tpu.GetGuestAttributes`.

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

| JSON representation |
|---|
| ``` { "guestAttributes": [ { object (`https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributes`) } ] } ``` |

| Fields ||
|---|---|
| `guestAttributes[]` | ``object (`https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributes`)`` The guest attributes for the TPU workers. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `tpu.nodes.get`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## GuestAttributes

A guest attributes.

| JSON representation |
|---|
| ``` { "queryPath": string, "queryValue": { object (`https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesValue`) } } ``` |

| Fields ||
|---|---|
| `queryPath` | `string` The path to be queried. This can be the default namespace ('/') or a nested namespace ('/\<namespace\>/') or a specified key ('/\<namespace\>/\<key\>') |
| `queryValue` | ``object (`https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesValue`)`` The value of the requested queried path. |

## GuestAttributesValue

Array of guest attribute namespace/key/value tuples.

| JSON representation |
|---|
| ``` { "items": [ { object (`https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesEntry`) } ] } ``` |

| Fields ||
|---|---|
| `items[]` | ``object (`https://docs.cloud.google.com/tpu/docs/reference/rest/v2/projects.locations.nodes/getGuestAttributes#GuestAttributesEntry`)`` The list of guest attributes entries. |

## GuestAttributesEntry

A guest attributes namespace/key/value entry.

| JSON representation |
|---|
| ``` { "namespace": string, "key": string, "value": string } ``` |

| Fields ||
|---|---|
| `namespace` | `string` Namespace for the guest attribute entry. |
| `key` | `string` Key for the guest attribute entry. |
| `value` | `string` Value for the guest attribute entry. |