# REST Resource: projects.locations.serviceProjectAttachments

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

## Resource: ServiceProjectAttachment

ServiceProjectAttachment represents an attachment from a service project to a host project. Service projects contain the underlying cloud infrastructure resources, and expose these resources to the host project through a ServiceProjectAttachment. With the attachments, the host project can provide an aggregated view of resources across all service projects.

| JSON representation |
|---|
| ``` { "name": string, "serviceProject": string, "createTime": string, "uid": string, "state": enum (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.serviceProjectAttachments#State`) } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of a ServiceProjectAttachment. Format: `"projects/{host-project-id}/locations/global/serviceProjectAttachments/{service-project-id}."` |
| `serviceProject` | `string` Required. Immutable. Service project name in the format: `"projects/abc"` or `"projects/123"`. As input, project name with either project id or number are accepted. As output, this field will contain project number. |
| `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"`. |
| `uid` | `string` Output only. A globally unique identifier (in UUID4 format) for the `ServiceProjectAttachment`. |
| `state` | ``enum (`https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.serviceProjectAttachments#State`)`` Output only. ServiceProjectAttachment state. |

## State

ServiceProjectAttachment state.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Unspecified state. |
| `CREATING` | The ServiceProjectAttachment is being created. |
| `ACTIVE` | The ServiceProjectAttachment is ready. This means Services and Workloads under the corresponding ServiceProjectAttachment is ready for registration. |
| `DELETING` | The ServiceProjectAttachment is being deleted. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.serviceProjectAttachments/create` | Attaches a service project to the host project. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.serviceProjectAttachments/delete` | Deletes a service project attachment. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.serviceProjectAttachments/get` | Gets a service project attachment. |
| ### `https://docs.cloud.google.com/app-hub/docs/reference/rest/v1alpha/projects.locations.serviceProjectAttachments/list` | Lists service projects attached to the host project. |