Package: pyHDLFS
PyHDLFSPythonAPI for SAP HDLFS using theRestAPIFor authentication both options are supported: key/certification and keystore/passphrase. The suffix of the certification
file is used for selecting the authentication method.Certification: .crt or .pemKeystore: .pkcs12, .p12 or .pfxStatus: In Progress, unsupportedGenerated DocumentationTable of Contentshdlfsget_path_contentget_recursive_path_contenthdlfs_apiuploadrenamecopydeletefile_statuslist_pathlist_path_recursivewhoamiget_operations_statushdlfsget_path_contentdefget_path_content(response:dict)->listExtracts the path items from response of LISTSTATUS APIArguments:response: Response from LISTSTATUSReturns:List of path items (folders and files)get_recursive_path_contentdefget_recursive_path_content(response:dict)->listExtracts the path items from response of LISTSTATUS_RECURSIVE APIArguments:response: Response from LISTSTATUS_RECURSIVEReturns:List of path items (folders and files)hdlfs_apidefhdlfs_api(method:str,operation:str)->dictDECORATOR for all API-callsArguments:method: HTTP-method [get, put, ..]operation: RESTAPI nameReturns:response of Rest APIupload@hdlfs_api(method='put',operation='CREATE')defupload(endpoint:str,certificate:str,password:str,destination='',data="",noredirect=False,headers={},verify=True)->dictUpload file to HDFS using CREATE-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystoredestination: destination path of filedata: file contentnoredirect: API parameterheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responserename@hdlfs_api(method='put',operation='RENAME')defrename(endpoint:str,certificate:str,password:str,path='',destination='',headers={},verify=True)->dictRename/Move file in HDFS with RENAME-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystorepath: path to source filedestination: destination of fileheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responsecopy@hdlfs_api(method='put',operation='COPY')defcopy(endpoint,certificate,password,path='',destination='',a_sync=False,headers={},verify=True)Copy file in HDFS with Copy-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystorepath: path to source filedestination: destination of filea_sync: API parameterheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responsedelete@hdlfs_api(method='del',operation='DELETE')defdelete(endpoint:str,certificate:str,password:str,path='',headers={},verify=True)->dictDelete file in HDFS with DELETE-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystorepath: path to source fileheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responsefile_status@hdlfs_api(method='get',operation='GETFILESTATUS')deffile_status(endpoint:str,certificate:str,password:str,path='',headers={},verify=True)Get file statusArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystorepath: path to source fileheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responselist_path@hdlfs_api(method='get',operation='LISTSTATUS')deflist_path(endpoint:str,certificate:str,password:str,path='',headers={},verify=True)Get all items of folder by using LISTSTATUS-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystorepath: path to source fileheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responselist_path_recursive@hdlfs_api(method='get',operation='LISTSTATUS_RECURSIVE')deflist_path_recursive(endpoint:str,certificate:str,password:str,path='',start_after=None,headers={},verify=True)->dictGet all items of folder and sub-folders by using LISTSTATUS_RECURSIVE-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystorepath: path to source filestart_after: API parameter for paging resultheaders: Passing optional parameter to APIverify: Enables/ disables server verificationReturns:responsewhoami@hdlfs_api(method='get',operation='WHOAMI')defwhoami(endpoint:str,certificate:str,password:str,verify=True)Get user information by WHOAMI-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystoreverify: Enables/ disables server verificationReturns:responseget_operations_status@hdlfs_api(method='get',operation='GETOPERATIONSTATUS')defget_operations_status(endpoint:str,certificate:str,password:str,token='',verify=True)->dictGet operation status by GETOPERATIONSTATUS-APIArguments:endpoint: endpoint urlcertificate: filename with path to certificate or pkcs12-keystorepassword: filename with path to key or passphrase for keystoreverify: Enables/ disables server verificationReturns:response