Skip to main content

Conditional updates

Use the resource version from a read to avoid overwriting another client's changes. Conditional version checks apply to PATCH and DELETE, not POST.

Note: Balancer is in beta. Endpoints, fields and behavior may change before general availability, and the feature must be enabled on your account before use. Contact your NetActuate account manager to request access.

Version controls​

ControlBehavior
If-Match headerSupplies the expected version. Takes precedence over ifVersion when both are present.
ifVersion argumentOptional integer from 0 to 9007199254740991; integer strings are normalized.
version response fieldResource version to use for your next conditional change.
HTTP 412The supplied version differs from the transaction-locked version, or the checked resource disappeared.

Version checks cover the operation's primary resource or parent, not every referenced object. Use the version associated with that operation. POST actions do not honor these controls.

Update an HTTP load balancer​

Set BALANCER_API_BASE to https://<your-api-host>, using the host shown in the Balancer portal. Use an account API key with write access and jq. Set BALANCER_HTTP_LB_ID to a load balancer you can edit.

  1. Read its current configuration and version.

    curl --silent --show-error \
    "$BALANCER_API_BASE/http-loadbalancers/$BALANCER_HTTP_LB_ID" \
    -H "x-api-key: $BALANCER_API_KEY" > before.json
    BALANCER_VERSION=$(jq -r '.data.version' before.json)
    cat before.json

    Expect HTTP 200 with data.httpLbId and data.version. Verify the identifier before editing.

  2. Submit your change with that version.

    curl --silent --show-error -i -X PATCH \
    "$BALANCER_API_BASE/http-loadbalancers/$BALANCER_HTTP_LB_ID" \
    -H "x-api-key: $BALANCER_API_KEY" \
    -H "If-Match: $BALANCER_VERSION" \
    -H 'Content-Type: application/json' \
    --data '{"description":"Updated application configuration"}'

    Expect HTTP 200 with data.httpLbId if the version still matches. For example, if your read returns version 7 and another client changes it to 8 before this request, a request with If-Match: 7 returns 412.

    To use the body argument instead, omit If-Match and construct the body with jq -n --argjson version "$BALANCER_VERSION" '{ifVersion:$version,description:"Updated application configuration"}'. Send that JSON as the PATCH body.

  3. Read the resource again with the command from step 1. Verify the saved description and use the returned version for your next edit. After 412, compare the latest data with your earlier copy, reconcile the intended edit and repeat step 2 with the new version. Do not merely replace the version and resend an obsolete change.