Skip to contentSkip to conversation

Add subdomain calling format

PATCH In review Pete Zaitcev 2 participants 3 messages Dec 6, 2010 – Dec 7, 2010 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add subdomain calling format

Amazon appears to give up on forcing users to migrate and bucket-in-path format is going to stay. However, they still refuse to list buckets from other regions on the default endpoint, which leads to annoying indirection (need to know the region somehow before listing). Easier just use the subdomain format in one invocation.

---
 include/hstor.h |    6 +
 lib/hstor.c     |  178 +++++++++++++++++++++++++---------------------
 2 files changed, 106 insertions(+), 78 deletions(-)
include/hstor.h +6 -0
index b47387b..ca63f4a 100644
@@ -25,6 +25,8 @@
 #include <curl/curl.h>
 #include <glib.h>
 
+enum hstor_calling_format { HFMT_ORDINARY, HFMT_SUBDOMAIN };
+
 struct hstor_client {
 	CURL		*curl;
 	char		*acc;
@@ -32,6 +34,7 @@ struct hstor_client {
 	char		*user;
 	char		*key;
 	bool		verbose;
+	bool		subdomain;
 };
 
 struct hstor_bucket {
@@ -165,6 +168,9 @@ extern void hstor_free_keylist(struct hstor_keylist *keylist);
 extern struct hstor_client *hstor_new(const char *service_acc,
 	const char *service_host, const char *user, const char *secret_key);
 
+extern bool hstor_set_format(struct hstor_client *hstor,
+			     enum hstor_calling_format f);
+
 extern bool hstor_add_bucket(struct hstor_client *hstor, const char *name);
 extern bool hstor_del_bucket(struct hstor_client *hstor, const char *name);
 
lib/hstor.c +100 -78

307 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Pete Zaitcev

Amazon appears to give up on forcing users to migrate and bucket-in-path format is going to stay. However, they still refuse to list buckets from other regions on the default endpoint, which leads to annoying indirection (need to know the region somehow before listing). Easier just use the subdomain format in one invocation.

Quoted 6 lines
---
  include/hstor.h |    6 +
  lib/hstor.c     |  178 +++++++++++++++++++++++++---------------------
  2 files changed, 106 insertions(+), 78 deletions(-)

applied 1-2

#2 lore raw
Quoted 9 lines · On Tue, 07 Dec 2010 05:05:38 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 5 lines · Pete Zaitcev

Amazon appears to give up on forcing users to migrate and bucket-in-path format is going to stay. However, they still refuse to list buckets from other regions on the default endpoint, which leads to annoying indirection (need to know the region somehow before listing). Easier just use the subdomain format in one invocation.

applied 1-2

Thanks. I eventually got around this by calling buckets foo-west, foo-east, but might as well just have this.

-- Pete