Qorus Integration Engine®  4.1.4.p4_git
RemoteDevelopment Namespace Reference

Main namespace for QorusRemoteDevelopmentClient module. More...

Classes

class  Client
 Remote development client class. More...
 

Functions

 constructor (*string username=NOTHING, *string password=NOTHING, *hash connection_options=NOTHING)
 Constructs RemoteDevelopment Client object. More...
 
 setLog (code log)
 Sets log method that will be used in the RemoteDevelopment Client. More...
 
list< stringlistFiles (string directory, bool truncate=False, int max_files=MAX_FILES)
 Lists files from the given directory. More...
 
list< hash< auto > > createFileList (list< string > file_names, string directory="")
 Creates file list needed for deployment/release request from the list of file names. More...
 
list< hash< auto > > createFileListFromDirectory (string directory, bool truncate=False, int max_files=MAX_FILES)
 Creates file list needed for deploy/release requests from the given directory. More...
 
string getUrlForRequest (Request request)
 Returns API URL of the given request. More...
 
*string obtainTokenIfNeeded (string username, string password)
 Returns a token using username and password if authentication is needed to connect to the Qorus. More...
 
hash< auto > waitUntilRequestIsFinished (Request request, timeout time, *reference< hash > info)
 Wait until remote development request is finished. Request must contain id. More...
 
hash< auto > post (Request request, timeout time=0s, *reference< hash > info)
 Post the given remote development request. WARN: the function will fill the id in the request. More...
 
hash< auto > del (Request request, *reference< hash > info)
 Delete the given remote development request. Request must contain id. More...
 
hash< auto > getStatus (Request request, *reference< hash > info)
 Gets status of the given remote development request. Request must contain id. More...
 

Detailed Description

Main namespace for QorusRemoteDevelopmentClient module.

Function Documentation

◆ constructor()

RemoteDevelopment::constructor ( *string  username = NOTHING,
*string  password = NOTHING,
*hash  connection_options = NOTHING 
)

Constructs RemoteDevelopment Client object.

Parameters
username
password
connection_optionsaccording to QorusSystemRestHelper constructor:
  • api_version: the REST API version (defaults to the latest version)
  • connect_timeout: the connect timeout value in milliseconds
  • timeout: the socket I/O timeout value in milliseconds
  • url: the target URL

◆ createFileList()

list<hash<auto> > RemoteDevelopment::createFileList ( list< string file_names,
string  directory = "" 
)

Creates file list needed for deployment/release request from the list of file names.

Parameters
file_nameslist of the file names.
directorycontaining needed files. Fill in case file names list doesn't contain path.
Returns
list of hashes containing file names and their content.

◆ createFileListFromDirectory()

list<hash<auto> > RemoteDevelopment::createFileListFromDirectory ( string  directory,
bool  truncate = False,
int  max_files = MAX_FILES 
)

Creates file list needed for deploy/release requests from the given directory.

Parameters
directorycontaining needed files.
truncateif True then truncate number of files to max_files param.
max_filesmaximum of files that should be taken from the directory (30 by default).
Returns
list of hashes containing file names and their content.

◆ del()

hash<auto> RemoteDevelopment::del ( Request  request,
*reference< hash info 
)

Delete the given remote development request. Request must contain id.

Parameters
requestobject reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest.
infoan 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:
  • headers: a hash of outgoing HTTP request headers
  • request-uri: the request URI string sent (ex: "POST /services/async/38.0/job HTTP/1.1")
  • body-content-type: the outgoing message body Mime Content-Type value
  • response-headers: a hash of incoming HTTP headers in the response
  • chunked: set to True if the response was received with chunked transfer encoding
  • response-code: the HTTP response code
  • response-body: the raw message body in the response (after any content decoding)
  • response-serialization: the type of message serialization in the response; see DataSerializationOptions for possible values when used with the null REST schema validator
  • request-body: the raw message body in the request (before any content encoding)
  • request-serialization: the type of message serialization in the request; see DataSerializationOptions for possible values when used with the null REST schema validator
Returns
hash containing cancel response.

◆ getStatus()

hash<auto> RemoteDevelopment::getStatus ( Request  request,
*reference< hash info 
)

Gets status of the given remote development request. Request must contain id.

Parameters
requestobject reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest.
infoan 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:
  • headers: a hash of outgoing HTTP request headers
  • request-uri: the request URI string sent (ex: "POST /services/async/38.0/job HTTP/1.1")
  • body-content-type: the outgoing message body Mime Content-Type value
  • response-headers: a hash of incoming HTTP headers in the response
  • chunked: set to True if the response was received with chunked transfer encoding
  • response-code: the HTTP response code
  • response-body: the raw message body in the response (after any content decoding)
  • response-serialization: the type of message serialization in the response; see DataSerializationOptions for possible values when used with the null REST schema validator
  • request-body: the raw message body in the request (before any content encoding)
  • request-serialization: the type of message serialization in the request; see DataSerializationOptions for possible values when used with the null REST schema validator
Returns
hash containing the request status.

◆ getUrlForRequest()

string RemoteDevelopment::getUrlForRequest ( Request  request)

Returns API URL of the given request.

Parameters
requestobject reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest, TestRequest.
Returns
string with a token if authentication is needed otherwise NOTHING.

◆ listFiles()

list<string> RemoteDevelopment::listFiles ( string  directory,
bool  truncate = False,
int  max_files = MAX_FILES 
)

Lists files from the given directory.

Parameters
directorycontaining needed files.
truncateif True then truncate number of files to max_files param.
max_filesmaximum number of files to be returned.
Returns
list of file names.

◆ obtainTokenIfNeeded()

*string RemoteDevelopment::obtainTokenIfNeeded ( string  username,
string  password 
)

Returns a token using username and password if authentication is needed to connect to the Qorus.

Parameters
username
password
Returns
string with a token if authentication is needed otherwise NOTHING

◆ post()

hash<auto> RemoteDevelopment::post ( Request  request,
timeout  time = 0s,
*reference< hash info 
)

Post the given remote development request. WARN: the function will fill the id in the request.

Parameters
requestobject reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest.
timetimeout, = 0 by default. If time = 0 then the request is created asynchronously otherwise it will wait when request is finished or timeout expires.
infoan 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:
  • headers: a hash of outgoing HTTP request headers
  • request-uri: the request URI string sent (ex: "POST /services/async/38.0/job HTTP/1.1")
  • body-content-type: the outgoing message body Mime Content-Type value
  • response-headers: a hash of incoming HTTP headers in the response
  • chunked: set to True if the response was received with chunked transfer encoding
  • response-code: the HTTP response code
  • response-body: the raw message body in the response (after any content decoding)
  • response-serialization: the type of message serialization in the response; see DataSerializationOptions for possible values when used with the null REST schema validator
  • request-body: the raw message body in the request (before any content encoding)
  • request-serialization: the type of message serialization in the request; see DataSerializationOptions for possible values when used with the null REST schema validator
Returns
hash containing creation response from the Qorus in case time is set to 0, otherwise returns status of the finished request.
Exceptions
TIMEOUT-ERRORin case the request is not finished within the given timeout (only if timeout > 0).

◆ setLog()

RemoteDevelopment::setLog ( code  log)

Sets log method that will be used in the RemoteDevelopment Client.

Parameters
logclosure that will be called when Client produces some logs

◆ waitUntilRequestIsFinished()

hash<auto> RemoteDevelopment::waitUntilRequestIsFinished ( Request  request,
timeout  time,
*reference< hash info 
)

Wait until remote development request is finished. Request must contain id.

Parameters
requestobject reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest.
timein which the request should be finished if not exception is thrown.
infoan 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:
  • headers: a hash of outgoing HTTP request headers
  • request-uri: the request URI string sent (ex: "POST /services/async/38.0/job HTTP/1.1")
  • body-content-type: the outgoing message body Mime Content-Type value
  • response-headers: a hash of incoming HTTP headers in the response
  • chunked: set to True if the response was received with chunked transfer encoding
  • response-code: the HTTP response code
  • response-body: the raw message body in the response (after any content decoding)
  • response-serialization: the type of message serialization in the response; see DataSerializationOptions for possible values when used with the null REST schema validator
  • request-body: the raw message body in the request (before any content encoding)
  • request-serialization: the type of message serialization in the request; see DataSerializationOptions for possible values when used with the null REST schema validator
Returns
hash containing status of the finished request.
Exceptions
TIMEOUT-ERRORin case the request is not finished within the given timeout (only if timeout > 0).