> 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 all Operating Systems

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

Get an Operating System by ID

If the Operating System has `infrastructureProviderId` set, then org must have an Infrastructure Provider entity and its ID should match the Operating System Infrastructure Provider ID. User must have `FORGE_PROVIDER_ADMIN` authorization role.

If the Operating System has `tenantId` set, then org must have a Tenant entity and its ID should match the Operating System Tenant ID. User must have `FORGE_TENANT_ADMIN` role.

Reference: https://docs.nvidia.com/infra-controller/infra-controller/rest-api-reference/api-reference/operating-system/get-all-operating-system

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: NCX Infra Controller REST API
  version: 1.0.0
paths:
  /v2/org/{org}/carbide/operating-system:
    get:
      operationId: get-all-operating-system
      summary: Retrieve all Operating Systems
      description: >-
        Get an Operating System by ID


        If the Operating System has `infrastructureProviderId` set, then org
        must have an Infrastructure Provider entity and its ID should match the
        Operating System Infrastructure Provider ID. User must have
        `FORGE_PROVIDER_ADMIN` authorization role.


        If the Operating System has `tenantId` set, then org must have a Tenant
        entity and its ID should match the Operating System Tenant ID. User must
        have `FORGE_TENANT_ADMIN` role.
      tags:
        - subpackage_operatingSystem
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: siteId
          in: query
          description: >-
            Filter Operating Systems by Site ID.  Can be specified multiple
            times to filter on more than one ID.
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Filter Operating Systems by Type
          required: false
          schema:
            $ref: >-
              #/components/schemas/V2OrgOrgCarbideOperatingSystemGetParametersType
        - name: status
          in: query
          description: >-
            Filter Operating Systems by Status.  Can be specified multiple times
            to filter on more than one status.
          required: false
          schema:
            type: string
        - name: query
          in: query
          description: >-
            Provide query to search for matches. Input will be matched against
            name, description and status fields
          required: false
          schema:
            type: string
        - name: includeRelation
          in: query
          description: Related entity to expand
          required: false
          schema:
            $ref: >-
              #/components/schemas/V2OrgOrgCarbideOperatingSystemGetParametersIncludeRelation
        - name: pageNumber
          in: query
          description: Page number for pagination query
          required: false
          schema:
            type: integer
            default: 1
        - name: pageSize
          in: query
          description: Page size for pagination query
          required: false
          schema:
            type: integer
        - name: orderBy
          in: query
          description: Ordering for pagination query
          required: false
          schema:
            $ref: >-
              #/components/schemas/V2OrgOrgCarbideOperatingSystemGetParametersOrderBy
        - 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:
                type: array
                items:
                  $ref: '#/components/schemas/OperatingSystem'
        '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:
    V2OrgOrgCarbideOperatingSystemGetParametersType:
      type: string
      enum:
        - Image
        - iPXE
      title: V2OrgOrgCarbideOperatingSystemGetParametersType
    V2OrgOrgCarbideOperatingSystemGetParametersIncludeRelation:
      type: string
      enum:
        - InfrastructureProvider
        - Tenant
      title: V2OrgOrgCarbideOperatingSystemGetParametersIncludeRelation
    V2OrgOrgCarbideOperatingSystemGetParametersOrderBy:
      type: string
      enum:
        - NAME_ASC
        - NAME_DESC
        - STATUS_ASC
        - STATUS_DESC
        - CREATED_ASC
        - CREATED_DESC
        - UPDATED_ASC
        - UPDATED_DESC
      title: V2OrgOrgCarbideOperatingSystemGetParametersOrderBy
    OperatingSystemType:
      type: string
      enum:
        - iPXE
        - Image
      description: Type of the Operating System
      title: OperatingSystemType
    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
    SshKeyGroupStatus:
      type: string
      enum:
        - Syncing
        - Synced
        - Error
        - Deleting
      description: Status values for SSH Key Group objects
      title: SshKeyGroupStatus
    OperatingSystemSiteAssociation:
      type: object
      properties:
        site:
          $ref: '#/components/schemas/SiteSummary'
        status:
          $ref: '#/components/schemas/SshKeyGroupStatus'
        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 Operating Systems and Sites
      title: OperatingSystemSiteAssociation
    OperatingSystemStatus:
      type: string
      enum:
        - Pending
        - Provisioning
        - Syncing
        - Ready
        - Deleting
        - Error
        - Deactivated
      description: Status values for Operating System objects
      title: OperatingSystemStatus
    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
    OperatingSystem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the Operating System
        name:
          type: string
          description: Name of the Operating System
        description:
          type: string
          description: Optional description of the Operating System
        infrastructureProviderId:
          type:
            - string
            - 'null'
          format: uuid
          description: Specified if a Provider owns the Operating System
        tenantId:
          type:
            - string
            - 'null'
          format: uuid
          description: Specified if a Tenant owns the Operating System
        type:
          $ref: '#/components/schemas/OperatingSystemType'
          description: Type of the Operating System
        imageUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Original URL from where the Operating System image can be retrieved
        imageSha:
          type:
            - string
            - 'null'
          description: SHA hash of the image file, only present for image based OS
        imageAuthType:
          type:
            - string
            - 'null'
          description: Authentication type for image URL e.g. 'Basic' or 'Bearer'
        imageAuthToken:
          type:
            - string
            - 'null'
          description: Auth token to retrieve the image from image URL
        imageDisk:
          type:
            - string
            - 'null'
          description: Disk path where the image should be monuted
        rootFsId:
          type:
            - string
            - 'null'
          description: >-
            Root filesystem UUID, only applicable for image based Operating
            System
        rootFsLabel:
          type:
            - string
            - 'null'
          description: >-
            Root filesystem label, only applicable for image based Operating
            System
        ipxeScript:
          type:
            - string
            - 'null'
          description: iPXE script or URL, only applicable for iPXE based Operating System
        userData:
          type:
            - string
            - 'null'
          description: User data for the Operating System
        isCloudInit:
          type: boolean
          description: Specified when the Operating System is Cloud Init based
        phoneHomeEnabled:
          type: boolean
          description: >-
            Indicates whether the Phone Home service should be enabled or
            disabled for Operating System
        isActive:
          type: boolean
          description: Indicates if the Operating System is active
        deactivationNote:
          type:
            - string
            - 'null'
          description: Optional deactivation note if OS is inactive
        allowOverride:
          type: boolean
          description: >-
            Indicates if the user data can be overridden at Instance creation
            time
        siteAssociations:
          type: array
          items:
            $ref: '#/components/schemas/OperatingSystemSiteAssociation'
          description: Sites the Operating System is synced to
        status:
          $ref: '#/components/schemas/OperatingSystemStatus'
          description: Status of the Operating System
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StatusDetail'
          description: History of status changes over time
        created:
          type: string
          format: date-time
          description: Date/time when the Operating System was created
        updated:
          type: string
          format: date-time
          description: Date/time when the Operating System was updated
      description: >-
        Describes the attributes of the operating system/bootloader that can be
        used on instances
      title: OperatingSystem
    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/operating-system"

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/operating-system';
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/operating-system"

	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/operating-system")

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/operating-system")
  .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/operating-system', [
  '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/operating-system");
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/operating-system")! 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 example-2
import requests

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

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

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

print(response.json())
```

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

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

func main() {

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

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

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

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-2
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/operating-system")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

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

```csharp example-2
using RestSharp;

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

```swift example-2
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/operating-system")! 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()
```