Application Programming Interface Guide > REST API > TDV Server REST APIs > Link
 
Link
The Link REST API provides the ability to create, alter or delete multiple virtual tables/procedures and read a virtual table/procedure.
GET/link
PUT/link
POST/link
DELETE/link
DELETE/link/{linkPath}
GET/link
This API is used to get summary and/or detailed information of virtual table or procedure.
Parameters:
Name
Description
Parameter Type
Data Type
path
virtual table or procedure path
query
string
summary
fetch virtual table or procedure summary
query
boolean
Example to Get summary of published table "/services/databases/ publishedDB/pubTable"
curl -X GET -u admin:admin "http://localhost:9400/rest/link/v1?path=%2Fservices%2Fdatabases%2FpublishedDB%2FpubTable&summary=true" -H "Content-Type:application/json"
Example to Get detailed information about published table "/services/databases/publishedDB/pubTable"
curl -X GET -u admin:admin "http://localhost:9400/rest/link/v1?path=%2Fservices%2Fdatabases%2FpublishedDB%2FpubTable" -H "Content-Type:application/json"
Example to Get detailed information about published procedure "/services/databases/publishedDB/pubProcedure"
curl -X GET -u admin:admin "http://localhost:9400/rest/link/v1?path=%2Fservices%2Fdatabases%2FpublishedDB%2FpubProcedure" -H "Content-Type:application/json"
PUT/link
This API is used to update virtual tables or procedures.
Parameters:
None.
Request Body
Example Value - Schema
[
“path”: "string",
“isTable”: true,
“targetPath”: “string”,
“annotation”: “string”,
“newPath”: “string”,
“ifNotExists”: true
]
Example to Update annotation and rename a published table "/services/databases/publishedDB/link1 to /services/databases/ publishedDB/pubTable"
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link1\", \"isTable\" : true, \"annotation\":\"Edited published table created using REST api\", \"newPath\":\"/services/databases/publishedDB/pubTable\" }]"
Example to Update annotation and relocate a published procedure "/services/databases/publishedDB/link2 to /services/databases/ publishedDB1/pubProcedure"
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link2\", \"isTable\" : false, \"annotation\":\"Edited published procedure created using REST api\", \"newPath\":\"/services/databases/publishedDB1/pubProcedure\" }]"
Example to Update target of a published table "/services/databases/ publishedDB/pubTable"
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\" : true, \"annotation\":\"Edited target of published table created using REST api\", \"targetPath\":\"/shared/examples/ds_orders/tutorial/orderdetails\" }]"
Example to Unset annotation of a published table "/services/databases/ publishedDB/pubTable"
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\" : true, \"annotation\":\"null\"}]"
POST/link
This API is used to creates virtual tables or procedures.
Parameters:
None.
Request Body
Example Value - Schema
[
“path”: "string",
“isTable”: true,
“targetPath”: “string”,
“annotation”: “string”,
“newPath”: “string”,
“ifNotExists”: true
]
Example to Create virtual table "/services/databases/publishedDB/link1"
curl -X POST -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link1\", \"isTable\":true, \"targetPath\" : \"/shared/examples/ds_orders/tutorial/orders\", \"annotation\":\"This is a published table created using REST api\" }]"
Example to Creates virtual procedure "/services/databases/ publishedDB/link2"
curl -X PUT -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link2\", \"isTable\" : false, \"annotation\":\"Edited published procedure created using REST api\", \"newPath\":\"/services/databases/publishedDB1/pubProcedure\" }]"
Example to Update target of a published table "/services/databases/ publishedDB/pubTable"
curl -X POST -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link2\", \"isTable\":false, \"targetPath\" : \"/shared/examples/LookupProduct\", \"annotation\":\"This is a published procedure created using REST api\" }]"
Example to Creates virtual table "/services/databases/publishedDB/link1" with "ifNotExists" syntax
curl -X POST -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/link1\", \"ifNotExists\":true, \"isTable\":true, \"targetPath\" : \"/shared/examples/ds_orders/tutorial/orders\", \"annotation\":\"This is a published table created using REST api\" }]"
DELETE/link
This API is used to delete virtual tables or procedures.
Parameters:
None.
Request Body
Example Value - Schema
[
“path”: "string",
“isTable”: true
]
Example to Deletes virtual table and procedure "/services/databases/ publishedDB/pubTable" and "/services/databases/ publishedDB/pubProcedure"
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\":true}, {\"path\":\"/services/databases/publishedDB/pubProcedure\", \"isTable\":false}]"
Sample CURL Invocation with "ifExists":
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1?ifExists=true" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/pubTable\", \"isTable\":true}, {\"path\":\"/services/databases/publishedDB/pubProcedure\", \"isTable\":false}]"
DELETE/link/{linkPath}
This API is used to delete virtual tables or procedures.
Parameters:
 
Name
Description
Parameter Type
Data Type
linkPath
virtual table or procedure path
query
string
isTable
flag to indicate if resource is a table
query
boolean
ifExists
flag to indicate if resource exists
query
boolean
Example to Deletes virtual table
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1/{linkPath}?isTable=true&ifExists=true" -H "Content-Type: application/json"
Sample CURL Invocation with "ifExists":
curl -X DELETE -u admin:admin "http://localhost:9400/rest/link/v1/%2Fservices%2Fdatabases%2FpublishedDB%2FpubProcedure?isTable=false&ifExists=true" -H "Content-Type:application/json"