> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/infra-controller/llms.txt.
> For full documentation content, see https://docs.nvidia.com/infra-controller/llms-full.txt.

# Retrieve a Machine

GET https://carbide-rest-api.carbide.svc.cluster.local/v2/org/{org}/carbide/machine/{machineId}

Org must have either an Infrastructure Provider entity or a Tenant entity.

If org has an Infrastructure Provider entity, then a user with `FORGE_PROVIDER_ADMIN` role can request details for any Machine on any Site owned by the Provider.

If org has a Tenant entity, then a user with `FORGE_TENANT_ADMIN` role can request details for any Machine associated with Tenant's active Instances.


Reference: https://docs.nvidia.com/infra-controller/infra-controller/rest-api-reference/api-reference/machine/get-machine

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: NCX Infra Controller REST API
  version: 1.0.0
paths:
  /v2/org/{org}/carbide/machine/{machineId}:
    get:
      operationId: get-machine
      summary: Retrieve a Machine
      description: >
        Org must have either an Infrastructure Provider entity or a Tenant
        entity.


        If org has an Infrastructure Provider entity, then a user with
        `FORGE_PROVIDER_ADMIN` role can request details for any Machine on any
        Site owned by the Provider.


        If org has a Tenant entity, then a user with `FORGE_TENANT_ADMIN` role
        can request details for any Machine associated with Tenant's active
        Instances.
      tags:
        - subpackage_machine
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: machineId
          in: path
          required: true
          schema:
            type: string
        - name: includeRelation
          in: query
          description: Related entity to expand
          required: false
          schema:
            $ref: >-
              #/components/schemas/V2OrgOrgCarbideMachineMachineIdGetParametersIncludeRelation
        - name: includeMetadata
          in: query
          description: >-
            Include Machine metadata e.g. BMC, DPU, GPU and Interface data. Can
            only be requested by Provider.
          required: false
          schema:
            type: boolean
        - name: Authorization
          in: header
          description: >-
            ```

            export JWT_BEARER_TOKEN="<jwt-bearer-token>"


            # Example org name: "acme-inc

            export ORG_NAME=<org-name>


            # Use the JWT bearer token in your API request auth header:

            curl -v -X GET -H "Content-Type: application/json" -H
            "Authorization: Bearer $JWT_BEARER_TOKEN"
            https://carbide-rest-api.carbide.svc.cluster.local/v2/org/$ORG_NAME/carbide/user/current

            ```
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Machine'
        '403':
          description: >-
            Error response when user is not authorized to call an endpoint or
            retrieve/modify objects
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CarbideAPIError'
servers:
  - url: https://carbide-rest-api.carbide.svc.cluster.local
components:
  schemas:
    V2OrgOrgCarbideMachineMachineIdGetParametersIncludeRelation:
      type: string
      enum:
        - InfrastructureProvider
        - Site
        - InstanceType
      title: V2OrgOrgCarbideMachineMachineIdGetParametersIncludeRelation
    MachineCapabilityType:
      type: string
      enum:
        - CPU
        - Memory
        - Storage
        - Network
        - GPU
        - InfiniBand
        - DPU
      description: Type of the Capability
      title: MachineCapabilityType
    MachineCapability:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/MachineCapabilityType'
          description: Type of the Capability
        name:
          type: string
          description: Name of the Capability component
        frequency:
          type:
            - string
            - 'null'
          description: Frequency of the Capability component, if available
        cores:
          type:
            - integer
            - 'null'
          description: Number of Cores in the Capability component, if applicable
        threads:
          type:
            - integer
            - 'null'
          description: Number of Threads in the Capability component, if applicable
        capacity:
          type:
            - string
            - 'null'
          description: Capacity of the Capability component, if applicable
        vendor:
          type:
            - string
            - 'null'
          description: Vendor of the Capability component, if available
        inactiveDevices:
          type: array
          items:
            type: integer
          description: A list of inactive devices
        count:
          type:
            - integer
            - 'null'
          description: Count of the Capability component
        deviceType:
          type:
            - string
            - 'null'
          description: Device Type of the Capability component, if available
      description: Describes capabilities of a Machine
      title: MachineCapability
    MachineInterface:
      type: object
      properties:
        id:
          type: string
          format: uuid
        machineId:
          type: string
        controllerInterfaceId:
          type: string
          format: uuid
        controllerSegmentId:
          type: string
          format: uuid
        attachedDpuMachineID:
          type:
            - string
            - 'null'
        subnetId:
          type:
            - string
            - 'null'
          format: uuid
        hostname:
          type: string
          format: hostname
        isPrimary:
          type: boolean
        macAddress:
          type: string
        ipAddresses:
          type: array
          items:
            type: string
          description: Array of IP addresses
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Describes an interface attached to a machine
      title: MachineInterface
    MachineHealthProbeSuccess:
      type: object
      properties:
        id:
          type: string
          description: Health probe identifier
        target:
          type:
            - string
            - 'null'
          description: Specific component targeted by health probe
      description: Describes results of successful Machine health probe
      title: MachineHealthProbeSuccess
    MachineHealthProbeAlert:
      type: object
      properties:
        id:
          type: string
          description: Health probe identifier
        target:
          type:
            - string
            - 'null'
          description: Specific component targeted by health probe
        inAlertSince:
          type:
            - string
            - 'null'
          description: Date/time since the alert has been in effect
        message:
          type: string
          description: Details of the failed health probe result
        tenantMessage:
          type:
            - string
            - 'null'
          description: Information provided by Tenant, if any
        classifications:
          type: array
          items:
            type: string
          description: Classifications for this alert, category or impact
      description: Describes results of a failed Machine health probe
      title: MachineHealthProbeAlert
    MachineHealth:
      type: object
      properties:
        source:
          type: string
          description: Describes how the health report was generated
        observedAt:
          type:
            - string
            - 'null'
          description: Date/time when health report was generated
        successes:
          type: array
          items:
            $ref: '#/components/schemas/MachineHealthProbeSuccess'
          description: Results from successful health probes for the Machine
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/MachineHealthProbeAlert'
          description: Results from failed health probes for the Machine
      description: Describes results of various Machine health probes and alerts
      title: MachineHealth
    MachineDMIData:
      type: object
      properties:
        boardName:
          type: string
        boardSerial:
          type: string
        boardVersion:
          type: string
        biosDate:
          type: string
        biosVersion:
          type: string
        productSerial:
          type: string
        chassisSerial:
          type: string
      description: Describes DMI data of a Machine
      title: MachineDMIData
    MachineBMCInfo:
      type: object
      properties:
        ip:
          type: string
          format: ipv4
        mac:
          type: string
        version:
          type: string
        firmwareRevision:
          type: string
      description: Describes BMC information of a Machine
      title: MachineBMCInfo
    MachineGPUInfo:
      type: object
      properties:
        name:
          type: string
        serial:
          type: string
        driverVersion:
          type: string
        vbiosVersion:
          type: string
        inforomVersion:
          type: string
        totalMemory:
          type: string
        frequency:
          type: string
        pciBusId:
          type: string
      description: Describes information about GPU of a Machine
      title: MachineGPUInfo
    MachineNetworkInterface:
      type: object
      properties:
        macAddress:
          type: string
        vendor:
          type: string
        device:
          type: string
        path:
          type: string
        numaNode:
          type: integer
        description:
          type: string
        slot:
          type: string
      description: Describes information about an Ethernet Interface of a Machine
      title: MachineNetworkInterface
    MachineInfiniBandInterface:
      type: object
      properties:
        guid:
          type: string
        vendor:
          type: string
        device:
          type: string
        path:
          type: string
        numaNode:
          type: integer
        description:
          type: string
        slot:
          type: string
      description: Describes information about an Infiniband Interface of a Machine
      title: MachineInfiniBandInterface
    MachineMetadata:
      type: object
      properties:
        dmiData:
          $ref: '#/components/schemas/MachineDMIData'
        bmcInfo:
          $ref: '#/components/schemas/MachineBMCInfo'
        gpus:
          type: array
          items:
            $ref: '#/components/schemas/MachineGPUInfo'
        networkInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/MachineNetworkInterface'
        infinibandInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/MachineInfiniBandInterface'
      description: Describes metadata for various Machine components
      title: MachineMetadata
    Labels:
      type: object
      additionalProperties:
        type: string
      title: Labels
    MachineStatus:
      type: string
      enum:
        - Initializing
        - Ready
        - Reset
        - Maintenance
        - InUse
        - Error
        - Decommissioned
        - Unknown
      description: Status values for Machine objects
      title: MachineStatus
    StatusDetail:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Describes the details of a status transition for a resource
      title: StatusDetail
    Machine:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of Machine
        infrastructureProviderId:
          type: string
          format: uuid
          description: ID of the Provider that owns the Machine
        siteId:
          type: string
          format: uuid
          description: ID of the Site the Machine belongs to
        instanceTypeId:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the Instance Type, if assigned
        instanceId:
          type:
            - string
            - 'null'
          format: uuid
          description: ID of the Instance if this Machine is assigned to one
        tenantId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            ID of the Tenant that owns the Instance if the Machine is assigned
            to one
        controllerMachineId:
          type: string
          description: ID of the Machine at Site, now same as the primary ID
        controllerMachineType:
          type: string
          description: Denotes architecture (x86 vs ARM) of the Machine
        hwSkuDeviceType:
          type:
            - string
            - 'null'
          description: >-
            SKU derived device type of the machine, e.g. cpu, gpu, cache,
            storage, etc.
        vendor:
          type: string
          description: Name of the vendor of the Machine
        productName:
          type: string
          description: Product name of the Machine
        serialNumber:
          type: string
          description: Serial number of the Machine, only visible to Provider
        machineCapabilities:
          type: array
          items:
            $ref: '#/components/schemas/MachineCapability'
        machineInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/MachineInterface'
        maintenanceMessage:
          type:
            - string
            - 'null'
          description: >-
            If the Machine is in maintenance mode, this message will typically
            describe the reason and how long it is expected to be in maintenance
        health:
          $ref: '#/components/schemas/MachineHealth'
        metadata:
          $ref: '#/components/schemas/MachineMetadata'
          description: >-
            Only available to Providers. Returned if includeMetadata query param
            is specified. Otherwise attribute is omitted from response.
        labels:
          $ref: '#/components/schemas/Labels'
        status:
          $ref: '#/components/schemas/MachineStatus'
        isUsableByTenant:
          type: boolean
          description: >-
            Indicates whether the machine is usable by or currently in use by a
            tenant.
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StatusDetail'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Machine is the baremetal server that sits in the datacenter
      title: Machine
    CarbideApiErrorSource:
      type: string
      enum:
        - carbide
      description: Source of the error. Only 'carbide' is supported
      title: CarbideApiErrorSource
    CarbideApiErrorData:
      type: object
      properties: {}
      description: Additional data about the error
      title: CarbideApiErrorData
    CarbideAPIError:
      type: object
      properties:
        source:
          $ref: '#/components/schemas/CarbideApiErrorSource'
          description: Source of the error. Only 'carbide' is supported
        message:
          type: string
          description: Message describing the error
        data:
          oneOf:
            - $ref: '#/components/schemas/CarbideApiErrorData'
            - type: 'null'
          description: Additional data about the error
      description: Describes the error response from NCX Infra Controller REST API
      title: CarbideAPIError
  securitySchemes:
    JWTBearerToken:
      type: http
      scheme: bearer
      description: >-
        ```

        export JWT_BEARER_TOKEN="<jwt-bearer-token>"


        # Example org name: "acme-inc

        export ORG_NAME=<org-name>


        # Use the JWT bearer token in your API request auth header:

        curl -v -X GET -H "Content-Type: application/json" -H "Authorization:
        Bearer $JWT_BEARER_TOKEN"
        https://carbide-rest-api.carbide.svc.cluster.local/v2/org/$ORG_NAME/carbide/user/current

        ```

```

## SDK Code Examples

```python Without Metadata
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Without Metadata
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Without Metadata
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Without Metadata
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Without Metadata
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Without Metadata
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Without Metadata
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Without Metadata
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python With Metadata
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript With Metadata
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go With Metadata
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby With Metadata
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java With Metadata
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php With Metadata
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp With Metadata
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift With Metadata
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python With Machine Health Alerts
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript With Machine Health Alerts
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go With Machine Health Alerts
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby With Machine Health Alerts
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java With Machine Health Alerts
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php With Machine Health Alerts
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp With Machine Health Alerts
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift With Machine Health Alerts
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/machine/machineId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```