How to create a restful api in Intersystems cache with %CSP.REST

Hello Guys,

Can you please guide me to create a RESTful API service in our cache (using intersystems cache kit) with CSP (Cache Server Pages ) object script.

Class REST.NativeDIspatcher Extends %CSP.REST
{

XData UrlMap [XMLNamespace = "http://www.native.rest.com/urlmap" ]
{
<Routes>
   <!--  <Route Url="/:name" Method="GET" Call="displaySystem" Cors="false" /> -->   
     <Route Url="/:ostype" Method="GET" Call="externalFreeze" Cors="false" />  
  </Routes>
 }

ClassMethod externalFreeze(Ostype as %String) as %Status{
        set status = ##Class(Backup.General).ExternalFreeze()
           WRITE "EXTERNAL FREEZE RESPONSE FOUND " _status
           QUIT $$$OK
    }

}

I had written above code snippet but, I need to explore more using %CSP.REST object script language.

Can anyone suggest/ share sample code snippet to create a REST service web application using %CSP.REST object script language.

Thanks,

Chandrasekhar Reddy,

Email: cbandi@purestorage.com | +91 9880318877  

  • 0
  • 0
  • 354
  • 0
  • 2

Answers

The online documentation is here:

There is some training in the InterSystems Learning portal (you'll need to enrol/login):

e.g.