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

Feat: add a new API component that implements the Pinning services API #1483

Merged
merged 25 commits into from
Mar 14, 2022

Conversation

hsanjuan
Copy link
Collaborator

@hsanjuan hsanjuan commented Oct 20, 2021

This branch adds a new API component which is very similar to the REST API component (using the common code that was extracted from it), only to implement the Pinning Services API (or the parts that we can).

WIP #1213

@hsanjuan hsanjuan self-assigned this Oct 20, 2021
@hsanjuan hsanjuan added this to the Release v0.14.2 milestone Oct 20, 2021
@fuson
Copy link

fuson commented Dec 2, 2021

Any hope to receive it in next release?

@hsanjuan
Copy link
Collaborator Author

hsanjuan commented Dec 3, 2021

Not in 0.14.2, but hopefully in the next one. The hardest part here is all done, it needs the tests though.

This will facilitate building outputs for the Pinning Services API, saving a
round trip to query the cluster State, since all the needed information
already comes from the PinTracker, which has already accessed the state.

Since the pintracker already included a state attribute (Name), we are simply
going down that path.
This fixes #1213. It adds partial support for the Pinning Services API with some caveats:

* RequestIDs == CIDs. This is a violation of the spec, as request IDs will not be unique etc.
* Pagination, name matching, metadata matching, ordering etc. are not supported in the List endpoint.
* The List endpoint only supports status filtering and cid query parameter.
* Created time property is not supported and always set to Now()

There is more work to do here: cleanup, extract useful types etc. and TESTS.
pinsvcapi: do not cache peer information here as all the needed information is
in the status objects.

This adds ipfs_addresses as a field broadcasted with the ping metrics.
@hsanjuan hsanjuan marked this pull request as ready for review March 11, 2022 16:19
api/pinsvcapi/pinsvc/pinsvc.go Outdated Show resolved Hide resolved
api/pinsvcapi/pinsvc/pinsvc.go Outdated Show resolved Hide resolved
api/pinsvcapi/pinsvc/pinsvc.go Outdated Show resolved Hide resolved
api/pinsvcapi/pinsvc/pinsvc.go Show resolved Hide resolved
api/pinsvcapi/pinsvcapi.go Show resolved Hide resolved
api/pinsvcapi/pinsvcapi.go Show resolved Hide resolved
api/pinsvcapi/pinsvcapi.go Outdated Show resolved Hide resolved
api/pinsvcapi/pinsvcapi_test.go Outdated Show resolved Hide resolved
api/pinsvcapi/pinsvcapi_test.go Outdated Show resolved Hide resolved
api/types.go Outdated Show resolved Hide resolved
- Add "Created" field to pinInfo.
- Support before/after filter
- 404 when something is unpinned or on a non-recognize state
@hsanjuan hsanjuan merged commit 358057b into master Mar 14, 2022
@hsanjuan hsanjuan deleted the feat/pinning-api branch March 14, 2022 14:04
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.

None yet

2 participants