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

# Create Operating System

POST https://carbide-rest-api.carbide.svc.cluster.local/v2/org/{org}/carbide/operating-system
Content-Type: application/json

Create an Operating System for the org.

Either `infrastructureProviderId` or `tenantId` must be provided in request data. Both cannot be provided at the same time.

If `infrastructureProviderId` is provided in request data, then org must have an Infrastructure Provider entity and its ID should match the query param value. User must have `FORGE_PROVIDER_ADMIN` role.

If `tenantId` is provided in request data, then org must have a Tenant entity and its ID should match the query param value. User must have `FORGE_TENANT_ADMIN` role.

Only Tenants are allowed to create Operating System for MVP.

Reference: https://docs.nvidia.com/infra-controller/infra-controller/rest-api-reference/api-reference/operating-system/create-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:
    post:
      operationId: create-operating-system
      summary: Create Operating System
      description: >-
        Create an Operating System for the org.


        Either `infrastructureProviderId` or `tenantId` must be provided in
        request data. Both cannot be provided at the same time.


        If `infrastructureProviderId` is provided in request data, then org must
        have an Infrastructure Provider entity and its ID should match the query
        param value. User must have `FORGE_PROVIDER_ADMIN` role.


        If `tenantId` is provided in request data, then org must have a Tenant
        entity and its ID should match the query param value. User must have
        `FORGE_TENANT_ADMIN` role.


        Only Tenants are allowed to create Operating System for MVP.
      tags:
        - subpackage_operatingSystem
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - 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:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatingSystem'
        '400':
          description: Error response when request data cannot be validated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CarbideAPIError'
        '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'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OperatingSystemCreateRequest'
servers:
  - url: https://carbide-rest-api.carbide.svc.cluster.local
components:
  schemas:
    OperatingSystemCreateRequest:
      type: object
      properties:
        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: >-
            Deprecated: Infrastructure Provider is now inferred from org
            membership.
        tenantId:
          type:
            - string
            - 'null'
          format: uuid
          description: 'Deprecated: Tenant is now inferred from org membership.'
        siteIds:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Specified only one Site if an Operating System is Image based, more
            than one Site is not supported"
        ipxeScript:
          type:
            - string
            - 'null'
          description: >-
            iPXE script or URL, only applicable for iPXE based OS. Cannot be
            specified if imageUrl is specified
        imageUrl:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Original URL from where the Operating System image can be retreived
            from, required for image based OS. Cannot be specified if ipxeScript
            is specified
        imageSha:
          type:
            - string
            - 'null'
          description: SHA hash of the image file, required for image based OS
        imageAuthType:
          type:
            - string
            - 'null'
          description: >-
            Authentication type for image URL if needed e.g. basic/bearer/token,
            required is imageAuthToken is specified
        imageAuthToken:
          type:
            - string
            - 'null'
          description: >-
            Auth token to retrieve the image from image URL, required if
            imageAuthType is specified
        imageDisk:
          type:
            - string
            - 'null'
          description: Disk path where the image should be mounted, optional
        rootFsId:
          type:
            - string
            - 'null'
          description: >-
            Root filesystem UUID, this or `rootFsLabel` required for image based
            OS
        rootFsLabel:
          type:
            - string
            - 'null'
          description: >-
            Root filesystem label, this or `rootFsId` required for image based
            OS
        phoneHomeEnabled:
          type:
            - boolean
            - 'null'
          description: >-
            Indicates whether the Phone Home service should be enabled or
            disabled for 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
        allowOverride:
          type: boolean
          description: >-
            Indicates if the user data can be overridden at Instance creation
            time
      required:
        - name
      description: Request data to create an OperatingSystem
      title: OperatingSystemCreateRequest
    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"

payload = {
    "name": "ubuntu-official-22.04",
    "description": "Official Ubuntu 22.04",
    "ipxeScript": "#!ipxe
kernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz
initrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz
boot || imgfree
 shell",
    "phoneHomeEnabled": True,
    "userData": "#cloud-config
autoinstall:
  apt:
    geoip: true
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://archive.ubuntu.com/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports",
    "isCloudInit": True,
    "allowOverride": False,
    "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, 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: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"ubuntu-official-22.04","description":"Official Ubuntu 22.04","ipxeScript":"#!ipxe\nkernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz\ninitrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz\nboot || imgfree\n shell","phoneHomeEnabled":true,"userData":"#cloud-config\nautoinstall:\n  apt:\n    geoip: true\n    preserve_sources_list: false\n    primary:\n    - arches: [amd64, i386]\n      uri: http://archive.ubuntu.com/ubuntu\n    - arches: [default]\n      uri: http://ports.ubuntu.com/ubuntu-ports","isCloudInit":true,"allowOverride":false,"tenantId":"f97df110-f4de-492e-8849-4a6af68026b0"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"ubuntu-official-22.04\",\n  \"description\": \"Official Ubuntu 22.04\",\n  \"ipxeScript\": \"#!ipxe\\nkernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz\\ninitrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz\\nboot || imgfree\\n shell\",\n  \"phoneHomeEnabled\": true,\n  \"userData\": \"#cloud-config\\nautoinstall:\\n  apt:\\n    geoip: true\\n    preserve_sources_list: false\\n    primary:\\n    - arches: [amd64, i386]\\n      uri: http://archive.ubuntu.com/ubuntu\\n    - arches: [default]\\n      uri: http://ports.ubuntu.com/ubuntu-ports\",\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"ubuntu-official-22.04\",\n  \"description\": \"Official Ubuntu 22.04\",\n  \"ipxeScript\": \"#!ipxe\\nkernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz\\ninitrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz\\nboot || imgfree\\n shell\",\n  \"phoneHomeEnabled\": true,\n  \"userData\": \"#cloud-config\\nautoinstall:\\n  apt:\\n    geoip: true\\n    preserve_sources_list: false\\n    primary:\\n    - arches: [amd64, i386]\\n      uri: http://archive.ubuntu.com/ubuntu\\n    - arches: [default]\\n      uri: http://ports.ubuntu.com/ubuntu-ports\",\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}"

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.post("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/operating-system")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"ubuntu-official-22.04\",\n  \"description\": \"Official Ubuntu 22.04\",\n  \"ipxeScript\": \"#!ipxe\\nkernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz\\ninitrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz\\nboot || imgfree\\n shell\",\n  \"phoneHomeEnabled\": true,\n  \"userData\": \"#cloud-config\\nautoinstall:\\n  apt:\\n    geoip: true\\n    preserve_sources_list: false\\n    primary:\\n    - arches: [amd64, i386]\\n      uri: http://archive.ubuntu.com/ubuntu\\n    - arches: [default]\\n      uri: http://ports.ubuntu.com/ubuntu-ports\",\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}")
  .asString();
```

```php example-1
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/operating-system', [
  'body' => '{
  "name": "ubuntu-official-22.04",
  "description": "Official Ubuntu 22.04",
  "ipxeScript": "#!ipxe\\nkernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz\\ninitrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz\\nboot || imgfree\\n shell",
  "phoneHomeEnabled": true,
  "userData": "#cloud-config\\nautoinstall:\\n  apt:\\n    geoip: true\\n    preserve_sources_list: false\\n    primary:\\n    - arches: [amd64, i386]\\n      uri: http://archive.ubuntu.com/ubuntu\\n    - arches: [default]\\n      uri: http://ports.ubuntu.com/ubuntu-ports",
  "isCloudInit": true,
  "allowOverride": false,
  "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"ubuntu-official-22.04\",\n  \"description\": \"Official Ubuntu 22.04\",\n  \"ipxeScript\": \"#!ipxe\\nkernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz\\ninitrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz\\nboot || imgfree\\n shell\",\n  \"phoneHomeEnabled\": true,\n  \"userData\": \"#cloud-config\\nautoinstall:\\n  apt:\\n    geoip: true\\n    preserve_sources_list: false\\n    primary:\\n    - arches: [amd64, i386]\\n      uri: http://archive.ubuntu.com/ubuntu\\n    - arches: [default]\\n      uri: http://ports.ubuntu.com/ubuntu-ports\",\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift example-1
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "ubuntu-official-22.04",
  "description": "Official Ubuntu 22.04",
  "ipxeScript": "#!ipxe
kernel http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux initrd=initrd.gz
initrd http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz
boot || imgfree
 shell",
  "phoneHomeEnabled": true,
  "userData": "#cloud-config
autoinstall:
  apt:
    geoip: true
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://archive.ubuntu.com/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports",
  "isCloudInit": true,
  "allowOverride": false,
  "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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 = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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"

payload = {
    "name": "debian-12-amd64",
    "description": "Official Debian 12 for AMD/Intel",
    "siteIds": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
    "imageUrl": "https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2",
    "imageSha": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
    "imageAuthType": "Bearer",
    "imageAuthToken": "acbd18db4cc2f85cedef654fccc4a4d8",
    "imageDisk": "/dev/sda",
    "rootFsId": "6c2ac315-3040-4728-94eb-b66d320206c1",
    "rootFsLabel": None,
    "phoneHomeEnabled": False,
    "userData": None,
    "isCloudInit": True,
    "allowOverride": False,
    "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, 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: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"debian-12-amd64","description":"Official Debian 12 for AMD/Intel","siteIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"imageUrl":"https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2","imageSha":"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae","imageAuthType":"Bearer","imageAuthToken":"acbd18db4cc2f85cedef654fccc4a4d8","imageDisk":"/dev/sda","rootFsId":"6c2ac315-3040-4728-94eb-b66d320206c1","rootFsLabel":null,"phoneHomeEnabled":false,"userData":null,"isCloudInit":true,"allowOverride":false,"tenantId":"f97df110-f4de-492e-8849-4a6af68026b0"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"debian-12-amd64\",\n  \"description\": \"Official Debian 12 for AMD/Intel\",\n  \"siteIds\": [\n    \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n  ],\n  \"imageUrl\": \"https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2\",\n  \"imageSha\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\",\n  \"imageAuthType\": \"Bearer\",\n  \"imageAuthToken\": \"acbd18db4cc2f85cedef654fccc4a4d8\",\n  \"imageDisk\": \"/dev/sda\",\n  \"rootFsId\": \"6c2ac315-3040-4728-94eb-b66d320206c1\",\n  \"rootFsLabel\": null,\n  \"phoneHomeEnabled\": false,\n  \"userData\": null,\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"debian-12-amd64\",\n  \"description\": \"Official Debian 12 for AMD/Intel\",\n  \"siteIds\": [\n    \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n  ],\n  \"imageUrl\": \"https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2\",\n  \"imageSha\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\",\n  \"imageAuthType\": \"Bearer\",\n  \"imageAuthToken\": \"acbd18db4cc2f85cedef654fccc4a4d8\",\n  \"imageDisk\": \"/dev/sda\",\n  \"rootFsId\": \"6c2ac315-3040-4728-94eb-b66d320206c1\",\n  \"rootFsLabel\": null,\n  \"phoneHomeEnabled\": false,\n  \"userData\": null,\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}"

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.post("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/operating-system")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"debian-12-amd64\",\n  \"description\": \"Official Debian 12 for AMD/Intel\",\n  \"siteIds\": [\n    \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n  ],\n  \"imageUrl\": \"https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2\",\n  \"imageSha\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\",\n  \"imageAuthType\": \"Bearer\",\n  \"imageAuthToken\": \"acbd18db4cc2f85cedef654fccc4a4d8\",\n  \"imageDisk\": \"/dev/sda\",\n  \"rootFsId\": \"6c2ac315-3040-4728-94eb-b66d320206c1\",\n  \"rootFsLabel\": null,\n  \"phoneHomeEnabled\": false,\n  \"userData\": null,\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}")
  .asString();
```

```php example-2
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/operating-system', [
  'body' => '{
  "name": "debian-12-amd64",
  "description": "Official Debian 12 for AMD/Intel",
  "siteIds": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "imageUrl": "https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2",
  "imageSha": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
  "imageAuthType": "Bearer",
  "imageAuthToken": "acbd18db4cc2f85cedef654fccc4a4d8",
  "imageDisk": "/dev/sda",
  "rootFsId": "6c2ac315-3040-4728-94eb-b66d320206c1",
  "rootFsLabel": null,
  "phoneHomeEnabled": false,
  "userData": null,
  "isCloudInit": true,
  "allowOverride": false,
  "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"debian-12-amd64\",\n  \"description\": \"Official Debian 12 for AMD/Intel\",\n  \"siteIds\": [\n    \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n  ],\n  \"imageUrl\": \"https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2\",\n  \"imageSha\": \"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae\",\n  \"imageAuthType\": \"Bearer\",\n  \"imageAuthToken\": \"acbd18db4cc2f85cedef654fccc4a4d8\",\n  \"imageDisk\": \"/dev/sda\",\n  \"rootFsId\": \"6c2ac315-3040-4728-94eb-b66d320206c1\",\n  \"rootFsLabel\": null,\n  \"phoneHomeEnabled\": false,\n  \"userData\": null,\n  \"isCloudInit\": true,\n  \"allowOverride\": false,\n  \"tenantId\": \"f97df110-f4de-492e-8849-4a6af68026b0\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift example-2
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "debian-12-amd64",
  "description": "Official Debian 12 for AMD/Intel",
  "siteIds": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
  "imageUrl": "https://saimei.ftp.acc.umu.se/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2",
  "imageSha": "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
  "imageAuthType": "Bearer",
  "imageAuthToken": "acbd18db4cc2f85cedef654fccc4a4d8",
  "imageDisk": "/dev/sda",
  "rootFsId": "6c2ac315-3040-4728-94eb-b66d320206c1",
  "rootFsLabel": ,
  "phoneHomeEnabled": false,
  "userData": ,
  "isCloudInit": true,
  "allowOverride": false,
  "tenantId": "f97df110-f4de-492e-8849-4a6af68026b0"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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 = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```