Move a File or Folder

URL:
https://<root>/dataaccess/<userName>/move
Methods:
POST
Required Capability:
Administrator or Create and Edit
Version Introduced:
11.4

Description

The move operation enables an administrator or a notebook author to relocate a file or folder within their workspace. Additionally, administrators have the privilege to transfer a file or folder between user workspaces. This action is permitted only when there are no active notebook containers open for the user whose file or folder is being relocated.

Request parameters

ParameterDetails

source

The name of the file or folder to be moved should be specified. To move the file or folder from a specific folder path, prepend the name with a relative path to the /arcgis/home folder, as shown in the example below

target

Desired output name for file or folder. To move the file or folder to a specific folder path, prefix the name with a relative path to /arcgis/home folder as shown in example below.

targetUsername

The targetUsername refers to the recipient of the moved file or folder. In cases involving non-administrators, the targetUsername must match the user initiating the move operation.

f

The response format. The default response format is html . Values: html | json | pjson

Example usages

Example one: same user workspace

Below is a sample request URL and parameters for the move operation within the same users workspace:

Use dark colors for code blocksCopy
1
2
3
4
5
6
HTTP POST
https://notebookserver.domain.com/arcgis/admin/dataaccess/gis_joe/move
targetUsername=gis_joe
source = csv_folder
target = mydata/csv_folder
f=json

Example two: move between workspaces

Below is a sample request URL and parameters for the move operation between user workspaces (allowed only for an administrator):

Use dark colors for code blocksCopy
1
2
3
4
5
6
HTTP POST
https://notebookserver.domain.com/arcgis/admin/dataaccess/gis_joe/move
targetUsername=gis_jane
source = csvdata1/7000Points.csv
target = csvdata/7000Points.csv
f=json

JSON Response syntax

Use dark colors for code blocksCopy
1
{"status": "<success | failure>"}

JSON Response example

Example 1:

Use dark colors for code blocksCopy
1
{"status":"success"}

Example 2 - Error when source user has one or more active containers:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
    "error": {
        "code": 500,
        "message": "Failed to move user workspace. The user has actively running containers.",
        "details": null
    }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.