diff --git a/lib/tritonapi.js b/lib/tritonapi.js index 99cae9d..0bad6c2 100644 --- a/lib/tritonapi.js +++ b/lib/tritonapi.js @@ -171,7 +171,12 @@ TritonApi.prototype._cacheGetJson = function _cacheGetJson(key, cb) { /** - * cloudapi listImages wrapper with optional caching + * CloudAPI listImages wrapper with optional caching. + * + * @param opts {Object} Optional. + * - useCase {Boolean} Whether to use Triton's local cache. + * - ... all other cloudapi ListImages options + * @param {Function} callback `function (err, imgs)` */ TritonApi.prototype.listImages = function listImages(opts, cb) { var self = this; @@ -183,6 +188,9 @@ TritonApi.prototype.listImages = function listImages(opts, cb) { assert.optionalBool(opts.useCache, 'opts.useCache'); assert.func(cb, 'cb'); + var listOpts = common.objCopy(opts); + delete listOpts.useCache; + var cacheKey = 'images.json'; var cached; var fetched; @@ -207,7 +215,7 @@ TritonApi.prototype.listImages = function listImages(opts, cb) { return next(); } - self.cloudapi.listImages(opts, function (err, imgs, res_) { + self.cloudapi.listImages(listOpts, function (err, imgs, res_) { if (err) { return next(err); }