Project folders

You can interact with project folders through the API.

Basic operations

The ROOT project folder can be retrieved with the get_root_project_folder method.

client = DSSClient(host, apiKey)
root_folder = client.get_root_project_folder()

Alternatively any project folder can be retrieved with its ID with the get_project_folder method.

client = DSSClient(host, apiKey)
prj_folder = client.get_project_folder(prj_folder_id)

The name and path of a project folder can be retrived.

name = prj_folder.get_name()
path = prj_folder.get_path()

Creating entities

To create a child project folder, use the create_sub_folder method.

newborn_child = prj_folder.create_sub_folder(project_folder_name)

Projects can be created the same way using the create_project method.

new_project = prj_folder.create_project(project_key, project_name, owner)

Moving entities

To move a project folder to another location (into another project folder), use the move_to method.

prj_folder.move_to(new_parent)

Similarly projects can be moved to another location (into another project folder), use the move_project_to method.

prj_folder.move_project_to(project_key, new_parent)

Managing project folders

One can delete an empty project folder with sufficient permissions.

prj_folder.delete()

In order to edit its name, or its permissions, one must get the project folder settings beforehand.

pf_settings = prj_folder.get_settings()
pf_settings.set_name(new_name)
pf_settings.set_owner(new_owner)
pf_permissions = pf_settings.get_permissions()
pf_permissions.append(new_permission_item)
pf_settings.save()