Class FileSystemOnboardingResource
java.lang.Object
org.odpi.openmetadata.accessservices.assetowner.server.spring.FileSystemOnboardingResource
@RestController
@RequestMapping("/servers/{serverName}/open-metadata/access-services/asset-owner/users/{userId}")
public class FileSystemOnboardingResource
extends Object
FileSystemOnboardingResource supports the server-side capture of REST calls to add new file-based asset definitions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAvroFileToCatalog
(String serverName, String userId, NewFileAssetRequestBody requestBody) Add a simple asset description linked to a connection object for an Avro file.addCSVFileToCatalog
(String serverName, String userId, NewCSVFileAssetRequestBody requestBody) Add a simple asset description linked to a connection object for a CSV file.addDataFileAssetToCatalog
(String serverName, String userId, NewFileAssetRequestBody requestBody) Creates a new file asset and links it to the folder structure implied in the path name.addDataFolderAssetToCatalog
(String serverName, String userId, NewFileAssetRequestBody requestBody) Creates a new folder asset that is identified as a data asset.attachDataFileAssetToFolder
(String serverName, String userId, String folderGUID, String fileGUID, NullRequestBody requestBody) Link an existing file asset to a folder.attachFolderToFileSystem
(String serverName, String userId, String fileSystemGUID, String folderGUID, NullRequestBody requestBody) Links a folder to a file system.createFileSystemInCatalog
(String serverName, String userId, NewFileSystemRequestBody requestBody) Files live on a file system.createFolderStructureInCatalog
(String serverName, String userId, String anchorGUID, PathNameRequestBody requestBody) Creates a new folder asset for each element in the pathName that is linked from the anchor entity.createFolderStructureInCatalog
(String serverName, String userId, PathNameRequestBody requestBody) Creates a new folder asset for each element in the pathName.detachDataFileAssetFromFolder
(String serverName, String userId, String folderGUID, String fileGUID, NullRequestBody requestBody) Remove a link between a file asset and a folder.detachFolderFromFileSystem
(String serverName, String userId, String fileSystemGUID, String folderGUID, NullRequestBody requestBody) Removed the link between a folder and a file system.getFileSystemByGUID
(String serverName, String userId, String fileSystemGUID) Retrieve a FileSystemProperties asset by its unique identifier (GUID).getFileSystemByUniqueName
(String serverName, String userId, String uniqueName) Retrieve a FileSystemProperties asset by its unique name.getFileSystems
(String serverName, String userId, int startingFrom, int maxPageSize) Retrieve a list of defined FileSystems assets.getFolderByGUID
(String serverName, String userId, String folderGUID) Retrieve a FileFolderProperties asset by its unique identifier (GUID).getFolderByPathName
(String serverName, String userId, PathNameRequestBody requestBody) Retrieve a folder by its fully qualified path name.getFolderFiles
(String serverName, String userId, String folderGUID, int startingFrom, int maxPageSize) Get the files inside a folder - both those that are nested and those that are linked.getNestedFolders
(String serverName, String userId, String anchorGUID, int startingFrom, int maxPageSize) Return the list of folders nested inside a folder.moveDataFileInCatalog
(String serverName, String userId, String folderGUID, String fileGUID, NullRequestBody requestBody) Move a data file from its current parent folder to a new parent folder - this changes the file's qualified name but not its unique identifier (guid).moveDataFolderInCatalog
(String serverName, String userId, String folderGUID, String dataFolderGUID, NullRequestBody requestBody) Move a data folder from its current parent folder to a new parent folder - this changes the folder's qualified name but not its unique identifier (guid).
-
Constructor Details
-
FileSystemOnboardingResource
public FileSystemOnboardingResource()Default constructor
-
-
Method Details
-
createFileSystemInCatalog
@PostMapping(path="/file-systems") public GUIDResponse createFileSystemInCatalog(@PathVariable String serverName, @PathVariable String userId, @RequestBody NewFileSystemRequestBody requestBody) Files live on a file system. This method creates a top level anchor for a file system.- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- properties of the file system- Returns:
- unique identifier for the file system or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem
-
createFolderStructureInCatalog
@PostMapping(path="/folders/{anchorGUID}") public GUIDListResponse createFolderStructureInCatalog(@PathVariable String serverName, @PathVariable String userId, @PathVariable String anchorGUID, @RequestBody PathNameRequestBody requestBody) Creates a new folder asset for each element in the pathName that is linked from the anchor entity. For example, a pathName of "one/two/three" creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three".- Parameters:
serverName
- name of calling serveruserId
- calling useranchorGUID
- root object to connect the folder torequestBody
- pathname of the folder (or folders)- Returns:
- list of GUIDs from the top level to the leaf of the supplied pathname or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
createFolderStructureInCatalog
@PostMapping(path="/folders") public GUIDListResponse createFolderStructureInCatalog(@PathVariable String serverName, @PathVariable String userId, @RequestBody PathNameRequestBody requestBody) Creates a new folder asset for each element in the pathName. For example, a pathName of "one/two/three" creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three".- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- pathname of the folder (or folders)- Returns:
- list of GUIDs from the top level to the leaf of the supplied pathname or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
attachFolderToFileSystem
@PostMapping(path="/file-systems/{fileSystemGUID}/folders/{folderGUID}/attach") public VoidResponse attachFolderToFileSystem(@PathVariable String serverName, @PathVariable String userId, @PathVariable String fileSystemGUID, @PathVariable String folderGUID, @RequestBody(required=false) NullRequestBody requestBody) Links a folder to a file system. The folder is not changed.- Parameters:
serverName
- name of calling serveruserId
- calling userfileSystemGUID
- unique identifier of the file system in the catalogfolderGUID
- unique identifier of the folder in the catalogrequestBody
- dummy request body- Returns:
- void or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
detachFolderFromFileSystem
@PostMapping(path="/file-systems/{fileSystemGUID}/folders/{folderGUID}/detach") public VoidResponse detachFolderFromFileSystem(@PathVariable String serverName, @PathVariable String userId, @PathVariable String fileSystemGUID, @PathVariable String folderGUID, @RequestBody(required=false) NullRequestBody requestBody) Removed the link between a folder and a file system.- Parameters:
serverName
- name of calling serveruserId
- calling userfileSystemGUID
- unique identifier of the file system in the catalogfolderGUID
- unique identifier of the folder in the catalogrequestBody
- dummy request body- Returns:
- void or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
addDataFileAssetToCatalog
@PostMapping(path="/assets/data-files") public GUIDListResponse addDataFileAssetToCatalog(@PathVariable String serverName, @PathVariable String userId, @RequestBody NewFileAssetRequestBody requestBody) Creates a new file asset and links it to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyFile.txt" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a file asset called "one/two/three/MyFile.txt".- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- pathname of the data file- Returns:
- list of GUIDs from the top level to the root of the pathname or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
addDataFolderAssetToCatalog
@PostMapping(path="/assets/data-folders") public GUIDListResponse addDataFolderAssetToCatalog(@PathVariable String serverName, @PathVariable String userId, @RequestBody NewFileAssetRequestBody requestBody) Creates a new folder asset that is identified as a data asset. This means the files and sub-folders within it collectively make up the contents of the data asset. As with other types of file-based asset, links are made to the folder structure implied in the path name. If the folder structure is not catalogued already, this is created automatically using the createFolderStructureInCatalog() method. For example, a pathName of "one/two/three/MyDataFolder" potentially creates 3 new folder assets, one called "one", the next called "one/two" and the last one called "one/two/three" plus a DataFolder asset called "one/two/three/MyDataFolder".- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- pathname of the data folder- Returns:
- list of GUIDs from the top level to the root of the pathname or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
attachDataFileAssetToFolder
@PostMapping(path="/folders/{folderGUID}/assets/data-files/{fileGUID}/attach") public VoidResponse attachDataFileAssetToFolder(@PathVariable String serverName, @PathVariable String userId, @PathVariable String folderGUID, @PathVariable String fileGUID, @RequestBody(required=false) NullRequestBody requestBody) Link an existing file asset to a folder. The file is not changed as this is used to create a logical link to the folder.- Parameters:
serverName
- name of calling serveruserId
- calling userfolderGUID
- unique identifier of the folderfileGUID
- unique identifier of the filerequestBody
- dummy request body- Returns:
- void or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
detachDataFileAssetFromFolder
@PostMapping(path="/folders/{folderGUID}/assets/data-files/{fileGUID}/detach") public VoidResponse detachDataFileAssetFromFolder(@PathVariable String serverName, @PathVariable String userId, @PathVariable String folderGUID, @PathVariable String fileGUID, @RequestBody(required=false) NullRequestBody requestBody) Remove a link between a file asset and a folder. The file is not changed. Use moveDataFileInCatalog to record the fact that the physical file has moved. Use attachDataFileAssetToFolder to create logical link to a new folder.- Parameters:
serverName
- name of calling serveruserId
- calling userfolderGUID
- unique identifier of the folderfileGUID
- unique identifier of the filerequestBody
- dummy request body- Returns:
- void or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
moveDataFileInCatalog
@PostMapping(path="/folders/{folderGUID}/assets/data-files/{fileGUID}/move-to") public VoidResponse moveDataFileInCatalog(@PathVariable String serverName, @PathVariable String userId, @PathVariable String folderGUID, @PathVariable String fileGUID, @RequestBody(required=false) NullRequestBody requestBody) Move a data file from its current parent folder to a new parent folder - this changes the file's qualified name but not its unique identifier (guid). Similarly, for the endpoint in the connection object.- Parameters:
serverName
- name of calling serveruserId
- calling userfolderGUID
- new parent folderfileGUID
- unique identifier of the file to moverequestBody
- null request body to satisfy REST protocol- Returns:
- void or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
moveDataFolderInCatalog
@PostMapping(path="/folders/{folderGUID}/assets/data-folders/{dataFolderGUID}/move-to") public VoidResponse moveDataFolderInCatalog(@PathVariable String serverName, @PathVariable String userId, @PathVariable String folderGUID, @PathVariable String dataFolderGUID, @RequestBody(required=false) NullRequestBody requestBody) Move a data folder from its current parent folder to a new parent folder - this changes the folder's qualified name but not its unique identifier (guid). Similarly, for the endpoint in the connection object.- Parameters:
serverName
- name of calling serveruserId
- calling userfolderGUID
- new parent folderdataFolderGUID
- unique identifier of the data folder to moverequestBody
- null request body to satisfy REST protocol- Returns:
- void or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getFileSystemByGUID
@GetMapping(path="/file-systems/{fileSystemGUID}") public FileSystemResponse getFileSystemByGUID(@PathVariable String serverName, @PathVariable String userId, @PathVariable String fileSystemGUID) Retrieve a FileSystemProperties asset by its unique identifier (GUID).- Parameters:
serverName
- name of calling serveruserId
- calling userfileSystemGUID
- unique identifier used to locate the file system- Returns:
- FileSystemProperties properties or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getFileSystemByUniqueName
@GetMapping(path="/file-systems/by-name/{uniqueName}") public FileSystemResponse getFileSystemByUniqueName(@PathVariable String serverName, @PathVariable String userId, @PathVariable String uniqueName) Retrieve a FileSystemProperties asset by its unique name.- Parameters:
serverName
- name of calling serveruserId
- calling useruniqueName
- unique name for the filesystem- Returns:
- Filesystem properties or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getFileSystems
@GetMapping(path="/file-systems") public GUIDListResponse getFileSystems(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startingFrom, @RequestParam int maxPageSize) Retrieve a list of defined FileSystems assets.- Parameters:
serverName
- name of calling serveruserId
- calling userstartingFrom
- starting point in the listmaxPageSize
- maximum number of results- Returns:
- List of Filesystem unique identifiers or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getFolderByGUID
@GetMapping(path="/folders/{folderGUID}") public FileFolderResponse getFolderByGUID(@PathVariable String serverName, @PathVariable String userId, @PathVariable String folderGUID) Retrieve a FileFolderProperties asset by its unique identifier (GUID).- Parameters:
serverName
- name of calling serveruserId
- calling userfolderGUID
- unique identifier used to locate the folder- Returns:
- FileFolderProperties properties or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getFolderByPathName
@GetMapping(path="/folders/by-path-name") public FileFolderResponse getFolderByPathName(@PathVariable String serverName, @PathVariable String userId, @RequestBody PathNameRequestBody requestBody) Retrieve a folder by its fully qualified path name.- Parameters:
serverName
- name of calling serveruserId
- calling userrequestBody
- path name- Returns:
- FileFolderProperties properties or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getNestedFolders
@GetMapping(path="/{anchorGUID}/folders") public GUIDListResponse getNestedFolders(@PathVariable String serverName, @PathVariable String userId, @PathVariable String anchorGUID, @RequestParam int startingFrom, @RequestParam int maxPageSize) Return the list of folders nested inside a folder.- Parameters:
serverName
- name of calling serveruserId
- calling useranchorGUID
- unique identifier of the anchor folder or FilesystemstartingFrom
- starting point in the listmaxPageSize
- maximum number of results- Returns:
- list of folder unique identifiers (null value means no nested folders) or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
getFolderFiles
@GetMapping(path="/folders/{folderGUID}/files") public GUIDListResponse getFolderFiles(@PathVariable String serverName, @PathVariable String userId, @PathVariable String folderGUID, @RequestParam int startingFrom, @RequestParam int maxPageSize) Get the files inside a folder - both those that are nested and those that are linked.- Parameters:
serverName
- name of calling serveruserId
- calling userfolderGUID
- unique identifier of the anchor folderstartingFrom
- starting point in the listmaxPageSize
- maximum number of results- Returns:
- list of file asset unique identifiers or InvalidParameterException one of the parameters is null or invalid or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem.
-
addAvroFileToCatalog
@PostMapping(path="/assets/data-files/avro") public GUIDListResponse addAvroFileToCatalog(@PathVariable String serverName, @PathVariable String userId, @RequestBody NewFileAssetRequestBody requestBody) Add a simple asset description linked to a connection object for an Avro file.- Parameters:
serverName
- name of calling serveruserId
- calling user (assumed to be the owner)requestBody
- properties for the asset- Returns:
- list of GUIDs from the top level to the root of the pathname or InvalidParameterException full path or userId is null PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
addCSVFileToCatalog
@PostMapping(path="/assets/data-files/csv") public GUIDListResponse addCSVFileToCatalog(@PathVariable String serverName, @PathVariable String userId, @RequestBody NewCSVFileAssetRequestBody requestBody) Add a simple asset description linked to a connection object for a CSV file.- Parameters:
serverName
- name of calling serveruserId
- calling user (assumed to be the owner)requestBody
- parameters for the new asset- Returns:
- list of GUIDs from the top level to the root of the pathname or InvalidParameterException full path or userId is null or PropertyServerException problem accessing property server or UserNotAuthorizedException security access problem
-