List containers/files
This commit is contained in:
parent
ceeb14e620
commit
afb3b99c58
26
app.js
26
app.js
|
@ -1,4 +1,4 @@
|
||||||
var storage = require('pkgcloud').storage;
|
var storage = require('./lib/index');
|
||||||
|
|
||||||
var client = storage.createClient({
|
var client = storage.createClient({
|
||||||
provider: 'rackspace',
|
provider: 'rackspace',
|
||||||
|
@ -9,8 +9,17 @@ var client = storage.createClient({
|
||||||
// Container
|
// Container
|
||||||
|
|
||||||
client.getContainers(function (err, containers) {
|
client.getContainers(function (err, containers) {
|
||||||
containers.forEach(function(c) {
|
if (err) {
|
||||||
console.log(c.name);
|
console.error(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
containers.forEach(function (c) {
|
||||||
|
console.log('rackspace: ', c.name);
|
||||||
|
c.getFiles(function (err, files) {
|
||||||
|
files.forEach(function (f) {
|
||||||
|
console.log('....', f.name);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -36,11 +45,16 @@ var s3 = storage.createClient({
|
||||||
});
|
});
|
||||||
|
|
||||||
s3.getContainers(function (err, containers) {
|
s3.getContainers(function (err, containers) {
|
||||||
if(err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
containers.forEach(function(c) {
|
containers.forEach(function (c) {
|
||||||
console.log(c.name);
|
console.log('amazon: ', c.name);
|
||||||
|
c.getFiles(function (err, files) {
|
||||||
|
files.forEach(function (f) {
|
||||||
|
console.log('....', f.name);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue