]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rgw: add realm create zone-creds command
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 25 May 2021 21:23:31 +0000 (14:23 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 24 Nov 2021 20:54:30 +0000 (12:54 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/pybind/mgr/rgw/module.py

index 8563a474419dd50e760e2201b2ea5bc63fc3e229..4b31e4ea14011896661f295100c4f9d197cefae0 100644 (file)
@@ -94,6 +94,20 @@ class Module(MgrModule):
 
         return HandleCommandResult(retval=retval, stdout=out, stderr=err)
 
+    @CLICommand('rgw realm create zone-creds', perm='rw')
+    def _cmd_rgw_realm_bootstrap(self,
+                                 endpoints: Optional[str] = None,
+                                 sys_uid: Optional[str] = None):
+        """Create credentials for new zone creation"""
+
+        try:
+            retval, out, err = RGWAM(self.ceph_common_args).realm_new_zone_creds(endpoints, sys_uid)
+        except RGWAMException as e:
+            self.log.error('cmd run exception: (%d) %s' % (e.retcode, e.message))
+            return (e.retcode, e.message, e.stderr)
+
+        return HandleCommandResult(retval=retval, stdout=out, stderr=err)
+
     @CLICommand('rgw zone create', perm='rw')
     def _cmd_rgw_zone_create(self,
                              realm_token : Optional[str] = None,