# REST Resource: projects.locations.applications.workloads

- [Resource: Workload](https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads#Workload)
  - [JSON representation](https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads#Workload.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads#State)
- [Methods](https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads#METHODS_SUMMARY)

## Resource: Workload

Workload is an App Hub data model that contains a discovered workload, which represents a binary deployment (such as managed instance groups (MIGs) and GKE deployments) that performs the smallest logical subset of business functionality.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "description": string, "workloadReference": { object (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/WorkloadReference`) }, "workloadProperties": { object (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/WorkloadProperties`) }, "discoveredWorkload": string, "attributes": { object (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/Attributes`) }, "createTime": string, "updateTime": string, "uid": string, "state": enum (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads#State`) } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of the Workload. Format: `"projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}"` |
| `displayName` | `string` Optional. User-defined name for the Workload. Can have a maximum length of 63 characters. |
| `description` | `string` Optional. User-defined description of a Workload. Can have a maximum length of 2048 characters. |
| `workloadReference` | ``object (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/WorkloadReference`)`` Output only. Reference of an underlying compute resource represented by the Workload. These are immutable. |
| `workloadProperties` | ``object (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/WorkloadProperties`)`` Output only. Properties of an underlying compute resource represented by the Workload. These are immutable. |
| `discoveredWorkload` | `string` Required. Immutable. The resource name of the original discovered workload. |
| `attributes` | ``object (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/Attributes`)`` Optional. Consumer provided attributes. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Create time. 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. Update time. 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"`. |
| `uid` | `string` Output only. A universally unique identifier (UUID) for the `Workload` in the UUID4 format. |
| `state` | ``enum (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads#State`)`` Output only. Workload state. |

## State

Workload state.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Unspecified state. |
| `CREATING` | The Workload is being created. |
| `ACTIVE` | The Workload is ready. |
| `DELETING` | The Workload is being deleted. |
| `DETACHED` | The underlying compute resources have been deleted. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads/create` | Creates a Workload in an Application. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads/delete` | Deletes a Workload from an Application. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads/get` | Gets a Workload in an Application. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads/list` | Lists Workloads in an Application. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.applications.workloads/patch` | Updates a Workload in an Application. |