Application Programming Interface Guide > Web Services Operations > Operations Reference > copyResources
 
copyResources
Copy the specified resources into a folder.
Location
/services/webservices/system/admin/resource/operations/
Request Elements
entries: List of source path-type pairs to copy.
targetContainerPath: The path of the target container to copy the resources into.
copyMode: Controls behavior in the case where a resource exists with the same name and type in the container specified by newPath. It can be one of the following:
ALTER_NAME_IF_EXISTS: If a resource of the same name and type as the source resource already exists in the target container, avoid conflicts by automatically generating a new name. Names are generated by appending a number to the end of the provided name.
FAIL_IF_EXISTS: Fail if a resource of the same name and type of the source resource already exists in the target container. No resources are copied if this occurs.
OVERWRITE_MERGE_IF_EXISTS: If a resource of the same name and type of the source resource already exists in the target container, overwrite the resource in the target container. If the source resource is a container, merge the contents of the source container with the corresponding resource in the target. All resources in the source container overwrite those resources with the same name in the target, but child resources in the target with different names are not overwritten and remain unaltered.
OVERWRITE_REPLACE_IF_EXISTS: If a resource of the same name and type of the source resource already exists in the target container, overwrite the resource in the target container. If the source resource is a container, replace the container within the target container with the source container. This is equivalent to deleting the container in the target before copying the source.
Response Elements
N/A
Faults
DuplicateName: If a resource in the target container exists with the same name and type as one of the source and the copy mode is FAIL_IF_EXISTS.
IllegalArgument: If any of the given paths or types are malformed, or if the copyMode is not one of the legal values.
IllegalState: If the source resource is not allowed to be copied. Resources in /services/databases/system, /services/webservices/system, or within any physical data source, cannot be copied.
NotAllowed: If any of the source resources are not allowed to exist within the target container. Resources cannot be copied to a physical data source. LINK resources can only be copied into a RELATIONAL_DATA_SOURCE, SCHEMA, or a PORT under /services. Non-LINK resources cannot be copied into any location under /services.
NotFound: If any of the source resources or any portion of the new path does not exist.
Security: If the user does not have READ access on all items in the source paths.
Security: If the user does not have READ access on the items in the newPath other than the last item.
Security: If the user does not have WRITE access to the last item in newPath.
Security: If the user does not have WRITE access to a resource that is to be overwritten in one of the overwrite modes.
Security: If the user does not have the ACCESS_TOOLS right.