use of com.google.cloud.compute.v1.SerialPortOutput in project java-docs-samples by GoogleCloudPlatform.
the class GetInstanceSerialPort method getInstanceSerialPort.
// Prints an instance serial port output.
public static void getInstanceSerialPort(String projectId, String zone, String instanceName) throws IOException {
// Instantiates a client.
try (InstancesClient instancesClient = InstancesClient.create()) {
SerialPortOutput serialPortOutput = instancesClient.getSerialPortOutput(projectId, zone, instanceName);
System.out.printf("Output from instance serial port %s", serialPortOutput.getContents());
}
}
Aggregations