Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #934 from pouchrobot/auto-doc-2019-09-19
Browse files Browse the repository at this point in the history
docs: auto generate Dragonfly cli/api/contributors docs via code
  • Loading branch information
starnop authored Sep 19, 2019
2 parents 0ba7a24 + d3de3c2 commit 266923d
Showing 1 changed file with 62 additions and 3 deletions.
65 changes: 62 additions & 3 deletions docs/api_reference/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,10 @@ the situation.

#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**id** <br>*required*|ID of task|string|
|Type|Name|Description|Schema|Default|
|---|---|---|---|---|
|**Path**|**id** <br>*required*|ID of task|string||
|**Query**|**full** <br>*optional*|supernode will also delete the cdn files when the value of full equals true.|boolean|`"false"`|


#### Responses
Expand Down Expand Up @@ -668,6 +669,47 @@ to those peers.
* `application/json`


<a name="tasks-id-pieces-piecerange-error-post"></a>
### report a piece error
```
POST /tasks/{id}/pieces/{pieceRange}/error
```


#### Description
When a peer failed to download a piece from supernode or
failed to validate the pieceMD5,
and then dfget should report the error info to supernode.


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**id** <br>*required*|ID of task|string|
|**Path**|**pieceRange** <br>*required*|the range of specific piece in the task, example "0-45565".|string|
|**Body**|**PieceErrorRequest** <br>*optional*|request body which contains piece error information.|[PieceErrorRequest](#pieceerrorrequest)|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|no error|No Content|
|**404**|An unexpected 404 error occurred.|[Error](#error)|
|**500**|An unexpected server error occurred.|[Error](#error)|


#### Consumes

* `application/json`


#### Produces

* `application/json`


<a name="version-get"></a>
### Get version and build information
```
Expand Down Expand Up @@ -785,6 +827,23 @@ The detailed information of a peer in supernode.
|**version** <br>*optional*|version number of dfget binary|string|


<a name="pieceerrorrequest"></a>
### PieceErrorRequest
Peer's detailed information in supernode.


|Name|Description|Schema|
|---|---|---|
|**dstIP** <br>*optional*|the peer ID of the target Peer.|string|
|**dstPid** <br>*optional*|the peer ID of the target Peer.|string|
|**errorType** <br>*optional*|the error type when failed to download from supernode that dfget will report to supernode|enum (FILE_NOT_EXIST, FILE_MD5_NOT_MATCH)|
|**expectedMd5** <br>*optional*|the MD5 value of piece which returned by the supernode that<br>in order to verify the correctness of the piece content which<br>downloaded from the other peers.|string|
|**range** <br>*optional*|the range of specific piece in the task, example "0-45565".|string|
|**realMd5** <br>*optional*|the MD5 information of piece which calculated by the piece content<br>which downloaded from the target peer.|string|
|**srcCid** <br>*optional*|the CID of the src Peer.|string|
|**taskId** <br>*optional*|the taskID of the piece.|string|


<a name="pieceinfo"></a>
### PieceInfo
Peer's detailed information in supernode.
Expand Down

0 comments on commit 266923d

Please sign in to comment.