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 optional params to /azure #44

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Add optional params to /azure #44

merged 1 commit into from
Jul 2, 2024

Conversation

F-X64
Copy link
Member

@F-X64 F-X64 commented Jul 2, 2024

Changes
Add optional arch filter
Add optional urn filter
Add optional version filter
Add pagination
Add find_azure_images crud function
Add necessary testing

Example

http://localhost:8000/azure?arch=x64&version=9.4&urn=rhel9-gen1&page=2&page_size=1

{
  "results": [
    {
      "publisher": "RedHat",
      "id": "RedHat:rh-rhel:rh-rhel9-gen1:9.4.2024061120",
      "urn": "RedHat:rh-rhel:rh-rhel9-gen1:9.4.2024061120",
      "offer": "rh-rhel",
      "sku": "rh-rhel9-gen1",
      "architecture": "x64",
      "version": "9.4.2024061120"
    }
  ],
  "page": 2,
  "page_size": 1,
  "total_count": 4,
  "total_pages": 4
}

Add optional arch filter
Add optional urn filter
Add optional version filter
Add find_azure_images crud function
Add necessary testing
@F-X64 F-X64 requested a review from major July 2, 2024 13:23
"""
query = db.query(AzureImage).order_by(desc(AzureImage.version))

if arch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very slick low-code method for handling this. 👏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For once it comes in handy that we have the date suffix in all image versions on Azure.

@major major merged commit fbe5fcc into main Jul 2, 2024
3 checks passed
@major major deleted the enhance-azure-endoint branch July 2, 2024 13:27
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.

2 participants