Overview
These public interfaces are used in REST components. They are provided for implementing advanced functionality in your scripts. In order for you to use these interfaces in your project, you have to reference CozyRoc.SSISPlus.dll and RestSharp.dll libraries. Also include CozyRoc.SqlServer.SSIS, CozyRoc.Rest and RestSharp namespaces.
IConnection
When you call REST Connection Manager AcquireConnection method, it returns object implementing IConnection interface. This is the interface used for interaction with REST service.
Methods
Connects to REST service.
Closes the connection to REST service. Use always after you finish working with the service.
Returns true if connected to the service.
Get REST web service object. The result is RestClient object.
Returns list of available REST resources for specific operation. These are the method parameters:
- operation (uint) - It can be one of the options listed in the following table.
Value Description 0 Return records, which can be read. 1 Return records, which support adding. 2 Return records, which can be updated. 3 Return records, which support remove. 4 Return records, which support upsert.
Get object used to manage REST resource. The method returns IResource object. These are the method parameters:
- name (string) - resource name.
Properties
Specify REST configuration name.
Specify REST service URL.
Specify REST connection parameters. The format is [name]=[value]. Each parameter is separated with newline (\r\n).
Specify token storage type. "File" specifies that token is stored in a file. "Database" specifies that token is stored in a SQL Server database.
Specify token file path when storage type is "File" or database connection string when storage type is "Database".
Specify token identifier when storage type is "Database".
Specify token decryption password.
Specify the number of seconds before timing out session connect. The default value of this property is 100 seconds.
Specify if all clients should use the same connection. This property has the options listed in the following table.
Value | Description |
---|---|
True | All clients use same connection (default). |
False | Every client uses different connection. |
Specify log file name.
Specify how many requests per second are permitted.
Specify maximum request retry number. Specify 0 to disable retry.
Specify pause in seconds between retries. The default is 30 seconds.
Specify RegEx pattern to retry if error message matches.
Specify the name or IP address of the proxy server.
Specify the port number on the proxy server to use for the connection.
Specify user name to access the proxy server.
Specify password to access the proxy server.
Specify the certificate location. "File" specify the certificate is stored in a file. "CurrentUser" or "LocalMachine" specify the current user or the local machine certificate storage.
Specify the certificate path and file name when "File" location is used. Specify the certificate store name and the certificate thumbprint when a certificate storage is used. The format is "[store name],[thumbprint]".
Specify the password to decrypt the certificate file.
Specify the user agent for the HTTP requests.
IField
This interface is used to retrieve REST resource field information.
Properties
Returns field identifier.
Returns field name.
Returns true if field is resource key.
Returns field type.
Returns field length.
Returns field precision.
Returns field scale.
Returns true if field is read-only.
IResource
This interface is used for REST resource management.
Methods
Get resource fields. The method returns array of IField objects.
Constructs new in-memory REST resource instance.
Sets field value in a resource. These are the method parameters:
- instance (object) - resource instance.
- name (string) - field name.
- value (object) - field value.
Returns field value from resource object. These are the method parameters:
- instance (object) - resource instance.
- name (string) - field name.
Retrieves records from REST resource. The method returns array of resource objects. These are the method parameters:
- filter (string array) - array of filters. The filter format is [name]=[value].
- fields (string array) - list of fields to retrieve.
- iterator (ref string) - contains current start iteration position. After data is retrieved, the parameter will contain next iteration position.
- batchSize (int) - number of records to retrieve in one batch.
Creates records in resource. The method returns array of IStatus objects for each input object. These are the method parameters:
- list (object array) - array of objects to create.
- parameters (string array) - array of additional parameters. The parameter format is [name]=[value].
Updates existing records in resource. The method returns array of IStatus objects for each input object. These are the method parameters:
- list (object array) - array of objects with update data.
- parameters (string array) - array of additional parameters. The parameter format is [name]=[value].
Deletes records in resource. The method returns array of IStatus objects for each input object. These are the method parameters:
- list (object array) - array of objects to delete.
- parameters (string array) - array of additional parameters. The parameter format is [name]=[value].
Update or insert records in resource. The method returns array of IStatus objects for each input object. These are the method parameters:
- list (object array) - array of objects to upsert.
- parameters (string array) - array of additional parameters. The parameter format is [name]=[value].
IStatus
This interface is used for reporting back status.
Methods
Returns the REST resource identifier.
Returns the REST error code. If zero, there is no error.
Returns the REST status message.
Returns source JSON object.
Knowledge Base
COZYROC SSIS+ Components Suite is free for testing in your development environment.
A licensed version can be deployed on-premises, on Azure-SSIS IR and on COZYROC Cloud.