def gbp_policy_cfg_all(self, cmd_val, cfgobj, name_uuid, **kwargs):
        cfgobj_dict = {
            "action": "policy-action",
            "classifier": "policy-classifier",
            "rule": "policy-rule",
            "ruleset": "policy-rule-set",
            "group": "policy-target-group",
            "target": "policy-target",
            "l2p": "l2policy",
            "l3p": "l3policy",
            "nsp": "network-service-policy",
            "extseg": "external-segment",
            "extpol": "external-policy",
            "natpool": "nat-pool"}

        if cfgobj != '':
            if cfgobj not in cfgobj_dict:
                raise KeyError
        if cmd_val == '' or name_uuid == '':
            _log.info('''Function Usage: gbp_policy_cfg_all 'rule' 0 "abc"\n
                       --cmd_val == 0:delete; 1:create; 2:update\n
                       -- name_uuid == UUID or name_string\n''')
            return 0

        # Build the command with mandatory params
        if cmd_val == 0:
            cmd = 'gbp %s-delete ' % cfgobj_dict[cfgobj] + str(name_uuid)
        if cmd_val == 1:
            cmd = 'gbp %s-create ' % cfgobj_dict[cfgobj] + str(name_uuid)
        if cmd_val == 2:
            cmd = 'gbp %s-update ' % cfgobj_dict[cfgobj] + str(name_uuid)
        # Build the cmd string for optional/non-default args/values
        for arg, value in kwargs.items():
            if arg.startswith('_'):
                # Parameter not supported by CLI, leave it as is
                arg = arg[1:]
                cmd = cmd + " --" + "%s %s" % (arg, value)
            else:
                arg = string.replace(arg, '_', '-')
                cmd = cmd + " --" + "%s=%s" % (arg, value)
        _log.info(cmd)
        # Execute the cmd
        cmd_out = commands.getoutput(cmd)
        #_log.info(cmd_out)
        # Catch for non-exception error strings, even though try clause
        # succeded
        if self.cmd_error_check(cmd_out) == 0:
            return 0
        # If try clause succeeds for "create" cmd then parse the cmd_out to
        # extract the UUID of the object

        try:
            if cmd_val == 1 and cfgobj == "group":
                obj_uuid = self.get_uuid(cmd_out)
                match = re.search("\\bl2_policy_id\\b\s+\| (.*) \|",
                                  cmd_out, re.I)
                l2pid = match.group(1)
                match = re.search("\\bsubnets\\b\s+\| (.*) \|",
                                  cmd_out, re.I)
                subnetid = match.group(1)
                return obj_uuid, l2pid.rstrip(), subnetid.rstrip()
            if cmd_val == 1 and cfgobj == "target":
                obj_uuid = self.get_uuid(cmd_out)
                match = re.search("\\bport_id\\b\s+\| (.*) \|",
                                  cmd_out, re.I)
                neutr_port_id = match.group(1)
                return obj_uuid.rstrip(), neutr_port_id.rstrip()
            if cmd_val == 1 and cfgobj == "l2p":
                obj_uuid = self.get_uuid(cmd_out)
                match = re.search("\\l3_policy_id\\b\s+\| (.*) \|",
                                  cmd_out, re.I)
                l3p_uuid = match.group(1)
                return obj_uuid.rstrip(), l3p_uuid.rstrip()
            if cmd_val == 1:
                obj_uuid = self.get_uuid(cmd_out)
                return obj_uuid.rstrip()
        except Exception:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            _log.info('Exception Type = %s, Exception Object = %s' % (
                exc_type, exc_value))
            return 0
        return 1
--cfgobj== policy-*(where *=action;classifer,rule,ruleset,targetgroup,
dataset/ETHPy150Open openstack/group-based-policy/gbpservice/tests/contrib/gbpfunctests/libs/config_libs.py/Gbp_Config.gbp_policy_cfg_all