sasctl.services.folders#
- class sasctl._services.folders.Folders[source]#
Bases:
Service
The Folders API provides an organizational structure for SAS and external content. It can also be used for favorites folders or a history of objects accessed. The resources that are stored in folders (members) use a URI to point back to those resources.
- classmethod create_folder(name, parent=None, description=None)[source]#
Create a new folder.
- Parameters:
- Returns:
RestObj – Details of newly-created folder
- classmethod delete_folder(item)#
Delete a folder instance.
- Parameters:
item
- Returns:
None
- classmethod get_folder(folder, refresh=False)[source]#
Return a folder instance.
- Parameters:
- Returns:
RestObj or None – A dictionary containing the folder attributes or None.
Notes
If folder is a complete representation of the folder it will be returned unless refresh is set. This prevents unnecessary REST calls when data is already available on the client.
Examples
The following four examples are all functionally equivalent.
>>> get_folder("Public") {"name": "Public", "id": "4a737209-5662"}
>>> get_folder("/Public") {"name": "Public", "id": "4a737209-5662"}
>>> get_folder("@public") {"name": "Public", "id": "4a737209-5662"}
>>> get_folder("@public") {"name": "Public", "id": "4a737209-5662"}
>>> get_folder("4a737209-5662") {"name": "Public", "id": "4a737209-5662"}
The full folder path can also be specified.
>>> get_folder("/Public/Demo") {"name": "Demo", "id": "148081bf-1c86"}
Special folders can be identified using a delegate string. Currently supported are: @myFolder, @appDataFolder, @myHistory, @myFavorites, and @public.
>>> get_folder("@myFolder") {"name": "My Folder", "id": "71687cd2-db4b"}