# REST Resource: projects.locations.deploymentGroups

- [Resource: DeploymentGroup](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup)
  - [JSON representation](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.SCHEMA_REPRESENTATION)
  - [State](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.State)
  - [DeploymentUnit](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.DeploymentUnit)
    - [JSON representation](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.DeploymentUnit.SCHEMA_REPRESENTATION)
  - [ProvisioningState](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.ProvisioningState)
- [Methods](https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#METHODS_SUMMARY)

## Resource: DeploymentGroup

A DeploymentGroup is a collection of DeploymentUnits that in a DAG-like structure.

| JSON representation |
|---|
| ``` { "name": string, "createTime": string, "updateTime": string, "labels": { string: string, ... }, "annotations": { string: string, ... }, "state": enum (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.State`), "stateDescription": string, "deploymentUnits": [ { object (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.DeploymentUnit`) } ], "provisioningState": enum (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.ProvisioningState`), "provisioningStateDescription": string, "provisioningError": { object (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/Status`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The name of the deployment group. Format: 'projects/{projectId}/locations/{location}/deploymentGroups/{deploymentGroup}'. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time when the deployment group was created. 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"`. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Time when the deployment group was last updated. 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"`. |
| `labels` | `map (key: string, value: string)` Optional. User-defined metadata for the deployment group. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `annotations` | `map (key: string, value: string)` Optional. Arbitrary key-value metadata storage e.g. to help client tools identify deployment group during automation. See <https://google.aip.dev/148#annotations> for details on format and size limitations. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `state` | ``enum (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.State`)`` Output only. Current state of the deployment group. |
| `stateDescription` | `string` Output only. Additional information regarding the current state. |
| `deploymentUnits[]` | ``object (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.DeploymentUnit`)`` The deployment units of the deployment group in a DAG like structure. When a deployment group is being provisioned, the deployment units are deployed in a DAG order. The provided units must be in a DAG order, otherwise an error will be returned. |
| `provisioningState` | ``enum (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup.ProvisioningState`)`` Output only. The provisioning state of the deployment group. |
| `provisioningStateDescription` | `string` Output only. Additional information regarding the current provisioning state. |
| `provisioningError` | ``object (`https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/Status`)`` Output only. The error status of the deployment group provisioning or deprovisioning. |

### State

Possible states of a deployment group.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The default value. This value is used if the state is omitted. |
| `CREATING` | The deployment group is being created. |
| `ACTIVE` | The deployment group is healthy. |
| `UPDATING` | The deployment group is being updated. |
| `DELETING` | The deployment group is being deleted. |
| `FAILED` | The deployment group has encountered an unexpected error. |
| `SUSPENDED` | The deployment group is no longer being actively reconciled. This may be the result of recovering the project after deletion. |
| `DELETED` | The deployment group has been deleted. |

### DeploymentUnit

A DeploymentUnit is a container for a deployment and its dependencies. An existing deployment can be provided directly in the unit, or the unit can act as a placeholder to define the DAG, with the deployment specs supplied in a `provisionDeploymentRequest`.

| JSON representation |
|---|
| ``` { "id": string, "dependencies": [ string ], "deployment": string } ``` |

| Fields ||
|---|---|
| `id` | `string` The id of the deployment unit. Must be unique within the deployment group. |
| `dependencies[]` | `string` Required. The IDs of the deployment units within the deployment group that this unit depends on. |
| `deployment` | `string` Optional. The name of the deployment to be provisioned. Format: 'projects/{projectId}/locations/{location}/deployments/{deployment}'. |

### ProvisioningState

Possible provisioning states of a deployment group.

| Enums ||
|---|---|
| `PROVISIONING_STATE_UNSPECIFIED` | Unspecified provisioning state. |
| `PROVISIONING` | The deployment group is being provisioned. |
| `PROVISIONED` | The deployment group is provisioned. |
| `FAILED_TO_PROVISION` | The deployment group failed to be provisioned. |
| `DEPROVISIONING` | The deployment group is being deprovisioned. |
| `DEPROVISIONED` | The deployment group is deprovisioned. |
| `FAILED_TO_DEPROVISION` | The deployment group failed to be deprovisioned. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/create` | Creates a `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup` The newly created DeploymentGroup will be in the `CREATING` state and can be retrieved via Get and List calls. |
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/delete` | Deletes a `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup` |
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/deprovision` | Deprovisions a deployment group. |
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/get` | Get a DeploymentGroup for a given project and location. |
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/list` | List DeploymentGroups for a given project and location. |
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/patch` | Updates a `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups#DeploymentGroup` |
| ### `https://docs.cloud.google.com/infrastructure-manager/docs/reference/rest/v1/projects.locations.deploymentGroups/provision` | Provisions a deployment group. |