@@ -31,20 +31,21 @@ The following environment variables need to be set:
31
31
| Name | Description | Value for Docker |
32
32
| - | - | - |
33
33
| DC_API_URL | Decision Center API URL | http://localhost:9060/decisioncenter-api |
34
- | DSR_URL | Decision Server Runtime URL | http://localhost:9060/decisioncenter/DecisionService) |
34
+ | DSR_URL | Decision Server Runtime URL | http://localhost:9060/decisioncenter/DecisionService |
35
35
36
36
<!-- markdown-link-check-enable-->
37
37
38
- ### 2. Deploy the Decision Service
38
+ ### 2. Deploy the ` Loan Validation Service ` Decision Service
39
+
40
+ If the ` Loan Validation Service ` Decision Service is not available in Decision Center yet, run:
39
41
40
- If not already done, deploy the ` Loan Validation Service ` Decision Service into Decision Center by running:
41
42
``` bash
42
43
# configure the Authentication (using Basic Auth)
43
- auth_credentials=(--user \ " odmAdmin:odmAdmin\ " )
44
+ export auth_credentials=(--user " odmAdmin:odmAdmin" )
44
45
45
- decision_service_name=" Loan Validation Service"
46
- filename=" ${decision_service_name// / _} .zip" # replace spaces by underscores
47
- filename_urlencoded=" ${decision_service_name// /% 20} .zip" # replace spaces by %20
46
+ export decision_service_name=" Loan Validation Service"
47
+ export filename=" ${decision_service_name// / _} .zip" # replace spaces by underscores
48
+ export filename_urlencoded=" ${decision_service_name// /% 20} .zip" # replace spaces by %20
48
49
49
50
# download the Decision Service zip file
50
51
curl -sL -o ${filename} " https://github.com/DecisionsDev/odm-for-dev-getting-started/blob/master/${filename_urlencoded} ?raw=1"
@@ -55,21 +56,21 @@ curl -sk -X POST ${auth_credentials[@]} -H "accept: application/json" -H "Conten
55
56
" ${DC_API_URL} /v1/decisionservices/import"
56
57
```
57
58
58
- ## Run the sample
59
+ ## Running the sample
59
60
60
61
``` bash
61
62
# configure the Authentication (using Basic Auth)
62
- export auth_credentials=(--user ' odmAdmin:odmAdmin' )
63
+ export auth_credentials=(--user " odmAdmin:odmAdmin" )
63
64
64
65
# get the ID of the Decision Service in Decision Center
65
66
export decision_service_name=" Loan Validation Service"
66
- get_decisionService_result=$( curl -sk -X GET ${auth_credentials[@]} -H " accept: application/json" " ${DC_API_URL} /v1/decisionservices?q=name%3A${decision_service_name// /% 20} " )
67
- decisionServiceId=$( echo ${get_decisionService_result} | jq -r ' .elements[0].id' )
67
+ export get_decisionService_result=$( curl -sk -X GET ${auth_credentials[@]} -H " accept: application/json" " ${DC_API_URL} /v1/decisionservices?q=name%3A${decision_service_name// /% 20} " )
68
+ export decisionServiceId=$( echo ${get_decisionService_result} | jq -r ' .elements[0].id' )
68
69
69
70
# get the ID of the deployment configuration in Decision Center
70
71
export deployment_name=" production deployment"
71
- get_deployment_result=$( curl -sk -X GET ${auth_credentials[@]} -H " accept: application/json" " ${DC_API_URL} /v1/decisionservices/${decisionServiceId} /deployments?q=name%3A${deployment_name// /% 20} " )
72
- deploymentConfigurationId=$( echo ${get_deployment_result} | jq -r ' .elements[0].id' )
72
+ export get_deployment_result=$( curl -sk -X GET ${auth_credentials[@]} -H " accept: application/json" " ${DC_API_URL} /v1/decisionservices/${decisionServiceId} /deployments?q=name%3A${deployment_name// /% 20} " )
73
+ export deploymentConfigurationId=$( echo ${get_deployment_result} | jq -r ' .elements[0].id' )
73
74
74
75
# deploy the ruleapp from Decision Center
75
76
curl -sk -X POST ${auth_credentials[@]} -H " accept: application/json" " ${DC_API_URL} /v1/deployments/${deploymentConfigurationId} /deploy" | jq
@@ -80,14 +81,15 @@ curl -sk -X POST ${auth_credentials[@]} -H "accept: application/json" -H "Conten
80
81
```
81
82
82
83
> [ !NOTE]
83
- > The commands above rely on Basic Authentication (as ODM is deployed without an OpenID Connect Provider).
84
+ > The commands above rely on the Basic Authentication (as ODM is deployed without an OpenID Connect Provider).
85
+ >
84
86
> In a different environment with OpenID Connect, you can authenticate using the ` client_credentials ` grant type by:
85
87
> - setting the environment variables
86
88
> - CLIENT_ID
87
89
> - CLIENT_SECRET
88
90
> - OPENID_TOKEN_URL
89
- > - and replacing ` auth_credentials=(--user "odmAdmin:odmAdmin") ` by the commands below:
91
+ > - and replacing ` export auth_credentials=(--user "odmAdmin:odmAdmin")` by the commands below:
90
92
> ``` bash
91
- > access_token=$( curl -sk -X POST -H " Content-Type: application/x-www-form-urlencoded" -d " client_id=${CLIENT_ID} &scope=openid&client_secret=${CLIENT_SECRET} &grant_type=client_credentials" ${OPENID_TOKEN_URL} ) | jq -r ' .access_token' )
92
- > auth_credentials=(-H " Authorization: Bearer ${access_token} " )
93
+ > export access_token=$( curl -sk -X POST -H " Content-Type: application/x-www-form-urlencoded" -d " client_id=${CLIENT_ID} &scope=openid&client_secret=${CLIENT_SECRET} &grant_type=client_credentials" ${OPENID_TOKEN_URL} ) | jq -r ' .access_token' )
94
+ > export auth_credentials=(-H " Authorization: Bearer ${access_token} " )
93
95
> ` ` `
0 commit comments