# Method: apps.services.versions.instances.debug

- [HTTP request](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#body.response_body)
- [Authorization Scopes](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#body.aspect)
- [Try it!](https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions.instances/debug#try-it)

Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.

Only applicable for instances in App Engine flexible environment.

### HTTP request

`POST https://appengine.googleapis.com/v1/{name=apps/*/services/*/versions/*/instances/*}:debug`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Name of the resource requested. Example: `apps/myapp/services/default/versions/v1/instances/instance-1`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `appengine.instances.enableDebug` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "sshKey": string } ``` |

| Fields ||
|---|---|
| `sshKey` | `string` Public SSH key to add to the instance. Examples: - `[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]` - `[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}` For more information, see [Adding and Removing SSH Keys](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `sshKey`: - `appengine.instances.enableDebug` |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/appengine/docs/admin-api/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization Scopes

Requires the following OAuth scope:

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

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