Creating and using multiple profiles using CDE CLI

You can now add a collection of CDE CLI configurations grouped together as profiles, to the config.yaml file. You can use these profiles while running commands. You can set the configurations either at a profile level or at a global level.

The CDE CLI client uses ~/.cde/config.yaml configuration file to define the default CDE virtual cluster to interact with and to define other configuration parameters. CDE CLI now supports the profiling option in the configuration file. A profile is a collection of configurations that you can apply to a CLI command. Multiple named profiles can be stored in the configuration file.
Make sure that you have downloaded the CLI client. For more information, see Using the Cloudera Data Engineering command line interface.
  1. Create or open the ~/.cde/config.yaml file.
  2. Add profiles to the config.yaml file based on the following structure:
    <Global Configurations>
    - name: <Profile Name 1>        
     <Profile Configurations>
    - name: <Profile Name 2>
     <Profile Configurations>

    Example Configuration file:

    user: cdpuser
    - name: dev
      user: cdpuser1
    - name: test
    • Global Configuration: These configurations are set at the global level. The configurations set here are used by default when a profile name is not specified or the configuration is not specified in the profile
    • Profile Configuration: These configurations are set at the profile level and overrides the respective configurations set at the global level. You can select the profile either by using the environment variables, or command flags.
  3. You can select the profile using the flag or environment variable.


    cde job list --config-profile <PROFILE NAME>

    Environment variable

    cde job list
  4. [Optional] You can view the active profile in the configuration file.
    cde profile show-active