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.
Procedure
-
If you do not have a personal access token yet, generate one. For further
information, see Generating a Personal Access Token.
-
Open Talend API Tester in your browser.
-
From the Repository tab, select Put
in the Method drop-down list.
-
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
.
-
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.
-
Click the Add header
button and enter Cookie in the
name field and leave the value field empty.
-
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
},
...
-
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: