@cumulus/ingest
Version:
Ingest utilities
68 lines • 2.5 kB
TypeScript
import { ProviderClient, S3ProviderClientListItem } from './types';
declare class S3ProviderClient implements ProviderClient {
private readonly bucket;
constructor({ bucket }?: {
bucket?: string;
});
/**
* Download a remote file to disk
*
* @param {object} params
* @param {string} params.remotePath - the full path to the remote file to be fetched
* @param {string} params.localPath - the full local destination file path
* @param {string} params.remoteAltBucket - alternate per-file bucket override to this.bucket
* bucket
* @returns {Promise<string>} - the path that the file was saved to
*/
download(params: {
remotePath: string;
localPath: string;
remoteAltBucket?: string;
}): Promise<string>;
/**
* List all files from a given endpoint
*
* @param {string} path - the remote path to list
* @returns {Promise<Array>} a list of files
* @private
*/
list(path: string): Promise<S3ProviderClientListItem[]>;
/**
* Download the remote file to a given s3 location
*
* @param {object} params
* @param {string} params.fileRemotePath - the full path to the remote file to be fetched
* @param {string} params.bucket - destination s3 bucket of the file
* @param {string} params.destinationBucket - destination s3 bucket of the file
* @param {string} params.destinationKey - destination s3 key of the file
* @returns {Promise.<{ s3uri: string, etag: string }>} an object containing
* the S3 URI and ETag of the destination file
*/
sync(params: {
bucket?: string;
destinationBucket: string;
destinationKey: string;
fileRemotePath: string;
}): Promise<{
s3uri: string;
etag: string;
}>;
/**
* Upload a file
*
* @param {object} params
* @param {string} params.localPath - the full local file path
* @param {string} params.uploadPath - the full remote file path for uploading file to
* @param {string} [params.remoteAltBucket] - alternate per-file bucket override to this.bucket
* @returns {Promise<string>} the uri of the uploaded file
*/
upload(params: {
localPath: string;
uploadPath: string;
remoteAltBucket?: string;
}): Promise<string>;
connect(): Promise<void>;
end(): Promise<void>;
}
export = S3ProviderClient;
//# sourceMappingURL=S3ProviderClient.d.ts.map