> 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 Instance

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

Get an Instance by ID

Org must have a Tenant entity. Instance must belong to Tenant. User must have `FORGE_TENANT_ADMIN` authorization role.


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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: NCX Infra Controller REST API
  version: 1.0.0
paths:
  /v2/org/{org}/carbide/instance/{instanceId}:
    get:
      operationId: get-instance
      summary: Retrieve Instance
      description: >
        Get an Instance by ID


        Org must have a Tenant entity. Instance must belong to Tenant. User must
        have `FORGE_TENANT_ADMIN` authorization role.
      tags:
        - subpackage_instance
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: instanceId
          in: path
          required: true
          schema:
            type: string
        - name: includeRelation
          in: query
          description: Related entity to expand
          required: false
          schema:
            $ref: >-
              #/components/schemas/V2OrgOrgCarbideInstanceInstanceIdGetParametersIncludeRelation
        - 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/Instance'
        '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:
    V2OrgOrgCarbideInstanceInstanceIdGetParametersIncludeRelation:
      type: string
      enum:
        - InfrastructureProvider
        - Tenant
        - Site
        - InstanceType
        - Allocation
        - VPC
        - OperatingSystem
        - NetworkSecurityGroup
      title: V2OrgOrgCarbideInstanceInstanceIdGetParametersIncludeRelation
    NetworkSecurityGroupPropagationDetailsDetailedStatus:
      type: string
      enum:
        - None
        - Partial
        - Full
        - Unknown
        - Error
      title: NetworkSecurityGroupPropagationDetailsDetailedStatus
    NetworkSecurityGroupPropagationStatus:
      type: string
      enum:
        - Synchronizing
        - Synchronized
        - Error
      description: Status values for Network Security Group propagation
      title: NetworkSecurityGroupPropagationStatus
    NetworkSecurityGroupPropagationDetails:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The VPC or Instance ID
        detailedStatus:
          $ref: >-
            #/components/schemas/NetworkSecurityGroupPropagationDetailsDetailedStatus
        status:
          $ref: '#/components/schemas/NetworkSecurityGroupPropagationStatus'
        details:
          type:
            - string
            - 'null'
        unpropagatedInstanceIds:
          type: array
          items:
            type: string
            format: uuid
        relatedInstanceIds:
          type: array
          items:
            type: string
            format: uuid
      description: The Network Security Group propagation details for a VPC or Instance
      title: NetworkSecurityGroupPropagationDetails
    Labels:
      type: object
      additionalProperties:
        type: string
      title: Labels
    InterfaceStatus:
      type: string
      enum:
        - Pending
        - Provisioning
        - Ready
        - Deleting
        - Error
      description: Status values for Interface objects
      title: InterfaceStatus
    Interface:
      type: object
      properties:
        id:
          type: string
          format: uuid
        instanceId:
          type: string
          format: uuid
        subnetId:
          type:
            - string
            - 'null'
          format: uuid
        vpcPrefixId:
          type:
            - string
            - 'null'
          format: uuid
        isPhysical:
          type: boolean
        device:
          type:
            - string
            - 'null'
          description: Name of the device to use
        deviceInstance:
          type:
            - integer
            - 'null'
          description: >-
            Index of the device, used to identify which interface card to
            attache the Partition to
        virtualFunctionId:
          type:
            - integer
            - 'null'
          description: Must be specified if isPhysical is false
        macAddress:
          type:
            - string
            - 'null'
        ipAddresses:
          type: array
          items:
            type: string
          description: A list of IPv4 or IPv6 addresses
        requestedIpAddress:
          type:
            - string
            - 'null'
          description: >-
            Explicitly requested IP address for the interface. This is only used
            for VPC Prefix based interfaces and is not valid for Subnet based
            interfaces. The least-significant host bit must be 1.
        status:
          $ref: '#/components/schemas/InterfaceStatus'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Associates an Instance with a Subnet
      title: Interface
    InfiniBandInterfaceStatus:
      type: string
      enum:
        - Pending
        - Provisioning
        - Ready
        - Deleting
        - Error
      description: Status values for InfiniBand Interface objects
      title: InfiniBandInterfaceStatus
    InfiniBandInterface:
      type: object
      properties:
        id:
          type: string
          format: uuid
        instanceId:
          type: string
          format: uuid
        partitionId:
          type: string
          format: uuid
          description: ID of the InfiniBand Partition associated with this interface
        device:
          type: string
          description: Name of the InfiniBand device associated with this interface
        deviceInstance:
          type: integer
        isPhysical:
          type: boolean
          description: Indicates whether this is a physical interface
        virtualFunctionId:
          type:
            - integer
            - 'null'
        guid:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/InfiniBandInterfaceStatus'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: >-
        Defines an interface created by associating an Instance with an
        InfiniBand Partition
      title: InfiniBandInterface
    NVLinkInterfaceStatus:
      type: string
      enum:
        - Pending
        - Provisioning
        - Ready
        - Deleting
        - Error
      description: Status values for NVLink Interface objects
      title: NVLinkInterfaceStatus
    NVLinkInterface:
      type: object
      properties:
        id:
          type: string
          format: uuid
        instanceId:
          type: string
          format: uuid
        nvLinkLogicalPartitionId:
          type: string
          format: uuid
          description: ID of the NVLink Logical Partition associated with this interface
        nvLinkDomainId:
          type: string
          format: uuid
          description: ID of the NVLink Domain associated with this Interface
        deviceInstance:
          type: integer
          description: >-
            Index of the device, used to identify the GPU associated with this
            Interface
        gpuGuid:
          type: string
          description: Unique ID of the GPU
        status:
          $ref: '#/components/schemas/NVLinkInterfaceStatus'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: >-
        Defines an interface created by associating a GPU of an Instance with an
        NVLink Logical Partition
      title: NVLinkInterface
    DpuExtensionServiceSummaryServiceType:
      type: string
      enum:
        - KubernetesPod
      description: Type of the DPU Extension Service
      title: DpuExtensionServiceSummaryServiceType
    DpuExtensionServiceStatus:
      type: string
      enum:
        - Pending
        - Ready
        - Error
        - Deleting
      description: Status values for DPU Extension Service objects
      title: DpuExtensionServiceStatus
    DpuExtensionServiceSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the DPU Extension Service
        name:
          type: string
          description: >-
            Name for the DPU Extension Service. Must be unique for a given
            Tenant
        serviceType:
          $ref: '#/components/schemas/DpuExtensionServiceSummaryServiceType'
          description: Type of the DPU Extension Service
        latestVersion:
          type:
            - string
            - 'null'
          description: Latest version of the DPU Extension Service
        status:
          $ref: '#/components/schemas/DpuExtensionServiceStatus'
          description: Status of the DPU Extension Service
      description: >-
        DPU Extension Service allows user defined services to run on DPUs of
        their Instances
      title: DpuExtensionServiceSummary
    DpuExtensionServiceDeploymentStatus:
      type: string
      enum:
        - Pending
        - Running
        - Error
        - Failed
        - Terminating
      description: Status values for DPU Extension Service Deployment objects
      title: DpuExtensionServiceDeploymentStatus
    DpuExtensionServiceDeployment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the DPU Extension Service Deployment
        dpuExtensionService:
          $ref: '#/components/schemas/DpuExtensionServiceSummary'
          description: >-
            Summary of the DPU Extension Service. Deployed version may be
            different
        version:
          type: string
          description: Deployed version of the DPU Extension Service
        status:
          $ref: '#/components/schemas/DpuExtensionServiceDeploymentStatus'
          description: Status of the DPU Extension Service Deployment
        created:
          type: string
          format: date-time
          description: >-
            Date/time when this version of the DPU Extension Service Deployment
            was created
        updated:
          type: string
          format: date-time
          description: >-
            Date/time when this version of the DPU Extension Service Deployment
            was updated
      description: Describes a deployment of a DPU Extension Service on DPUs of an Instance
      title: DpuExtensionServiceDeployment
    SshKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the key
        name:
          type: string
        org:
          type: string
        tenantId:
          type: string
          format: uuid
        fingerprint:
          type: string
          description: SHA256 fingerprint of the public key
        created:
          type: string
          format: date-time
          description: Date/time when the SSH key was created
        updated:
          type: string
          format: date-time
          description: Date/time when the SSH key was last updated
      description: Details of SSH public key
      title: SshKey
    SiteCapabilities:
      type: object
      properties:
        nativeNetworking:
          type: boolean
        networkSecurityGroup:
          type: boolean
        nvLinkPartition:
          type: boolean
        rackLevelAdministration:
          type: boolean
        imageBasedOperatingSystem:
          type: boolean
      description: Boolean flags to indicate features supported by a Site
      title: SiteCapabilities
    SiteStatus:
      type: string
      enum:
        - Pending
        - Registered
        - Error
      description: Status values for Site objects
      title: SiteStatus
    SiteSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          description: Name of the Site
        infrastructureProviderId:
          type: string
          format: uuid
        isSerialConsoleEnabled:
          type: boolean
          description: Indicates if Serial Console is enabled for the Site by the Provider
        isOnline:
          type: boolean
          description: Indicates if the Site is currently reachable from Cloud
        capabilities:
          $ref: '#/components/schemas/SiteCapabilities'
        status:
          $ref: '#/components/schemas/SiteStatus'
      description: >-
        SiteSummary contains a subset of data for Site object, used when nesting
        in other objects
      title: SiteSummary
    SshKeyGroupSiteAssociationStatus:
      type: string
      enum:
        - Syncing
        - Synced
        - Pending
        - Error
        - Deleting
      description: Status values for SSH Key Group Site Association objects
      title: SshKeyGroupSiteAssociationStatus
    SshKeyGroupSiteAssociation:
      type: object
      properties:
        site:
          $ref: '#/components/schemas/SiteSummary'
        status:
          $ref: '#/components/schemas/SshKeyGroupSiteAssociationStatus'
        version:
          type: string
          description: Version of the Key Group on Site
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Describes the relationship between an SSH Key Group and a Site
      title: SshKeyGroupSiteAssociation
    SshKeyGroupStatus:
      type: string
      enum:
        - Syncing
        - Synced
        - Error
        - Deleting
      description: Status values for SSH Key Group objects
      title: SshKeyGroupStatus
    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
    SshKeyGroup:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the SSH Key Group
        name:
          type: string
          description: Name of the SSH Key Group
        description:
          type:
            - string
            - 'null'
          description: Description for the SSH Key Group, optional
        org:
          type: string
          description: Organization this SSH Key Group belongs to
        tenantId:
          type: string
          format: uuid
          description: ID of the Tenane the SSH Key Group belongs to
        version:
          type: string
          description: Version of the SSH Key Group
        sshKeys:
          type: array
          items:
            $ref: '#/components/schemas/SshKey'
          description: SSH Keys associated with this SSH Key Group
        siteAssociations:
          type: array
          items:
            $ref: '#/components/schemas/SshKeyGroupSiteAssociation'
          description: Sites the SSH Key Group is synced to
        status:
          $ref: '#/components/schemas/SshKeyGroupStatus'
          description: Status of the SSH Key Group
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StatusDetail'
          description: History of the SSH Key Group states
        created:
          type: string
          format: date-time
          description: Date/time when the SSH key was created
        updated:
          type: string
          format: date-time
          description: Date/time when the SSH key was last updated
      description: Describes the model that groups SSH Keys
      title: SshKeyGroup
    InstanceStatus:
      type: string
      enum:
        - Pending
        - Provisioning
        - Configuring
        - Ready
        - Updating
        - Rebooting
        - Terminating
        - Error
      description: Status values for Instance objects
      title: InstanceStatus
    Deprecation:
      type: object
      properties:
        attribute:
          type:
            - string
            - 'null'
        queryParam:
          type:
            - string
            - 'null'
        endpoint:
          type:
            - string
            - 'null'
        replacedBy:
          type:
            - string
            - 'null'
        takeActionBy:
          type: string
          format: date-time
        notice:
          type: string
      description: Details of a particular deprecation in NCX Infra Controller API
      title: Deprecation
    Instance:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the Instance
        name:
          type: string
          description: Name for the Instance
        description:
          type: string
          description: Description for the Instance
        tenantId:
          type: string
          format: uuid
          description: ID of the Tenant the Instance belongs to
        infrastructureProviderId:
          type: string
          format: uuid
          description: >-
            ID of the Infrastructure Provider that owns the Site where the
            Instance is located
        siteId:
          type: string
          format: uuid
          description: ID of the Site where the Instance is located
        instanceTypeId:
          type: string
          format: uuid
        vpcId:
          type: string
          format: uuid
        secondaryVpcIds:
          type: array
          items:
            type: string
            format: uuid
          description: IDs of VPCs attached to the Instance through non-primary interfaces
        machineId:
          type:
            - string
            - 'null'
        operatingSystemId:
          type: string
          format: uuid
        networkSecurityGroupId:
          type:
            - string
            - 'null'
        networkSecurityGroupPropagationDetails:
          $ref: '#/components/schemas/NetworkSecurityGroupPropagationDetails'
          description: Propagation details for the attached Network Security Group
        networkSecurityGroupInherited:
          type: boolean
          description: Indicates if the Network Security Group is inherited from VPC
        controllerInstanceId:
          type:
            - string
            - 'null'
          format: uuid
        ipxeScript:
          type:
            - string
            - 'null'
        alwaysBootWithCustomIpxe:
          type: boolean
          description: >-
            Indicates whether the Instance should always execute custom iPXE
            script when rebooting
        phoneHomeEnabled:
          type: boolean
          description: >-
            Indicates whether the Phone Home service should be enabled or
            disabled for Instance
        userData:
          type:
            - string
            - 'null'
        labels:
          $ref: '#/components/schemas/Labels'
        isUpdatePending:
          type: boolean
          description: >-
            Indicates whether an update is available for the Instance. Updates
            can be applied on reboot
        serialConsoleUrl:
          type:
            - string
            - 'null'
          description: >-
            Serial Console URL for the Instance. Format:
            ssh://<id>@siteSerialConsoleHostname
        interfaces:
          type: array
          items:
            $ref: '#/components/schemas/Interface'
        infinibandInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/InfiniBandInterface'
        nvLinkInterfaces:
          type: array
          items:
            $ref: '#/components/schemas/NVLinkInterface'
        dpuExtensionServiceDeployments:
          type: array
          items:
            $ref: '#/components/schemas/DpuExtensionServiceDeployment'
          description: DPU Extension Services deployed on DPUs of this Instance
        sshKeyGroupIds:
          type: array
          items:
            type: string
            format: uuid
          description: IDs of SSH Key Groups associated with this Instance
        sshKeyGroups:
          type: array
          items:
            $ref: '#/components/schemas/SshKeyGroup'
          description: IDs of SSH Key Groups associated with this Instance
        tpmEkCertificate:
          type:
            - string
            - 'null'
          description: base64 encoded TPM EK Certificate associated with this Instance
        status:
          $ref: '#/components/schemas/InstanceStatus'
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StatusDetail'
        deprecations:
          type: array
          items:
            $ref: '#/components/schemas/Deprecation'
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
      description: Instance is a baremetal Machine that has been provisioned for a Tenant
      title: Instance
    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 example-1
import requests

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

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

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

print(response.json())
```

```javascript example-1
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/instance/instanceId';
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 example-1
package main

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

func main() {

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

	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 example-1
require 'uri'
require 'net/http'

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

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 example-1
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/instance/instanceId")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php example-1
<?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/instance/instanceId', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp example-1
using RestSharp;

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

```swift example-1
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/instance/instanceId")! 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()
```