To prevent clients from overwriting each other's changes, this API uses optimistic concurrency control.
Etag and If-Match headers
Etag and If-Match headersWhen reading data from the resources, the response includes an Etag header—a unique, double-quoted string that represents the current version of a resource. To update a resource, include the same Etag value in the If-Match header of your request. The update succeeds if the digest matches the current state of the resource's data, otherwise it produces a 412 error, letting you know that your copy is outdated.
This ensures that updates are based on the latest version when more than one client accesses the same resource, and keeps you from overwriting other users' data, whether changes come from the API or the Control Center application.
The value in both the
EtagandIf-Matchheaders need to be double-quoted. Otherwise, the request fails, even if the digest matches.
Cloning resources
This concurrency control also applies when cloning resources, for example environments. By passing the cloneFromVersionEtag value in your request body, you ensure that the resource version you’re cloning hasn’t changed since you last checked.
