diff --git a/docs/commands.adoc b/docs/commands.adoc index 8385cab4..f7799489 100644 --- a/docs/commands.adoc +++ b/docs/commands.adoc @@ -5,151 +5,9 @@ them with built-in other shell commands as well as executables from your environ include::commands/buckets.adoc[] -=== Working with `scopes` and `collections` +include::commands/scopes.adoc[] -The `scopes` and `collections` commands can be used for managing scopes and collection respectively. - -==== Scopes - -``` -> scopes -h -Fetches scopes through the HTTP API - -Usage: - > scopes {flags} - -Subcommands: - scopes create - Creates scopes through the HTTP API - scopes drop - Deletes scopes through the HTTP API - -Flags: - -h, --help - Display the help message for this command - --bucket - the name of the bucket - --clusters - the clusters to query against -``` - -To list all scopes in the bucket you would use: - -``` -> scopes -╭───┬─────────────────┬───────────╮ -│ # │ scope │ cluster │ -├───┼─────────────────┼───────────┤ -│ 0 │ inventory │ dev.local │ -│ 1 │ tenant_agent_00 │ dev.local │ -│ 2 │ tenant_agent_01 │ dev.local │ -│ 3 │ tenant_agent_02 │ dev.local │ -│ 4 │ tenant_agent_03 │ dev.local │ -│ 5 │ tenant_agent_04 │ dev.local │ -│ 6 │ _default │ dev.local │ -╰───┴─────────────────┴───────────╯ -``` - -You can also create and remove scopes: - -``` -> scopes create tenant_agent_05 -> scopes -╭───┬─────────────────┬───────────╮ -│ # │ scope │ cluster │ -├───┼─────────────────┼───────────┤ -│ 0 │ tenant_agent_05 │ dev.local │ -│ 1 │ inventory │ dev.local │ -│ 2 │ tenant_agent_00 │ dev.local │ -│ 3 │ tenant_agent_01 │ dev.local │ -│ 4 │ tenant_agent_02 │ dev.local │ -│ 5 │ tenant_agent_03 │ dev.local │ -│ 6 │ tenant_agent_04 │ dev.local │ -│ 7 │ _default │ dev.local │ -╰───┴─────────────────┴───────────╯ -``` - -``` -> scopes drop tenant_agent_05 -> scopes -╭───┬─────────────────┬───────────╮ -│ # │ scope │ cluster │ -├───┼─────────────────┼───────────┤ -│ 0 │ inventory │ dev.local │ -│ 1 │ tenant_agent_00 │ dev.local │ -│ 2 │ tenant_agent_01 │ dev.local │ -│ 3 │ tenant_agent_02 │ dev.local │ -│ 4 │ tenant_agent_03 │ dev.local │ -│ 5 │ tenant_agent_04 │ dev.local │ -│ 6 │ _default │ dev.local │ -╰───┴─────────────────┴───────────╯ -``` - -==== Collections - -``` -> collections -h -Fetches collections through the HTTP API - -Usage: - > collections {flags} - -Subcommands: - collections create - Creates collections through the HTTP API - collections drop - Deletes collections through the HTTP API - -Flags: - -h, --help - Display the help message for this command - --bucket - the name of the bucket - --scope - the name of the scope - --clusters - the clusters to query against -``` - -To list all collection in the bucket you would use: - -``` -> collections -╭────┬─────────────────┬────────────┬────────────┬───────────╮ -│ # │ scope │ collection │ max_expiry │ cluster │ -├────┼─────────────────┼────────────┼────────────┼───────────┤ -│ 0 │ inventory │ landmark │ 0sec │ dev.local │ -│ 1 │ inventory │ hotel │ 0sec │ dev.local │ -│ 2 │ inventory │ airport │ 0sec │ dev.local │ -│ 3 │ inventory │ airline │ 0sec │ dev.local │ -│ 4 │ inventory │ route │ 0sec │ dev.local │ -│ 5 │ tenant_agent_00 │ bookings │ 0sec │ dev.local │ -│ 6 │ tenant_agent_00 │ users │ 0sec │ dev.local │ -│ 7 │ tenant_agent_01 │ users │ 0sec │ dev.local │ -│ 8 │ tenant_agent_01 │ bookings │ 0sec │ dev.local │ -│ 9 │ tenant_agent_02 │ users │ 0sec │ dev.local │ -│ 10 │ tenant_agent_02 │ bookings │ 0sec │ dev.local │ -│ 11 │ tenant_agent_03 │ users │ 0sec │ dev.local │ -│ 12 │ tenant_agent_03 │ bookings │ 0sec │ dev.local │ -│ 13 │ tenant_agent_04 │ users │ 0sec │ dev.local │ -│ 14 │ tenant_agent_04 │ bookings │ 0sec │ dev.local │ -│ 15 │ _default │ _default │ 0sec │ dev.local │ -╰────┴─────────────────┴────────────┴────────────┴───────────╯ -``` - -You can also create and remove collections: - -``` -> collections create staff --scope tenant_agent_00 -> collections --scope tenant_agent_00 -╭───┬─────────────────┬────────────┬────────────┬───────────╮ -│ # │ scope │ collection │ max_expiry │ cluster │ -├───┼─────────────────┼────────────┼────────────┼───────────┤ -│ 0 │ tenant_agent_00 │ staff │ 0sec │ dev.local │ -│ 1 │ tenant_agent_00 │ bookings │ 0sec │ dev.local │ -│ 2 │ tenant_agent_00 │ users │ 0sec │ dev.local │ -╰───┴─────────────────┴────────────┴────────────┴───────────╯ -``` - -``` -> collections drop staff --scope tenant_agent_00 -> collections --scope tenant_agent_00 -╭───┬─────────────────┬────────────┬────────────┬───────────╮ -│ # │ scope │ collection │ max_expiry │ cluster │ -├───┼─────────────────┼────────────┼────────────┼───────────┤ -│ 0 │ tenant_agent_00 │ bookings │ 0sec │ dev.local │ -│ 1 │ tenant_agent_00 │ users │ 0sec │ dev.local │ -╰───┴─────────────────┴────────────┴────────────┴───────────╯ -``` +include::commands/collections.adoc[] === Listing `nodes` diff --git a/docs/commands/collections.adoc b/docs/commands/collections.adoc new file mode 100644 index 00000000..c27580fb --- /dev/null +++ b/docs/commands/collections.adoc @@ -0,0 +1,63 @@ +=== collections + +The `collections` commands are used to manage collections. + +==== `collections` + +Lists all of the collections in the active scope: + +``` +👤 Charlie 🏠 local in 🗄 travel-sample.inventory._default +> collections +╭───┬────────────┬────────────┬─────────╮ +│ # │ collection │ max_expiry │ cluster │ +├───┼────────────┼────────────┼─────────┤ +│ 0 │ landmark │ inherited │ local │ +│ 1 │ hotel │ inherited │ local │ +│ 2 │ airport │ inherited │ local │ +│ 3 │ airline │ inherited │ local │ +│ 4 │ route │ inherited │ local │ +╰───┴────────────┴────────────┴─────────╯ +``` + +==== `collections create` + +Create a collection with the name supplied: + +``` +👤 Charlie 🏠 local in 🗄 my-bucket.my-scope._default +> collections +╭────────────╮ +│ empty list │ +╰────────────╯ +👤 Charlie 🏠 local in 🗄 my-bucket.my-scope._default +> collections create new-collection +👤 Charlie 🏠 local in 🗄 my-bucket.my-scope._default +> collections +╭───┬────────────────┬────────────┬─────────╮ +│ # │ collection │ max_expiry │ cluster │ +├───┼────────────────┼────────────┼─────────┤ +│ 0 │ new-collection │ inherited │ local │ +╰───┴────────────────┴────────────┴─────────╯ +``` + +==== `collections drop` + +Drop the collection matching the name given: + +``` +👤 Charlie 🏠 local in 🗄 default.my-scope._default +> collections +╭───┬────────────────┬────────────┬─────────╮ +│ # │ collection │ max_expiry │ cluster │ +├───┼────────────────┼────────────┼─────────┤ +│ 0 │ new-collection │ inherited │ local │ +╰───┴────────────────┴────────────┴─────────╯ +👤 Charlie 🏠 local in 🗄 default.my-scope._default +> collections drop new-collection +👤 Charlie 🏠 local in 🗄 default.my-scope._default +> collections +╭────────────╮ +│ empty list │ +╰────────────╯ +``` \ No newline at end of file diff --git a/docs/commands/scopes.adoc b/docs/commands/scopes.adoc new file mode 100644 index 00000000..dcb88ac4 --- /dev/null +++ b/docs/commands/scopes.adoc @@ -0,0 +1,73 @@ +=== scopes + +The `scopes` commands are used to manage scopes. + +==== `scopes` + +Lists all of the scopes in the active bucket: + +``` +👤 Charlie 🏠 local in 🗄 travel-sample._default._default +> scopes +╭───┬─────────────────┬─────────╮ +│ # │ scope │ cluster │ +├───┼─────────────────┼─────────┤ +│ 0 │ inventory │ local │ +│ 1 │ tenant_agent_00 │ local │ +│ 2 │ tenant_agent_01 │ local │ +│ 3 │ tenant_agent_02 │ local │ +│ 4 │ tenant_agent_03 │ local │ +│ 5 │ tenant_agent_04 │ local │ +│ 6 │ _default │ local │ +╰───┴─────────────────┴─────────╯ +``` + + +==== `scopes create` + +Creates a scope with the name supplied: + +``` +👤 Charlie 🏠 local in 🗄 default._default._default +> scopes +╭───┬──────────┬─────────╮ +│ # │ scope │ cluster │ +├───┼──────────┼─────────┤ +│ 0 │ _default │ local │ +╰───┴──────────┴─────────╯ +👤 Charlie 🏠 local in 🗄 default._default._default +> scopes create new-scope +👤 Charlie 🏠 local in 🗄 default._default._default +> scopes +╭───┬───────────┬─────────╮ +│ # │ scope │ cluster │ +├───┼───────────┼─────────┤ +│ 0 │ new-scope │ local │ +│ 1 │ _default │ local │ +╰───┴───────────┴─────────╯ +``` + +==== `scopes drop` + + +Deletes the scope matching the given name: + +``` +👤 Charlie 🏠 local in 🗄 default._default._default +> scopes +╭───┬───────────┬─────────╮ +│ # │ scope │ cluster │ +├───┼───────────┼─────────┤ +│ 0 │ new-scope │ local │ +│ 1 │ _default │ local │ +╰───┴───────────┴─────────╯ +👤 Charlie 🏠 local in 🗄 default._default._default +> scopes drop new-scope +👤 Charlie 🏠 local in 🗄 default._default._default +> scopes +╭───┬──────────┬─────────╮ +│ # │ scope │ cluster │ +├───┼──────────┼─────────┤ +│ 0 │ _default │ local │ +╰───┴──────────┴─────────╯ +``` \ No newline at end of file