Method: Baidu::PCS::Client#move

Defined in:
lib/baidu/pcs/client.rb

#move(from, to) ⇒ Hash #move(froms, tos) ⇒ Hash

单个或批量移动文件/目录

Examples:

返回的原始 JSON

{
  "extra": {
    "list": [
      {
        "to": "/apps/album/test2/2.jpg",
        "from": "/apps/album/test1/1.jpg"
      }
    ]
  },
  "request_id": 2298812844
}

:from 

Overloads:

  • #move(from, to) ⇒ Hash
    Note:

    调用move接口时,目标文件的名称如果和源文件不相同,将会在move操作时对文件进行重命名

    移动单个文件/目录

    Parameters:

    • from (String)

      源文件地址(包括文件名,相对于应用根目录)

    • to (String)

      目标文件地址(包括文件名,相对于应用根目录)

    Returns:

    • (Hash)

      如果move操作执行成功,那么response会返回执行成功的from/to列表

    See Also:

  • #move(froms, tos) ⇒ Hash
    Note:

    批量执行move操作时,move接口一次对请求参数中的每个from/to进行操作;执行失败就会退出,成功就继续,返回执行成功的from/to列表

    批量移动文件/目录

    Parameters:

    • froms (Array<String>)

      源文件地址(包括文件名,相对于应用根目录)

    • tos (Array<String>)

      目标文件地址(包括文件名,相对于应用根目录)

    Returns:

    • (Hash)

      返回参数extra由list数组组成,list数组的两个元素分别是“from”和“to”,代表move操作的源地址和目的地址

    See Also:

Returns:

  • (Hash)


425
426
427
# File 'lib/baidu/pcs/client.rb', line 425

def move(from, to)
  move_or_copy :move, from, to
end