Exemple #1
0
    def _cmd_rgw_realm_rm_zone_creds(self, realm_token: Optional[str] = None):
        """Create credentials for new zone creation"""

        try:
            retval, out, err = RGWAM(self.env).realm_rm_zone_creds(realm_token)
        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)
Exemple #2
0
    def run(self):
        parser = argparse.ArgumentParser(description='Run radosgw daemon',
                                         usage='rgwam zone run [<args>]')
        parser.add_argument('--port')
        parser.add_argument('--log-file')
        parser.add_argument('--debug-ms')
        parser.add_argument('--debug-rgw')

        args = parser.parse_args(self.args[1:])

        return RGWAM(self.env).run_radosgw(port=args.port)
Exemple #3
0
    def new_zone_creds(self):
        parser = argparse.ArgumentParser(
            description='Bootstrap new realm',
            usage='rgwam realm new-zone-creds [<args>]')
        parser.add_argument('--endpoints')
        parser.add_argument('--sys-uid')

        args = parser.parse_args(self.args[1:])

        return RGWAM(self.env).realm_new_zone_creds(args.endpoints,
                                                    args.sys_uid)
Exemple #4
0
    def _cmd_rgw_realm_reconcile(self,
                                 realm_name: Optional[str] = None,
                                 zonegroup_name: Optional[str] = None,
                                 zone_name: Optional[str] = None,
                                 update: Optional[bool] = False):
        """Bootstrap new rgw zone that syncs with existing zone"""

        try:
            retval, out, err = RGWAM(self.env).realm_reconcile(
                realm_name, zonegroup_name, zone_name, update)
        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)
Exemple #5
0
    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] = True):
        """Bootstrap new rgw zone that syncs with existing zone"""

        try:
            retval, out, err = RGWAM(self.env).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)
Exemple #6
0
    def _cmd_rgw_realm_bootstrap(self,
                                 realm_name: Optional[str] = None,
                                 zonegroup_name: Optional[str] = None,
                                 zone_name: Optional[str] = None,
                                 endpoints: Optional[str] = None,
                                 sys_uid: Optional[str] = None,
                                 uid: Optional[str] = None,
                                 start_radosgw: Optional[bool] = True):
        """Bootstrap new rgw realm, zonegroup, and zone"""

        try:
            retval, out, err = RGWAM(self.env).realm_bootstrap(
                realm_name, zonegroup_name, zone_name, endpoints, sys_uid, uid,
                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)
Exemple #7
0
    def create(self):
        parser = argparse.ArgumentParser(
            description='Create new zone to join existing realm',
            usage='rgwam zone create [<args>]')
        parser.add_argument('--realm-token')
        parser.add_argument('--zone')
        parser.add_argument('--zonegroup')
        parser.add_argument('--endpoints')
        parser.add_argument('--start-radosgw',
                            action='store_true',
                            dest='start_radosgw',
                            default=True)
        parser.add_argument('--no-start-radosgw',
                            action='store_false',
                            dest='start_radosgw')

        args = parser.parse_args(self.args[1:])

        return RGWAM(self.env).zone_create(args.realm_token, args.zonegroup,
                                           args.zone, args.endpoints,
                                           args.start_radosgw)
Exemple #8
0
    def bootstrap(self):
        parser = argparse.ArgumentParser(
            description='Bootstrap new realm',
            usage='rgwam realm bootstrap [<args>]')
        parser.add_argument('--realm')
        parser.add_argument('--zonegroup')
        parser.add_argument('--zone')
        parser.add_argument('--endpoints')
        parser.add_argument('--sys-uid')
        parser.add_argument('--uid')
        parser.add_argument('--start-radosgw',
                            action='store_true',
                            dest='start_radosgw',
                            default=True)
        parser.add_argument('--no-start-radosgw',
                            action='store_false',
                            dest='start_radosgw')

        args = parser.parse_args(self.args[1:])

        return RGWAM(self.env).realm_bootstrap(args.realm, args.zonegroup,
                                               args.zone, args.endpoints,
                                               args.sys_uid, args.uid,
                                               args.start_radosgw)