Skip to content

Conversation

@QuanMPhm
Copy link
Contributor

@QuanMPhm QuanMPhm commented Oct 9, 2025

Counterpart to #52, which implements API versioning, so that the create and update methods are available in v2 of the API. API versioning is done through DRF's header versioning

To create an allocation, a JSON payload can be uploaded to `/api/allocations`:

{
    "attributes": [
        {"attribute_type": "OpenShift Limit on CPU Quota", "value": 8},
        {"attribute_type": "OpenShift Limit on RAM Quota (MiB)", "value": 16},
    ],
    "project": {"id": project.id},
    "resources": [{"id": self.resource.id}],
    "status": "New",
}

Updating allocation status is done via a PATCH request
to `/api/allocations/{id}` with a JSON payload:

{
    "status": "Active"
}

Certain status transitions trigger signals:
- New -> Active: allocation_activate
- Active -> Denied: allocation_deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant