IBM Data Server Gateway for OData V1.0
The IBM Data Server Gateway for OData V1.0 provides below new features:
Download
You can download IBM Data Server Gateway for OData V 1.0 from here
Support for $skip
With the system query option $skip
, number of entries can be specified that should be ignored at the beginning of a collection. So if a user specifies $skip=n
then the IBM OData Gateway service will return the list of entries starting at position n+1
For example, to exclude the first four employee details :
http://localhost:9080/ODataOne/ODataService/EmployeeDataService/EMPLOYEES?$format=json&$skip=4
Support for $orderby
The order of entries can be specified when requesting, with using the system query option $orderby.
The order can be ascending or descending:
$orderby=<propertyName> asc
$orderby=<propertyName> desc
For example:
To sort by Employee Name in ascending order
http://localhost:9080/ODataOne/ODataService/EmployeeDataService/EMPLOYEES?$format=json&$orderby=NAME asc
To sort by Employee Name descending order
http://localhost:9080/ODataOne/ODataService/EmployeeDataService/EMPLOYEES?$format=json&$orderby=NAME desc
Create a service with user given service Id
While creating a service via GUI, in Service Id for the OData Service Generation form, uncheck the Auto generate Service id checkbox, enter the service Id and follow the form to create the service.

Service Administration Dashboard
The service administration dashboard provides a web interface to manage services. Below administrative tasks are supported:
Dashboard Login:
Open the below link in browser:
http://localhost:9080/ODataOne/dashboard
http://<server_name>:<port>/ODataOne/dashboard

Enter the database name (under the services were created), host name, port, Db2 Administrator user having DBADMAUTH privilege and password.
After entering valid details, click on “Login” button.
List all the services in tabular format.
After your login is successful, all the services will get displayed in tabular format with client-side pagination.
Each column header has a sort option. The table provides an option to specify the number of services to be shown under each page. The table also provides a search option to find a service in the list.

Edit a Service
Select a service by clicking on radio button in the table, and then click on Edit Service from the top menu.
Edit Service Details form will get opened with the selected service details.

In Edit Service Details form, you can update the database name, hostname, port number, schema, Db2 user name for OData service, Use SSL, and Add/remove tables for the selected service.
After updating information, click on Ok button to save the changes.
Add tables to a service
To add tables, click on the Add Table button, below form will get opened with listing all the tables present in the selected schema.
Select tables by clicking on the check boxes to add in them in the service and then click Ok button to save the changes.

Remove tables from a service
To remove a table from a service, select the table you want to remove from the service and click on the Remove Table button and then click Ok button to save the changes.

Change Db2 user password of a service
To change the Db2 user password for a service, select the service by clicking on the radio button in the table and click on Change Password from top menu. The Change Service Password form will get opened. In the form, enter the old and new password and click then Ok button to save the changes.

Change the Id of a service
To change the Id of a service, select the service by clicking on the radio button in the table and then click on the Change Service Id from top menu. The Change Service Id form will get opened. In the form, enter the new service Id and then click Ok button to save changes.
The new service Id must be unique and alphanumeric.

Disable a Service
A service can be disabled, if is in enable state. After disabling the service, it will be in disabled status and will not work until it is enabled again.
To disable a service, select the service by clicking on the radio button in the table, if it is enable, you will see Disable Service menu enabled, click on it. The below confirmation message will get displayed. Click on Ok button to disable the service.

Enable a Service
A service can be enabled, if it is in disable state. After enabling the service it will be in enable status and will continue to work until you disable it or delete it.
To enable a service, select the service by clicking on the radio button in the table, if it was disabled, you will see Enable Service in the top menu is enabled, click on it. The below confirmation message will get displayed. Click on Ok button to enable the service.

Delete a Service
A service can be deleted, if it is no longer required. Once a service is deleted, it will stop working. It will get deleted and cannot be recovered.
To delete a service, select the service by clicking on the radio button in the table, and click on Delete Service in the top menu. Below confirmation message will get displayed, click on Ok button to delete the service.

Restart a service
A service can be restarted. The restarting service is useful, when a table's metadata is changed in Db2 server and service to be refreshed with the new metadata.
To restart a service, select the service via clicking on the radio button in table, then click on the Restart Service from top menu. Below confirmation message will get displayed, click on Ok button to restart the service.

IBM OData Connector APIs to manage services
The services can also be managed programmatically by calling the IBM OData Connector APIs.
Below service administration operations are supported by APIs:
Create a service with user given service Id
Service can be created by calling createService API.
To create a service via API, invoke IBM OData connector API following below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/createService
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"tablenames": ["table1", "table2"],
"serviceId": "<serviceId_value>"
}
5. Submit the request.
Note, the last attribute in JSON String “service Id”, if it is specified, the service will be created by this name. The service Id should be unique and alphanumeric.
If you do not add the “service Id” attribute in JSON string, IBM OData Gateway server will generate the service id automatically.
Edit a service to update database credentials, add/remove tables
The database details host name, database name, port, Db2 user name, Schema, Use SSL can be updated and tables can be added or removed from the service by calling update API.
Note, When calling this API, you should specify all the tables names that were defined while creating the service.
To add tables, add the table names, in JSON array attribute named "tablenames".
To remove the tables, remove the tables name from the JSON array attribute named "tablenames".
To update the changes via API, invoke IBM OData connector API following below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/update
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"tablenames": ["table1", "table2"],
"serviceId": "<serviceId_value>"
}
5. Submit the request.
Change the Db2 user password of a service
The Db2 user password of a service can be changed by calling the changePassword API.
To change the Db2 service password via IBM OData connector API, follow below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/changePassword
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header. The JSON attribute named as "db2ServicePasswordNew" must be added in JSON string to specify the new password.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"serviceId": "<serviceId_value>",
"db2ServicePasswordNew": "<new_password>"
}
5. Submit the request.
Change the Id of a service
The service Id can be renamed by calling changeServiceId API.
To rename a service via IBM OData connector API, follow below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/changeServiceId
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header. The JSON attribute named as "serviceIdNew" must be added in JSON string to specify the new service Id.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"serviceId": "<serviceId_value>",
"serviceIdNew": "<new_serviceId>"
}
5. Submit the request.
Disable a service
The service can be disabled by calling disable API. After a service is disabled, it will not be accessible until it is enabled.
To disable a service, invoke via IBM OData connector API follow below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/disable
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"serviceId": "<serviceId_value>"
}
5. Submit the request.
Enable a service
A service can be enabled by calling the enable API. After a service is enabled, it will be accessible.
To enable a service via IBM OData connector API, follow below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/enable
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"serviceId": "<serviceId_value>"
}
5. Submit the request.
Delete a Service
A service can be deleted by calling delete API.
To delete a service via IBM OData connector API, follow below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/delete
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"serviceId": "<serviceId_value>",
}
5. Submit the request.
Restart a service
A service can be restarted by calling restart API. This is useful when any change is done in table's metadata and service has to be refreshed.
To Restart a service via IBM OData connector API, follow below steps:
1. Create a http request with URL as http://<host>:<port>/ODataOne/restart
2. Set request Content-Type as application/json.
3. Set http request method to POST.
4. Create a JSON string in below format and set it in Request Header.
{
"database": "<database_name>",
"host": "<database_host>",
"port": "<database_port>",
"db2AdminUser": "<db2_admin_user>",
"db2AdminPassword": "<db2_admin_password>",
"db2ServiceUser": "<db2_service_user>",
"db2ServicePassword": "<db2_service_password>",
"ssl": false,
"schema": "<schema_name>",
"serviceId": "<serviceId_value>"
}
5. Submit the request.
For more information on IBM Data server Gateway for OData refer this.
#DataManagementGlobal#DataServerDrivers