> 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 DPU Extension Service

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

Create a DPU Extension Service for the current Tenant.

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

Reference: https://docs.nvidia.com/infra-controller/infra-controller/rest-api-reference/api-reference/dpu-extension-service/create-dpu-extension-service

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: NCX Infra Controller REST API
  version: 1.0.0
paths:
  /v2/org/{org}/carbide/dpu-extension-service:
    post:
      operationId: create-dpu-extension-service
      summary: Create DPU Extension Service
      description: >-
        Create a DPU Extension Service for the current Tenant.


        Org must have a Tenant entity. User must have `FORGE_TENANT_ADMIN`
        authorization role.
      tags:
        - subpackage_dpuExtensionService
      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/DpuExtensionService'
        '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/DpuExtensionServiceCreateRequest'
servers:
  - url: https://carbide-rest-api.carbide.svc.cluster.local
components:
  schemas:
    DpuExtensionServiceCreateRequestServiceType:
      type: string
      enum:
        - KubernetesPod
      description: Type of the DPU Extension Service
      title: DpuExtensionServiceCreateRequestServiceType
    DpuExtensionServiceCredentials:
      type: object
      properties:
        registryUrl:
          type: string
          description: URL for the registry the credential should be used for
        username:
          type:
            - string
            - 'null'
          description: >-
            Username for the registry. Must be specified if registry URL is
            specified
        password:
          type:
            - string
            - 'null'
          description: >-
            Password for the registry. Must be specified if registry URL is
            specified
      description: >-
        Credentials for retreiving resources specified in DPU Extension Service
        data
      title: DpuExtensionServiceCredentials
    DpuExtensionServiceObservabilityConfig:
      oneOf:
        - description: Any type
        - description: Any type
      description: A single observability configuration for a DPU Extension Service version
      title: DpuExtensionServiceObservabilityConfig
    DpuExtensionServiceObservability:
      type: object
      properties:
        configs:
          type: array
          items:
            $ref: '#/components/schemas/DpuExtensionServiceObservabilityConfig'
          description: Observability configurations to apply to the service version
      description: Observability configuration for a DPU Extension Service version
      title: DpuExtensionServiceObservability
    DpuExtensionServiceCreateRequest:
      type: object
      properties:
        name:
          type: string
          description: >-
            Name for the DPU Extension Service. Must be unique for a given
            Tenant
        description:
          type:
            - string
            - 'null'
          description: Optional description for the DPU Extension Service
        serviceType:
          $ref: '#/components/schemas/DpuExtensionServiceCreateRequestServiceType'
          description: Type of the DPU Extension Service
        siteId:
          type: string
          format: uuid
          description: ID for the Site the DPU Extension Service belongs to
        data:
          type: string
          description: Deployment spec for the DPU Extension Service
        credentials:
          $ref: '#/components/schemas/DpuExtensionServiceCredentials'
          description: >-
            Credentials to download resources specified in DPU Extension Service
            data
        observability:
          $ref: '#/components/schemas/DpuExtensionServiceObservability'
          description: Observability configuration for the DPU Extension Service version
      required:
        - name
        - serviceType
        - siteId
        - data
      description: Request data to create a new DPU Extension Service
      title: DpuExtensionServiceCreateRequest
    DpuExtensionServiceServiceType:
      type: string
      enum:
        - KubernetesPod
      description: Type of the DPU Extension Service
      title: DpuExtensionServiceServiceType
    DpuExtensionServiceVersionInfo:
      type: object
      properties:
        version:
          type:
            - string
            - 'null'
          description: Current version of the DPU Extension Service
        data:
          type: string
          description: Deployment spec for the DPU Extension Service
        hasCredentials:
          type: boolean
          description: Indicates whether this version was created with credentials
        created:
          type: string
          format: date-time
          description: Date/time when this version of the DPU Extension Service was created
        observability:
          $ref: '#/components/schemas/DpuExtensionServiceObservability'
          description: Observability configuration for this DPU Extension Service version
      description: Information about a specific version of DPU Extension Service
      title: DpuExtensionServiceVersionInfo
    DpuExtensionServiceStatus:
      type: string
      enum:
        - Pending
        - Ready
        - Error
        - Deleting
      description: Status values for DPU Extension Service objects
      title: DpuExtensionServiceStatus
    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
    DpuExtensionService:
      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
        description:
          type:
            - string
            - 'null'
          description: Optional description for the DPU Extension Service
        serviceType:
          $ref: '#/components/schemas/DpuExtensionServiceServiceType'
          description: Type of the DPU Extension Service
        siteId:
          type: string
          format: uuid
          description: ID for the Site the DPU Extension Service belongs to
        tenantId:
          type: string
          format: uuid
          description: ID for the Tenant the DPU Extension Service belongs to
        version:
          type:
            - string
            - 'null'
          description: Latest version of the DPU Extension Service
        versionInfo:
          $ref: '#/components/schemas/DpuExtensionServiceVersionInfo'
          description: Details for the latest version of the DPU Extension Service
        activeVersions:
          type: array
          items:
            type: string
          description: >-
            Latest and past versions of this DPU Extension Service that have not
            been deleted and are available for deployment
        status:
          $ref: '#/components/schemas/DpuExtensionServiceStatus'
          description: Status of the DPU Extension Service
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StatusDetail'
          description: History of the DPU Extension Service statuses
        created:
          type: string
          format: date-time
          description: Date/time when the DPU Extension Service was created
        updated:
          type: string
          format: date-time
          description: Date/time when the DPU Extension Service was last updated
      description: >-
        DPU Extension Service allows user defined services to run on DPUs of
        their Instances
      title: DpuExtensionService
    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
import requests

url = "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/dpu-extension-service"

payload = {
    "name": "busybox",
    "serviceType": "KubernetesPod",
    "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
    "data": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: busybox-deployment\n  labels:\n    app: busybox\nspec:\n  replicas: 1 # You can adjust the number of desired replicas here\n  selector:\n    matchLabels:\n      app: busybox\n  template:\n    metadata:\n      labels:\n        app: busybox\n    spec:\n      containers:\n      - name: busybox-container\n        image: busybox:latest # You can specify a different BusyBox image tag\n        command: [\"sh\", \"-c\", \"echo \'BusyBox container running\' && sleep 3600\"]",
    "description": "Single, multi-call executable that contains stripped-down versions of common Unix utilities",
    "credentials": {
        "registryUrl": "https://registry.hub.docker.com",
        "username": "johndoe",
        "password": "password123"
    },
    "observability": { "configs": [
            {
                "name": "busybox-metrics",
                "prometheus": {
                    "scrapeIntervalSeconds": 30,
                    "endpoint": "busybox:9090"
                }
            }
        ] }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/dpu-extension-service';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"busybox","serviceType":"KubernetesPod","siteId":"60189e9c-7d12-438c-b9ca-6998d9c364b1","data":"apiVersion: apps/v1\\nkind: Deployment\\nmetadata:\\n  name: busybox-deployment\\n  labels:\\n    app: busybox\\nspec:\\n  replicas: 1 # You can adjust the number of desired replicas here\\n  selector:\\n    matchLabels:\\n      app: busybox\\n  template:\\n    metadata:\\n      labels:\\n        app: busybox\\n    spec:\\n      containers:\\n      - name: busybox-container\\n        image: busybox:latest # You can specify a different BusyBox image tag\\n        command: [\"sh\", \"-c\", \"echo \\'BusyBox container running\\' && sleep 3600\"]","description":"Single, multi-call executable that contains stripped-down versions of common Unix utilities","credentials":{"registryUrl":"https://registry.hub.docker.com","username":"johndoe","password":"password123"},"observability":{"configs":[{"name":"busybox-metrics","prometheus":{"scrapeIntervalSeconds":30,"endpoint":"busybox:9090"}}]}}'
};

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

```go
package main

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

func main() {

	url := "https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/dpu-extension-service"

	payload := strings.NewReader("{\n  \"name\": \"busybox\",\n  \"serviceType\": \"KubernetesPod\",\n  \"siteId\": \"60189e9c-7d12-438c-b9ca-6998d9c364b1\",\n  \"data\": \"apiVersion: apps/v1\\\\nkind: Deployment\\\\nmetadata:\\\\n  name: busybox-deployment\\\\n  labels:\\\\n    app: busybox\\\\nspec:\\\\n  replicas: 1 # You can adjust the number of desired replicas here\\\\n  selector:\\\\n    matchLabels:\\\\n      app: busybox\\\\n  template:\\\\n    metadata:\\\\n      labels:\\\\n        app: busybox\\\\n    spec:\\\\n      containers:\\\\n      - name: busybox-container\\\\n        image: busybox:latest # You can specify a different BusyBox image tag\\\\n        command: [\\\"sh\\\", \\\"-c\\\", \\\"echo \\\\'BusyBox container running\\\\' && sleep 3600\\\"]\",\n  \"description\": \"Single, multi-call executable that contains stripped-down versions of common Unix utilities\",\n  \"credentials\": {\n    \"registryUrl\": \"https://registry.hub.docker.com\",\n    \"username\": \"johndoe\",\n    \"password\": \"password123\"\n  },\n  \"observability\": {\n    \"configs\": [\n      {\n        \"name\": \"busybox-metrics\",\n        \"prometheus\": {\n          \"scrapeIntervalSeconds\": 30,\n          \"endpoint\": \"busybox:9090\"\n        }\n      }\n    ]\n  }\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
require 'uri'
require 'net/http'

url = URI("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/dpu-extension-service")

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\": \"busybox\",\n  \"serviceType\": \"KubernetesPod\",\n  \"siteId\": \"60189e9c-7d12-438c-b9ca-6998d9c364b1\",\n  \"data\": \"apiVersion: apps/v1\\\\nkind: Deployment\\\\nmetadata:\\\\n  name: busybox-deployment\\\\n  labels:\\\\n    app: busybox\\\\nspec:\\\\n  replicas: 1 # You can adjust the number of desired replicas here\\\\n  selector:\\\\n    matchLabels:\\\\n      app: busybox\\\\n  template:\\\\n    metadata:\\\\n      labels:\\\\n        app: busybox\\\\n    spec:\\\\n      containers:\\\\n      - name: busybox-container\\\\n        image: busybox:latest # You can specify a different BusyBox image tag\\\\n        command: [\\\"sh\\\", \\\"-c\\\", \\\"echo \\\\'BusyBox container running\\\\' && sleep 3600\\\"]\",\n  \"description\": \"Single, multi-call executable that contains stripped-down versions of common Unix utilities\",\n  \"credentials\": {\n    \"registryUrl\": \"https://registry.hub.docker.com\",\n    \"username\": \"johndoe\",\n    \"password\": \"password123\"\n  },\n  \"observability\": {\n    \"configs\": [\n      {\n        \"name\": \"busybox-metrics\",\n        \"prometheus\": {\n          \"scrapeIntervalSeconds\": 30,\n          \"endpoint\": \"busybox:9090\"\n        }\n      }\n    ]\n  }\n}"

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

```java
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/dpu-extension-service")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"busybox\",\n  \"serviceType\": \"KubernetesPod\",\n  \"siteId\": \"60189e9c-7d12-438c-b9ca-6998d9c364b1\",\n  \"data\": \"apiVersion: apps/v1\\\\nkind: Deployment\\\\nmetadata:\\\\n  name: busybox-deployment\\\\n  labels:\\\\n    app: busybox\\\\nspec:\\\\n  replicas: 1 # You can adjust the number of desired replicas here\\\\n  selector:\\\\n    matchLabels:\\\\n      app: busybox\\\\n  template:\\\\n    metadata:\\\\n      labels:\\\\n        app: busybox\\\\n    spec:\\\\n      containers:\\\\n      - name: busybox-container\\\\n        image: busybox:latest # You can specify a different BusyBox image tag\\\\n        command: [\\\"sh\\\", \\\"-c\\\", \\\"echo \\\\'BusyBox container running\\\\' && sleep 3600\\\"]\",\n  \"description\": \"Single, multi-call executable that contains stripped-down versions of common Unix utilities\",\n  \"credentials\": {\n    \"registryUrl\": \"https://registry.hub.docker.com\",\n    \"username\": \"johndoe\",\n    \"password\": \"password123\"\n  },\n  \"observability\": {\n    \"configs\": [\n      {\n        \"name\": \"busybox-metrics\",\n        \"prometheus\": {\n          \"scrapeIntervalSeconds\": 30,\n          \"endpoint\": \"busybox:9090\"\n        }\n      }\n    ]\n  }\n}")
  .asString();
```

```php
<?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/dpu-extension-service', [
  'body' => '{
  "name": "busybox",
  "serviceType": "KubernetesPod",
  "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
  "data": "apiVersion: apps/v1\\\\nkind: Deployment\\\\nmetadata:\\\\n  name: busybox-deployment\\\\n  labels:\\\\n    app: busybox\\\\nspec:\\\\n  replicas: 1 # You can adjust the number of desired replicas here\\\\n  selector:\\\\n    matchLabels:\\\\n      app: busybox\\\\n  template:\\\\n    metadata:\\\\n      labels:\\\\n        app: busybox\\\\n    spec:\\\\n      containers:\\\\n      - name: busybox-container\\\\n        image: busybox:latest # You can specify a different BusyBox image tag\\\\n        command: [\\"sh\\", \\"-c\\", \\"echo \\\\\'BusyBox container running\\\\\' && sleep 3600\\"]",
  "description": "Single, multi-call executable that contains stripped-down versions of common Unix utilities",
  "credentials": {
    "registryUrl": "https://registry.hub.docker.com",
    "username": "johndoe",
    "password": "password123"
  },
  "observability": {
    "configs": [
      {
        "name": "busybox-metrics",
        "prometheus": {
          "scrapeIntervalSeconds": 30,
          "endpoint": "busybox:9090"
        }
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://carbide-rest-api.carbide.svc.cluster.local/v2/org/org/carbide/dpu-extension-service");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"busybox\",\n  \"serviceType\": \"KubernetesPod\",\n  \"siteId\": \"60189e9c-7d12-438c-b9ca-6998d9c364b1\",\n  \"data\": \"apiVersion: apps/v1\\\\nkind: Deployment\\\\nmetadata:\\\\n  name: busybox-deployment\\\\n  labels:\\\\n    app: busybox\\\\nspec:\\\\n  replicas: 1 # You can adjust the number of desired replicas here\\\\n  selector:\\\\n    matchLabels:\\\\n      app: busybox\\\\n  template:\\\\n    metadata:\\\\n      labels:\\\\n        app: busybox\\\\n    spec:\\\\n      containers:\\\\n      - name: busybox-container\\\\n        image: busybox:latest # You can specify a different BusyBox image tag\\\\n        command: [\\\"sh\\\", \\\"-c\\\", \\\"echo \\\\'BusyBox container running\\\\' && sleep 3600\\\"]\",\n  \"description\": \"Single, multi-call executable that contains stripped-down versions of common Unix utilities\",\n  \"credentials\": {\n    \"registryUrl\": \"https://registry.hub.docker.com\",\n    \"username\": \"johndoe\",\n    \"password\": \"password123\"\n  },\n  \"observability\": {\n    \"configs\": [\n      {\n        \"name\": \"busybox-metrics\",\n        \"prometheus\": {\n          \"scrapeIntervalSeconds\": 30,\n          \"endpoint\": \"busybox:9090\"\n        }\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "busybox",
  "serviceType": "KubernetesPod",
  "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
  "data": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: busybox-deployment\n  labels:\n    app: busybox\nspec:\n  replicas: 1 # You can adjust the number of desired replicas here\n  selector:\n    matchLabels:\n      app: busybox\n  template:\n    metadata:\n      labels:\n        app: busybox\n    spec:\n      containers:\n      - name: busybox-container\n        image: busybox:latest # You can specify a different BusyBox image tag\n        command: [\"sh\", \"-c\", \"echo \'BusyBox container running\' && sleep 3600\"]",
  "description": "Single, multi-call executable that contains stripped-down versions of common Unix utilities",
  "credentials": [
    "registryUrl": "https://registry.hub.docker.com",
    "username": "johndoe",
    "password": "password123"
  ],
  "observability": ["configs": [
      [
        "name": "busybox-metrics",
        "prometheus": [
          "scrapeIntervalSeconds": 30,
          "endpoint": "busybox:9090"
        ]
      ]
    ]]
] 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/dpu-extension-service")! 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()
```