Renames a folder within a bucket with hierarchical namespace enabled. For details about how the rename operation works, see Rename folders .
Request
HTTP request
POST https://storage.googleapis.com/storage/v1/b/ bucket /folders/ sourcePath /renameTo/folders/ destinationPath
In addition to standard query parameters , the following parameters apply to this method.
To see an example of how to include query parameters in a request, see the JSON API Overview page.
Parameters
bucket
string
sourcePath
string
src-folder/
,
URL-encoded as src-folder%2F
.destinationPath
string
dest-folder/
,
URL-encoded as dest-folder%2F
.ifMetagenerationMatch
long
ifMetagenerationNotMatch
long
Request body
Do not supply a request body with this method.
Response
If successful, this method returns an instance of the long-running operation in the response body:
{ "name": " string ", "metadata": { object }, "done": boolean , // Result can include either an error or response: "error": { object (Status) }, "response": { object (Folder) } }
name
string
done
boolean
false
, indicates that the operation is still in progress, and neither error
nor response
is set. If true
, it indicates that the operation is completed and either error
or response
is set.error
object
If a failure occurs, the folders are reverted to their original state prior to the rename attempt. For information about status and error codes returned by this API, see the reference page .
response
object
google.storage.control.v2.Folder
is returned. { "name": " string ", "metageneration": integer , "createTime": " datetime "", "updateTime": " datetime ", }
Where:
-
nameis the name of the folder resource. -
metagenerationis the metageneration of the folder. -
createTimeis the time when the folder was created. -
updateTimeis the time when the folder was last updated.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.

