Browse Source

Update docs

Leszek Wiesner 3 years ago
parent
commit
f67064fe47

+ 4 - 4
distributor-node/docs/api/operator/index.md

@@ -264,7 +264,7 @@ OperatorAuth
 ```javascript
 const inputBody = '{
   "buckets": [
-    0
+    "string"
   ]
 }';
 const headers = {
@@ -303,7 +303,7 @@ Updates buckets supported by the node.
 ```json
 {
   "buckets": [
-    0
+    "string"
   ]
 }
 ```
@@ -359,7 +359,7 @@ OperatorAuth
 ```json
 {
   "buckets": [
-    0
+    "string"
   ]
 }
 
@@ -369,7 +369,7 @@ OperatorAuth
 
 |Name|Type|Required|Restrictions|Description|
 |---|---|---|---|---|
-|buckets|[integer]|false|none|Set of bucket ids to be distributed by the node. If not provided - all buckets assigned to currently configured worker will be distributed.|
+|buckets|[string]|false|none|Set of bucket ids to be distributed by the node. If not provided - all buckets assigned to currently configured worker will be distributed.|
 
 undefined
 

+ 3 - 3
distributor-node/docs/api/public/index.md

@@ -141,7 +141,7 @@ Returns list of distributed buckets
 ```json
 {
   "bucketIds": [
-    0
+    "string"
   ]
 }
 ```
@@ -356,7 +356,7 @@ This operation does not require authentication
 ```json
 {
   "bucketIds": [
-    0
+    "string"
   ]
 }
 
@@ -369,7 +369,7 @@ oneOf
 |Name|Type|Required|Restrictions|Description|
 |---|---|---|---|---|
 |*anonymous*|object|false|none|none|
-|» bucketIds|[integer]|true|none|none|
+|» bucketIds|[string]|true|none|none|
 
 xor
 

+ 11 - 23
distributor-node/docs/commands/leader.md

@@ -26,13 +26,11 @@ USAGE
   $ joystream-distributor leader:cancel-invitation
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -w, --workerId=workerId      (required) ID of the invited operator (distribution group worker)
 
   -y, --yes                    Answer "yes" to any prompt, skipping any manual confirmations
@@ -90,13 +88,11 @@ USAGE
   $ joystream-distributor leader:delete-bucket
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -y, --yes                    Answer "yes" to any prompt, skipping any manual confirmations
 ```
 
@@ -130,13 +126,11 @@ USAGE
   $ joystream-distributor leader:invite-bucket-operator
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -w, --workerId=workerId      (required) ID of the distribution group worker to invite as bucket operator
 
   -y, --yes                    Answer "yes" to any prompt, skipping any manual confirmations
@@ -157,13 +151,11 @@ USAGE
   $ joystream-distributor leader:remove-bucket-operator
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -w, --workerId=workerId      (required) ID of the operator (distribution working group worker) to remove from the
                                bucket
 
@@ -228,7 +220,7 @@ USAGE
 
 OPTIONS
   -a, --add=add
-      [default: ] ID of a bucket to add to bag
+      [default: ] Index(es) (within the family) of bucket(s) to add to the bag
 
   -b, --bagId=bagId
       (required) Bag ID. Format: {bag_type}:{sub_type}:{id}.
@@ -250,13 +242,13 @@ OPTIONS
       (required) ID of the distribution bucket family
 
   -r, --remove=remove
-      [default: ] ID of a bucket to remove from bag
+      [default: ] Index(es) (within the family) of bucket(s) to remove from the bag
 
   -y, --yes
       Answer "yes" to any prompt, skipping any manual confirmations
 
 EXAMPLE
-  $ joystream-distributor leader:update-bag -b 1 -f 1 -a 1 -a 2 -a 3 -r 4 -r 5
+  $ joystream-distributor leader:update-bag -b 1 -f 1 -a 1 2 3 -r 4 5
 ```
 
 _See code: [src/commands/leader/update-bag.ts](https://github.com/Joystream/joystream/blob/v0.1.0/src/commands/leader/update-bag.ts)_
@@ -270,15 +262,13 @@ USAGE
   $ joystream-distributor leader:update-bucket-mode
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
   -d, --mode=(on|off)          (required) Whether the bucket should be "on" (distributing) or "off" (not distributing)
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -y, --yes                    Answer "yes" to any prompt, skipping any manual confirmations
 ```
 
@@ -293,14 +283,12 @@ USAGE
   $ joystream-distributor leader:update-bucket-status
 
 OPTIONS
-  -B, --bucketId=bucketId       (required) Distribution bucket id
+  -B, --bucketId=bucketId       (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
   -a, --acceptingBags=(yes|no)  (required) Whether the bucket should accept new bags
 
   -c, --configPath=configPath   [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                 directory)
 
-  -f, --familyId=familyId       (required) Distribution bucket family id
-
   -y, --yes                     Answer "yes" to any prompt, skipping any manual confirmations
 ```
 
@@ -318,7 +306,7 @@ OPTIONS
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
-  -p, --policy=policy          Key-value pair of {familyId}:{numberOfBuckets}
+  -p, --policy=policy          [default: ] Key-value pair of {familyId}:{numberOfBuckets}
 
   -t, --type=(Member|Channel)  (required) Dynamic bag type
 
@@ -328,7 +316,7 @@ DESCRIPTION
   Requires distribution working group leader permissions.
 
 EXAMPLE
-  $ joystream-distributor leader:update-dynamic-bag-policy -t Member -p 1:5 -p 2:10 -p 3:5
+  $ joystream-distributor leader:update-dynamic-bag-policy -t Member -p 1:5 2:10 3:5
 ```
 
 _See code: [src/commands/leader/update-dynamic-bag-policy.ts](https://github.com/Joystream/joystream/blob/v0.1.0/src/commands/leader/update-dynamic-bag-policy.ts)_

+ 7 - 1
distributor-node/docs/commands/node.md

@@ -18,7 +18,9 @@ USAGE
   $ joystream-distributor node:set-buckets
 
 OPTIONS
-  -B, --bucketIds=bucketIds    Set of bucket ids to distribute
+  -B, --bucketIds=bucketIds    Set of bucket ids to distribute. Each bucket id should be in {familyId}:{bucketIndex}
+                               format. Multiple ids can be provided, separated by space.
+
   -a, --all                    Distribute all buckets belonging to configured worker
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
@@ -29,6 +31,10 @@ OPTIONS
   -u, --url=url                (required) Distributor node operator api base url (ie. http://localhost:3335)
 
   -y, --yes                    Answer "yes" to any prompt, skipping any manual confirmations
+
+EXAMPLES
+  $ joystream-distributor node:set-buckets --bucketIds 1:1 1:2 1:3 2:1 2:2
+  $ joystream-distributor node:set-buckets --all
 ```
 
 _See code: [src/commands/node/set-buckets.ts](https://github.com/Joystream/joystream/blob/v0.1.0/src/commands/node/set-buckets.ts)_

+ 2 - 6
distributor-node/docs/commands/operator.md

@@ -15,13 +15,11 @@ USAGE
   $ joystream-distributor operator:accept-invitation
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -w, --workerId=workerId      (required) ID of the invited operator (distribution group worker)
 
   -y, --yes                    Answer "yes" to any prompt, skipping any manual confirmations
@@ -41,15 +39,13 @@ USAGE
   $ joystream-distributor operator:set-metadata
 
 OPTIONS
-  -B, --bucketId=bucketId      (required) Distribution bucket id
+  -B, --bucketId=bucketId      (required) Distribution bucket ID in {familyId}:{bucketIndex} format.
 
   -c, --configPath=configPath  [default: ./config.yml] Path to config JSON/YAML file (relative to current working
                                directory)
 
   -e, --endpoint=endpoint      Root distribution node endpoint
 
-  -f, --familyId=familyId      (required) Distribution bucket family id
-
   -i, --input=input            Path to JSON metadata file
 
   -w, --workerId=workerId      (required) ID of the operator (distribution group worker)

+ 0 - 7
distributor-node/docs/schema/definition-properties-bucket-ids-items.md

@@ -1,7 +0,0 @@
-## items Type
-
-`integer`
-
-## items Constraints
-
-**minimum**: the value of this number must greater than or equal to: `0`

+ 13 - 0
distributor-node/docs/schema/definition-properties-distributed-buckets-ids-items.md

@@ -0,0 +1,13 @@
+## items Type
+
+`string`
+
+## items Constraints
+
+**pattern**: the string must match the following regular expression: 
+
+```regexp
+^[0-9]+:[0-9]+$
+```
+
+[try pattern](https://regexr.com/?expression=%5E%5B0-9%5D%2B%3A%5B0-9%5D%2B%24 "try regular expression with regexr.com")

+ 1 - 1
distributor-node/docs/schema/definition-properties-bucket-ids.md → distributor-node/docs/schema/definition-properties-distributed-buckets-ids.md

@@ -1,6 +1,6 @@
 ## buckets Type
 
-`integer[]`
+`string[]`
 
 ## buckets Constraints
 

+ 17 - 17
distributor-node/docs/schema/definition.md

@@ -4,19 +4,19 @@
 
 # Distributor node configuration Properties
 
-| Property                    | Type      | Required | Nullable       | Defined by                                                                                                                                  |
-| :-------------------------- | :-------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------ |
-| [id](#id)                   | `string`  | Required | cannot be null | [Distributor node configuration](definition-properties-id.md "https://joystream.org/schemas/argus/config#/properties/id")                   |
-| [endpoints](#endpoints)     | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-endpoints.md "https://joystream.org/schemas/argus/config#/properties/endpoints")     |
-| [directories](#directories) | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-directories.md "https://joystream.org/schemas/argus/config#/properties/directories") |
-| [logs](#logs)               | `object`  | Optional | cannot be null | [Distributor node configuration](definition-properties-logs.md "https://joystream.org/schemas/argus/config#/properties/logs")               |
-| [limits](#limits)           | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-limits.md "https://joystream.org/schemas/argus/config#/properties/limits")           |
-| [intervals](#intervals)     | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-intervals.md "https://joystream.org/schemas/argus/config#/properties/intervals")     |
-| [publicApi](#publicapi)     | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-publicapi.md "https://joystream.org/schemas/argus/config#/properties/publicApi")     |
-| [operatorApi](#operatorapi) | `object`  | Optional | cannot be null | [Distributor node configuration](definition-properties-operatorapi.md "https://joystream.org/schemas/argus/config#/properties/operatorApi") |
-| [keys](#keys)               | `array`   | Optional | cannot be null | [Distributor node configuration](definition-properties-keys.md "https://joystream.org/schemas/argus/config#/properties/keys")               |
-| [buckets](#buckets)         | `array`   | Optional | cannot be null | [Distributor node configuration](definition-properties-bucket-ids.md "https://joystream.org/schemas/argus/config#/properties/buckets")      |
-| [workerId](#workerid)       | `integer` | Optional | cannot be null | [Distributor node configuration](definition-properties-workerid.md "https://joystream.org/schemas/argus/config#/properties/workerId")       |
+| Property                    | Type      | Required | Nullable       | Defined by                                                                                                                                          |
+| :-------------------------- | :-------- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [id](#id)                   | `string`  | Required | cannot be null | [Distributor node configuration](definition-properties-id.md "https://joystream.org/schemas/argus/config#/properties/id")                           |
+| [endpoints](#endpoints)     | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-endpoints.md "https://joystream.org/schemas/argus/config#/properties/endpoints")             |
+| [directories](#directories) | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-directories.md "https://joystream.org/schemas/argus/config#/properties/directories")         |
+| [logs](#logs)               | `object`  | Optional | cannot be null | [Distributor node configuration](definition-properties-logs.md "https://joystream.org/schemas/argus/config#/properties/logs")                       |
+| [limits](#limits)           | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-limits.md "https://joystream.org/schemas/argus/config#/properties/limits")                   |
+| [intervals](#intervals)     | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-intervals.md "https://joystream.org/schemas/argus/config#/properties/intervals")             |
+| [publicApi](#publicapi)     | `object`  | Required | cannot be null | [Distributor node configuration](definition-properties-publicapi.md "https://joystream.org/schemas/argus/config#/properties/publicApi")             |
+| [operatorApi](#operatorapi) | `object`  | Optional | cannot be null | [Distributor node configuration](definition-properties-operatorapi.md "https://joystream.org/schemas/argus/config#/properties/operatorApi")         |
+| [keys](#keys)               | `array`   | Optional | cannot be null | [Distributor node configuration](definition-properties-keys.md "https://joystream.org/schemas/argus/config#/properties/keys")                       |
+| [buckets](#buckets)         | `array`   | Optional | cannot be null | [Distributor node configuration](definition-properties-distributed-buckets-ids.md "https://joystream.org/schemas/argus/config#/properties/buckets") |
+| [workerId](#workerid)       | `integer` | Optional | cannot be null | [Distributor node configuration](definition-properties-workerid.md "https://joystream.org/schemas/argus/config#/properties/workerId")               |
 
 ## id
 
@@ -190,21 +190,21 @@ an array of merged types ([Details](definition-properties-keys-items.md))
 
 ## buckets
 
-Set of bucket ids distributed by the node. If not specified, all buckets currently assigned to worker specified in `config.workerId` will be distributed.
+Set of bucket ids distributed by the node. If not specified, all buckets currently assigned to worker specified in `config.workerId` will be distributed. Expected bucket id format is: {familyId}:{bucketIndex}
 
 `buckets`
 
 *   is optional
 
-*   Type: `integer[]`
+*   Type: `string[]`
 
 *   cannot be null
 
-*   defined in: [Distributor node configuration](definition-properties-bucket-ids.md "https://joystream.org/schemas/argus/config#/properties/buckets")
+*   defined in: [Distributor node configuration](definition-properties-distributed-buckets-ids.md "https://joystream.org/schemas/argus/config#/properties/buckets")
 
 ### buckets Type
 
-`integer[]`
+`string[]`
 
 ### buckets Constraints