Application Programming Interface Guide > DSL API > Data Views > Examples
 
Examples
Create view with only sql
curl -d "[\"CREATE DATA VIEW /shared/examples/myview DEFINE AS SELECT OrderID FROM /shared/examples/ViewOrder\"]" -u "admin:admin" -X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke" -H "Content-Type:application/json"
Create view with sql and annotation
curl -d "[\"CREATE DATA VIEW /shared/examples/myview DEFINE AS SELECT OrderID FROM /shared/examples/ViewOrder SET ANNOTATION 'this view is created using DSL'\"]" -u "admin:admin" -X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke" -H "Content-Type:application/json"
Create data view IF NOT EXISTS with sql and annotation
curl -d "[\"CREATE DATA VIEW IF NOT EXISTS /shared/examples/myview DEFINE AS SELECT OrderID FROM /shared/examples/ViewOrder SET ANNOTATION 'this view is created using DSL'\"]" -u "admin:admin" -X POST "http://localhost:9400/rest/execute/v1/actions/dsl/invoke" -H "Content-Type:application/json"