LoadCausataConfig: Load passwords and configuration data.

Description Usage Arguments Details Value Author(s) References See Also

Description

Loads Causata configuration data, including usernames and passwords, from a configuration file. This way scripts can be shared among users without compromising passwords.

Usage

1

Arguments

group

A text string indicating a group name. In a configuration file, arguments under the will be returned in a list.

Details

Configuration data can be stored in a local file located in the user directory. The file must be named .causata-config.yaml, and it must be located in the user's home directory. This function will attempt to load the file using path.expand:

path.expand("~/.causata-config.yaml")

Two functions in the Causata package will call LoadCausataConfig if a group name is provided: CausataConfig, and Connect. The parameter names provided in the config file will be mapped to the input parameters of these functions.

The format of the configuration file is simple. There are one or more groups with a set of indented parameters below. The group and parameter names are followed by a colon.

If the user has a configuration file as shown in the example below, then calling this function returns a list as follows:

Example .causata-config.yaml file

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Use hash for comments
example.1:
  sql.server.host : 123.456.789.219
  sql.server.port : 33060
  config.server.host : 123.456.789.100
  config.server.port : 8003
  username : example@causata.com
  password : ni83jfH

example.2:
  sql.server.host : 123.456.789.999
  sql.server.port : 33060
  config.server.host : 123.456.789.500
  config.server.port : 8003
  username : example@causata.com
  password : 972hfgHB

If "example.1" is used then the first set of parameters is returned in a list:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  LoadCausataConfig("example.1")
  $sql.server.host
  [1] "123.456.789.219"
  
  $sql.server.port
  [1] 33060
  
  $config.server.host
  [1] "123.456.789.100"
  
  $config.server.port
  [1] 8003
  
  $username
  [1] "example@causata.com"
  
  $password
  [1] "ni83jfH"

Similarly, if the "example.2" group is supplied then the second set of parameters is returned in a list:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  LoadCausataConfig("example.2")
  $sql.server.host
  [1] "123.456.789.999"
  
  $sql.server.port
  [1] 33060
  
  $config.server.host
  [1] "123.456.789.500"
  
  $config.server.port
  [1] 8003
  
  $username
  [1] "example@causata.com"
  
  $password
  [1] "972hfgHB"

Value

A list of parameters for the group is returned.

Author(s)

Justin Hemann <support@causata.com>

References

http://www.yaml.org/

See Also

path.expand, yaml.load_file, CausataConfig, Connect.


Causata documentation built on May 2, 2019, 3:26 a.m.