Overview
Decision Center exposes a REST API that you can use to build, test, and deploy decision services. With this REST API, you can easily set up and enforce a continuous deployment process by using the programming language of your choice.
- Retrieve the decision services of your repository, their branches, deployment configurations, and test suites.
- Retrieve the list of servers available.
- Build, download, or deploy a RuleApp for a deployment configuration.
- Run a test suite.
- Import and export decision services.
- Manage decision services that use the decision governance framework.
- View the contents of your repository.
Restrictions based on user roles and permissions also apply to the Decision Center REST API. See Decision Center groups of users.
curl http://localhost:9090/decisioncenter-api/v1/decisionservices --user rtsAdmin:rtsAdmin
{
"elements": [
{
"id": "77072920-2ec3-11db-bb3d-a34db576b043",
"internalId": "brm.RuleProject:1:1",
"name": "miniloan-rules",
"buildMode": "DecisionEngine"
},
{
"id": "4d9b5dc7-8a7e-404d-a05d-59023707c7d9",
"internalId": "brm.RuleProject:2:2",
"name": "AutoQuote",
"buildMode": "DecisionEngine"
}
],
"totalCount": 2,
"number": 0,
"size": 2
}
Packaging and deployment
On Liberty profile and Tomcat application servers, the REST API is bundled as a stand-alone web application (WAR file) that can be deployed independently from the Business console and Enterprise console. For more information, see Deploying the Decision Center WAR files on Liberty profile, or Deploying the Decision Center WAR files on Tomcat.
If you are using another application server, such as WebSphere® Application Server, the REST API is deployed when the Decision Center EAR file is deployed.
This web application is completely stateless and can be deployed behind a load balancer for scalability and reliability purposes, without any session affinity. When it is deployed, you can access the Swagger user interface at http://localhost:<port_number>/decisioncenter-api. This interface exposes a view of the available endpoints, their documentation, and a Try it out button to test each endpoint.
Authentication
/about
, require authentication. You can use basic
authentication by entering your Decision Center
user name and password. For example:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices --user rtsAdmin:rtsAdmin
/token(POST)
endpoint, for
example:
token=`curl -X POST --user dcAdmin:dcAdmin 'http://localhost:9090/decisioncenter-api/v1/token?appName=MyAppd&date=2020-09-13T10%3A48%3A32.698%2B0000'
`curl 'http://localhost:9090/decisioncenter-api/v1/decisionservices --header "Authorization: Bearer ${token}"
When you use the token, you must enter the keyword Bearer
before you provide the
token.
To cancel a token, you can either provide an expiration date when you generate the token, or
revoke the token at any time by using the /token(DELETE)
endpoint.
Errors
{
"error": "IlrConnectException",
"reason": "Could not look up datasource named 'mydatasource'",
"status": "BAD_REQUEST",
"details": [
"Could not look up datasource named 'mydatasource'",
"Name [mydatasource] is not bound in this Context. Unable to find [mydatasource]."
]
}
Filtering and pagination
/decisionservices
,
can be paginated. By default, all elements of the collection are returned, but you can specify a
page size and a page number to retrieve only a subset of the collection. For example:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices?page=2&size=20 --user rtsAdmin:rtsAdmin
q
parameter:
curl http://localhost:9090/decisioncenter-api/v1/decisionservices?q=name:AutoQuote --user rtsAdmin:rtsAdmin