curl --request GET \
--url https://api.example.com/compute/v1/baremetalmachines/{name}import requests
url = "https://api.example.com/compute/v1/baremetalmachines/{name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/compute/v1/baremetalmachines/{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/baremetalmachines/{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/baremetalmachines/{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/baremetalmachines/{name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/compute/v1/baremetalmachines/{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{
"bareMetalMachine": {
"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": {
"username": "<string>",
"password": "<string>"
}
}Get bare metal machine
Reads one bare-metal machine by name in your tenant. The response also carries access_credential, the machine’s managed local account, recorded when the machine was provisioned. 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/baremetalmachines/{name}import requests
url = "https://api.example.com/compute/v1/baremetalmachines/{name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/compute/v1/baremetalmachines/{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/baremetalmachines/{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/baremetalmachines/{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/baremetalmachines/{name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/compute/v1/baremetalmachines/{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{
"bareMetalMachine": {
"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": {
"username": "<string>",
"password": "<string>"
}
}Path Parameters
Response
OK
BareMetalMachine is the friendly view/return shape of a bare-metal Mac.
Show child attributes
Show child attributes
access_credential is optional: absent when the machine 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