Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simpler allocation API #23

Open
JohnGarbutt opened this issue Aug 28, 2024 · 0 comments
Open

Add simpler allocation API #23

JohnGarbutt opened this issue Aug 28, 2024 · 0 comments

Comments

@JohnGarbutt
Copy link
Member

JohnGarbutt commented Aug 28, 2024

Ideally we add a new REST API that allows updating a matching account with some resource allocations, e.g. to create an allocation, you can do a post something like this, with a failure if you reduce the allocation below the amount already consumed:

curl -s -X POST -H "$AUTH_HEADER" -H "$CONTENT_TYPE" -d \
    "{"provider_name\": \"mycloud\", "start\": \"$START_DATE\", "end\": \"$END_DATE\", \"resources\": {
        \"VCPU\": 1000,
        \"MEMORY_MB\": 240000,
        \"DISK_GB\": 50000
    }}" \
    http://$SITE:$PORT/resource_provider_account/$project_uuid/allocations

The update should also be easy to do, using the same set of inputs, find a matching allocation for that project_uuid and then update.

I think the DB schema is being used too heavily for the APIs.

@JohnGarbutt JohnGarbutt changed the title Simpler allocation API Add simpler allocation API Aug 28, 2024
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

No branches or pull requests

1 participant