Using the API to set up IBM Optim relationships
To define an IBM® Optim
relationship by using the API, you must create a JSON pipeline job with a
relationship_definition node.
IBM Optim relationships are defined
in the relationship_definition node of a pipeline job JSON. The
relationship_definition node is on the same level as the other execution nodes in
the pipeline, such as the access_definition and insert_definition
nodes.
Before you begin
Ensure that you complete following prerequisites:
- Ensure that both the parent and child tables are defined in the
access_definitionnode. - Obtain the table IDs for both tables.
About this task
The JSON payload of the
relationships_definition node includes the following
parameters:
| Parameter | Description |
|---|---|
id |
A random UUID for the node. |
type |
The type of node. This must be set to execution_node. |
op |
The type of operation. This must be set to relationship_definition. |
app_data.relationships |
An array of relationship objects. Each object includes the following parameters:
|
Note: Note the following limitations of relationship conditions:
- Matching is limited to column names only.
- Expressions such as substring, concatenation, or string literals are not supported.
Sample relationship_definition JSON
Refer to the following sample JSON for an example of how to structure the
execution_node of your pipeline job JSON.
{
"id": "d4b2e988-f2d9-4e30-8396-fb20df4fb560",
"type": "execution_node",
"op": "relationship_definition",
"app_data": {
"relationships": [
{
"id": "1423d17e-ca13-47ba-b51a-92fd8ee7430b",
"parent_table_id": "788c474f-b637-4521-be38-5ca72dbee838",
"child_table_id": "6912f124-593f-46ef-aaa7-e953afb9c997",
"relationship_conditions": [
{
"parent_conditions": {"column_name":"c1"},
"child_conditions": {"column_name":"d1"}
},
{
"parent_conditions": {"column_name":"c2"},
"child_conditions": {"column_name":"d2"}
}
]
}
]
}
}
Defining IBM Optim relationships in a pipeline job
To define relationships IBM Optim in a pipeline job:
- Open the pipeline job JSON file.
- Add an
execution_nodewith:opset torelationship_definition.app_data.relationshipscontaining one or more relationship objects.
- For each relationship object:
- Assign a unique UUID to the
idparameter. - Specify the
parent_table_idandchild_table_idvalues. The IDs must match the table IDs from the access definition. - Define column mappings in
relationship_conditions.
- Assign a unique UUID to the
- Validate the JSON structure.
- Submit the job by using the following
endpoint:
POST /v1/flow/submit/{id}