- [HTTP request](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.request_body)
- [Response body](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.SerialPortOutput.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/compute/docs/reference/rest/v1/instances/getSerialPortOutput#try-it)

Returns the last 1 MB of serial port output from the specified instance.

### HTTP request

Choose an endpoint:
global africa-south1 asia-east1 asia-east2 asia-northeast1 asia-northeast2 asia-northeast3 asia-south1 asia-south2 asia-southeast1 asia-southeast2 asia-southeast3 australia-southeast1 australia-southeast2 europe-central2 europe-north1 europe-north2 europe-southwest1 europe-west1 europe-west10 europe-west12 europe-west2 europe-west3 europe-west4 europe-west6 europe-west8 europe-west9 me-central1 me-central2 me-west1 northamerica-northeast1 northamerica-northeast2 northamerica-south1 southamerica-east1 southamerica-west1 us-central1 us-east1 us-east4 us-east5 us-south1 us-west1 us-west2 us-west3 us-west4   
`GET https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `project` | `string` Project ID for this request. |
| `zone` | `string` The name of the zone for this request. |
| `instance` | `string` Name of the instance for this request. |

### Query parameters

| Parameters ||
|---|---|
| `port` | `integer` Specifies which COM or serial port to retrieve data from. |
| `start` | `string (https://developers.google.com/discovery/v1/type-format format)` Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size. |

### Request body

The request body must be empty.

### Response body

An instance serial console output.

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

| JSON representation |
|---|
| ``` { "kind": string, "contents": string, "start": string, "next": string, "selfLink": string } ``` |

| Fields ||
|---|---|
| `kind` | `string` Output only. Type of the resource. Always `compute#serialPortOutput` for serial port output. |
| `contents` | `string` Output only. The contents of the console output. |
| `start` | `string (https://developers.google.com/discovery/v1/type-format format)` The starting byte position of the output that was returned. This should match the `start` parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request. |
| `next` | `string (https://developers.google.com/discovery/v1/type-format format)` Output only. The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the `start` parameter. |
| `selfLink` | `string` Output only. Server-defined URL for this resource. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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

### IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following [IAM](https://cloud.google.com/iam/docs/) permissions:

- `compute.instances.getSerialPortOutput`

To find predefined roles that contain those permissions, see [Compute Engine IAM Roles](https://docs.cloud.google.com/compute/docs/access/iam).