Commit fa5f6ee6 authored by David Gatica's avatar David Gatica

function deleteCos, added

parent 439563aa
......@@ -592,6 +592,13 @@ class ZimbraAdminApi {
return this.remove('Domain', resource_data, callback);
}
deleteCos(id_cos, callback){
const request_data = this.buildRequestData('DeleteCos', callback);
request_data.parse_response = ResponseParser.emptyResponse;
request_data.params.params = { 'id': {'_content': id_cos}};
return this.performRequest(request_data);
}
removeDomainAdmin(domain, account_id, coses, callback) {
this.getDomain(domain, (err, domain) => {
if (err) return callback(err);
......
......@@ -841,6 +841,21 @@ var zimbraAdminPassword = process.env.ZIMBRA_PASSWORD || '12345678';
});
})
it.only('Should delete COS "unknow" ', function(done){
let api = new ZimbraAdminApi(auth_data);
api.getCos("unknow", function(err, cos){
if (err) return console.error(err);
let cosId = cos.id;
console.log(cosId);
api.deleteCos(cosId, function(err, res){
if (err) return console.error(err);
console.log(res);
expect(err).to.be.null;
done();
})
});
})
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment