Updating a data model using the API - Cloud

Talend Cloud Data Stewardship User Guide

Version
Cloud
Language
English
Product
Talend Cloud
Module
Talend Data Stewardship
Content
Administration and Monitoring > Managing users
Data Governance > Assigning tasks
Data Governance > Managing campaigns
Data Governance > Managing data models
Data Quality and Preparation > Handling tasks
Last publication date
2024-01-30

You can update a data model using the response from the GET https://tds.{region}.cloud.talend.com/schemaservice/api/v1/schemas/org.talend.schema/{dataModelName} operation as the body data of this update operation, with the desired modifications

In this example, Talend API Tester is used to send requests.

For further information about Talend API Tester, see Talend Cloud API Tester User Guide.

Before you begin

You retrieved the details about the data model to be updated, using the GET https://tds.{region}.cloud.talend.com/schemaservice/api/v1/schemas/org.talend.schema/{dataModelName} operation.

Procedure

  1. If you do not have a personal access token yet, generate one. For further information, see Generating a Personal Access Token.
  2. Open Talend API Tester in your browser.
  3. From the Repository tab, select Put in the Method drop-down list.
  4. Enter the following URL: https://tds.{region}.cloud.talend.com/schemaservice/api/v1/schemas/org.talend.schema/{dataModelName}
    You'll find a list of the URLs to use for each data center in Talend Cloud regions and URLs.

    {dataModelName} is the data model's technical name and not the name displayed in the list of data models in Talend Cloud Data Stewardship. For example, demo_product.

  5. Click the Add header button and enter Authorization in the name field and Bearer followed by a whitespace and your token in the value field.
  6. Click the Add header button and enter Cookie in the name field and leave the value field empty.
  7. In the Body field, include the response from the GET https://tds.{region}.cloud.talend.com/schemaservice/api/v1/schemas/org.talend.schema/{dataModelName} operation, with the desired modifications.

    Example

    To change the type of the id field from integer to text in the my_products_created_via_API data model you created, replace "type": "integer", with "type": "text", for the first field in the fields array from the response retrieved using GET https://tds.{region}.cloud.talend.com/schemaservice/api/v1/schemas/org.talend.schema/my_products_created_via_API operation:
    
        "fields": [{
            "uuid": "333ca858-5083-4425-bf36-c4fb3c259550",
            "name": "Id",
            "displayName": "Id",
            "description": "",
            "type": "text",
            "required": true
        },
    ...
  8. Click Send.

Results

The API returns a 200 HTTP code to inform you that the request was successful. The response includes an updated JSON description of the data model attributes.

You can see the updated data model in Talend Cloud Data Stewardship:

Configuration to update a data model using the API.