Parameters
Each property can either be set as a static value or a value from an existing column of the input DataFrame. All input parameters are expected to be in string format. Other column types such asarray/JSON/struct can be created using combination of aggregate/window gems along with reformat component and then can be cast as string prior to passing the column in RestAPIEnrich gem as needed.
The following table lists all parameters of the RestAPIEnrich gem.
| Parameter | Description | Required | Default |
|---|---|---|---|
| method | method for the new Request object: GET, OPTIONS, HEAD, POST, PUT, PATCH, or DELETE. | true | |
| url | URL for the REST API. | true | |
| params | Dictionary, list of tuples or bytes to send in the query string for the Request. eg: {"key1":"value1", "key2": value2, "key3": ["value1", "value2"]} | false | |
| data | Dictionary to send in the body of the Request. eg: {"key1":"value1", "key2": value2} | false | |
| JSON | A JSON serializable Python object to send in the body of the Request. eg: {"key1":"value1", "key2": value2} | false | |
| headers | Dictionary of HTTP Headers to send with the Request. eg: {"key1":"value1", "key2": "value2"} | false | |
| cookies | Dictionary to send with the Request. eg: {"key1":"value1", "key2": "value2"} | false | |
| auth | Auth tuple to enable Basic/Digest/Custom HTTP Auth. eg: user:pass | false | |
| timeout | How many seconds to wait for the server to send data before giving up, as a float, eg: 0.5 or a (connect timeout, read timeout) tuple. eg: 0.5:0.25 | false | |
| allow redirects | Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. eg: true or false | false | true |
| proxies | Dictionary mapping protocol to the URL of the proxy. eg: {"https" : "https://1.1.0.1:80"} | false | |
| verify | Either a boolean, in which case it controls whether we verify the server’s TLS certificate eg: true or false or a string, in which case it must be a path to a CA bundle to use. Defaults to True. eg: dbfs:/path-to-file | false | true |
| stream | if False, the response content will be immediately downloaded. eg: true or false | false | |
| cert | if String, path to SSL client cert file (.pem). eg. dbfs:/path-to-file. If Tuple, (‘cert’, ‘key’) pair. eg: cert:key. | false | |
| parse content | Parse content as JSON (to make the schema available, enable custom schema, and click infer from cluster at the bottom left in the output tab) | false | false |
Reference pipeline configurations
To reference variables from your pipeline configs:- Use the following syntax:
${config_name} - You can also use partial strings, for example:
foo_${config_name}bar

