# Method: projects.zones.instances.lookupEffectiveGuestPolicy

- [HTTP request](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.EffectiveGuestPolicy.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#body.aspect)
- [SourcedPackage](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackage)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackage.SCHEMA_REPRESENTATION)
- [SourcedPackageRepository](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackageRepository)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackageRepository.SCHEMA_REPRESENTATION)
- [SourcedSoftwareRecipe](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedSoftwareRecipe)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedSoftwareRecipe.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#try-it)

Lookup the effective guest policy that applies to a VM instance. This lookup merges all policies that are assigned to the instance ancestry.

### HTTP request

`POST https://osconfig.googleapis.com/v1beta/{instance=projects/*/zones/*/instances/*}:lookupEffectiveGuestPolicy`

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

### Path parameters

| Parameters ||
|---|---|
| `instance` | `string` Required. The VM instance whose policies are being looked up. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "osShortName": string, "osVersion": string, "osArchitecture": string } ``` |

| Fields ||
|---|---|
| `osShortName` | `string` Short name of the OS running on the instance. The OS Config agent only provides this field for targeting if OS Inventory is enabled for that instance. |
| `osVersion` | `string` Version of the OS running on the instance. The OS Config agent only provides this field for targeting if OS Inventory is enabled for that VM instance. |
| `osArchitecture` | `string` Architecture of OS running on the instance. The OS Config agent only provides this field for targeting if OS Inventory is enabled for that instance. |

### Response body

The effective guest policy that applies to a VM instance.

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

| JSON representation |
|---|
| ``` { "packages": [ { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackage`) } ], "packageRepositories": [ { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackageRepository`) } ], "softwareRecipes": [ { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedSoftwareRecipe`) } ] } ``` |

| Fields ||
|---|---|
| `packages[]` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackage`)`` List of package configurations assigned to the VM instance. |
| `packageRepositories[]` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedPackageRepository`)`` List of package repository configurations assigned to the VM instance. |
| `softwareRecipes[]` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.zones.instances/lookupEffectiveGuestPolicy#SourcedSoftwareRecipe`)`` List of recipes assigned to the VM instance. |

### Authorization scopes

Requires the following OAuth scope:

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

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

## SourcedPackage

A guest policy package including its source.

| JSON representation |
|---|
| ``` { "source": string, "package": { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#Package`) } } ``` |

| Fields ||
|---|---|
| `source` | `string` Name of the guest policy providing this config. |
| `package` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#Package`)`` A software package to configure on the VM instance. |

## SourcedPackageRepository

A guest policy package repository including its source.

| JSON representation |
|---|
| ``` { "source": string, "packageRepository": { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#PackageRepository`) } } ``` |

| Fields ||
|---|---|
| `source` | `string` Name of the guest policy providing this config. |
| `packageRepository` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#PackageRepository`)`` A software package repository to configure on the VM instance. |

## SourcedSoftwareRecipe

A guest policy recipe including its source.

| JSON representation |
|---|
| ``` { "source": string, "softwareRecipe": { object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#SoftwareRecipe`) } } ``` |

| Fields ||
|---|---|
| `source` | `string` Name of the guest policy providing this config. |
| `softwareRecipe` | ``object (`https://docs.cloud.google.com/compute/docs/osconfig/rest/v1beta/projects.guestPolicies#SoftwareRecipe`)`` A software recipe to configure on the VM instance. |