From: Pritha Srivastava Date: Mon, 20 Feb 2017 11:14:16 +0000 (+0530) Subject: rgw: Added code to fetch a role by its id. X-Git-Tag: v12.1.0~10^2~82^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0507da00b781f4c60f674ca3cbd43daa169101b8;p=ceph.git rgw: Added code to fetch a role by its id. Signed-off-by: Pritha Srivastava --- diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index b6cb7e92f9e..2089f83c259 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -203,6 +203,14 @@ int RGWRole::get() return 0; } +int RGWRole::get_by_id() +{ + int ret = read_info(); + if (ret < 0) { + return ret; + } +} + int RGWRole::update() { auto& pool = store->get_zone_params().roles_pool; diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index 03cd67c6926..b6ec5fed021 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -56,6 +56,13 @@ public: name(std::move(name)), tenant(std::move(tenant)) {} + RGWRole(CephContext *cct, + RGWRados *store, + string id) + : cct(cct), + store(store), + id(std::move(id)) {} + RGWRole(CephContext *cct, RGWRados *store) : cct(cct), @@ -97,10 +104,12 @@ public: const string& get_name() const { return name; } const string& get_path() const { return path; } const string& get_create_date() const { return creation_date; } + const string& get_assume_role_policy() const { return trust_policy;} int create(bool exclusive); int delete_obj(); int get(); + int get_by_id(); int update(); void update_trust_policy(string& trust_policy); void set_perm_policy(const string& policy_name, const string& perm_policy);