curl --request GET \
--url https://api.example.com/compute/v1/virtualmachines/{name}import requests
url = "https://api.example.com/compute/v1/virtualmachines/{name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/compute/v1/virtualmachines/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/compute/v1/virtualmachines/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/compute/v1/virtualmachines/{name}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/compute/v1/virtualmachines/{name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/compute/v1/virtualmachines/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"virtualMachine": {
"name": "<string>",
"image": "<string>",
"machineClass": "<string>",
"ports": [
{
"name": "<string>",
"guestPort": 123
}
],
"sshAuthorizedKeys": [
{
"publicKey": "<string>",
"username": "<string>"
}
],
"status": {
"id": "<string>",
"state": "MACHINE_STATE_UNSPECIFIED",
"ready": true,
"message": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
},
"accessCredential": {
"vncPassword": "<string>"
}
}Get virtual machine
Reads one virtual machine by name in your tenant. The response also carries access_credential, the VM’s screen sharing password, recorded when the VM was created. It is returned only on Get (never on List), only to the tenant that owns the machine, and is omitted — not an error — when the credential has not been created, when the deployment does not serve credentials, or when your token lacks the compute:ReadMachineCredential scope.
curl --request GET \
--url https://api.example.com/compute/v1/virtualmachines/{name}import requests
url = "https://api.example.com/compute/v1/virtualmachines/{name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/compute/v1/virtualmachines/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/compute/v1/virtualmachines/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/compute/v1/virtualmachines/{name}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/compute/v1/virtualmachines/{name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/compute/v1/virtualmachines/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"virtualMachine": {
"name": "<string>",
"image": "<string>",
"machineClass": "<string>",
"ports": [
{
"name": "<string>",
"guestPort": 123
}
],
"sshAuthorizedKeys": [
{
"publicKey": "<string>",
"username": "<string>"
}
],
"status": {
"id": "<string>",
"state": "MACHINE_STATE_UNSPECIFIED",
"ready": true,
"message": "<string>"
},
"createdAt": "2023-11-07T05:31:56Z"
},
"accessCredential": {
"vncPassword": "<string>"
}
}Path Parameters
Response
OK
VirtualMachine is the friendly view/return shape of a VM.
Show child attributes
Show child attributes
access_credential is optional: absent when the VM has no credential recorded yet, when this deployment does not serve credentials, or when the caller's token does not carry the compute:ReadMachineCredential scope. A narrowed token is not an error — the machine is returned without it.
Show child attributes
Show child attributes