Skip to content

Support simultaneous quota updates without generating undefined #554

@NathaliaTS

Description

@NathaliaTS

Problem description

Problem Description

Our CI/CD pipeline uses apim api import to create and update multiple APIs concurrently on the Axway Gateway. All APIs store their quotas under the system scope.

"$APIM_CLI" api import \
    --host $AXWAY_HOST \
    -port 443 \
    --username '$AXWAY_USER' \
    --password $AXWAY_PASSWORD \
    --apidefinition "api-specification.json" \
    --config "api-config.yaml" \
    -timeout 300000 \
    -retryDelay 120000 \
    -ignoreCache \
    -changeOrganization \
    -force \
    -validateRemoteHost false
  • On the first simultaneous deploy, quotas apply correctly.

  • On parallel updates of two or more APIs, the CLI writes some system quotas with value undefined, blocking any further quota deployments until those invalid entries are manually removed.
    Image
    Image

  • Versions used:

    • Gateway - 7.7.20230830.
    • CLI - 1.14.10 and 1.14.11.
  • Configuration used:
    Image

Steps to Reproduce

  1. Define two or more APIs with system-level quotas in your configuration files.
  2. Run the provided command in parallel across all APIs.
  3. Observe that after import, some quotas appear as undefined.
  4. Any subsequent import with quotas fails until the broken quotas are deleted in the API-Manager.

Feature request

Proposed Solutions

  1. Delta / PATCH-style Updates

    • Instead of doing a full PUT /quotas/0000…000 with the entire APIQuota JSON, expose (or leverage) a PATCH endpoint or JSON-Patch support.
    • Each import sends only the specific restrictions to add, update or remove for one API.
    • Benefits:
      • Much smaller payloads
      • Zero risk of overwriting other APIs’ entries
  2. Optimistic Locking with ETag / If-Match

    • On every quota read, capture the response’s ETag header.
    • When performing the PUT, include If-Match: <etag>. If someone else updated in the meantime, the server returns 412 Precondition Failed.
    • Client logic: on 412 → re-GET → re-merge your change → retry PUT.
    • Benefits: guarantee you never overwrite a newer version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions