StorageApi
getFilePath
For GCP cloud storage bucket Get the file path based on the file ID.
StorageApi.getFilePath(fileId)Parameters
fileId: stringReturns
The file path for the input File ID.getFileIdByPath
For GCP cloud storage bucket Get the file ID based on the absolute file path.
StorageApi.getFileIdByPath(absoluteFilePath)Parameters
absoluteFilePath: stringReturns
The File ID using file path.getFolderPath
For GCP cloud storage bucket Get the folder path based on the folder ID.
StorageApi.getFolderPath(folderId)Parameters
folderId: stringReturns
Folder path.getSignedUrl
For GCP cloud storage bucket Get a signed URL for accessing a file.
StorageApi.getSignedUrl(filePath)
or
StorageApi.getSignedUrl(filePath, duration, unit)
or
StorageApi.getSignedUrl(bucketName, filePath)
or
StorageApi.getSignedUrl(bucketName, filePath, duration, unit)Parameters
filePath: string
duration: int
unit: string
bucketName: stringReturns
Signed URL for accessing the file.copyFileToBucket
For GCP cloud storage bucket Copy a file to the specified bucket.
StorageApi.copyFileToBucket(sourceFilePath, targetFilePath)
or
StorageApi.copyFileToBucket(bucketName, sourceFilePath, targetFilePath)
or
StorageApi.copyFileToBucket(bucketName, serviceAccountPropName,
sourceFilePath, targetFilePath)
Parameters
sourceFilePath: string
targetFilePath: string
bucketName: string
serviceAccountPropName: stringReturns
Response from the server.copyFileFromBucket
For GCP cloud storage bucket Copy a file from the specified bucket.
StorageApi.copyFileFromBucket(sourceFilePath, targetFilePath)
or
Storageapi.copyFileFromBucket(bucketName, sourceFilePath, targetFilePath)
or
Storageapi.copyFileFromBucket(bucketName, serviceAccountPropName,
sourceFilePath, targetFilePath)Parameters
sourceFilePath: string
targetFilePath: string
bucketName: string
serviceAccountPropName: stringReturns
Response from the server.copyFileWithinBucket
For GCP cloud storage bucket Copy a file within the same bucket.
StorageApi.copyFileWithinBucket(sourceFilePath, targetFilePath)
or
StorageApi.copyFileWithinBucket(sourceFilePath, targetFilePath, makeCopy)
or
StorageApi.copyFileWithinBucket(bucketName, sourceFilePath, targetFilePath)
or
StorageApi.copyFileWithinBucket(bucketName, sourceFilePath, targetFilePath, makeCopy)Parameters
sourceFilePath: string
targetFilePath: string
makeCopy: bool
bucketName: stringReturns
Response from the server.writeToBucket
For GCP cloud storage bucket Write data to a file in the specified bucket.
StorageApi.writeToBucket(bytes, targetFilePath, contentType)
or
StorageApi.writeToBucket(bucketName, bytes, targetFilePath, contentType)Parameters
bytes: bytes[]
targetFilePath: string
contentType: string
bucketName: stringReturns
Response from the server.readFromBucket
For GCP cloud storage bucket Read the content of a file from the specified bucket.
StorageApi.readFromBucket(sourceFilePath)
or
StorageApi.readFromBucket(bucketName, sourceFilePath)Parameters
sourceFilePath: string
bucketName: stringReturns
Content of the file.listFiles
For GCP cloud storage bucket List files in the specified path.
StorageApi.listFiles(pathName, versioned)
or
StorageApi.listFiles(bucketName, pathName, versioned)
or
StorageApi.listFiles(bucketName, pathName,
versioned, pageToken, pageSize)Parameters
pathName: string
versioned: bool
bucketName: string
pageToken: string
pageSize: intReturns
List of dictionaries containing file details.saveFileObject
For GCP cloud storage bucket Save a file object.
StorageApi.saveFileObject(fileObject)Parameters
fileObject: dictionaryReturns
Response from the server.exists
Check if file exists.
StorageApi.exists(filePath)Parameters
filePath: stringReturns
True if the file exists, False otherwise.getFileList
Get list of files in folder
StorageApi.getFileList(folderId, orderBy)Parameters
folderId: int
orderBy: stringReturns
ListgetFilesPages
Get files pages
StorageApi.getFilesPage(bucketName, pathName,
versioned)
or
StorageApi.getFilesPage(bucketName, pathName,
versioned, pageToken, pageSize)Parameters
bucketName: string
pathName: string
versioned; bool
pageToken: string
pageSize: intReturns
FilesPagegetBucketName
Get default bucket name.
StorageApi.getBucketName()Parameters
NoneReturns
Bucket name.shareWithTenants
For GCP cloud storage bucket Share a file with tenants.
StorageApi.shareWithTenants(params)Parameters
params: dictionaryReturns
Response from the server.copyLargeFileToBucket
For GCP cloud storage bucket Copy a large file to the specified bucket
StorageApi.copyLargeFileToBucket(sourceFilePath, targetFilePath)
or
StorageApi.copyLargeFileToBucket(bucketName, sourceFilePath,
targetFilePath)
or
StorageApi.copyLargeFileToBucket((bucketName, serviceAccountPropName,
sourceFilePath, targetFilePath)Parameters
sourceFilePath: string
targetFilePath: string
bucketName: string
serviceAccountPropName: stringReturns
Response from the server.makePublic
make a file public
StorageApi.makePublic(bucketName, filePath)
or
StorageApi.makePublic(bucketName, serviceAccountPropName,
filePath)Parameters
bucketName: string
filePath: string
serviceAccountPropName: stringReturns
Response from the server.getContent
Get content of a doc
StorageApi.getContent(doc)Parameters
doc: dictionaryReturns
ObjectgetBucketPath
Get bucket path using file object
StorageApi.getBucketPath(fileObject)Parameters
fileObject: dictionaryReturns
StringgetBucketPath
Get path using fileId
StorageApi.getBucketPath(fileId)Parameters
fileId: stringReturns
StringLast updated