Application Programming Interface Guide > Web Services Operations > Operations Reference > createLinksRecursively
 
createLinksRecursively
Create links for each of the resources within the source path recursively into the target container. Container resources are not linked; instead, new resources are created within path to match all containers within the source path. The specific type of container create in path depends on its location within path.
Only resources that can be linked are linked. Resources that cannot be linked or are not containers will be linked. If includeRoot is TRUE, the source resource is the one resource that is recursively traversed. If includeRoot is FALSE, the source path must be a container and the contents of this container are used as a list of sources.
If a resource already exists at the targetPath, the behavior of this operation depends on the createMode as follows:
ALTER_NAME_IF_EXISTS: If a resource in targetPath already exists within path with the same name, avoid conflicts by automatically generating a new name. This only applies to the root if includeRoot is TRUE.
FAIL_IF_EXISTS: Fail if a resource in the targetPath already exists within path. No resources are created if this occurs. This only applies to the root if includeRoot is TRUE.
OVERWRITE_MERGE_IF_EXISTS: If a resource in targetPath already exists within path with the same name, recreate the resource within path. If the resource is a container, merge the contents of the container with the corresponding resource in path. Any link resources with conflicting names are recreated.
OVERWRITE_REPLACE_IF_EXISTS: If a resource in targetPath already exists within path with the same name, recreate the resource within path. If the resource is a container, destroy and recreate the container within path. Only RELATIONAL_DATA_SOURCE resources can be used as the source. The target can be /services/databases if includeRoot is TRUE; it can be a COMPOSITE_DATABASE under /services/databases if includeRoot is FALSE.
Location
/services/webservices/system/admin/resource/operations/
Request Elements
path: A path to the resource to use as a source.
type: The type of the source resource.
detail: The level of detail about the resources to include in the response. Valid values are NONE, SIMPLE, and FULL.
targetContainerPath: The path of the container resource to create links into.
createMode: One of the following: ALTER_NAME_IF_EXISTS, FAIL_IF_EXISTS, OVERWRITE_MERGE_IF_EXISTS, or OVERWRITE_REPLACE_IF_EXISTS.
includeRoot: If TRUE, create a resource with the same name as the source within the target container. If FALSE, create links to the children of the source container into the target container.
copyAnnotations: If TRUE, all created link resources within path inherit their annotations from the corresponding resource in targetPath. If FALSE, no annotations are provided for created links. Container annotations are not created or modified.
Response Elements
resources: List of the newly created or updated resources. See Resources Element
Faults
DuplicateName: If a resource already exists with the same path and type as one of the source resources, and createMode is FAIL_IF_EXISTS.
IllegalArgument: If any of the given paths, types, or detail levels are malformed.
NotAllowed: If includeRoot is TRUE and the target container is not /services, or if includeRoot is FALSE and the target container is not a COMPOSITE_DATABASE under /service/databases.
IllegalState: If the source is not a RELATIONAL_DATA_SOURCE.
NotFound: If the target resource or any portion of path does not exist.
Security: If the user does not have READ access on all items in path.
Security: If the user does not have READ access on the items in the targetContainerPath.
Security: If the user does not have WRITE access to the last item in targetContainerPath.
Security: If the user does not have WRITE access to a resource that is to be recreated when in one of the OVERWRITE modes.
Security: If the user does not have the ACCESS_TOOLS right.