How to use the uuid function from assert-plus
Find comprehensive JavaScript assert-plus.uuid code examples handpicked from public code repositorys.
103 104 105 106 107 108 109 110 111 112
var log = api.log; return function findExternalNetworkWithOwnerUuid(opts, cb) { assert.object(opts, 'opts'); assert.object(opts.account, 'opts.account'); assert.uuid(opts.req_id, 'opts.req_id'); log.debug('Running ' + findExternalNetworkWithOwnerUuid.name); var accountUuid = opts.account.uuid;
49
183
0
3326 3327 3328 3329 3330 3331 3332 3333 3334 3335
/* * Manta allows us to make a request to the top-level upload directory as * if the multipart upload was anchored there. The response will be a * redirect to the fully-qualified upload directory. */ assert.uuid(uu.uu_id, 'uu_id'); assert.object(uu.uu_opts, 'uu_opts'); var idurl = baseURL + '/' + uu.uu_id; var options = createOptions({ path: idurl
41
75
0
498 499 500 501 502 503 504 505 506 507 508
* * @param {String} - UUID * @param {Function} callback of the form `function (err, network, res)` */ CloudApi.prototype.getNetwork = function getNetwork(id, cb) { assert.uuid(id, 'id'); assert.func(cb, 'cb'); var endpoint = this._path(format('/%s/networks/%s', this.account, id)); this._request(endpoint, function (err, req, res, body) {
38
55
0
+ 475 other calls in file
1566 1567 1568 1569 1570 1571 1572 1573 1574 1575
*/ IMGADM.prototype._importImage = function _importImage(opts, cb) { var self = this; assert.object(opts, 'opts'); assert.object(opts.importInfo, 'opts.importInfo'); assert.uuid(opts.importInfo.uuid, 'opts.importInfo.uuid'); assert.object(opts.importInfo.source, 'opts.importInfo.source'); assert.string(opts.zpool, 'opts.zpool'); assert.optionalBool(opts.zstream, 'opts.zstream'); assert.optionalBool(opts.quiet, 'opts.quiet');
248
0
0
415 416 417 418 419 420 421 422 423 424 425 426
/* * Convert a UUID to a short ID */ function uuidToShortId(s) { assert.uuid(s, 's'); return s.split('-', 1)[0]; } /*
38
55
41
+ 3 other calls in file
298 299 300 301 302 303 304 305 306 307
function deleteSubusers(ctx, next) { vasync.forEachPipeline({ inputs: ctx.subusersToDelete, func: function delOneSubuser(subuser, nextSubuser) { assert.uuid(subuser.id, 'subuser.id'); ctx.smardcClient.deleteUser(opts.account.login, subuser.id, nextSubuser); } }, function (err) {
16
13
0
+ 9 other calls in file
840 841 842 843 844 845 846 847 848 849 850
* updated. We no longer need to execute partial updates */ Moray.prototype.putVm = function putVm(uuid, vm, oldVm, cb) { var self = this; assert.uuid(uuid, 'uuid'); assert.object(vm, 'vm'); assert.object(oldVm, 'oldVm'); assert.func(cb, 'cb');
20
11
0
+ 5 other calls in file
771 772 773 774 775 776 777 778 779
}; } // Allow overriding of the target server. if (req.params.override_server_uuid) { assert.uuid(req.params.override_server_uuid, 'req.params.override_server_uuid'); record.target_server_uuid = req.params.override_server_uuid; }
20
11
0
+ 2 other calls in file
28 29 30 31 32 33 34 35 36 37 38 39
function validateFabricNetworkOwnership(napiClient, volumeParams, callback) { assert.object(napiClient, 'napiClient'); assert.object(volumeParams, 'volumeParams'); assert.arrayOfUuid(volumeParams.networks, 'volumeParams.networks'); assert.uuid(volumeParams.owner_uuid, 'volumeParams.owner_uuid'); assert.func(callback, 'callback'); var missing = []; var nonFabric = [];
6
8
0
+ 3 other calls in file
281 282 283 284 285 286 287 288 289 290
ctx.instanceUuid = instanceUuid; next(err); }); }, function initChangefeedListener(ctx, next) { mod_assert.uuid(ctx.instanceUuid, 'ctx.instanceUuid'); var options = { backoff: { maxTimeout: Infinity,
6
8
0
+ 13 other calls in file
GitHub: TritonDataCenter/sdc-manta
2556 2557 2558 2559 2560 2561 2562 2563 2564 2565
// (`ctx.config`) with the given server, image, and, if // applicable, shard. let addInst = function(svr, svcName, img, shard) { assertplus.uuid(svr, 'svr'); assertplus.string(svcName, 'svcName'); assertplus.uuid(img, 'img'); assertplus.optionalString(shard, 'shard'); if (!ctx.config[svr]) { ctx.config[svr] = {};
13
7
42
+ 4 other calls in file
72 73 74 75 76 77 78 79 80 81 82
function _buildStorageVMPayload(version, volumeParams, storageVmUuid, billingPackage, affinity) { assert.number(version, 'version'); assert.object(volumeParams, 'volumeParams'); assert.uuid(storageVmUuid, 'storageVmUuid'); assert.object(billingPackage, 'billingPackage'); assert.string(billingPackage.uuid, 'billingPackage.uuid'); assert.optionalArray(affinity, 'affinity'); assert.uuid(CONFIG.nfsServerImageUuid, 'CONFIG.nfsServerImageUuid');
6
8
0
+ 13 other calls in file
266 267 268 269 270 271 272 273 274
callback = options; options = undefined; } assert.object(params, 'params'); assert.uuid(params.uuid, 'params.uuid'); assert.optionalUuid(params.owner_uuid, 'params.owner_uuid'); assert.optionalObject(options, 'options'); assert.func(callback, 'callback');
13
2
0
+ 25 other calls in file
90 91 92 93 94 95 96 97 98 99 100 101
TritonTracer.prototype.inject = function inject(spanCtx, format, carrier) { var self = this; assert.object(spanCtx, 'spanCtx'); assert.uuid(spanCtx._spanId, 'spanCtx._spanId'); assert.uuid(spanCtx._traceId, 'spanCtx._traceId'); assert.equal(format, opentracing.FORMAT_TEXT_MAP, 'Unsupported format'); assert.object(carrier, 'carrier'); // We only support "TextMap" format which we assume for now is a restify
4
0
0
+ 5 other calls in file
86 87 88 89 90 91 92 93 94 95
if (opts.sysinfo) { assertSysinfo(opts.sysinfo); self.sysinfo = opts.sysinfo; self.serverUuid = opts.sysinfo.UUID; } else { assert.uuid(opts.serverUuid, 'opts.serverUuid'); self.serverUuid = opts.serverUuid; } }
3
3
0
+ 19 other calls in file
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
IMGAPI.prototype.addImageFileFromUrl = function addImageFileFromUrl( options, account, callback) { var self = this; assert.object(options, 'options'); assert.uuid(options.uuid, 'options.uuid'); assert.string(options.file_url, 'options.file_url'); assert.optionalString(options.compression, 'options.compression'); assert.optionalObject(options.headers, 'options.headers');
13
2
36
+ 2 other calls in file
283 284 285 286 287 288 289 290 291 292
var local = false; var span = {}; var name; var proto = {}; assert.uuid(obj.spanId, 'obj.spanId'); assert.uuid(obj.traceId, 'obj.traceId'); if (obj.parentSpanId !== '0') { assert.optionalUuid(obj.parentSpanId, 'obj.parentSpanId'); }
2
1
0
+ 5 other calls in file
assert-plus.object is the most popular function in assert-plus (2295 examples)