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

chore: v0.0.5 #52

Merged
merged 7 commits into from
Aug 14, 2020
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions ipfs-pinning-service.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
version: "0.0.4"
version: "0.0.5"
title: 'IPFS Pinning Service API'
x-logo:
url: "https://bafybeidehxarrk54mkgyl5yxbgjzqilp6tkaz2or36jhq24n3rdtuven54.ipfs.dweb.link/?filename=ipfs-pinning-service.svg"
Expand Down Expand Up @@ -30,23 +30,32 @@ A full list of fields and schemas can be found in the `schemas` section of the [

### Pin object


![pinning-services-api-pin-object.png](https://bafybeidcoyxd723nakggdayy6qg25bl7mls3ilwwiyxmys5qpek7y6jwc4.ipfs.dweb.link/?filename=pinning-services-api-pin-object.png)


The `Pin` object is a representation of a pin request.


It includes the `cid` of data to be pinned, as well as optional metadata in `origins` and `meta`.
It includes the `cid` of data to be pinned, as well as optional metadata in `name`, `origins`, and `meta`.


### Pin status response


![pinning-services-api-pin-status-response.png](https://bafybeiec3c3gzsus4rksddsuxcybilex3odq5cm2cyrzrb7m3suwspl6uy.ipfs.dweb.link/?filename=pinning-services-api-pin-status-response.png)

### Pin status object

The `PinStatus` object is a representation of a pinning operation.
The `PinStatus` object is a representation of the current state of a pinning operation.

It includes the original `pin` object, along with current `status` and globally unique `id`, which can be used for status checks and management.
It includes the original `pin` object, along with current `status` and globally unique `id` of the entire pinning request, which can be used for future status checks and management.
lidel marked this conversation as resolved.
Show resolved Hide resolved
Addresses in the `delegates` array are peers delegated by the pinning service for facilitating direct file transfers (more details in the provider hints section). Any additional vendor-specific information is returned in optional `info`.


## The pin lifecycle


![pinning-services-api-objects.png](https://bafkreidoahwczlxww2y4d7d56cojpsuredfprtodzfzzadasbeyg7zftr4.ipfs.dweb.link/?filename=pinning-services-api-objects.png)
![pinning-services-api-objects.png](https://bafybeigyefq6vwfcsi7dfgqunf4uei426lvia3w73ylg4kgdwwg6txivpe.ipfs.dweb.link/?filename=pinning-services-api-objects.png)


### Creating a new pin object
Expand Down Expand Up @@ -96,8 +105,8 @@ issues in restrictive network topologies such as NATs.

## Custom metadata

Pinning services are encouraged to add support for additional features by leveraging optional `Pin.meta` and `PinStatus.info` fields.
While these attributes can be application or vendor-specific, we encourage the community at large to leverage these attributes as a sandbox to come up with conventions that could become part of future revisions of this API.
Pinning services are encouraged to add support for additional features by leveraging the optional `Pin.meta` and `PinStatus.info` fields.
While these attributes can be application- or vendor-specific, we encourage the community at large to leverage these attributes as a sandbox to come up with conventions that could become part of future revisions of this API.

### Pin metadata

Expand All @@ -108,7 +117,7 @@ Potential uses:

- `Pin.meta[app_id]`: Attaching a unique identifier to pins created by an app enables filtering pins per app via `?meta={\"app_id\":<UUID>}`

- `Pin.meta[vendor_policy]`: Vendor-specific policy (which region use, how many copies keep)
- `Pin.meta[vendor_policy]`: Vendor-specific policy (for example: which region to use, how many copies to keep)


Note that it is OK for a client to omit or ignore these optional attributes; doing so should not impact the basic pinning functionality.
Expand All @@ -121,16 +130,16 @@ Additional `PinStatus.info` can be returned by pinning service.

Potential uses:

- `PinStatus.info[status_details]`: more info about current status (queue
position, % of transferred data, summary of where data is stored etc); when
- `PinStatus.info[status_details]`: more info about the current status (queue
position, percentage of transferred data, summary of where data is stored, etc); when
`PinStatus.status=failed`, it could provide a reason why a pin operation
failed (e.g. lack of funds, DAG too big, etc.)

- `PinStatus.info[dag_size]`: the size of pinned data along with DAG overhead
- `PinStatus.info[dag_size]`: the size of pinned data, along with DAG overhead

- `PinStatus.info[raw_size]`: the size of data without DAG overhead (eg. unixfs)

- `PinStatus.info[pinned_until]`: if vendor supports time-bound pins, this could indicate when pin will expire
- `PinStatus.info[pinned_until]`: if vendor supports time-bound pins, this could indicate when the pin will expire


# Pagination and filtering
Expand Down Expand Up @@ -326,7 +335,7 @@ components:
- delegates
properties:
id:
description: Globally unique ID of the pin request; can be used to check status of ongoing pinning, modification of pin object or pin removal
description: Globally unique ID of the pin request; can be used to check status of ongoing pinning, modification of pin object, or pin removal
lidel marked this conversation as resolved.
Show resolved Hide resolved
type: string
example: "UniqueIdOfPinRequest"
status:
Expand Down