@lifeomic/cli
Version:
CLI for interacting with the LifeOmic PHC API.
37 lines (33 loc) • 1.07 kB
JavaScript
;
const { post } = require('../../../api');
const print = require('../../../print');
exports.command = 'create-foundation-bam <projectId> <bamFileId>';
exports.desc = 'Create Foundation BAM ingestion for <bamFileId> in <projectId>';
exports.builder = yargs => {
yargs.positional('projectId', {
describe: 'The project ID.',
type: 'string'
}).positional('bamFileId', {
describe: 'The ID of the BAM file.',
type: 'string'
}).option('succeededEmail', {
describe: 'An email address to notify if the ingestion succeeds',
type: 'string'
}).option('failedEmail', {
describe: 'An email address to notify if the ingestion fails',
type: 'string'
});
};
exports.handler = async argv => {
const response = await post(argv, `/v1/genomic-ingestion/projects/${argv.projectId}/ingestions`, {
ingestionType: 'FoundationBam',
inputFiles: {
bam: argv.bamFileId
},
notificationConfig: {
succeededEmail: argv.succeededEmail,
failedEmail: argv.failedEmail
}
});
print(response.data, argv);
};