Compare commits
No commits in common. "b75969116060cbbbf27054c646a897880201734a" and "58e47e501544a8565bb9f7dd552bdb37d90e27a9" have entirely different histories.
b759691160
...
58e47e5015
|
@ -147,40 +147,6 @@ class MetadataWrapper {
|
|||
});
|
||||
}
|
||||
|
||||
updateBucketCapabilities(bucketName, capabilityName, capability, log, cb) {
|
||||
log.debug('updating bucket capabilities in metadata');
|
||||
if (!this.client.putBucketAttributesCapabilities) {
|
||||
return cb(errors.NotImplemented);
|
||||
}
|
||||
return this.client.putBucketAttributesCapabilities(bucketName, capabilityName, capability,
|
||||
log, err => {
|
||||
if (err) {
|
||||
log.debug('error from metadata', { implName: this.implName,
|
||||
error: err });
|
||||
return cb(err);
|
||||
}
|
||||
log.trace('bucket capabilities updated in metadata');
|
||||
return cb(err);
|
||||
});
|
||||
}
|
||||
|
||||
deleteBucketCapabilities(bucketName, capabilityName, log, cb) {
|
||||
log.debug('deleting bucket capabilities in metadata');
|
||||
if (!this.client.deleteBucketAttributesCapability) {
|
||||
return cb(errors.NotImplemented);
|
||||
}
|
||||
return this.client.deleteBucketAttributesCapability(bucketName, capabilityName,
|
||||
log, err => {
|
||||
if (err) {
|
||||
log.debug('error from metadata', { implName: this.implName,
|
||||
error: err });
|
||||
return cb(err);
|
||||
}
|
||||
log.trace('bucket capabilities deleted in metadata');
|
||||
return cb(err);
|
||||
});
|
||||
}
|
||||
|
||||
getBucket(bucketName, log, cb) {
|
||||
log.debug('getting bucket from metadata');
|
||||
this.client.getBucketAttributes(bucketName, log, (err, data) => {
|
||||
|
|
|
@ -412,64 +412,6 @@ class MongoClientInterface {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} bucketName - name of bucket
|
||||
* @param {String} capabilityName - name of capability
|
||||
* @param {Object} capability - capability object
|
||||
* @param {Sbject} log - logger
|
||||
* @param {Function} cb - callback
|
||||
* @return {undefined}
|
||||
*/
|
||||
putBucketAttributesCapabilities(bucketName, capabilityName, capability, log, cb) {
|
||||
const m = this.getCollection(METASTORE);
|
||||
m.update({
|
||||
_id: bucketName,
|
||||
}, {
|
||||
$set: {
|
||||
_id: bucketName,
|
||||
[`value.capabilities.${capabilityName}`]: capability,
|
||||
},
|
||||
}, {
|
||||
upsert: true,
|
||||
}, err => {
|
||||
if (err) {
|
||||
log.error(
|
||||
'putBucketAttributesCapabilities: error putting bucket attributes',
|
||||
{ error: err.message });
|
||||
return cb(errors.InternalError);
|
||||
}
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete bucket attributes capability
|
||||
* @param {String} bucketName - name of bucket
|
||||
* @param {String} capabilityName - name of capability
|
||||
* @param {Object} log - logger
|
||||
* @param {Function} cb - callback
|
||||
* @return {undefined}
|
||||
**/
|
||||
deleteBucketAttributesCapability(bucketName, capabilityName, log, cb) {
|
||||
const m = this.getCollection(METASTORE);
|
||||
m.update({
|
||||
_id: bucketName,
|
||||
}, {
|
||||
$unset: {
|
||||
[`value.capabilities.${capabilityName}`]: '',
|
||||
},
|
||||
}, err => {
|
||||
if (err) {
|
||||
log.error(
|
||||
'deleteBucketAttributesCapability: error deleting bucket attributes',
|
||||
{ error: err.message });
|
||||
return cb(errors.InternalError);
|
||||
}
|
||||
return cb();
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete bucket from metastore
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue