def _create_upload(self, project_id, path_data, hash_data, remote_filename=None, storage_provider_id=None,
                       chunked=True):
        """
        Create upload for uploading multiple chunks or the non-chunked variety (includes upload url).
        :param project_id: str: uuid of the project
        :param path_data: PathData: holds file system data about the file we are uploading
        :param hash_data: HashData: contains hash alg and value for the file we are uploading
        :param remote_filename: str: name to use for our remote file (defaults to path_data basename otherwise)
        :param storage_provider_id: str: optional storage provider id
        :param chunked: bool: should we create a chunked upload
        :return: str: uuid for the upload
        """
        if not remote_filename:
            remote_filename = path_data.name()
        mime_type = path_data.mime_type()
        size = path_data.size()

        def func():
            return self.data_service.create_upload(project_id, remote_filename, mime_type, size,
                                                   hash_data.value, hash_data.alg,
                                                   storage_provider_id=storage_provider_id,
                                                   chunked=chunked)

        resp = retry_until_resource_is_consistent(func, self.waiting_monitor)
        return resp.json()
def _create_upload ( self , project_id , path_data , hash_data , remote_filename = None , storage_provider_id = None , chunked = True ) : if not remote_filename : remote_filename = path_data . name ( ) mime_type = path_data . mime_type ( ) size = path_data . size ( ) def func ( ) : return self . data_service . create_upload ( project_id , remote_filename , mime_type , size , hash_data . value , hash_data . alg , storage_provider_id = storage_provider_id , chunked = chunked ) resp = retry_until_resource_is_consistent ( func , self . waiting_monitor ) return resp . json ( )
Create upload for uploading multiple chunks or the non-chunked variety (includes upload url).
        :param project_id: str: uuid of the project
        :param path_data: PathData: holds file system data about the file we are uploading
        :param hash_data: HashData: contains hash alg and value for the file we are uploading
        :param remote_filename: str: name to use for our remote file (defaults to path_data basename otherwise)
        :param storage_provider_id: str: optional storage provider id
        :param chunked: bool: should we create a chunked upload
        :return: str: uuid for the upload