]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Added code to fetch a role by its id.
authorPritha Srivastava <prsrivas@redhat.com>
Mon, 20 Feb 2017 11:14:16 +0000 (16:44 +0530)
committerPritha Srivastava <prsrivas@redhat.com>
Tue, 7 Mar 2017 04:26:46 +0000 (09:56 +0530)
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
src/rgw/rgw_role.cc
src/rgw/rgw_role.h

index b6cb7e92f9e28199dc3903a5b8768debe4279b73..2089f83c259c9b505674d08f88f17d32324dc338 100644 (file)
@@ -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;
index 03cd67c692621983ed5b5d01216f025ab4b1872f..b6ec5fed021b4b7544c564618766697869b6414c 100644 (file)
@@ -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);