Skip to content

Commit d63ebca

Browse files
author
Frederic Mercier
committed
update README.md
1 parent 4c87fa7 commit d63ebca

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

cross-component/deployexecute/README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@ The following environment variables need to be set:
3131
| Name  | Description | Value for Docker |
3232
| - | - | - |
3333
| 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 |
3535

3636
<!-- markdown-link-check-enable-->
3737

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:
3941

40-
If not already done, deploy the `Loan Validation Service` Decision Service into Decision Center by running:
4142
```bash
4243
# configure the Authentication (using Basic Auth)
43-
auth_credentials=(--user \"odmAdmin:odmAdmin\")
44+
export auth_credentials=(--user "odmAdmin:odmAdmin")
4445

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
4849

4950
# download the Decision Service zip file
5051
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
5556
"${DC_API_URL}/v1/decisionservices/import"
5657
```
5758

58-
## Run the sample
59+
## Running the sample
5960

6061
```bash
6162
# configure the Authentication (using Basic Auth)
62-
export auth_credentials=(--user 'odmAdmin:odmAdmin')
63+
export auth_credentials=(--user "odmAdmin:odmAdmin")
6364

6465
# get the ID of the Decision Service in Decision Center
6566
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')
6869

6970
# get the ID of the deployment configuration in Decision Center
7071
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')
7374

7475
# deploy the ruleapp from Decision Center
7576
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
8081
```
8182

8283
> [!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+
>
8486
> In a different environment with OpenID Connect, you can authenticate using the `client_credentials` grant type by:
8587
> - setting the environment variables
8688
> - CLIENT_ID
8789
> - CLIENT_SECRET
8890
> - 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:
9092
> ```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}")
9395
> ```

0 commit comments

Comments
 (0)