Skip to content

tools and datafiles can be fetched with parameter queries#699

Merged
acashmoney merged 41 commits intomainfrom
get-datafiles-by-attribute
Oct 17, 2023
Merged

tools and datafiles can be fetched with parameter queries#699
acashmoney merged 41 commits intomainfrom
get-datafiles-by-attribute

Conversation

@acashmoney
Copy link
Copy Markdown
Contributor

Fetching tools

Tools can be fetched using individual or a combination of parameter queries. They can be fetched with a GET request at /tools.

Queryable parameters include

  • CID
  • Name
  • WalletAddress

Example

curl "http://localhost:8080/tools?cid=YOUR_CID_HERE&name=YOUR_TOOL_NAME_HERE&walletAddress=YOUR_WALLET_ADDRESS_HERE"

Fetching datafiles

Datafiles can be fetched using individual or a combination of queries for parameters. They can be fetched with a GET request at /datafiles.

Queryable parameters include

  • CID
  • WalletAddress
  • Filename (needs to match exactly)
  • Timestamp

For Timestamp, the queries are tsBefore and tsAfter and can be combined to specify a range through which to search for datafiles uploaded. Both of these should adhere to RFC3339 format, which aligns with how we write datafiles to our DB.

Example

curl "http://localhost:8080/datafiles?cid=YOUR_CID_VALUE_HERE&filename=YOUR_FILENAME_HERE&walletAddress=YOUR_WALLET_ADDRESS_HERE&tsBefore=YOUR_TIMESTAMP_BEFORE_HERE&tsAfter=YOUR_TIMESTAMP_AFTER_HERE"

@acashmoney
Copy link
Copy Markdown
Contributor Author

acashmoney commented Oct 11, 2023

@thetechnocrat-dev this is branching off #698, hence all the Files changed.

Relevant files for this PR with respect to #698 are

  • /gateway/handlers/tools.go
  • /gateway/handlers/datafiles.go
  • /gateway/server/server.go

I didn't build a frontend for this since we're holding off on Search functionality on the frontend for now, and we still have a few more cycles for designing the wireframes. But the endpoints should still be useful for when we update the pip package.

@acashmoney acashmoney changed the title tools and datafiles can be fetched with query parameters tools and datafiles can be fetched with parameter queries Oct 11, 2023
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 18:13 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 18:13 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 18:13 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 18:13 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 21:56 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 21:56 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 21:56 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 21:56 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 22:00 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 12, 2023 22:00 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 17, 2023 19:08 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 17, 2023 19:08 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 17, 2023 19:08 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 17, 2023 19:08 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 17, 2023 19:11 — with GitHub Actions Inactive
@acashmoney acashmoney temporarily deployed to ci October 17, 2023 19:11 — with GitHub Actions Inactive
Copy link
Copy Markdown

@thetechnocrat-dev thetechnocrat-dev left a comment

Choose a reason for hiding this comment

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

Screenshot 2023-10-17 at 3 21 59 PM

@acashmoney acashmoney merged commit 2e5dec7 into main Oct 17, 2023
@acashmoney acashmoney deleted the get-datafiles-by-attribute branch October 17, 2023 20:09
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