forked from fritzy/node-azure-media
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_everything.js
29 lines (28 loc) · 1.02 KB
/
delete_everything.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var repl = require('repl');
var AzureMedia = require('./index');
var optimist = require('optimist');
optimist.demand(['config']);
var config = require(optimist.argv.config);
var api = new AzureMedia(config.auth);
api.init(function () {
api.rest.asset.create({'Name': 'testtodelete'}, function (err, asset) {
api.rest.accesspolicy.list(function (err, policies) {
policies.forEach(function (policy) {
console.log(policy.Id);
api.rest.accesspolicy.delete(policy.Id);
});
api.rest.asset.list(function (err, assets) {
assets.forEach(function (asset) {
console.log(asset.Id);
asset.delete();
});
api.rest.assetfile.list(function (err, files) {
files.forEach(function (file) {
console.log(file.Id);
api.rest.assetfile.delete(file.Id);
});
});
});
});
});
});