Application Programming Interface Guide > DSL API > Virtual Catalogs > Examples
 
Examples
Create a Virtual Catalog
curl -d "[\"CREATE VIRTUAL CATALOG /services/databases/PUB3/cat1 SET ANNOTATION 'this is a published catalog'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"
Create a Virtual Catalog If not exists
curl -d "[\"CREATE VIRTUAL CATALOG IF NOT EXISTS /services/databases/PUB3/cat1 SET ANNOTATION 'this is a published catalog'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"
Rename & Relocate a Virtual catalog
//only rename
curl -d "[\"ALTER VIRTUAL CATALOG /services/databases/PUB3/cat1 RELOCATE TO /services/databases/PUB3/cat2 SET ANNOTATION 'renamed virtual catalog'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"
//Both rename and relocate
curl -d "[\"ALTER VIRTUAL CATALOG /services/databases/PUB3/cat2 RELOCATE TO /services/databases/publishedDB/cat3 SET ANNOTATION 'altered virtual catalog'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"