Application Programming Interface Guide > DSL API > Virtual Schemas > Examples
 
Examples
Create a Virtual Schema
 
curl -d "[\"CREATE VIRTUAL SCHEMA /services/databases/PUB3/sch1 SET ANNOTATION 'this is a published schema'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"
Create a Virtual Schema If not exists
 
curl -d "[\"CREATE VIRTUAL SCHEMA IF NOT EXISTS /services/databases/PUB3/sch1 SET ANNOTATION 'this is a published schema'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"
Rename & Relocate a Virtual schema
 
//only rename
curl -d "[\"ALTER VIRTUAL SCHEMA /services/databases/PUB3/sch1 RELOCATE TO /services/databases/PUB3/sch2 SET ANNOTATION 'renamed virtual schema'\"]"
-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 SCHEMA /services/databases/PUB3/sch2 RELOCATE TO /services/databases/publishedDB/sch3 SET ANNOTATION 'altered virtual schema'\"]"
-u "admin:admin"
-X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke"
-H "Content-Type:application/json"