4 Replies Latest reply on Nov 19, 2018 9:56 AM by Steven Hawkins

    Auto Generate Rest Service from DDL based VBD

    gadeyne.bram Master

      Hi,

       

      I'm wondering if this should work with a DDL based VBD.

       

      In my schema I have this to declare some virtual view.

       

      SET SCHEMA izisviews;
      
      CREATE VIEW tv_numbers (
        nr integer not null,
        primary key(nr)
      ) as
      SELECT 0 AS nr
      UNION SELECT 1
      UNION SELECT 2
      UNION SELECT 3
      UNION SELECT 4
      UNION SELECT 5
      UNION SELECT 6
      UNION SELECT 7
      UNION SELECT 8
      UNION SELECT 9;

       

      A bit further I've declared a procedure that I would like to be available using REST.

       

      SET SCHEMA rest;
      
      CREATE VIRTUAL PROCEDURE restnumbers()
      OPTIONS (
          "teiid_rest:method" 'GET',
          "teiid_rest:uri" '/restnumber',
          "teiid_rest:produces" 'json',
          "teiid_rest:charset" 'UTF-8',
          "teiid_rest:auto-generate" 'true'
      )
      AS
      BEGIN
          select *
          from izisviews.tv_numbers;
      END

       

      My vdb is called "vdb" and the version is currently 1.2.0 so I tried accessing http://localhost:8080/vdb_1.2.0/restnumber but I receive a 404 message. I also see no specific wards being deployed separately.

       

      How should this be enabled?