From 20e7de13ff39f8fd6f353004c2b000e89db61a39 Mon Sep 17 00:00:00 2001 From: Christian Reynolds Date: Tue, 28 Jan 2020 17:02:09 -0600 Subject: [PATCH] PF-2247 added a migrateKG method to the synic client --- src/synic.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/synic.js b/src/synic.js index 7b70c64..d657d5f 100644 --- a/src/synic.js +++ b/src/synic.js @@ -318,6 +318,22 @@ return this._ajax('DELETE', '/kb/' + encodeURIComponent(kgname), null, callback); }, + /** + * Attempts to structurally migrate a KG + * + * @param {string} kgname - the KG to migrate + * @param {boolean} forceMigration - forces a migration to be run, even if not required + * @param {requestCallback} [callback] + * @returns {promise} + */ + migrateKG: /* istanbul ignore next */ function(kgname, forceMigration, callback){ + var endpoint = '/kb/' + encodeURIComponent(kgname) + '/migrate'; + if(forceMigration){ + endpoint += '?force=true'; + } + return this._ajax('POST', endpoint, null, callback); + }, + /* * App Config */