.net - Rackspace Cloud Files Get Objects In Container C# -


i have been looking @ documentation, testing examples , getting familiar rackspace cloud files api. got basic code down, got api key, got username, basic stuff. 1 thing confuses me, problem appears not documented.

so trying objects, including folders , files in container. have tried example:

ienumerable<containerobject> containerobjects = cloudfilesprovider.listobjects("storage",null,null,null,null,null,false,ci);  foreach(containerobject containerobject in containerobjects) {     messagebox.show(containerobject.tostring()); } 

this doesn't return result looking for, seems not return anything.

i using openstack provided running in nuget console: install-package rackspace.

i trying create file backup program me , family.

a common problem not specifying region. when rackspace cloud account's default region not same region container lives, must specify region, otherwise won't see results listed. quite misleading...

here sample console application prints contents of containers (and objects) in particular region. change "dfw" name of region container lives. if aren't sure region has container, log rackspace cloud control panel , go "storage > files" , note region drop down @ top right.

using system; using net.openstack.core.domain; using net.openstack.providers.rackspace;  namespace listcloudfiles {     class program     {         static void main()         {             var region = "dfw";             var identity = new cloudidentity             {                 username = "username",                 apikey = "apikey"             };              var cloudfilesprovider = new cloudfilesprovider(identity);              foreach (container container in cloudfilesprovider.listcontainers(region: region))             {                 console.writeline(container.name);                  foreach (containerobject obj in cloudfilesprovider.listobjects(container.name, region: region))                 {                     console.writeline(" * " + obj.name);                 }             }             console.readline();         }     } } 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -