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

[openstack] swift: add support for max_keys when retrieving dir items #3723

Closed
mtekel opened this issue Oct 14, 2015 · 9 comments
Closed

[openstack] swift: add support for max_keys when retrieving dir items #3723

mtekel opened this issue Oct 14, 2015 · 9 comments

Comments

@mtekel
Copy link

mtekel commented Oct 14, 2015

Currently there is no remapping in getting directory keys. This means that people are forced to add 'limit' explicitly into the calls. This is a problem when you try to have code that's compatible with multiple cloud vendors, as this breaks some other APIs, like Google Cloud Storage.

Raised PR, but it needs a bit more work. I am opening this issue so that someone else can take this over, as I have no SWIFT currently to test against.

mtekel added a commit to mtekel/cloud_controller_ng that referenced this issue Oct 14, 2015
When you include explicit 'limit' attribute, you make OpenStack SWIFT
work, but you break compatibility with other storage providers, like
Google Cloud Storage. Revert this again. Fog should support remapping
max_keys into limit specifically for SWIFT. Fog issue risen here:
fog/fog#3723
mtekel added a commit to mtekel/cloud_controller_ng that referenced this issue Oct 14, 2015
When you include explicit 'limit' attribute, you make OpenStack SWIFT
work, but you break compatibility with other storage providers, like
Google Cloud Storage. Revert this again. Fog should support remapping
max_keys into limit specifically for SWIFT. Fog issue risen here:
fog/fog#3723
mtekel added a commit to alphagov/paas-alpha-cf-terraform that referenced this issue Oct 14, 2015
Use Google Cloud Storage for blobstore. This requires interoperability
key and key_id to be added to secrets. Currently this doesn't work as
there are compatibility issues:
cloudfoundry/cloud_controller_ng#452
fog/fog#3723
@geemus
Copy link
Member

geemus commented Oct 19, 2015

@Ladas @TerryHowe perhaps one of you could provide some insight? Thanks!

@Ladas
Copy link
Contributor

Ladas commented Oct 19, 2015

@geemus hm seems like @mtekel is trying to unify interface of Google storage with OpenStack Swift, so attribute names are translated from google format to others. Is that right?

The placement is probably wrong, there would need need to be some Google -> OpenStack interface adapter layer for this, so we know what is translated to what, and you could even pick it e.g. while building OpenStack storage object. Something like Openstack::Storage.new(GoogleInterfaceAdapter) or AmazonInterfaceAdapter, etc.

Do we use somewhere single pane of glass for multiple providers like this? Should it be solved in Fog? That is a question I guess. :-)

@geemus
Copy link
Member

geemus commented Oct 19, 2015

Ah, I guess I should have read more closely. Where it is feasible/makes sense, unifying seems good. This sounds, at a high level, like it could be a reasonable case to do this. But I'm not sure about exactly how we should do it (and/or which keys should be the common ones).

@mtekel
Copy link
Author

mtekel commented Oct 19, 2015

Hi,

I thought that using max_keys is the standard, abstract fog way to declare how many items you want to receive. It is upon each implementation to transfer this into whatever parameter it needs to. Like e.g.:

For openstack, you just need to translate this attribute into limit. That way, you don't have to explicitly include limit=<# of items you want to limit to> in higher level calls, like here: https://github.com/cloudfoundry/cloud_controller_ng/pull/452/files#diff-aa2798782d5185bb6e352d8fcec4aceaL14

In that specific case limit=1 is included specifically to tell openstack to limit number of returned elements. However including that attribute into request also breaks GCS API...

@geemus
Copy link
Member

geemus commented Nov 5, 2015

I think it may have (up to this point anyway) been simply coincidental that multiple services called it the same thing. Also the internet archive stuff is a s3 work-alike I think, so it would end up with a similar API by default. Anyway, it does seem like a standard key here could work and max_keys might be easiest, but it could just as well be limit if we really wanted. We'll just need to document it and work on adding the appropriate aliases.

@mtekel
Copy link
Author

mtekel commented Nov 6, 2015

I suggest it is done this way. The suggested implementation doesn't force anyone to start using max_keys. You can still use limit the old way, so it will not break any existing code, but it adds option to use max_keys instead of explicit limit, making it possible to write code that's compatible with multiple cloud storage providers (which I believe is the goal of Fog - write one code that works on multiple providers without changes, because all the differences are implemented in Fog...).

@Ladas
Copy link
Contributor

Ladas commented Nov 6, 2015

Having alias sounds reasonable( until we reach such that conflicts :-) ). I wonder where to put this information, so people know what attributes are supported across all models?

For more fun, not even OpenStack is consistent, e.g. keystone v3 uses per_page instead of limit and it doesn't use marker based pagination. :-)

@mtekel
Copy link
Author

mtekel commented Feb 9, 2016

It would be nice if someone could pick up that PR and add tests so that it is mergable. Without this, functionality for GCS is still broken in some projects which want to be compatible with Openstack, like the referenced cloud foundry controller.

@plribeiro3000
Copy link
Member

Closing in favor of fog/fog-openstack#51

@fog fog locked and limited conversation to collaborators Mar 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants