Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sometimes delimter='/' doesn't work in get_objects #341

Closed
ghost opened this issue Apr 4, 2014 · 6 comments
Closed

sometimes delimter='/' doesn't work in get_objects #341

ghost opened this issue Apr 4, 2014 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 4, 2014

Hi, i am using pyrax API to fetch objects from container.
sometimes i've seen that delimiter = '/' in get_objects() method on container doesn't get prefix object like amazon or google storage service do. why?

@EdLeafe
Copy link
Contributor

EdLeafe commented Apr 4, 2014

Can you give me an example of what you are expecting? Pyrax supports both the delimiter and prefix parameters, as explained here.

@ghost
Copy link
Author

ghost commented Apr 4, 2014

yes.
what i expect is to get only key part with occurrence at first '/'.
for ex. if i have an object say 'question/one' then i want to retrieve only 'question' part of the key by delimiter '/'(like other cloud API does says prefix object.), but the problem is that i get only those keys who has no slashes inside their name.
is there any hack here to get this?

like in your example(the link you shared) :
i want also to get the prefix 'stuff' by delimiter '/' and only 'stuff' object(like prefix) no others.

help me how can i achieve this?

@EdLeafe
Copy link
Contributor

EdLeafe commented Apr 4, 2014

If you have an object named 'question/one', what do you mean that you only want to retrieve the 'question' part? Do you mean all objects that begin with 'question'?

@ghost
Copy link
Author

ghost commented Apr 5, 2014

yes.
like there are lots of objects start with 'question' part for ex. 'question/one', 'question/two', 'question/three' and so on... and let's take another objects name starts with 'answer' for ex. 'answer/one', 'answer/two', 'answer/three' and so on... Then i want retrieve only 'question' part (not whole key i.e. 'question/one') among all keys who has 'question' prefix and also same as in 'answer'.
The reason behind asking this question that, is there any method in pyrax API to achieve this? otherwise I have to put extra efforts in hard-code way.

@ghost
Copy link
Author

ghost commented Apr 7, 2014

even REST API support this feature as describes in this link:
http://docs.rackspace.com/files/api/v1/cf-devguide/content/Pseudo-Hierarchical_Folders_Directories-d1e1580.html
in this link by delimiter '/' only the pseudo directory photos/ is displayed.
I mean why this feature is not added in pyrax API?.

@ghost
Copy link
Author

ghost commented Apr 27, 2014

I found why this is happened. My main concern was to show rackspace cloud files in hierarchical structure as other cloud services do like google storage and amazon s3. I don't know it is bug or why they are doing this but by the get_objects method i'll never achieve this subdir part until things will be fixed in pyrax and @andreabedini you never get stuff part as i know the bug in the code in list_subdirs.method.
Finally i achieved what i expected.

@ghost ghost closed this as completed Apr 27, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant