Qorus Integration Engine® Enterprise Edition 6.1.0_prod
|
class to call the system REST API from the client library More...
Public Member Methods | |
constructor (*hash< auto > opts, *softbool do_not_connect) | |
Creates the object with the given options. | |
constructor (string name, *softbool do_not_connect) | |
creates the object from the given remote connection name | |
constructor (string user, string pwd) | |
creates the object pointing to the first local listener for the current instance using the given user and password for connecting | |
setBasePath (string p) | |
sets the base path for REST requests | |
auto | restDo (string m, string path, auto args, *hash< auto > hdr, *hash< auto > opt, *reference< hash< auto > > info) |
makes the REST response and returns the deserialized body | |
auto | get (*hash< auto > opt, string path, auto args, *hash< auto > hdr, *reference< hash< auto > > info) |
issues an HTTP GET REST request against the server and returns the deserialized response | |
auto | put (*hash< auto > opt, string path, auto args, *hash< auto > hdr, *reference< hash< auto > > info) |
issues an HTTP PUT REST request against the server and returns the deserialized response | |
auto | post (*hash< auto > opt, string path, auto args, *hash< auto > hdr, *reference< hash< auto > > info) |
issues an HTTP POST REST request against the server and returns the deserialized response | |
auto | del (*hash< auto > opt, string path, auto args, *hash< auto > hdr, *reference< hash< auto > > info) |
issues an HTTP DELETE REST request against the server and returns the deserialized response | |
string | getRestErrorMessage (hash< auto > ex, *hash< auto > info, *reference< bool > down) |
returns a user-friendly error message when errors occur with REST messaging | |
bool | outputRestErrorMessage (hash< auto > ex, *hash< auto > info) |
outputs a user-friendly error string when errors occur with REST messaging | |
Public Member Methods inherited from OMQ::QorusSystemRestHelperBase | |
constructor (*hash< auto > opts, *softbool do_not_connect) | |
Creates the object with the given options. | |
setSchema () | |
Sets the REST validator to the latest version of the schema for the Qorus API. | |
setPublicSchema () | |
Sets the REST validator to the latest version of the public schema for the Qorus API. | |
Private Member Methods | |
autoSetUrl (*hash< auto > opts) | |
sets the URL automatically | |
setInternalUrl (string url) | |
Sets internal authentication info. | |
warning (string fmt,...) | |
prints a warning on the console | |
string | getBody (hash< auto > info) |
get the literal HTTP body from the info hash | |
showRestRequest (hash< auto > info, auto args, *hash< auto > opt) | |
outpus the REST request | |
showRestResponse (hash< auto > info, auto rv, *hash< auto > opt) | |
outpus the REST response | |
Additional Inherited Members | |
Public Attributes inherited from OMQ::QorusSystemRestHelperBase | |
const | Defaults |
default values for connection options | |
hash | conn_opts |
connection params | |
*string | api_version |
api version | |
*string | name |
connection name if known | |
class to call the system REST API from the client library
|
private |
sets the URL automatically
This method acquires an authentication token automatically that provides internal system access to Qorus APIs and data if no other explicit authentication information is available
OMQ::Client::QorusSystemRestHelper::constructor | ( | *hash< auto > | opts, |
*softbool | do_not_connect | ||
) |
Creates the object with the given options.
A connection is automatically made unless the do_not_connect argument is False
opts | options as follows:
|
do_not_connect | if True, then the object will be created in an unconnected state |
OMQ::Client::QorusSystemRestHelper::constructor | ( | string | name, |
*softbool | do_not_connect | ||
) |
creates the object from the given remote connection name
A connection is automatically made unless the do_not_connect argument is False
name | the remote connection name to use for the connection |
do_not_connect | if True, then the object will be created in an unconnected state |
OMQ::Client::QorusSystemRestHelper::constructor | ( | string | user, |
string | pwd | ||
) |
creates the object pointing to the first local listener for the current instance using the given user and password for connecting
user | the username for the connection |
pwd | the password for the connection |
auto OMQ::Client::QorusSystemRestHelper::del | ( | *hash< auto > | opt, |
string | path, | ||
auto | args, | ||
*hash< auto > | hdr, | ||
*reference< hash< auto > > | info | ||
) |
issues an HTTP DELETE
REST request against the server and returns the deserialized response
opt | output options: |
path | the URI path for the request |
args | any arguments to the REST request |
hdr | a hash of optional HTTP header info to add to the request |
info | an optional reference to a hash that will be used as an output variable giving a hash of request headers and other information about the HTTP request; if present the hash will contain the following keys:
|
auto OMQ::Client::QorusSystemRestHelper::get | ( | *hash< auto > | opt, |
string | path, | ||
auto | args, | ||
*hash< auto > | hdr, | ||
*reference< hash< auto > > | info | ||
) |
issues an HTTP GET
REST request against the server and returns the deserialized response
opt | output options: |
path | the URI path for the request |
args | any arguments to the REST request |
hdr | a hash of optional HTTP header info to add to the request |
info | an optional reference to a hash that will be used as an output variable giving a hash of request headers and other information about the HTTP request; if present the hash will contain the following keys:
|
string OMQ::Client::QorusSystemRestHelper::getRestErrorMessage | ( | hash< auto > | ex, |
*hash< auto > | info, | ||
*reference< bool > | down | ||
) |
returns a user-friendly error message when errors occur with REST messaging
ex | an exception hash |
info | an output hash from a REST call |
bool OMQ::Client::QorusSystemRestHelper::outputRestErrorMessage | ( | hash< auto > | ex, |
*hash< auto > | info | ||
) |
outputs a user-friendly error string when errors occur with REST messaging
ex | an exception hash |
info | an output hash from a REST call |
auto OMQ::Client::QorusSystemRestHelper::post | ( | *hash< auto > | opt, |
string | path, | ||
auto | args, | ||
*hash< auto > | hdr, | ||
*reference< hash< auto > > | info | ||
) |
issues an HTTP POST
REST request against the server and returns the deserialized response
opt | output options: |
path | the URI path for the request |
args | any arguments to the REST request |
hdr | a hash of optional HTTP header info to add to the request |
info | an optional reference to a hash that will be used as an output variable giving a hash of request headers and other information about the HTTP request; if present the hash will contain the following keys:
|
auto OMQ::Client::QorusSystemRestHelper::put | ( | *hash< auto > | opt, |
string | path, | ||
auto | args, | ||
*hash< auto > | hdr, | ||
*reference< hash< auto > > | info | ||
) |
issues an HTTP PUT
REST request against the server and returns the deserialized response
opt | output options: |
path | the URI path for the request |
args | any arguments to the REST request |
hdr | a hash of optional HTTP header info to add to the request |
info | an optional reference to a hash that will be used as an output variable giving a hash of request headers and other information about the HTTP request; if present the hash will contain the following keys:
|
auto OMQ::Client::QorusSystemRestHelper::restDo | ( | string | m, |
string | path, | ||
auto | args, | ||
*hash< auto > | hdr, | ||
*hash< auto > | opt, | ||
*reference< hash< auto > > | info | ||
) |
makes the REST response and returns the deserialized body
m | the HTTP method for the request (ex: "GET" ) |
path | the URI path for the request |
args | any arguments to the REST request |
hdr | a hash of optional HTTP header info to add to the request |
opt | output options: |
info | an optional reference to a hash that will be used as an output variable giving a hash of request headers and other information about the HTTP request; if present the hash will contain the following keys:
|