Downloading a Folder from OBS
Sample Code
In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
1 2 3 |
from modelarts.session import Session session = Session() session.obs.download_dir(src_obs_dir="obs://bucket-name/dir1/", dst_local_dir="/home/ma-user/work/") |
After the sample code is executed, source folder dir1 is downloaded from OBS to /home/ma-user/work/dir1/.
You must have the write permission on the local path.
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
session |
Yes |
Object |
Session object |
src_obs_dir |
Yes |
String |
Path to the source folder to be downloaded from OBS. The path must start with obs:// and end with a slash (/). If the downloaded folder contains empty folders, no empty folders are created in the corresponding local path. |
dst_local_dir |
Yes |
String |
Path to the target local folder. The path must end with a slash (/). |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code when the API call fails. This parameter is not included when the API call succeeds. |
error_msg |
String |
Error message when the API call fails. This parameter is not included when the API call succeeds. |
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