Copy a resource into a new parent

To update a resource's parent with this command, you must specify, at a minimum, the resource path or id, and optionally provide info for the resource template, blueprint, and application.

Request

PUT https://{hostname}:{port}
    /cli/resource/copy?{parameters}
Accept: application/json
Table 1. Request parameters
Parameter Type Required Description
resource string true ID or path to the resource, such as /ResourceGroup/Agents/Agent1
parent string true The path or id of the new parent
template string false Name or ID of the resource template (Optional)
blueprintId string false Name or ID of the blueprint (Optional)
application string false Name or ID of the application (Required to look up blueprint by name)
Table 2. Header parameters
Parameter Type Required Description
Accept application/json true
This command takes a JSON request string or file. Use the following template for the request:
{
  "agent": "Name or ID of an agent to use for automation 
  (Optional)",
  "agentPool": "Name or ID of an agent pool to use for 
  automation (Optional)",
  "component": "Name or ID of a component to associate 
  with the resource (Optional)",
  "componentTag": "Name or ID of a component tag to 
  associate with the resource; any components with that tag 
  can be deployed to this resource (Optional)",
  "description": "Description",
  "impersonationForce": "Specify true to prevent children 
  or steps from specifying their own impersonation settings 
  (Optional)",
  "impersonationGroup": "Group for default impersonation 
  (Optional)",
  "impersonationPassword": "Password for default 
  impersonation. Agents running on Linux and Unix machines 
  will ignore this value (Optional)",
  "impersonationUseSudo": "Specify true to use the sudo 
  command for impersonation. Agents running on Windows 
  machines will ignore this value (Optional)",
  "impersonationUser": "User name for default 
  impersonation (Optional)",
  "name": "Name for the new resource; leave blank to 
  inherit the name from an agent, pool, or role",
  "parent": "ID or path to parent resource; leave blank to 
  create a root resource (Optional)",
  "role": "Name or ID of a resource role to associate with 
  the agent; if this resource is for a component, specify 
  the component name instead (Optional)",
  "roleProperties": {"Property name": "Property value 
  (Optional)"}
"inheritTeam": false,
  "teamMappings": [
          {
            "teamId": "ID of a team, either this field or teamLabel are needed to specify a team",
            "teamLabel": "Name of the team to map the resource to, either this field or teamId are needed to specify a team"
          }
                  ]
}
Note: The team mappings and inheritTeam parameters are allowed in versions starting 7.3.2.1.

Related CLI command: copyResource.