GetSerialPortOutput
Returns the serial port output of the specified Instance resource.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetInstanceSerialPortOutputRequest =
cloudApi.compute.instance_service.GetInstanceSerialPortOutputRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.InstanceServiceClient);
const result = await client.getSerialPortOutput(
GetInstanceSerialPortOutputRequest.fromPartial({
instanceId: "instanceId",
// port: 0
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.compute.v1.instance_service_pb2 import GetInstanceSerialPortOutputRequest
from yandex.cloud.compute.v1.instance_service_pb2_grpc import InstanceServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(InstanceServiceStub)
response = service.GetSerialPortOutput(
GetInstanceSerialPortOutputRequest(
instance_id="instanceId",
# port = 0
)
)
print(response)
GetInstanceSerialPortOutputRequest
instanceId
: string
ID of the instance to return the serial port output for.
port
: int64
Serial port to retrieve data from. The default is 1.
GetInstanceSerialPortOutputResponse
contents
: string
The contents of the serial port output, starting from the time when the instance started to boot.