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

Commit c69bc35

Browse files
committed
docs: auto generate Dragonfly cli/api docs via code
Signed-off-by: pouchrobot <[email protected]>
1 parent 849f36f commit c69bc35

File tree

2 files changed

+60
-4
lines changed

2 files changed

+60
-4
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Guangming Wang <[email protected]>
3131
Guangwen Feng <[email protected]>
3232
Haines Chan <[email protected]>
3333
Haosdent Huang <[email protected]>
34+
3435
3536
3637

docs/api_reference/apis.md

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ request to setup a peer-to-peer network immediately.
213213
|---|---|---|
214214
|**200**|no error|[PreheatCreateResponse](#preheatcreateresponse)|
215215
|**400**|bad parameter|[Error](#error)|
216+
|**409**|preheat task already exists|[Error](#error)|
216217
|**500**|An unexpected server error occurred.|[Error](#error)|
217218

218219

@@ -270,6 +271,38 @@ get detailed information of a preheat task in supernode.
270271
* `application/json`
271272

272273

274+
<a name="api-v1-preheats-id-delete"></a>
275+
### Delete a preheat task
276+
```
277+
DELETE /api/v1/preheats/{id}
278+
```
279+
280+
281+
#### Description
282+
delete a preheat task
283+
284+
285+
#### Parameters
286+
287+
|Type|Name|Description|Schema|
288+
|---|---|---|---|
289+
|**Path**|**id** <br>*required*|ID of preheat task|string|
290+
291+
292+
#### Responses
293+
294+
|HTTP Code|Description|Schema|
295+
|---|---|---|
296+
|**200**|no error|No Content|
297+
|**404**|no such preheat task|[4ErrorResponse](#4errorresponse)|
298+
|**500**|An unexpected server error occurred.|[Error](#error)|
299+
300+
301+
#### Produces
302+
303+
* `application/json`
304+
305+
273306
<a name="api-v1-tasks-post"></a>
274307
### create a task
275308
```
@@ -572,7 +605,7 @@ And supernode could know if peer is alive in strem mode.
572605

573606
|HTTP Code|Description|Schema|
574607
|---|---|---|
575-
|**200**|no error|[ResultInfo](#resultinfo)|
608+
|**200**|no error|[HeartBeatResponse](#heartbeatresponse)|
576609
|**500**|An unexpected server error occurred.|[Error](#error)|
577610

578611

@@ -858,6 +891,16 @@ The request is to report peer to supernode to keep alive.
858891
|**port** <br>*optional*|when registering, dfget will setup one uploader process.<br>This one acts as a server for peer pulling tasks.<br>This port is which this server listens on. <br>**Minimum value** : `15000` <br>**Maximum value** : `65000`|integer (int32)|
859892

860893

894+
<a name="heartbeatresponse"></a>
895+
### HeartBeatResponse
896+
897+
|Name|Description|Schema|
898+
|---|---|---|
899+
|**needRegister** <br>*optional*|If peer do not register in supernode, set needRegister to be true, else set to be false.|boolean|
900+
|**seedTaskIDs** <br>*optional*|The array of seed taskID which now are selected as seed for the peer. If peer have other seed file which<br>is not included in the array, these seed file should be weed out.|< string > array|
901+
|**version** <br>*optional*|The version of supernode. If supernode restarts, version should be different, so dfdaemon could know<br>the restart of supernode.|string|
902+
903+
861904
<a name="networkinfofetchrequest"></a>
862905
### NetworkInfoFetchRequest
863906
The request is to fetch p2p network info from supernode.
@@ -999,8 +1042,8 @@ Request option of creating a preheat task in supernode.
9991042
|**filter** <br>*optional*|URL may contains some changeful query parameters such as authentication parameters. Dragonfly will<br>filter these parameter via 'filter'. The usage of it is that different URL may generate the same<br>download taskID.|string|
10001043
|**headers** <br>*optional*|If there is any authentication step of the remote server, the headers should contains authenticated information.<br>Dragonfly will sent request taking the headers to remote server.|< string, string > map|
10011044
|**identifier** <br>*optional*|This field is used for generating new downloading taskID to identify different downloading task of remote URL.|string|
1002-
|**type** <br>*optional*|this must be image or file|string|
1003-
|**url** <br>*optional*|the image or file location|string|
1045+
|**type** <br>*required*|this must be image or file|enum (image, file)|
1046+
|**url** <br>*required*|the image or file location <br>**Minimum length** : `3`|string|
10041047

10051048

10061049
<a name="preheatcreateresponse"></a>
@@ -1024,7 +1067,19 @@ task because that an image may have more than one layer.
10241067
|**ID** <br>*optional*|ID of preheat task.|string|
10251068
|**finishTime** <br>*optional*|the preheat task finish time|string (date-time)|
10261069
|**startTime** <br>*optional*|the preheat task start time|string (date-time)|
1027-
|**status** <br>*optional*|The status of preheat task.<br> WAITING -----> RUNNING -----> SUCCESS<br> \|--> FAILED<br>The initial status of a created preheat task is WAITING.<br>It's finished when a preheat task's status is FAILED or SUCCESS.<br>A finished preheat task's information can be queried within 24 hours.|enum (WAITING, RUNNING, FAILED, SUCCESS)|
1070+
|**status** <br>*optional*|The status of preheat task.<br> WAITING -----> RUNNING -----> SUCCESS<br> \|--> FAILED<br>The initial status of a created preheat task is WAITING.<br>It's finished when a preheat task's status is FAILED or SUCCESS.<br>A finished preheat task's information can be queried within 24 hours.|[PreheatStatus](#preheatstatus)|
1071+
1072+
1073+
<a name="preheatstatus"></a>
1074+
### PreheatStatus
1075+
The status of preheat task.
1076+
WAITING -----> RUNNING -----> SUCCESS
1077+
|--> FAILED
1078+
The initial status of a created preheat task is WAITING.
1079+
It's finished when a preheat task's status is FAILED or SUCCESS.
1080+
A finished preheat task's information can be queried within 24 hours.
1081+
1082+
*Type* : enum (WAITING, RUNNING, FAILED, SUCCESS)
10281083

10291084

10301085
<a name="resultinfo"></a>

0 commit comments

Comments
 (0)