Use APIs to Manage Associations in a Test Data Model

This article explains with the help of an example about how test data engineers (TDEs) can use exposed CA TDM Portal APIs to manage associations in test data models after they create them.
tdm42
This article explains with the help of an example about how test data engineers (TDEs) can use exposed CA TDM Portal APIs to manage associations in test data models after they create them.
This article covers the following tasks. You perform all these tasks by using the APIs. You get the information about the available associations in a test data model. You then identify the association that you want to update and delete.
2
2
Note:
 For more information about test data model concepts, persona-based tasks, prerequisites, assumptions, and considerations, see Use APIs to Design and Consume Automated Test Data Services.
This page refers to the following API Services:
Update an Association in a Test Data Model
The process to update an association in a test data model is as follows:
You can update the following association-related properties:
  • Name of the association.
  • Source entity of the association.
  • Join fields (if forceUpdate is true).
  • Association type (if forceUpdate is true).
Get the Security Token
Use the login API to log in and generate a security token. You use your CA TDM Portal login credentials to generate the security token. You can then use the same security token to perform all other operations. The security token remains valid for 24 hours.
Follow these steps:
  1. Access an application that allows you to encode your credentials to the Base64 format.
  2. Enter your CA TDM Portal login credentials (in the format 
    <user name>:<password>
    ) in the source field.
    Note:
     Ensure that the credentials have appropriate permissions to perform all the required operations.
  3. Click the option to encode the credentials. The encoded Base64 format for the example is displayed as follows:
    ZwRTaX5pc4SxYXSvcjptYXJtaXRl
  4. Copy the encoded value.
  5. Access the following CA TDM Portal API:
    POST https://<server>:<host>/TestDataManager/user/login
    Note:
     For more information about this API, see the "auth-controller: Auth Controller" section at https://<server>:<port>/TestDataManager/swagger-ui.html. For the example in this article, the URL is https://server-po:8443/TestDataManager/swagger-ui.html.
  6. Enter the encoded value in the 
    Authorization
     field, which is as follows for the example:
    Basic YWRtaW5pc3RyYXRvcjptYXJtaXRl
  7. Run the API to get a security token for your credentials.
  8. Note the value of the 
    token
     parameter in the response body, which is as follows for the example:
    eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
    You have successfully generated a security token that you can use in all the subsequent operations explained in this article.
Get the Project ID 
Get the project ID that includes the required test data model. Note the project ID, because you will be using it in all the subsequent operations.
Follow these steps:
  1. Access the following CA TDM Portal API:
    GET https://<server>:<host>/TDMProjectService/api/ca/v1/projects
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Run the API and review the response body. The following example response is generated:
    {
    "name": "Order",
    "description": "This is Order Management project.",
    "dateOrder": "YMD",
    "id": 141357,
    "inheritTables": true,
    "timestampPrecision": 3,
    "type": "DB",
    "levels": [],
    "created": null,
    "updated": null,
    "versions": [],
    "grantedFunctions": []
    },
    {
    "name": "StoreFront - Example Project - Oracle",
    "description": "StoreFront - Oracle",
    "dateOrder": "YMD",
    "id": 1760,
    "inheritTables": true,
    "timestampPrecision": 6,
    "type": "DB",
    "levels": [],
    "created": null,
    "updated": null,
    "versions": [],
    "grantedFunctions": []
    },
    {
    "name": "StoreFront - Example Project - SQL Server",
    "description": "StoreFront - Example Project - SQL Server",
    "dateOrder": "YMD",
    "id": 2234,
    "inheritTables": true,
    "timestampPrecision": 3,
    "type": "DB",
    "levels": [],
    "created": null,
    "updated": null,
    "versions": [],
    "grantedFunctions": []
    },
    {
    "name": "TDMPublish_Centrica",
    "description": "TDMPublish_Centrica",
    "dateOrder": "YMD",
    "id": 7739,
    "inheritTables": true,
    "timestampPrecision": 3,
    "type": "DB",
    "levels": [],
    "created": null,
    "updated": null,
    "versions": [],
    "grantedFunctions": []
    }
    ]
  4. Identify the project and note the project ID. For this example, the project is Order with the ID 141357.
Get the Version ID 
After you get the project ID, you must get the associated version ID. Note the version ID, because you will be using it in all the subsequent operations.
Follow these steps:
  1. Access the following CA TDM Portal API:
    GET https://<server>:<host>/TDMProjectService/api/ca/v1/projects/{projectId}/versions
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter the project ID as 141357 in the 
    projectId
     field. 
  4. Run the API and review the response body. The following example response is generated:
    [
    {
    "id": 141358,
    "name": "1.0",
    "created": "2017-03-07T07:28:09+0000",
    "description": "This is Order Management version 1.0.",
    "projectName": null,
    "levelDetails": null,
    "registeredObjectCount": 0,
    "tablesUsed": null,
    "isGeneric": false
    }
    ]
  5. Note the version ID, which is 141358 in this example.
Get the Test Data Model ID
Get the list of test data models for your specific project and version. After you get the list, identify the test data model that includes the association that you want to update. Note the ID of the test data model.
Follow these steps:
  1. Access the following CA TDM Portal API:
    GET https://<server>:<host>/TDMDataReservationService/api/ca/v1/testDataModels
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter information in the following fields:
    • projectId
      Specifies the ID of the project for which you want to retrieve test data models. For this example, the value is 141357.
    • versionId
      Specifies the ID of the project version for which you want to retrieve test data models. For this example, the value is 141358.
  4. Run the API and review the response body. The following example response is generated:
    {
    "numberOfTestDataModels": 2,
    "totalNumberOfTestDataModels": 2,
    "testDataModelsList": [
    {
    "id": 386,
    "name": "Orders",
    "description": "This test data model is for Orders Management application.",
    "visible": true,
    "projectId": 141357,
    "versionId": 141358
    },
    {
    "id": 410,
    "name": "Product_Purchase",
    "description": "This test data model is for the Purchase application.",
    "visible": true,
    "projectId": 141357,
    "versionId": 141358
    }
    ]
    }
    Note that the specified project and version include two test data models: Orders and Product_Purchase.
  5. Identify the test data model that includes the association; note the test data model ID. For this example, the test data model ID 386 includes the association.
Get All Associations in the Identified Test Data Model
Get all the associations that are related to a specific test data model. After you get the list, identify the association that you want to update.
Follow these steps:
  1. Access the following CA TDM Portal API:
    GET https://<server>:<host>/TDMDataReservationService/api/ca/v1/testDataModels/{testDataModelId}/associations
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter information in the following fields:
    • projectId
      Specifies the ID of the project that includes the test data model for which you want to get the associations. For this example, the value is 141357.
    • versionId
      Specifies the ID of the project version that includes the test data model for which you want to get the associations. For this example, the value is 141358.
    • testDataModelId
      Specifies the ID of the test data model for which you want to get the associations. For this example, the value is 386.
  4. Run the API and review the response body. The following example response that includes all the associations for the selected test data model is generated:
    [
    {
    "id": 391,
    "name": "Order Details",
    "associationType": "ONE_MANY",
    "joinFields": [
    {
    "fieldName": "OrderID",
    "referenceFieldName": "OrderID"
    }
    ],
    "sourceEntity": {
    "id": 387,
    "name": "Orders",
    "primaryKeys": [
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    },
    "targetEntity": {
    "id": 390,
    "name": "Order Details",
    "primaryKeys": [
    "ProductID",
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    }
    },
    {
    "id": 394,
    "name": "Products",
    "associationType": "MANY_ONE",
    "joinFields": [
    {
    "fieldName": "ProductID",
    "referenceFieldName": "ProductID"
    }
    ],
    "sourceEntity": {
    "id": 390,
    "name": "Order Details",
    "primaryKeys": [
    "ProductID",
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    },
    "targetEntity": {
    "id": 393,
    "name": "Products",
    "primaryKeys": [
    "ProductID"
    ],
    "dataSource": "Orders_DS"
    }
    }
    ]
    Note that the response includes two associations with IDs 391 and 394 for the Orders test data model (386).
  5. Identify the association that you want to update and note its ID. For this example, association with the ID 394 is chosen for the update.
Get Details of the Identified Association
After you note the association ID that you want to update, you can retrieve its details to review the information in more detail.
Follow these steps:
  1. Access the following CA TDM Portal API:
    GET https://<server>:<host>/TDMDataReservationService/api/ca/v1/testDataModels/{testDataModelId}/associations/{associationId}
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter information in the following fields as follows:
    • projectId
      Specifies the ID of the project related to the test data model that includes the association for which you want to get the details. For this example, the project ID value is 141357.
    • versionId
      Specifies the ID of the project version related to the test data model that includes the association for which you want to get the details. For this example, the value of the version ID is 141358.
    • testDataModelId
      Specifies the ID of the test data model that includes the association for which you want to get the details. For this example, the value of the test data model ID is 386 (Orders).
    • associationId
      Specifies the ID of the association for which you want to get the details. For this example, the value of the association ID is 394.
  4. Run the API and review the response body. The following example response is generated for the association ID 394:
    {
    "id": 394,
    "name": "Products",
    "associationType": "MANY_ONE",
    "joinFields": [
    {
    "fieldName": "ProductID",
    "referenceFieldName": "ProductID"
    }
    ],
    "sourceEntity": {
    "id": 390,
    "name": "Order Details",
    "primaryKeys": [
    "ProductID",
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    },
    "targetEntity": {
    "id": 393,
    "name": "Products",
    "primaryKeys": [
    "ProductID"
    ],
    "dataSource": "Orders_DS"
    }
    }
  5. Review the properties that you want to update. For this example, the association type is identified to be changed to ONE_ONE.
Update the Identified Association
After you review and identify the association that you want to update, you can use the update association API to do the update.
Follow these steps:
  1. Access the following CA TDM Portal API:
    PUT https://<server>:<host>/TDMDataReservationService/api/ca/v1/testDataModels/{testDataModelId}/associations/{associationId}
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter information in the following fields as follows:
    • projectId
    • Specifies the ID of the project related to the test data model that includes the association you want to update. For this example, the value is 141357.
    • versionId
      Specifies the ID of the project version related to the test data model that includes the association you want to update. For this example, the value is 141358.
    • testDataModelId
      Specifies the ID of the test data model that includes the association you want to update. For this example, the value is 386.
    • associationId
      Specifies the ID of the association that you want to update. For this example, the value of the association ID is 394.
    • forceUpdate
      Specifies whether you want to forcefully save the association in case of a conflict. To do so, set the value to true; otherwise, select false. For this example, the value is true.
    • association
      Specifies the payload that includes the association parameters. Specify the parameter values that you want to update. This payload includes the following parameters:
      • associationType
        Specifies the type of the association. Applicable values are: 'ONE_ONE', 'ONE_MANY', 'MANY_ONE'. For this example, the value is set it ONE_ONE.
      • joinFields
         
        Specifies the field details that are used for establishing the join (association) between the source and the target entities.
      • name
        Specifies the name of the association that you are updating. For this example, the value of the association name is Products.
      • sourceEntity
          
        Specifies the parent data entity details. 
      • targetEntity
         
        Specifies the child data entity details. 
      • fieldName
          
        Specifies the name of the field used in the association. For this example, the value of the field name is ProductID, which comes from the Order Details entity (source).
      • referenceFieldName
          
        Specifies the name of the reference field used in the association. For this example, the value of the reference field name is ProductID, which comes from the Products entity (target).
      • dataSource
         
        Specifies the data source of the entities. For this example, the value of the data source is Orders_DS.
      • name
        Specifies the name of the source and target entities. For this example, the value of the source entity name is Order Details, and the value of the target entity name is Products.
      For this example, the association update payload is as follows. Note that the association type is chosen for the update:
      {
      "associationType": "
      ONE_ONE
      ",
      "joinFields": [
      {
      "fieldName": "ProductID",
      "referenceFieldName": "ProductID"
      }
      ],
      "name": "Products",
      "sourceEntity": {
      "dataSource": "Orders_DS",
      "name": "Order Details"
      },
      "targetEntity": {
      "dataSource": "Orders_DS",
      "name": "Products"
      }
      }
  4. Run the API and review the response body. The following example response is generated:
    {
    "id": 394,
    "name": "Products",
    "associationType": "
    ONE_ONE
    ",
    "joinFields": [
    {
    "fieldName": "ProductID",
    "referenceFieldName": "ProductID"
    }
    ],
    "sourceEntity": {
    "id": 390,
    "name": "Order Details",
    "primaryKeys": [
    "ProductID",
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    },
    "targetEntity": {
    "id": 393,
    "name": "Products",
    "primaryKeys": [
    "ProductID"
    ],
    "dataSource": "Orders_DS"
    }
    }
  5. Review that the response includes the updated property. In this case, the association type is changed to ONE_ONE.
You have successfully updated an association in a test data model.
Delete an Association in a Test Data Model
The process to delete an association in a test data model is as follows:
Get the Security Token
Use the login API to log in and generate a security token. You use your CA TDM Portal login credentials to generate the security token. You can then use the same security token to perform all other operations. The security token remains valid for 24 hours. To get the security token and log into the CA TDM Portal, follow the instructions in the corresponding section in Update a Test Data Model. 
Get the Project ID 
Get the project ID that includes the required test data model. Note the project ID, because you will be using it in all the subsequent operations. To get the project ID, follow the detailed instructions in the corresponding section in Update an Association in a Test Data Model. 
Summary of the example value used in this API is as follows: 
  • Authorization:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro 
The following response is generated, note the project ID (141357): 
{
"name": "Order",
"description": "This is Order Management project.",
"dateOrder": "YMD",
"id": 141357,
"inheritTables": true,
"timestampPrecision": 3,
"type": "DB",
"levels": [],
"created": null,
"updated": null,
"versions": [],
"grantedFunctions": []
},
{
"name": "StoreFront - Example Project - Oracle",
"description": "StoreFront - Oracle",
"dateOrder": "YMD",
"id": 1760,
"inheritTables": true,
"timestampPrecision": 6,
"type": "DB",
"levels": [],
"created": null,
"updated": null,
"versions": [],
"grantedFunctions": []
},
{
"name": "StoreFront - Example Project - SQL Server",
"description": "StoreFront - Example Project - SQL Server",
"dateOrder": "YMD",
"id": 2234,
"inheritTables": true,
"timestampPrecision": 3,
"type": "DB",
"levels": [],
"created": null,
"updated": null,
"versions": [],
"grantedFunctions": []
},
{
"name": "TDMPublish_Centrica",
"description": "TDMPublish_Centrica",
"dateOrder": "YMD",
"id": 7739,
"inheritTables": true,
"timestampPrecision": 3,
"type": "DB",
"levels": [],
"created": null,
"updated": null,
"versions": [],
"grantedFunctions": []
}
]
Get the Version ID 
After you get the project ID, you must get the associated version ID. Note the version ID, because you will be using it in all the subsequent operations. To get the version ID associated with the retrieved project ID, follow the detailed instructions in the corresponding section in Update an Association in a Test Data Model. 
Summary of the example values used in this API is as follows: 
  • Authorization:
     Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  • projectId: 
    141357  
The following example response is generated; note the version ID (141358): 
[
{
"id": 141358,
"name": "1.0",
"created": "2017-03-07T07:28:09+0000",
"description": "This is Order Management version 1.0.",
"projectName": null,
"levelDetails": null,
"registeredObjectCount": 0,
"tablesUsed": null,
"isGeneric": false
}
]
Get the Test Data Model ID 
Get the list of test data models for your specific project and version. After you get the list, identify the test data model that includes the association that you want to delete. Note the ID of the test data model. To get the ID, follow the detailed instructions in the corresponding section in Update an Association in a Test Data Model.
Summary of the example values used in this API is as follows: 
  • Authorization: 
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  • projectId: 
    141357
  • versionId: 
    141358 
The following example response is generated. Note that the specified project and version include two test data models: Orders and Product_Purchase. Identify the test data model that includes the association and note the test data model ID. For this example, the test data model ID 386 includes the association.
{
"numberOfTestDataModels": 2,
"totalNumberOfTestDataModels": 2,
"testDataModelsList": [
{
"id": 386,
"name": "Orders",
"description": "This test data model is for Orders Management application.",
"visible": true,
"projectId": 141357,
"versionId": 141358
},
{
"id": 410,
"name": "Product_Purchase",
"description": "This test data model is for the Purchase application.",
"visible": true,
"projectId": 141357,
"versionId": 141358
}
]
}
Get All Associations in the Identified Test Data Model
Get all the associations that are related to a specific test data model. After you get the list, identify the association that you want to delete. To get the list of associations in a test data model, follow the detailed instructions in the corresponding section in Update an Association in a Test Data Model.
Summary of the example values used in this API are as follows:
  • Authorization: 
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  • projectId: 
    141357
  • versionId: 
    141358
  • testDataModelId: 
    386
The following example response that includes all the associations for the selected test data model is generated. Note that the response includes two associations with IDs 391 and 394 for the Orders test data model (386). Identify the association that you want to delete and note its ID. For this example, association ID 394 is chosen for the delete: 
[
{
"id": 391,
"name": "Order Details",
"associationType": "ONE_MANY",
"joinFields": [
{
"fieldName": "OrderID",
"referenceFieldName": "OrderID"
}
],
"sourceEntity": {
"id": 387,
"name": "Orders",
"primaryKeys": [
"OrderID"
],
"dataSource": "Orders_DS"
},
"targetEntity": {
"id": 390,
"name": "Order Details",
"primaryKeys": [
"ProductID",
"OrderID"
],
"dataSource": "Orders_DS"
}
},
{
"id": 394,
"name": "Products",
"associationType": "MANY_ONE",
"joinFields": [
{
"fieldName": "ProductID",
"referenceFieldName": "ProductID"
}
],
"sourceEntity": {
"id": 390,
"name": "Order Details",
"primaryKeys": [
"ProductID",
"OrderID"
],
"dataSource": "Orders_DS"
},
"targetEntity": {
"id": 393,
"name": "Products",
"primaryKeys": [
"ProductID"
],
"dataSource": "Orders_DS"
}
}
]
Get Details of the Identified Association
After you note the association ID that you want to delete, you can retrieve its details to review the information in more detail. To get details of a specific association, follow the detailed instructions in the corresponding section in Update an Association in a Test Data Model.
Summary of the example values used in this API are as follows:
  • Authorization: 
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  • projectId: 
    141357
  • versionId: 
    141358
  • testDataModelId: 
    386 
  • associationId: 
    394
The following example response is generated for the association ID 394. Review the properties to confirm that you want to delete this association: 
{
"id": 394,
"name": "Products",
"associationType": "MANY_ONE",
"joinFields": [
{
"fieldName": "ProductID",
"referenceFieldName": "ProductID"
}
],
"sourceEntity": {
"id": 390,
"name": "Order Details",
"primaryKeys": [
"ProductID",
"OrderID"
],
"dataSource": "Orders_DS"
},
"targetEntity": {
"id": 393,
"name": "Products",
"primaryKeys": [
"ProductID"
],
"dataSource": "Orders_DS"
}
}
Delete the Identified Association
After you identify and confirm the appropriate association in a test data model, you can go ahead and delete it.
Follows these steps:
  1. Access the following CA TDM Portal API:
    DELETE https://<server>:<host>/TDMDataReservationService/api/ca/v1/testDataModels/{testDataModelId}/associations/{associationId}
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter information in the following fields as follows:
    • projectId
      Specifies the ID of the project that includes the test data model from which you want to delete the association. For this example, the value of the project ID is 141357.
    • versionId
      Specifies the ID of the project version that includes the test data model from which you want to delete the association. For this example, the value of the version ID is 141358.
    • testDataModelId
      Specifies the ID of the test data model from which you want to delete the association. For this example, the value of the test data model ID is 386.
    • associationId
      Specifies the ID of the association you want to delete. For this example, the value of the association ID is 394.
  4. Run the API and review the response body:
    {
    "message": "Association is deleted successfully."
    }
  5. Review that the response includes a message that states that the association has been deleted successfully.
Verify the Deletion
After you run the delete association API to delete the association, you can verify whether the association is appearing in the test data model.
Follow these steps:
  1. Access the following CA TDM Portal API:
    GET https://<server>:<host>/TDMDataReservationService/api/ca/v1/testDataModels/{testDataModelId}/associations
  2. Enter the security token in the 
    Authorization
     field as follows:
    Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlU0VSX0lEBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.7T1CyH_xQK0vQcBB7dLojUxm8ENTeRRrdOa-RQ5l4Ro
  3. Enter information in the following fields:
    • projectId
      Specifies the ID of the project that includes the test data model for which you want to get the associations. For this example, the value is 141357.
    • versionId
      Specifies the ID of the project version that includes the test data model for which you want to get the associations. For this example, the value is 141358.
    • testDataModelId
      Specifies the ID of the test data model for which you want to get the associations. For this example, the value is 386.
  4. Run the API and review the response body. The following example response that includes all the associations for the selected test data model is generated:
    [
    {
    "id": 391,
    "name": "Order Details",
    "associationType": "ONE_MANY",
    "joinFields": [
    {
    "fieldName": "OrderID",
    "referenceFieldName": "OrderID"
    }
    ],
    "sourceEntity": {
    "id": 387,
    "name": "Orders",
    "primaryKeys": [
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    },
    "targetEntity": {
    "id": 390,
    "name": "Order Details",
    "primaryKeys": [
    "ProductID",
    "OrderID"
    ],
    "dataSource": "Orders_DS"
    }
    }
    ]
  5. Note that the response now does not include the association ID 394 for the Orders test data model (386), which is correct.
You have successfully deleted an association related to a test data model.