Method: Baidu::PCS::Client#restore
- Defined in:
- lib/baidu/pcs/client.rb
#restore(fs_id) ⇒ Hash #restore(fs_ids) ⇒ Hash
Note:
非强一致接口,调用后请sleep 1秒读取
单个或批量还原文件/目录
976 977 978 979 980 981 982 983 984 985 986 987 |
# File 'lib/baidu/pcs/client.rb', line 976 def restore(fs_ids) query = case fs_ids when String { fs_id: fs_ids } when Array fs_ids = fs_ids.map { |id| { fs_id: id } } { param: JSON.dump({ list: fs_ids }) } else raise ArgumentError, 'fs_id(s) must be kind of String or Array' end post "#{BASE_PATH}/file", query.update(base_query 'restore') end |