def _resource(methode, zone, resource_type, resource_selector, **kwargs):
    '''
    internal resource hanlder

    methode : string
        add or update
    zone : string
        name of zone
    resource_type : string
        type of resource
    resource_selector : string
        unique resource identifier
    **kwargs : string|int|...
        resource properties

    '''
    ret = {'status': True}

    # parse kwargs
    kwargs = salt.utils.args.clean_kwargs(**kwargs)
    for k in kwargs:
        if isinstance(kwargs[k], dict) or isinstance(kwargs[k], list):
            kwargs[k] = _sanitize_value(kwargs[k])
    if methode not in ['add', 'update']:
        ret['status'] = False
        ret['message'] = 'unknown methode {0}'.format(methode)
        return ret
    if methode in ['update'] and resource_selector and resource_selector not in kwargs:
        ret['status'] = False
        ret['message'] = 'resource selector {0} not found in parameters'.format(resource_selector)
        return ret

    # generate update script
    cfg_file = salt.utils.files.mkstemp()
    with salt.utils.files.fpopen(cfg_file, 'w+', mode=0o600) as fp_:
        if methode in ['add']:
            fp_.write("add {0}\n".format(resource_type))
        elif methode in ['update']:
            if resource_selector:
                value = kwargs[resource_selector]
                if isinstance(value, dict) or isinstance(value, list):
                    value = _sanitize_value(value)
                value = six.text_type(value).lower() if isinstance(value, bool) else six.text_type(value)
                fp_.write("select {0} {1}={2}\n".format(resource_type, resource_selector, _sanitize_value(value)))
            else:
                fp_.write("select {0}\n".format(resource_type))
        for k, v in six.iteritems(kwargs):
            if methode in ['update'] and k == resource_selector:
                continue
            if isinstance(v, dict) or isinstance(v, list):
                value = _sanitize_value(value)
            value = six.text_type(v).lower() if isinstance(v, bool) else six.text_type(v)
            if k in _zonecfg_resource_setters[resource_type]:
                fp_.write("set {0}={1}\n".format(k, _sanitize_value(value)))
            else:
                fp_.write("add {0} {1}\n".format(k, _sanitize_value(value)))
        fp_.write("end\n")

    # update property
    if cfg_file:
        _dump_cfg(cfg_file)
        res = __salt__['cmd.run_all']('zonecfg -z {zone} -f {path}'.format(
            zone=zone,
            path=cfg_file,
        ))
        ret['status'] = res['retcode'] == 0
        ret['message'] = res['stdout'] if ret['status'] else res['stderr']
        if ret['message'] == '':
            del ret['message']
        else:
            ret['message'] = _clean_message(ret['message'])

        # cleanup config file
        if __salt__['file.file_exists'](cfg_file):
            __salt__['file.remove'](cfg_file)

    return ret