Based on Sriram's options idea:

"ganesha_config set blocknames [sub-blocknames] --parameter value"
will created block/subblocks if doesn't exist and will add the given
parameter values inside the block.

For example, "ganesha_config set NFS_CORE_PARAM --MNT_port 6666" will
create nfs_core_param block if it is not already there and will add
MNT_port as 6666.

"ganesha_config set LOG COMPONENTS --IDMAPPER FULL_DEBUG"  will create

 LOG {
         COMPONENTS {
                   IDMAPPER = FULL_DEBUG;
         }
}

Regards, Malahal.



On Mon, Feb 27, 2017 at 12:45 PM, sriram patil <spsrirampa...@gmail.com> wrote:
> Hi Malahal,
>
> Can we have the key value pairs as options to the commands? For example,
>
> ganesha_config add export path --pseudo <pseudo_path> --protocols 4 --access
> RW --exportid 30
>
> This way the block can be setup in a single command. Also, one does not have
> to worry about the exact key and cases (like Export_id).
>
> But, the line of code will increase for sure.
>
> Thanks,
> Sriram
>
>
> On Sun, Feb 26, 2017 at 9:26 AM, Frank Filz <ffilz...@mindspring.com> wrote:
>>
>> There are Sind empty blocks such as log components can be empty.
>>
>> Sent from my iPhone
>>
>> > On Feb 25, 2017, at 7:20 PM, Malahal Naineni <mala...@gmail.com> wrote:
>> >
>> > Assuming that there is no point in creating empty blocks, then we can
>> > just have "set" and "del" commands. The "set" command's last two
>> > arguments are always "key, value" pairs.
>> >
>> > ganesha_conf set block [subblocks] key value
>> > ganesha_conf del block [subblocks] [key]
>> >
>> > We might need a show command  to complement this as well.
>> >
>> >> On Sat, Feb 25, 2017 at 3:33 PM, Malahal Naineni <mala...@gmail.com>
>> >> wrote:
>> >> Hi All, As as I said last week, here are my thoughts on command line
>> >> interface to edit ganesha config. Appreciate any thoughts on this.
>> >>
>> >> Observations:
>> >>
>> >> - All config is in blocks
>> >> - Most blocks are unique with their tag names
>> >>  - exceptions: "export" and "client" blocks.
>> >>  - "export" is unique by "path" value
>> >>  - "client" is unique by "clients" value with in the export block.
>> >> - Log blocks have few subblocks.
>> >> - Blocks contain a list of key value pairs and possibly some subblocks.
>> >>
>> >> Commands to create a block/subblock
>> >> (block and subblock names should be validated)
>> >>
>> >> ganesha_config add blockname
>> >> ganesha_config add log [subblocks]
>> >> ganesha_config add export path
>> >> ganesha_config add export path client clients
>> >>
>> >> Add, delete, modify a key value pair in a block/subblock
>> >> (key and values need to be validated)
>> >>
>> >> ganehsa_config mod blockname key value
>> >> ganesha_config mod log [sub-blocks] key value
>> >> ganesha_config mod export path key value
>> >> ganehsa_config mod export path client clients key value
>> >>
>> >> Absence of "value" will delete the key itself from the block. This
>> >> means "key"
>> >> name can't be a subblock name. Is this true today and want to preserve
>> >> this
>> >> behavior? Otherwise, we will have to use "delete" as a special reserved
>> >> value to delete a key. Any thoughts?
>> >>
>> >>
>> >> Commands to delete a block/subblock (same as their "add" counter parts)
>> >>
>> >> ganesha_config del blockname
>> >> ganesha_config del log [subblocks]
>> >> ganesha_config del export path
>> >> ganesha_config del export path client clients
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> > _______________________________________________
>> > Nfs-ganesha-devel mailing list
>> > Nfs-ganesha-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Nfs-ganesha-devel mailing list
>> Nfs-ganesha-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel
>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to