fog / fog-openstack-core

fog's core openstack behaviors without API and cloud provider specifics
Apache License 2.0
6 stars 8 forks source link

Organization of request files within Identity #4

Open wchrisjohnson opened 10 years ago

wchrisjohnson commented 10 years ago

Mike and I are having a discussion and thought it best to brief everyone before the Ruby meeting this afternoon, as we will probably discuss this.

Inside the Identity Service (identity.rb) there are lots of requests for individual operations, typically centered around token, user, tenant, role, etc. An added wrinkle is that there are core operations and extensions to the api.

I made some changes last night that are reflected in the version of the identity.rb that sits inside PR#3. I moved all of the admin api token operations into a single file and referenced that using the "request" method on the service. The request method is really just a means to require a file that contains any methods to be mixed into the model/service. I accept that this is not an approach that has any precedent in fog. I just hated the view of all of the requests mixed into the requests/identity folder. I actually found 3 different instances of a method with the same path/url/signature. Finding the correct request for a specific operation was non-obvious. I see that the compute API has 50-60 requests associated with it.

It might make sense to drop the use of request method and just do straight 'require' instead; however, this would certainly deviate from fog practices as well.

My goals in doing this were several:

Thoughts, ideas, alternative suggestions are welcome.

I'd be happy to walk thru this during our hangout this afternoon.

mwhagedorn commented 10 years ago

my major objection is that requests are supposed to be declarative, so I dont dig the loss of that. if you cant see at a glance what requests are declared in the service object, then we are taking a huge delta away from the rest of fog imho