![]() |
Qorus Integration Engine® Enterprise Edition 6.0.4_dev
|
Remote development client class. More...
Public Member Methods | |
constructor (string username, string password, *hash< auto > connection_options) | |
Constructs RemoteDevelopment Client object. More... | |
constructor (*hash< auto > connection_options) | |
Constructs RemoteDevelopment Client object. More... | |
setLog (code log) | |
Sets log method that will be used in the RemoteDevelopment Client. More... | |
list< string > | listFiles (string directory, bool truncate=False, int max_files=MAX_FILES, *string regex) |
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, *string regex) |
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... | |
Remote development client class.
Examples of how the class can be used: 1) Create Remote Development Client object:
2) Get the file list from directory:
3) Obtain token if needed (can be skipped):
3) Create the request:
4) Post the request asynchronously and wait:
RemoteDevelopment::Client::constructor | ( | *hash< auto > | connection_options | ) |
Constructs RemoteDevelopment Client object.
connection_options | according to QorusSystemRestHelper constructor:
|
RemoteDevelopment::Client::constructor | ( | string | username, |
string | password, | ||
*hash< auto > | connection_options | ||
) |
Constructs RemoteDevelopment Client object.
username | |
password | |
connection_options | according to QorusSystemRestHelper constructor:
|
list< hash< auto > > RemoteDevelopment::Client::createFileList | ( | list< string > | file_names, |
string | directory = "" |
||
) |
Creates file list needed for deployment/release request from the list of file names.
file_names | list of the file names. |
directory | containing needed files. Fill in case file names list doesn't contain path. |
list< hash< auto > > RemoteDevelopment::Client::createFileListFromDirectory | ( | string | directory, |
bool | truncate = False , |
||
int | max_files = MAX_FILES , |
||
*string | regex | ||
) |
Creates file list needed for deploy/release requests from the given directory.
directory | containing needed files. |
truncate | if True then truncate number of files to max_files param. |
max_files | maximum of files that should be taken from the directory (30 by default). |
regex | an optional regex for matching files. |
hash< auto > RemoteDevelopment::Client::del | ( | Request | request, |
*reference< hash > | info | ||
) |
Delete the given remote development request. Request must contain id.
request | object reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest. |
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:
|
hash< auto > RemoteDevelopment::Client::getStatus | ( | Request | request, |
*reference< hash > | info | ||
) |
Gets status of the given remote development request. Request must contain id.
request | object reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest. |
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 RemoteDevelopment::Client::getUrlForRequest | ( | Request | request | ) |
Returns API URL of the given request.
request | object reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest, TestRequest. |
list< string > RemoteDevelopment::Client::listFiles | ( | string | directory, |
bool | truncate = False , |
||
int | max_files = MAX_FILES , |
||
*string | regex | ||
) |
Lists files from the given directory.
directory | containing needed files. |
truncate | if True then truncate number of files to max_files param. |
max_files | maximum number of files to be returned. |
regex | an optional regex for matching files. |
*string RemoteDevelopment::Client::obtainTokenIfNeeded | ( | string | username, |
string | password | ||
) |
Returns a token using username and password if authentication is needed to connect to the Qorus.
username | |
password |
hash< auto > RemoteDevelopment::Client::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.
request | object reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest. |
time | timeout, = 0 by default. If time = 0 then the request is created asynchronously otherwise it will wait when request is finished or timeout expires. |
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:
|
TIMEOUT-ERROR | in case the request is not finished within the given timeout (only if timeout > 0). |
RemoteDevelopment::Client::setLog | ( | code | log | ) |
Sets log method that will be used in the RemoteDevelopment Client.
log | closure that will be called when Client produces some logs |
hash< auto > RemoteDevelopment::Client::waitUntilRequestIsFinished | ( | Request | request, |
timeout | time, | ||
*reference< hash > | info | ||
) |
Wait until remote development request is finished. Request must contain id.
request | object reference to one of the supported types: DeployRequest, DeleteRequest, ReleaseRequest. |
time | in which the request should be finished if not exception is thrown. |
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:
|
TIMEOUT-ERROR | in case the request is not finished within the given timeout (only if timeout > 0). |