Dynamically Mounting OBS (AttachObs)
Function
This API is used to mount an OBS parallel file system to a specified file directory of a running notebook instance. This API applies to the following scenario: When you need to directly operate files in OBS in a notebook instance, you can use this API to mount the OBS parallel file system to a specified directory of the instance. Then the file system can be read and written. Before using this API, ensure that you have logged in to the system and have the permission to access the target notebook instance and OBS parallel file system. In addition, the notebook instance must be running. After this API is called, the system mounts the specified OBS parallel file system to the notebook instance. You can read and write objects in the OBS parallel file system in the container as a file system. If you do not have the permission to access the specified notebook instance or the notebook instance is not running, the API will return an error message.
Constraints
No constraints.
Debugging
You can debug this API in API Explorer which supports automatic authentication. API Explorer can automatically generate SDK code examples and provide the SDK code example debugging. Example CLI commands: hcloud ModelArts AttachObs.
Authorization Information
Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.
-
If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (* required)
Condition Key
Alias
Dependency
modelarts:notebook:mountStorage
Write
notebook *
-
-
-
-
g:EnterpriseProjectId
URI
POST /v1/{project_id}/notebooks/{instance_id}/storage
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| instance_id | Yes | String | Definition: Notebook instance ID. The ID is in the format of a Universally Unique Identifier (UUID). For details about how to obtain the ID, see Querying Notebook Instances. Constraints: N/A Range: N/A Default Value: N/A |
| project_id | Yes | String | Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| category | No | String | Definition: Storage type for dynamic mounting. Constraints: N/A Range: Default Value: OBS |
| mount_path | No | String | Definition: Path mounted to the notebook instance. Constraints: N/A Range: The value can contain at most 256 characters and must be in the /data/ subdirectory of the notebook instance. Default Value: /home/ma-user/work/ |
| uri | No | String | Definition: OBS object path, for example, obs://modelarts/notebook/. Constraints: Valid object path in the OBS parallel file system. Range: The value can contain a maximum of 256 characters. Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| category | String | Definition: Storage type. The value can be OBSFS. Range: N/A |
| id | String | Definition: ID of the dynamically mounted instance. Range: N/A |
| mount_path | String | Definition: Path mounted to the notebook instance. Range: N/A |
| status | String | Definition: Status of the dynamically mounted OBS. Range: |
| uri | String | Definition: OBS object path. Range: N/A |
Status code: 201
Created.
Sample Request
Mount OBS dynamically. Mount the OBS parallel file system to the /data/wang/ directory in the instance.
{
"category" : "OBS",
"mount_path" : "/data/wang/",
"uri" : "obs://authoring-test/wang/"
} Sample Response
Status code: 200
Request succeeded.
{
"id" : "91dd2d3f-2d92-475f-a375-04636af26cc9",
"category" : "OBSFS",
"mount_path" : "/data/wang/",
"uri" : "obs://authoring-test/wang/",
"status" : "MOUNTING"
} Status Code
| Status Code | Description |
|---|---|
| 200 | Request succeeded. |
| 201 | Created. |
| 401 | Unauthorized. |
| 403 | Forbidden. |
| 404 | Not found. |
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot