> This page is for Self-Hosted, version v3.0 (default).
> For other versions, use one of these documentation indexes:
> - v3.0 (default): https://docs.nvidia.com/run-ai/self-hosted/v3.0/llms.txt
> - v2.26: https://docs.nvidia.com/run-ai/self-hosted/v2.26/llms.txt
> - v2.25: https://docs.nvidia.com/run-ai/self-hosted/v2.25/llms.txt
> - v2.24: https://docs.nvidia.com/run-ai/self-hosted/v2.24/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/run-ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/run-ai/_mcp/server.

# Update an NFS asset.

PUT http://localhost:8080/api/v1/asset/datasource/nfs/{AssetId}
Content-Type: application/json

Use to update the details of NFS datasource asset by id.

Reference: https://docs.nvidia.com/run-ai/self-hosted/reference/rest-api/endpoints/workload-assets/nfs/update-nfs-asset-by-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication

## Request

### Path parameters

- `AssetId` (string, required) — Unique identifier of the asset.

### Body (application/json)

This endpoint expects a NFSUpdateRequest.

- `meta` (AssetUpdateRequest, required)
- `spec` (NFSAssetSpec, required)

## Response

### 202

Request accepted successfully.

- `meta` (AssetMeta, required)
- `spec` (NFSAssetSpec, required)
- `usedBy` (AssetUsageInfo, optional) — Details about resources that use the asset.
- `usageTimes` (UsageTimesInfo, optional) — Details about times the asset has been used by workloads, etc.
- `compliance` (ComplianceInfo, optional) — Compliance of an asset with creation of workloads in a given project.

## Errors

### 401 Unauthorized Error

Unauthorized

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 403 Forbidden Error

Forbidden

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 404 Not Found Error

The specified resource was not found

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

## Types

### AssetUpdateRequest

- `name` (string, required) — The name of the asset.
- `description` (string, optional) — The description of the asset.

### NFSAssetSpec

- `path` (string, optional, nullable) — Path that is exported by the NFS server (mandatory). For more information, see [NFS](https://kubernetes.io/docs/concepts/storage/volumes#nfs).
- `readOnly` (boolean, optional, nullable, default: true) — Force the NFS export to be mounted with read-only permissions.
- `server` (string, optional, nullable) — The hostname or IP address of the NFS server. (mandatory)
- `mountPath` (string, optional, nullable) — The path that the NFS volume will be mounted to when in use. (mandatory)

### AssetMeta

- `name` (string, required) — The name of the asset.
- `scope` (enum, required) — The scope in which an asset can be used. The highest scope, system, is intended for internal purposes only.
  - Allowed values: `system`, `tenant`, `cluster`, `department`, `project`
- `id` (string, required) — Unique identifier of the asset.
- `kind` (enum, required) — The kind of the asset.
  - Allowed values: `compute`, `environment`, `accessKey`, `dockerRegistry`, `password`, `genericSecret`, `registry`, `s3`, `git`, `nfs`, `pvc`, `hostPath`, `workload-template`, `model`, `config-map`, `secret-volume`, `data-volume`, `ngcApiKey`
- `createdBy` (string, required) — The user who created the asset.
- `createdAt` (datetime, required) — The time at which the asset were created
- `updatedBy` (string, required) — The user who updated the asset.
- `updatedAt` (datetime, required) — The time at which the asset has been updated
- `description` (string, optional) — The description of the asset.
- `clusterId` (string, optional) — The id of the cluster.
- `departmentId` (string, optional, nullable) — The id of the department. Must be specified for department scoped assets.
- `projectId` (integer, optional, nullable) — The id of the project. Must be specified for project scoped assets.
- `autoDelete` (boolean, optional, nullable, default: false) — The asset will be deleted automatically. This is intended for internal use.
- `workloadSupportedTypes` (WorkloadSupportedTypes, optional)
- `private` (boolean, optional, nullable, default: false) — The asset will be private to the user who created it. supported only for docker registry and generic secrets
- `tenantId` (integer, optional, nullable) — The id of the tenant.
- `deletedAt` (datetime, optional) — Deletion time of the asset (relevant for assets that sync to the cluster)
- `deletedBy` (string, optional) — The user who deleted the asset
- `projectName` (string, optional, nullable) — The name of the project that the asset is associated with, for project scoped assets.
- `updateCount` (long, optional) — the value of an update counter of a data in the system.

### AssetUsageInfo

Details about resources that use the asset.

- `workspaces` (list of WorkloadRefAndStatus, optional) — workspaces that rely on this asset.
- `trainings` (list of WorkloadRefAndStatus, optional) — trainings that rely on this asset.
- `distributed` (list of WorkloadRefAndStatus, optional) — distributed trainings that rely on this asset.
- `inferences` (list of WorkloadRefAndStatus, optional) — inferences that rely on this asset.
- `templates` (list of AssetRef, optional) — templates that rely on this asset.
- `assets` (AssetsUsageRef, optional) — list of other assets that use this asset. specifically, accessKeys used by s3, and passwords used by git.

### UsageTimesInfo

Details about times the asset has been used by workloads, etc.

- `lastUsedByWorkload` (datetime, optional, nullable) — The time at which the asset were last used by a workload of given type and project. This field requires complyToProject and complyToWorkload types flags of the API, to specify the workload type and project id.

### ComplianceInfo

Compliance of an asset with creation of workloads in a given project.

- `imposed` (boolean, optional) — Whether the asset is imposed on created workloads by the administrator.
- `compliance` (boolean, optional) — Whether the asset info complies with creation of workloads in the project.
- `reason` (list of ComplianceInfoReason, optional) — For asset that does not comply, specify one or more reason why.

### WorkloadSupportedTypes

- `inference` (boolean, optional, nullable) — Is inference a supported workload type.
- `workspace` (boolean, optional, nullable) — Is workspace a supported workload type.
- `training` (boolean, optional, nullable) — Is training a supported workload type.
- `distributed` (boolean, optional, nullable) — Is distributed a supported workload type.
- `distFramework` (enum, optional, nullable) — The distributed training framework used in the workload. Note: The TF, XGBoost and JAX frameworks are deprecated and will be removed in a future release.
  - Allowed values: `MPI`, `PyTorch`, `TF`, `XGBoost`, `JAX`

### WorkloadRefAndStatus

Id, name and status of a workspace or training

- `id` (string, required) — A unique ID of the workload.
- `name` (string, required) — The name of the workload.
- `status` (string, optional) — The status of the workspace or training.

### AssetRef

Reference information about an asset.

- `id` (string, required) — Unique identifier of the asset.
- `name` (string, required) — The name of the asset.

### AssetsUsageRef

Reference information about usage of assets by other assets, for example datasources that uses credentials.

- `environment` (EnvironmentAssetRef, optional, nullable) — environment asset.
- `environments` (list of AssetRef, optional)
- `compute` (AssetsUsageRefCompute, optional)
- `computes` (list of AssetRef, optional)
- `datasources` (list of AssetDatasourceRef, optional)

### ComplianceInfoReason

An issue preventing the use of a template or asset for creating workloads in a given project.

- `details` (string, required) — Explanation of the issue.
- `field` (string, optional, nullable) — For policy related issues, includes a json path to the field in the policy for which the issue applies.
- `rule` (enum, optional) — Indicates which validation rule (e.g., min, max, step, options, required, canEdit, canAdd) conflicted with policy restrictions, causing the asset or template to be rejected.
  - Allowed values: `min`, `max`, `step`, `options`, `required`, `canEdit`, `canAdd`, `locked`, `blocked`

### EnvironmentAssetRef

Reference information about environment asset.

- `id` (string, required) — Unique identifier of the asset.
- `name` (string, required) — The name of the asset.
- `toolTypes` (list of enum, optional, nullable) — the type of tools as defined in the connections of the environment asset.
  - Allowed values: `jupyter-notebook`, `pycharm`, `visual-studio-code`, `tensorboard`, `rstudio`, `mlflow`, `custom`, `wandb`, `matlab`, `comet`, `chatbot-ui`

### AssetsUsageRefCompute

- `id` (string, required) — Unique identifier of the asset.
- `name` (string, required) — The name of the asset.

### AssetDatasourceRef

Reference information about a datasource asset.

- `id` (string, required) — Unique identifier of the asset.
- `name` (string, required) — The name of the asset.
- `kind` (enum, required) — The kind of the asset.
  - Allowed values: `compute`, `environment`, `accessKey`, `dockerRegistry`, `password`, `genericSecret`, `registry`, `s3`, `git`, `nfs`, `pvc`, `hostPath`, `workload-template`, `model`, `config-map`, `secret-volume`, `data-volume`, `ngcApiKey`
- `overrides` (DataSourceOverrides, optional) — specific fields to override in the data source.

### DataSourceOverrides

specific fields to override in the data source.

- `containerPath` (string, optional, nullable)

## Examples

**Request**

```json
{
  "meta": {
    "name": "my-asset"
  }
}
```

**Response**

```json
{
  "meta": {
    "name": "my-asset",
    "scope": "tenant",
    "id": "a418ed33-9399-48c0-a890-122cadd13bfd",
    "kind": "s3",
    "createdBy": "test@run.ai",
    "createdAt": "2023-02-23T14:25:36.707685Z",
    "updatedBy": "test@run.ai",
    "updatedAt": "2023-02-23T14:25:36.707685Z",
    "workloadSupportedTypes": {
      "workspace": false,
      "training": false,
      "distributed": true,
      "distFramework": "TF"
    }
  },
  "spec": {
    "path": "/container/nfs",
    "readOnly": true,
    "server": "my.nfs.com",
    "mountPath": "/local/nfs"
  },
  "usedBy": {
    "workspaces": [
      {
        "id": "string",
        "name": "my-workload-name",
        "status": "string"
      }
    ],
    "trainings": [
      {
        "id": "string",
        "name": "my-workload-name",
        "status": "string"
      }
    ],
    "distributed": [
      {
        "id": "string",
        "name": "my-workload-name",
        "status": "string"
      }
    ],
    "inferences": [
      {
        "id": "string",
        "name": "my-workload-name",
        "status": "string"
      }
    ],
    "templates": [
      {
        "id": "string",
        "name": "my-asset"
      }
    ],
    "assets": {
      "environment": {
        "id": "string",
        "name": "my-asset",
        "toolTypes": [
          "jupyter-notebook"
        ]
      },
      "environments": [
        {
          "id": "string",
          "name": "my-asset"
        }
      ],
      "compute": {
        "id": "string",
        "name": "my-asset"
      },
      "computes": [
        {
          "id": "string",
          "name": "my-asset"
        }
      ],
      "datasources": [
        {
          "id": "string",
          "name": "my-asset",
          "kind": "compute",
          "overrides": {
            "containerPath": "/container/directory"
          }
        }
      ]
    }
  },
  "usageTimes": {
    "lastUsedByWorkload": "2024-01-15T09:30:00Z"
  },
  "compliance": {
    "imposed": true,
    "compliance": true,
    "reason": [
      {
        "details": "string",
        "field": "string",
        "rule": "min"
      }
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/api/v1/asset/datasource/nfs/AssetId"

payload = { "meta": { "name": "my-asset" } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'http://localhost:8080/api/v1/asset/datasource/nfs/AssetId';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"meta":{"name":"my-asset"}}'
};

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 := "http://localhost:8080/api/v1/asset/datasource/nfs/AssetId"

	payload := strings.NewReader("{\n  \"meta\": {\n    \"name\": \"my-asset\"\n  }\n}")

	req, _ := http.NewRequest("PUT", 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("http://localhost:8080/api/v1/asset/datasource/nfs/AssetId")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"meta\": {\n    \"name\": \"my-asset\"\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.put("http://localhost:8080/api/v1/asset/datasource/nfs/AssetId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"meta\": {\n    \"name\": \"my-asset\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://localhost:8080/api/v1/asset/datasource/nfs/AssetId', [
  'body' => '{
  "meta": {
    "name": "my-asset"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/asset/datasource/nfs/AssetId");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"meta\": {\n    \"name\": \"my-asset\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["meta": ["name": "my-asset"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/asset/datasource/nfs/AssetId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```