put_cmds = ['create', 'link', 'add']
post_cmds = ['unlink', 'modify']
delete_cmds = ['trim', 'rm', 'process']
- get_cmds = ['check', 'info', 'show', 'list']
+ get_cmds = ['check', 'info', 'show', 'list', '']
bucket_sub_resources = ['object', 'policy', 'index']
user_sub_resources = ['subuser', 'key', 'caps']
(ret, out) = rgwadmin_rest(admin_conn, ['user', 'info'], {'uid' : user1})
assert ret == 404
- # TESTCASE 'info' 'info' 'show' 'display info' 'succeeds'
+ # TESTCASE 'info' 'display info' 'succeeds'
(ret, out) = rgwadmin_rest(admin_conn, ['info', ''])
assert ret == 200
info = out['info']
- # currently, cluster_id is the only element in the info section
- fsid = info['cluster_id']
+ backends = info['storage_backends']
+ name = backends[0]['name']
+ fsid = backends[0]['cluster_id']
+ # name is always "rados" at time of writing, but zipper would allow
+ # other backends, at some point
+ assert len(name) > 0
# fsid is a uuid, but I'm not going to try to parse it
assert len(fsid) > 0
Formatter *formatter = flusher.get_formatter();
flusher.start(0);
- // extensible array of general info sections
+ /* extensible array of general info sections, currently only
+ * storage backend is defined:
+ * {"info":{"storage_backends":[{"name":"rados","cluster_id":"75d1938b-2949-4933-8386-fb2d1449ff03"}]}}
+ */
formatter->open_object_section("dummy");
formatter->open_object_section("info");
+ formatter->open_array_section("storage_backends");
+ // for now, just return the backend that is accessible
+ formatter->open_object_section("dummy");
+ formatter->dump_string("name", store->get_name());
formatter->dump_string("cluster_id", store->get_cluster_id(this, y));
formatter->close_section();
formatter->close_section();
+ formatter->close_section();
+ formatter->close_section();
flusher.flush();
} /* RGWOp_Info_Get::execute */
Store() {}
virtual ~Store() = default;
+ /** Name of this store provider (e.g., RADOS") */
+ virtual const char* get_name() const = 0;
/** Get cluster unique identifier */
virtual std::string get_cluster_id(const DoutPrefixProvider* dpp, optional_yield y) = 0;
/** Get a User from a rgw_user. Does not query store for user info, so quick */
}
int initialize(CephContext *cct, const DoutPrefixProvider *dpp);
+
+ virtual const char* get_name() const override {
+ return "dbstore";
+ }
+
virtual std::unique_ptr<User> get_user(const rgw_user& u) override;
virtual int get_user_by_access_key(const DoutPrefixProvider *dpp, const std::string& key, optional_yield y, std::unique_ptr<User>* user) override;
virtual int get_user_by_email(const DoutPrefixProvider *dpp, const std::string& email, optional_yield y, std::unique_ptr<User>* user) override;
delete rados;
}
+ virtual const char* get_name() const override {
+ return "rados";
+ }
+
virtual std::unique_ptr<User> get_user(const rgw_user& u) override;
virtual std::string get_cluster_id(const DoutPrefixProvider* dpp, optional_yield y) override;
virtual int get_user_by_access_key(const DoutPrefixProvider* dpp, const std::string& key, optional_yield y, std::unique_ptr<User>* user) override;