Search in sources :

Example 1 with SerialPortOutput

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());
    }
}
Also used : SerialPortOutput(com.google.cloud.compute.v1.SerialPortOutput) InstancesClient(com.google.cloud.compute.v1.InstancesClient)

Aggregations

InstancesClient (com.google.cloud.compute.v1.InstancesClient)1 SerialPortOutput (com.google.cloud.compute.v1.SerialPortOutput)1