Skip to content

Commit

Permalink
Merge pull request dragonflyoss#803 from pouchrobot/auto-doc-2019-08-12
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 Aug 12, 2019
2 parents 6f3b83c + 4a069e2 commit f582760
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Yizheng Jiao <[email protected]>
yuansmin <[email protected]>
yunfeiyangbuaa <[email protected]>
zhangyue <[email protected]>
zhouchencheng <[email protected]>
zhouhaibing089 <[email protected]>
zhoulin xie <[email protected]>
zou sheng <[email protected]>
Expand Down
10 changes: 6 additions & 4 deletions docs/api_reference/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,11 @@ The returned information from supernode.

|Name|Description|Schema|
|---|---|---|
|**cID** <br>*optional*|CID means the client ID. It maps to the specific dfget process. <br>When user wishes to download an image/file, user would start a dfget process to do this. <br>This dfget is treated a client and carries a client ID. <br>Thus, multiple dfget processes on the same peer have different CIDs.|string|
|**cID** <br>*optional*|CID means the client ID. It maps to the specific dfget process.<br>When user wishes to download an image/file, user would start a dfget process to do this.<br>This dfget is treated a client and carries a client ID.<br>Thus, multiple dfget processes on the same peer have different CIDs.|string|
|**callSystem** <br>*optional*|This attribute represents where the dfget requests come from. Dfget will pass<br>this field to supernode and supernode can do some checking and filtering via<br>black/white list mechanism to guarantee security, or some other purposes like debugging. <br>**Minimum length** : `1`|string|
|**dfdaemon** <br>*optional*|tells whether it is a call from dfdaemon. dfdaemon is a long running<br>process which works for container engines. It translates the image<br>pulling request into raw requests into those dfget recognizes.|boolean|
|**filter** <br>*optional*|filter is used to filter request queries in URL.<br>For example, when a user wants to start to download a task which has a remote URL of <br>a.b.com/fileA?user=xxx&auth=yyy, user can add a filter parameter ["user", "auth"]<br>to filter the url to a.b.com/fileA. Then this parameter can potentially avoid repeatable<br>downloads, if there is already a task a.b.com/fileA.|< string > array|
|**headers** <br>*optional*|extra HTTP headers sent to the rawURL.<br>This field is carried with the request to supernode. <br>Supernode will extract these HTTP headers, and set them in HTTP downloading requests<br>from source server as user's wish.|< string, string > map|
|**filter** <br>*optional*|filter is used to filter request queries in URL.<br>For example, when a user wants to start to download a task which has a remote URL of<br>a.b.com/fileA?user=xxx&auth=yyy, user can add a filter parameter ["user", "auth"]<br>to filter the url to a.b.com/fileA. Then this parameter can potentially avoid repeatable<br>downloads, if there is already a task a.b.com/fileA.|< string > array|
|**headers** <br>*optional*|extra HTTP headers sent to the rawURL.<br>This field is carried with the request to supernode.<br>Supernode will extract these HTTP headers, and set them in HTTP downloading requests<br>from source server as user's wish.|< string, string > map|
|**identifier** <br>*optional*|special attribute of remote source file. This field is used with taskURL to generate new taskID to<br>identify different downloading task of remote source file. For example, if user A and user B uses<br>the same taskURL and taskID to download file, A and B will share the same peer network to distribute files.<br>If user A additionally adds an identifier with taskURL, while user B still carries only taskURL, then A's<br>generated taskID is different from B, and the result is that two users use different peer networks.|string|
|**md5** <br>*optional*|md5 checksum for the resource to distribute. dfget catches this parameter from dfget's CLI<br>and passes it to supernode. When supernode finishes downloading file/image from the source location,<br>it will validate the source file with this md5 value to check whether this is a valid file.|string|
|**path** <br>*optional*|path is used in one peer A for uploading functionality. When peer B hopes<br>to get piece C from peer A, B must provide a URL for piece C.<br>Then when creating a task in supernode, peer A must provide this URL in request.|string|
Expand Down Expand Up @@ -890,7 +890,7 @@ detailed information about task in supernode.
|**ID** <br>*optional*|ID of the task.|string|
|**cdnStatus** <br>*optional*|The status of the created task related to CDN functionality.|enum (WAITING, RUNNING, FAILED, SUCCESS, SOURCE_ERROR)|
|**fileLength** <br>*optional*|The length of the file dfget requests to download in bytes<br>which including the header and the trailer of each piece.|integer (int64)|
|**headers** <br>*optional*|extra HTTP headers sent to the rawURL.<br>This field is carried with the request to supernode. <br>Supernode will extract these HTTP headers, and set them in HTTP downloading requests<br>from source server as user's wish.|< string, string > map|
|**headers** <br>*optional*|extra HTTP headers sent to the rawURL.<br>This field is carried with the request to supernode.<br>Supernode will extract these HTTP headers, and set them in HTTP downloading requests<br>from source server as user's wish.|< string, string > map|
|**httpFileLength** <br>*optional*|The length of the source file in bytes.|integer (int64)|
|**identifier** <br>*optional*|special attribute of remote source file. This field is used with taskURL to generate new taskID to<br>identify different downloading task of remote source file. For example, if user A and user B uses<br>the same taskURL and taskID to download file, A and B will share the same peer network to distribute files.<br>If user A additionally adds an identifier with taskURL, while user B still carries only taskURL, then A's<br>generated taskID is different from B, and the result is that two users use different peer networks.|string|
|**md5** <br>*optional*|md5 checksum for the resource to distribute. dfget catches this parameter from dfget's CLI<br>and passes it to supernode. When supernode finishes downloading file/image from the source location,<br>it will validate the source file with this md5 value to check whether this is a valid file.|string|
Expand All @@ -913,10 +913,12 @@ detailed information about task in supernode.
|**headers** <br>*optional*|extra HTTP headers sent to the rawURL.<br>This field is carried with the request to supernode. <br>Supernode will extract these HTTP headers, and set them in HTTP downloading requests<br>from source server as user's wish.|< string > array|
|**hostName** <br>*optional*|host name of peer client node. <br>**Minimum length** : `1`|string|
|**identifier** <br>*optional*|special attribute of remote source file. This field is used with taskURL to generate new taskID to<br>identify different downloading task of remote source file. For example, if user A and user B uses<br>the same taskURL and taskID to download file, A and B will share the same peer network to distribute files.<br>If user A additionally adds an identifier with taskURL, while user B still carries only taskURL, then A's<br>generated taskID is different from B, and the result is that two users use different peer networks.|string|
|**insecure** <br>*optional*|tells whether skip secure verify when supernode download the remote source file.|boolean|
|**md5** <br>*optional*|md5 checksum for the resource to distribute. dfget catches this parameter from dfget's CLI<br>and passes it to supernode. When supernode finishes downloading file/image from the source location,<br>it will validate the source file with this md5 value to check whether this is a valid file.|string|
|**path** <br>*optional*|path is used in one peer A for uploading functionality. When peer B hopes<br>to get piece C from peer A, B must provide a URL for piece C.<br>Then when creating a task in supernode, peer A must provide this URL in request.|string|
|**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)|
|**rawURL** <br>*optional*|The is the resource's URL which user uses dfget to download. The location of URL can be anywhere, LAN or WAN.<br>For image distribution, this is image layer's URL in image registry.<br>The resource url is provided by command line parameter.|string|
|**rootCAs** <br>*optional*|The root ca cert from client used to download the remote source file.|< string (byte) > array|
|**superNodeIp** <br>*optional*|The address of supernode that the client can connect to|string|
|**taskURL** <br>*optional*|taskURL is generated from rawURL. rawURL may contains some queries or parameter, dfget will filter some queries via<br>--filter parameter of dfget. The usage of it is that different rawURL may generate the same taskID.|string|
|**version** <br>*optional*|version number of dfget binary.|string|
Expand Down
2 changes: 2 additions & 0 deletions docs/cli_reference/dfget.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ download SUCCESS(0) cost:0.026s length:141898 reason:0

```
--alivetime duration Alive duration for which uploader keeps no accessing by any uploading requests, after this period uploader will automically exit (default 5m0s)
--cacerts strings The cacert file which is used to verify remote server when supernode interact with the source.
--callsystem string The name of dfget caller which is for debugging. Once set, it will be passed to all components around the request to make debugging easy
--clientqueue int specify the size of client queue which controls the number of pieces that can be processed simultaneously (default 6)
--console show log on console, it's conflict with '--showbar'
Expand All @@ -44,6 +45,7 @@ download SUCCESS(0) cost:0.026s length:141898 reason:0
--header strings http header, eg: --header='Accept: *' --header='Host: abc'
-h, --help help for dfget
-i, --identifier string The usage of identifier is making different downloading tasks generate different downloading task IDs even if they have the same URLs. conflict with --md5.
--insecure identify whether supernode should skip secure verify when interact with the source.
--ip string IP address that server will listen on
-s, --locallimit string network bandwidth rate limit for single download task, in format of 20M/m/K/k
-m, --md5 string md5 value input from user for the requested downloading file to enhance security
Expand Down

0 comments on commit f582760

Please sign in to comment.