src/indexOld.js
function getSnapshotRoute(machineName, versionKey, instanceKey, snapshotKey){

        let manifest = getManifest();

        let machine = manifest.machines[machineName];
        if (!machine) {
            throw new Error("Machine does not exists");
        }

        let version = machine.versions[versionKey];
        if (!version) {
            throw new Error("Version does not exists");
        }

        let instance = version.instances[instanceKey];
        if (!instance) {
            throw new Error("Instance does not exists");
        }

        let snapshot = instance.snapshots[snapshotKey];
        if (!snapshot) {
            throw new Error("Snapshot does not exists");
        }

        return snapshot.route;
    }
function getSnapshotRoute(machineName, versionKey, instanceKey, snapshotKey){

        let manifest = getManifest();

        let machine = manifest.machines[machineName];
        if (!machine) {
            throw new Error("Machine does not exists");
        }

        let version = machine.versions[versionKey];
        if (!version) {
            throw new Error("Version does not exists");
        }

        let instance = version.instances[instanceKey];
        if (!instance) {
            throw new Error("Instance does not exists");
        }

        let snapshot = instance.snapshots[snapshotKey];
        if (!snapshot) {
            throw new Error("Snapshot does not exists");
        }

        return snapshot.route;
    }
function getSnapshotRoute ( machineName , versionKey , instanceKey , snapshotKey ) { let manifest = getManifest ( ) ; let machine = manifest . machines [ machineName ] ; if ( ! machine ) { throw new Error ( "Machine does not exists" ) ; } let version = machine . versions [ versionKey ] ; if ( ! version ) { throw new Error ( "Version does not exists" ) ; } let instance = version . instances [ instanceKey ] ; if ( ! instance ) { throw new Error ( "Instance does not exists" ) ; } let snapshot = instance . snapshots [ snapshotKey ] ; if ( ! snapshot ) { throw new Error ( "Snapshot does not exists" ) ; } return snapshot . route ; }
Retrieve the snapshot's directory path
@method getSnapshotRoute
@param {String} machineName The name of the machine
@param {String} versionKey The key of the version
@param {String} instanceKey The key of the instance
@param {String} snapshotKey The key of the snapshot
@returns {String} The route
Retrieve the snapshot s directory path