From e6b3a158a1db5c2e722d3a6141e6cced0bec5468 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 24 May 2021 16:58:29 -0700 Subject: [PATCH] mgr/rgw: add zone create command (based on rgwam) Signed-off-by: Yehuda Sadeh --- src/pybind/mgr/rgw/module.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pybind/mgr/rgw/module.py b/src/pybind/mgr/rgw/module.py index 003dd8b7c88d5..8563a474419dd 100644 --- a/src/pybind/mgr/rgw/module.py +++ b/src/pybind/mgr/rgw/module.py @@ -94,6 +94,24 @@ class Module(MgrModule): 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, + zonegroup_name: Optional[str] = None, + zone_name: Optional[str] = None, + endpoints: Optional[str] = None, + start_radosgw: Optional[bool] = False): + """Bootstrap new rgw zone that syncs with existing zone""" + + try: + retval, out, err = RGWAM(self.ceph_common_args).zone_create(realm_token, zonegroup_name, + zone_name, endpoints, start_radosgw) + 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) + def shutdown(self) -> None: """ This method is called by the mgr when the module needs to shut -- 2.39.5