> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 更新 GPU 节点

> 部分更新咏唱引擎 PIN 中的 GPU 节点，包括 SSH 凭据、标签、规格与状态。

向已有的 GPU 节点发送部分更新。仅修改提供的字段；省略的字段保留当前值。提供的 SSH 凭据在存储前会重新加密。

## 接口

**PUT** `/v1/gpu-nodes/:id`

认证：需要 Bearer API 密钥。

## 路径参数

<ParamField path="id" type="string" required>
  GPU 节点标识符，例如 gn\_a1b2c3d4。
</ParamField>

## 请求体

<ParamField body="name" type="string">
  更新后的便于识别的名称。
</ParamField>

<ParamField body="ip" type="string">
  更新后的 IP 地址。
</ParamField>

<ParamField body="ssh_port" type="integer">
  更新后的 SSH 端口。
</ParamField>

<ParamField body="ssh_user" type="string">
  更新后的 SSH 用户名。
</ParamField>

<ParamField body="ssh_key" type="string">
  新的 SSH 私钥（存储前重新加密）。
</ParamField>

<ParamField body="ssh_password" type="string">
  新的 SSH 密码（存储前重新加密）。
</ParamField>

<ParamField body="spec" type="string">
  更新后的硬件规格摘要。
</ParamField>

<ParamField body="labels" type="array of strings">
  替换用的标签列表。
</ParamField>

<ParamField body="status" type="string">
  新的状态字符串，例如 active 或 maintenance。
</ParamField>

## 响应

<ResponseField name="id" type="string" required>
  节点标识符。
</ResponseField>

<ResponseField name="name" type="string" required>
  更新后的名称。
</ResponseField>

<ResponseField name="ip" type="string" required>
  更新后的 IP。
</ResponseField>

<ResponseField name="ssh_port" type="integer">
  SSH 端口。
</ResponseField>

<ResponseField name="ssh_user" type="string" required>
  SSH 用户名。
</ResponseField>

<ResponseField name="spec" type="string">
  规格摘要。
</ResponseField>

<ResponseField name="labels" type="array of strings">
  标签。
</ResponseField>

<ResponseField name="status" type="string">
  当前状态。
</ResponseField>

<ResponseField name="created_at" type="string (ISO 8601)">
  创建时间戳。
</ResponseField>

<ResponseField name="updated_at" type="string (ISO 8601)">
  最近更新时间戳。
</ResponseField>

## 示例

```bash theme={null}
curl -s -X PUT http://<pin-host>:8001/v1/gpu-nodes/gn_a1b2c3d4 \
  -H "Authorization: Bearer $ARIA_PIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "node-01-renamed",
    "spec": "A100-80G x8",
    "labels": ["training", "a100", "priority"]
  }'
```

```json theme={null}
{
  "id": "gn_a1b2c3d4",
  "name": "node-01-renamed",
  "ip": "10.0.1.10",
  "ssh_port": 22,
  "ssh_user": "ubuntu",
  "spec": "A100-80G x8",
  "labels": ["training", "a100", "priority"],
  "status": "active",
  "created_at": "2024-05-01T12:00:00Z",
  "updated_at": "2024-05-11T09:15:00Z"
}
```
