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 host filtering endpoint #152

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

chris124567
Copy link
Member

@chris124567 chris124567 commented Dec 17, 2024

Add host filtering endpoint similar to https://web.archive.org/web/20240106075954/https://siacentral.com/api/docs/#list-get in Siacentral. Also support querying the v2/rhp4 versions of fields like contract price if requested by the user.

@chris124567 chris124567 changed the title Christopher/add host filter Add host filter Dec 17, 2024
@chris124567 chris124567 changed the title Add host filter Add host filtering endpoint Dec 17, 2024
api/client.go Outdated Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
api/server.go Show resolved Hide resolved
persist/sqlite/hosts.go Outdated Show resolved Hide resolved
persist/sqlite/scan_test.go Outdated Show resolved Hide resolved
persist/sqlite/hosts.go Outdated Show resolved Hide resolved
persist/sqlite/hosts.go Show resolved Hide resolved
api/server.go Outdated Show resolved Hide resolved
api/server.go Show resolved Hide resolved
@chris124567 chris124567 force-pushed the christopher/add-host-filter branch from e8a70d1 to 5be2ea8 Compare December 18, 2024 18:32
api/server.go Outdated Show resolved Hide resolved
@chris124567
Copy link
Member Author

Note: this changes the schema. We add settings_used_storage and rhp4_settings_used_storage columns to host_info so we can sort by used storage. We don't store total_storage and remaining_storage as integers so we can't just ORDER BY (total_storage - remaining_storage) when we want to sort by used storage unfortunately.

explorer/types.go Outdated Show resolved Hide resolved
persist/sqlite/hosts.go Show resolved Hide resolved
persist/sqlite/hosts.go Show resolved Hide resolved
@chris124567
Copy link
Member Author

chris124567 commented Dec 20, 2024

Thank you PJ that was really helpful. V2, along with Online and AcceptContracts, are now pointers and optional to specify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants