Using the DCLI Configuration Store

The configuration store is a store for key-value tuples used to set default values for command options.

The configuration store has profiles. Profiles isolate key-value pairs. DCLI uses a default profile. You can specify the default profile by using the default_profile key.

In the following example, the default profile is labeled default. Each profile first specifies key-value items for a given component. The possible component values are vsphere, vmc, and nsx. This example contains the vmc and vsphere components. The profile then specifies the server you want the key-value pair to be valid for, and also that this pair should be used for the default options DCLI functionality. For more information about default options, see Using Default Options.

Configuration Store Syntax

{ 
    "configuration": { 
        "version": "1.0",  
        "profiles": { 
            "default": { 
                "vmc": { 
                    "https://vmc.vmware.com": { 
                        "default_options": { 
                            "org": "myOrgId" 
                        } 
                    } 
                }, 
                "vsphere": { 
                    "https://myVsphereIp": { 
                        "default_options": { 
                            "vm": "myVMID" 
                        } 
                    } 
                }, 
            } 
        },  
        "default_profile": "default" 
    } 
}

Configuration Store Path

The default DCLI configuration store path is $HOME/.dcli/.dcli_configuration. You can set a different configuration store path by using either the DCLI_CONFIGFILE environment variable or the +credstore-file option.