Method: instances.getSerialPortOutput Stay organized with collections Save and categorize content based on your preferences.
- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Returns the last 1 MB of serial port output from the specified instance.
HTTP request
GET https://compute.googleapis.com/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/serialPort
The URL usesgRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to theservice error catalog
Path parameters
| Parameters | |
|---|---|
project |
Project ID for this request. |
zone |
The name of the zone for this request. |
instance |
Name of the instance for this request. |
Query parameters
| Parameters | |
|---|---|
port |
Specifies which COM or serial port to retrieve data from. |
start |
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 If the output for that byte position is available, this field matches the 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 |
[Output Only] Type of the resource. Always |
contents |
[Output Only] The contents of the console output. |
start |
The starting byte position of the output that was returned. This should match the |
next |
[Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the |
selfLink |
[Output Only] Server-defined URL for this resource. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute.readonlyhttps://www.googleapis.com/auth/computehttps://www.googleapis.com/auth/cloud-platform
For more information, see theAuthentication Overview.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the followingIAM permissions:
compute.instances.getSerialPortOutput
To find predefined roles that contain those permissions, seeCompute Engine IAM Roles.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-18 UTC.