Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

Rename a file system directory

Renames a file system directory.

HTTP request syntax (URI)
PATCH <base_URI>/v8/storage/filesystems/{filesystemId}/directories/{directoryObjectId}
Parameters
Name Type Required Values Description
filesystemId URI_PARAM Y string Either the file system object ID or HNAS file system ID.
directoryObjectId URI_PARAM Y string Directory object ID.
newDirectory BODY Y string New absolute path of the directory. The path should be in UNIX format. If this directory exists or is not empty, the operation will fail.
ensureExist BODY Y boolean When set to TRUE, the end result is similar to the mkdir -p, which allows a directory to be created even though its parent directory does not exist. In this case, if the /destination object does not exist, and the newDirectory variable has the values /destination/subdirectory and ensureExist is TRUE, the operation will succeed.
Return codes
Code Data Description
303 directory File system directory has been successfully renamed.
400 Error Message Missing or invalid request contents.
403Error MessageOperation forbidden by access level.
404 Error Message Requested resource not found.
500 Error message Error associated with the storage system.

Any HTTP status code other than 303 indicates that the operation did not complete successfully.

Request example: Using the file system object ID
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.11.11:8444/v8/storage/filesystems/3037303741394333364638443842374230303030303030303030303030303030/directories/6d6574726f5f64697232 -X PATCH -d '{"newDirectory": "/xyz_rename","ensureExist":true}'
Response example: Using the file system object ID
HTTP/1.1 303 See Other
{
   "directory" : {
      "displayName" : [ "//xyz_rename" ],
      "objectId" : "6d6574726f5f72656e616d65"
   },
   "uri" : 			 		
"https://172.17.11.11:8444/v8/storage/filesystems/3037303741394333364638443842374230303030303030303030303030303030/directories/6d6574726f5f72656e616d65"
}
Request example: Using the HNAS storage file system ID
curl -vk -H "X-Api-Key: zrxvSDAv9x.RIP4gkmKarG3beF.or.4Tc2im7oeqYN88C9XPGHxbXC" https://172.17.11.11:8444/v8/storage/filesystems/864DC6E1DFB68C210000000000000000/directories/6d6574726f5f64697232 -X PATCH -d '{"newDirectory":"/xyz_rename","ensureExist":true}'
Response example: Using the HNAS storage file system ID
HTTP/1.1 303 See Other
{
   "directory" : {
      "displayName" : [ "//xyz_rename" ],
      "objectId" : "6d6574726f5f72656e616d65"
   },
   "uri" :  
"https://172.17.11.11:8444/v8/storage/filesystems/3037303741394333364638443842374230303030303030303030303030303030/directories/6d6574726f5f72656e616d65"
}

 

  • Was this article helpful?