Skip to main content

%REST.API

class %REST.API extends %Library.RegisteredObject

%REST.API is public interface to REST API Management

Method Inventory

Methods

classmethod CreateApplication(applicationName As %String, swagger As %DynamicObject = "", ByRef features, Output newApplication As %Boolean, Output internalError As %Boolean) as %Status
CreateApplication creates a REST application from the OpenAPI 2.0 swagger description of the application. CreateApplication replaces an existing REST application or creates a new REST application based from the specified OpenAPI 2.0 swagger definition. If the application does not exist, then a new default empty application is created. If the swagger argument = "", then the RESTSpec and dispatch classes are replaced with any empty application.
The method arguments hold values for:
applicationName, The name of the REST application which is the package name for the classes defining and implementing the application.
swagger, swagger is a JSON object, a URL or a filename specifying the swagger definition for this application or "" to create a new application.
features, features is a local of array of features which control application creation:
features("addPing"), If the request body is empty, addPing determines if a ping method should be added to the empty swagger spec.
features("strict"), If false, then only the swagger properties which are needed for code generation are checked. If true, then all swagger properties are checked. The default value is true.
features("keep"), If true, then the generated classes will be kept even in the case of error. This feature is meant primarily for testing.
The return values are in these method arguments: newApplication, newApplication is set to true if a new application case been created.
internalError, internalError is set to true in the case of an internal server error.
classmethod DeleteApplication(applicationName As %String) as %Status
This request deletes an application by deleting the specification class and the dispatch class that represent the application. The implementation class is not deleted.
The method arguments hold values for:
applicationName, The name of the REST application which is the package name for the classes defining and implementing the application.
classmethod GetAllRESTApps(Output appList As %ListOfObjects(ELEMENTTYPE="%REST.Application")) as %Status
GetAllRESTApps returns a list of all REST applications in all namespaces. The return values are in these method arguments: appList, A list of %REST.Application objects. The name argument is the REST application name.
classmethod GetAllWebRESTApps(Output appList As %ListOfObjects(ELEMENTTYPE="%REST.Application")) as %Status
GetAllWebRESTApps returns a list of all %CSP.REST based REST applications in all namespaces. The return values are in these method arguments: appList, A list of %REST.Application objects. The name argument is web application name.
classmethod GetApplication(applicationName As %String, Output swagger As %DynamicObject) as %Status
GetApplication returns the OpenAPI 2.0 swagger description of this application as a %DynamicObject. The application must be defined in the current namespace.
These method arguments hold values:
applicationName, The name of the REST application which is the package name for the classes defining and implementing the application.
The return values are in these method arguments: swagger, The %DynamicObject containing the OpenAPI 2.0 swagger document.
classmethod GetRESTApps(namespace As %String = "", Output appList As %ListOfObjects(ELEMENTTYPE="%REST.Application")) as %Status
GetRESTApps returns a list of all REST applications in the current namespace. These method arguments hold values:
namespace, The optional IRIS namespace as an additional filter. If not specified, then current namespace used.
The return values are in these method arguments: appList, A list of %REST.Application objects. The name argument is the REST application name.
classmethod GetWebRESTApplication(namespace As %String = "", webApplication As %String, Output swagger As %DynamicObject) as %Status
GetWebRESTApplication returns the OpenAPI 2.0 swagger description based on the UrlMap of %CSP.REST subclass for this REST application.
The method arguments hold values for:
webApplication, The name of the web application which to which this %CSP.REST based application is deployed.
The return values are in these method arguments: namespace, The IRIS namespace in which to perform the requested operation. The namespace defaults to web application's namespace.
swagger, The %DynamicObject containing the OpenAPI 2.0 swagger document.
classmethod GetWebRESTApps(namespace As %String = "", Output appList As %ListOfObjects(ELEMENTTYPE="%REST.Application")) as %Status
GetWebRESTApps returns a list of all %CSP.REST based REST applications in the specified namespace.
These method arguments hold values:
namespace, The optional IRIS namespace as an additional filter. If not specified, then current namespace used.
The return values are in these method arguments: appList, A list of %REST.Application objects. The name argument is web application name.
classmethod GetWebURLForApplication(applicationName As %String)
This request returns the web application name to which this application is deployed. If the application is deployed to multiple web applications, then the name of the first web application is returned. If the application is not deployed, then "" is returned.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab