Compensate a Saga Transaction
/admin/v1/lra-coordinator/{id}/cancel
Request
- application/json
-
id(required): string
Unique ID which you can use to track the transaction.
Response
- application/json
200 Response
string
[
"Active",
"Closing",
"Closed",
"FailedToClose",
"Cancelling",
"Cancelled",
"FailedToCancel"
]
400 Response
401 Response
404 Response
409 Response
string
[
"Active",
"Closing",
"Closed",
"FailedToClose",
"Cancelling",
"Cancelled",
"FailedToCancel"
]
500 Response
Examples
cURL Command
The following example shows how to compensate a Saga transaction by submitting a PUT
request on the REST resource using cURL. For more information about cURL, see Use cURL.
Note down the value of the Long-Running-Action
and Oracle-Tmm-Tx-Token
headers from the response received for a provisional booking. You can pass the values directly or save it in a variable. The Oracle-Tmm-Tx-Token
header is displayed in the response body of a provisional booking only if you have created a transaction token and enabled it. See Transaction Token Properties in Transaction Manager for Microservices Developer Guide.
Enter the command on a single line. Line breaks are used in this example for readability. Example values have been truncated with ... to improve readability. When you run this command in your environment, provide the entire value.
curl -X PUT -H "Authorization:Bearer $OTMM_COOKIE" -H "Long-Running-Action: [http://otmm-tcs:9000/api/v1/lra-coordinator/57b6...]" -H "Oracle-Tmm-Tx-Token: vmrpURFx...qpKmYn2" https://192.0.2.1:8080/admin/v1/lra-coordinator/15cd86ca-e0b7-4778-8cb6-4b78dfb3b981/cancel
-
OTMM_COOKIE
is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authenticate. -
192.0.2.1:8080
is an example REST endpoint URL. Change this value to the REST endpoint URL to access the Istio ingress gateway in your environment. For information about finding out REST endpoint URL for your site, see Send Requests. -
15cd86ca-e0b7-4778-8cb6-4b78dfb3b981
is an example value for a Saga transaction ID. Replace this value with the transaction ID of a Saga transaction in your environment.
No response is returned for this request.