Catalog

Using the Catalog REST API, you can create, delete, update and read virtual (published) catalogs. The operations that can be performed on the virtual catalogs are:

GET/catalog
PUT/catalog
POST/catalog
DELETE/catalogs
DELETE/catalog

GET/catalog

This API is used to get virtual catalog summary and/or detailed information.

Parameters

Name

Deacription

Parameter Type

Data Type

path

Virtual catalog path

query

string

summary

Fetch virtual catalog summary

query

boolean

Example to get summary of virtual catalog "/services/databases/publishedDB/cat1"

curl -X GET -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual?path=%2Fservices%2Fdatabases%2FpublishedDB%2Fcat1&summary=true" -H "Content-Type:application/json"

Example to get detailed information about a virtual catalog "/services/databases/publishedDB/cat1"

curl -X GET -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual?path=%2Fservices%2Fdatabases%2FpublishedDB%2Fcat1" -H "Content-Type:application/json"

PUT/catalog

This API is used to update virtual catalogs.

Parameters

None.

Request Body

Example Value - Schema

[
{
"path": "string",
"annotation": "string",
"newPath": "string",
"ifNotExists": true
}
]

Example to update annotation and rename a published catalog "/services/databases/publishedDB/cat1 to /services/databases/ publishedDB/cat2"

curl -X PUT -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"annotation\":\"Edited published catalog created using REST api\", \"newPath\":\"/services/databases/publishedDB/cat2\"  }]" 

Example to update annotation and relocate a published catalog "/services/databases/publishedDB/cat2 to /services/databases/ publishedDB1/cat2"

curl -X PUT -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat2\", \"annotation\":\"Edited published catalog created using REST api\", \"newPath\":\"/services/databases/publishedDB1/cat2\" }]"

Example to unset annotation of a published catalog "/services/databases/publishedDB/cat1"

curl -X PUT -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"annotation\":\"null\"}]"

POST/catalog

This API is used to create virtual catalogs.

Parameters

None.

Request Body

Example Value - Schema

[
{
"path": "string",
"annotation": "string",
"newPath": "string",
"ifNotExists": true
}
]

Example to create virtual catalog "/services/databases/publishedDB/cat1"

curl -X POST -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"annotation\":\"This is a published catalog created using REST api\" }]" 

Example to create virtual catalog "/services/databases/publishedDB/cat1" with "ifNotExists" syntax

curl -X POST -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/json" -d "[{\"path\":\"/services/databases/publishedDB/cat1\", \"ifNotExists\":true, \"annotation\":\"This is a published catalog created using REST api\" }]" 

DELETE/catalogs

This API is used to delete virtual catalogs.

Parameters

Name

Description

Parameter Type

Data Type

ifExists

If the catalogs exist

query

boolean

Request Body

Example Value - Schema

[
"string"
]

Example to delete virtual catalogs "/services/databases/publishedDB/cat1" and "/services/databases/publishedDB/cat2"

Sample CURL Invocation

curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual" -H "Content-Type:application/ json" -d "[\"/services/databases/publishedDB/cat1\", \"/services/databases/ publishedDB/cat2\"]" 

Sample CURL Invocation with ifExists

curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual?ifExists=true" -H "Content-Type:application/json" -d "[\"/shared/examples/publishedDB/cat2\"]"

DELETE/catalog

This API is used to delete a specific virtual catalog.

Parameters

Name

Description

Parameter Type

Data Type

ifExists

If the catalogs exist

query

boolean

Request Body

Example Value - Schema

[
"string"
]

Example to delete virtual catalog

curl -X DELETE -u admin:admin  "http://localhost:9400/rest/catalog/v1/virtual/{catalogPath}?ifExists=true"  -H "Content-Type: application/json"

curl -X DELETE -u admin:admin "http://localhost:9400/rest/catalog/v1/virtual/%2Fservices%2Fdatabases%2Fpubdb%2Fcatalog1?ifExists=true" -H "Content-Type:application/json"