Specifying Complex Parameters

Some brick parameters are easy to specify (require a simple string or a choice of true/false) while the others may be represented by complex structures and require special formatting and syntax requirements to be met.

When you have to specify a complex parameter, follow these steps:

  1. Encode complex parameters.
  2. Enter the result JSON structures as a brick parameter.

Contents:

Encode Complex Parameters

Some parameters require complex JSON structures, which may contain nested arrays or other JSON structures. Such parameters must be combined and entered as a value of a special parameter.

  • All parameters except for sensitive information (for example, passwords) are entered as a value of the gd_encoded_params parameter.
  • Parameters containing sensitive information (for example, passwords) are entered as a value of the gd_encoded_hidden_params parameter. The gd_encoded_hidden_params parameter is entered as a secure schedule parameter. For more information about secure parameters, see Configuring Schedule Parameters.

Let's use an example to see how to encode complex parameters.

Imagine that you are scheduling a brick that has a few parameters that are described with JSON structures. You have to define the following:

  • The location of your input data, which is stored in Data Warehouse (for information about Data Warehouse data source and the other data sources, see Types of Input Data Sources)

    {
      "ads_client": {
        "username": "john.dow@gooddata.com",
        "password": "secret",
        "ads_id": "123456abcdef7890"
      },
      "input_source": {
        "type": "ads",
        "query": "SELECT * FROM domain_users"
      }
    }
  • The login_user parameter

    {  
      "login_user": {
        "login": "john.dow@gooddata.com",
        "password": "secret0",
        "server": "https://secure.gooddata.com,
        "verify_ssl": false
      }
    }
  • The whitelists parameter

    {
      "whitelists": ["etl_admin@gooddata.com", "etl_tester@gooddata.com"]
    }

To encode these parameters, combine them into one JSON structure, like this:

{
  "ads_client": {
    "username": "john.dow@gooddata.com",
    "password": "secret",
    "ads_id": "123456abcdef7890"
  },
  "input_source": {
    "type": "ads",
    "query": "SELECT * FROM domain_users"
  },
  "login_user": {
    "login": "john.dow@gooddata.com",
    "password": "secret0",
    "server": "https://secure.gooddata.com,
    "verify_ssl": false
  },
  "whitelists": ["etl_admin@gooddata.com", "etl_tester@gooddata.com"]
}

Notice that we have sensitive information in this JSON structure: the password for ads_client and the password for login_user. These passwords must be encoded separately in gd_encoded_hidden_params, while the rest can be encoded in gd_encoded_params.

Therefore, let's split the JSON structure into two parts, one with the passwords and the other with the rest of the information.

Here is the JSON structure for non-sensitive information:

{
  "ads_client": {
    "username": "john.dow@gooddata.com",
    "ads_id": "123456abcdef7890"
  },
  "input_source": {
    "type": "ads",
    "query": "SELECT * FROM domain_users"
  },
  "login_user": {
    "login": "john.dow@gooddata.com",
    "server": "https://secure.gooddata.com",
    "verify_ssl": false
  },
  "whitelists": ["etl_admin@gooddata.com", "etl_tester@gooddata.com"]
}

This JSON structure is becoming a value of the gd_encoded_params parameter.

Here is the JSON structure for sensitive information:

{
  "ads_client": {
    "password": "secret"
  },
  "login_user": {
    "password": "secret0"
  }
}

This JSON structure is becoming a value of the gd_encoded_hidden_params parameter.

Now, you are ready to enter the parameters to the brick schedule.

Enter the Result JSON Structures as a Brick Parameter

At this point, you have the two JSON structures that combine several complex parameters. These structures represent the values of the gd_encoded_params and gd_encoded_hidden_params parameters.

While JSON structures are usually formatted in a specific way, you can still use them as a parameter value in the dialog for scheduling bricks: simply copy the structure and paste it in the parameter value field.

You can now enter the parameters in the brick schedule:

  • Enter the gd_encoded_params parameter as a regular (not secure) schedule parameter.
  • Enter the gd_encoded_hidden_params parameter as a secure schedule parameter.

You are now ready to finish the scheduling process.