# REST Resource: projects.locations.hostGroups

- [Resource: HostGroup](https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#HostGroup)
  - [JSON representation](https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#HostGroup.SCHEMA_REPRESENTATION)
- [Type](https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#Type)
- [State](https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#State)
- [Methods](https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#METHODS_SUMMARY)

## Resource: HostGroup

Host group is a collection of hosts that can be used for accessing a Block Volume.

| JSON representation |
|---|
| ``` { "name": string, "type": enum (`https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#Type`), "state": enum (`https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#State`), "createTime": string, "hosts": [ string ], "osType": enum (`https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/OsType`), "description": string, "labels": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of the host group. Format: `projects/{projectNumber}/locations/{locationId}/hostGroups/{hostGroupId}`. |
| `type` | ``enum (`https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#Type`)`` Required. Type of the host group. |
| `state` | ``enum (`https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups#State`)`` Output only. State of the host group. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Create time of the host group. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `hosts[]` | `string` Required. The list of hosts associated with the host group. |
| `osType` | ``enum (`https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/OsType`)`` Required. The OS type of the host group. It indicates the type of operating system used by all of the hosts in the HostGroup. All hosts in a HostGroup must be of the same OS type. This can be set only when creating a HostGroup. |
| `description` | `string` Optional. Description of the host group. |
| `labels` | `map (key: string, value: string)` Optional. Labels of the host group. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

## Type

Types of host group.

| Enums ||
|---|---|
| `TYPE_UNSPECIFIED` | Unspecified type for host group. |
| `ISCSI_INITIATOR` | iSCSI initiator host group. |

## State

Host group states.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Unspecified state for host group. |
| `CREATING` | Host group is creating. |
| `READY` | Host group is ready. |
| `UPDATING` | Host group is updating. |
| `DELETING` | Host group is deleting. |
| `DISABLED` | Host group is disabled. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups/create` | Creates a new host group. |
| ### `https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups/delete` | Deletes a host group. |
| ### `https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups/get` | Returns details of the specified host group. |
| ### `https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups/list` | Returns a list of host groups in a `location`. |
| ### `https://docs.cloud.google.com/netapp/volumes/docs/reference/rest/v1beta1/projects.locations.hostGroups/patch` | Updates an existing host group. |