更新时间:2025-12-04 GMT+08:00
Lite Server服务器挂载磁盘(仅Snt9b23机器支持)
示例代码
在ModelArts Notebook平台,Session鉴权无需输入鉴权参数。其它平台的Session鉴权请参见Session鉴权。
from modelarts.server_mgmt import ServerManagement from modelarts.session import Session from modelarts.servers.server_def import Volume volume = Volume(volume_id="b0e1f17b-019c-43d3-99f7-5e1703c1e9b7") ServerManagement.attach_volume(session = Session(), server_id = "server_id", volume = volume) #输入server_id
参数说明
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
server_id | 是 | String | Lite Server ID。 |
session | 是 | Class | 管理与Lite Server的交互,提供project_id |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
volume_id | 是 | String | 挂载磁盘ID |
参数 | 参数类型 | 描述 |
|---|---|---|
operation_id | String | 操作ID |
operation_status | String | 操作状态 |
operation_type | String | 操作种类 |

