Skip to main content

Update a resource

You can use the CI/CD Manager API to update a resource without overwriting changes introduced by other users. To do that, use Etag and If-Match header to point to the version of the resource you're updating.

Note:

The Etag header is available only in PATCH methods for endpoints that end with insurer-config, build-schedules, and post-deployment-tests.

All sample requests in this guide include the following path parameters:

Parameter nameDescription
tenantIdTenant ID.
starSystemIdID of the logical star system that includes the InsuranceSuite application for which you modify the CI/CD configuration.
applicationIdInsuranceSuite application which includes the build. For example:
- PC for PolicyCenter
- BC for BillingCenter
- CC for ClaimCenter
- CM for ContactManager

Note:

In the request URLs, substitute {baseUrl} with the correct URL for your region. For details, see Base URLs.

Update the resource

If you download the resource that you want to change, you download it with a specific Etag header. The header points to the resource version that is available on the server when you download it. To save the changes, send the following PATCH request:

curl -X 'PATCH' \
'{baseUrl}/api/v2/tenants/{tenantId}/starsystems/{starSystemId}/cicd-configs/{applicationId}/insurer-config' \
-H 'accept: */*' \
-H 'If-Match: {etag}' \
-H 'Authorization: Bearer {access-token}' \
-H 'Content-Type: application/json-patch+json' \
-d '[
{
"op": "replace",
"path": "/gunitServerTests/testEnv",
"value": "h2mem"
}
]'

For a successful request, you'll receive the 200 status code.

Missing If-Match header

Sending the PATCH request without the If-Match header might result in one of the following situations:

  • Your changes are uploaded on the server but might overwrite changes introduced by other users.
  • Your request fails to update the resource on the server due to frequent simultaneous resource state changes.

Troubleshooting

Can't update the resource due to conflicting versions

If another user updates the resource before you send a request with your changes, a different version of the resource with a new Etag header is available on the server. In this case, after sending the request, you'll get information that you're working on an outdated resource version that doesn't match a new Etag header.

For a failed update attempt, the response might look like this:

Example response

{
"timestamp": "2024-08-09T14:07:32.388+00:00",
"status": 412,
"error": "Precondition Failed",
"path": "/api/v2/tenants/{tenantId}/starsystems/{starSystemId}/cicd-configs/{applicationId}/insurer-config",
"message": "Precondition Failed. Current ETag doesn't match given one: {if-match-value}."
}

To successfully upload your changes, download a new version of the resource from the server before sending your request again with new Etag and If-Match headers.