cdd2d6efc612b75577db49604eeb7dc35ba5f9b5

Author
sed-i <82407168+sed-i@users.noreply.github.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

feat(juju): introduce additional juju aliases (#10426)

Diff

 1diff --git a/plugins/juju/README.md b/plugins/juju/README.md
 2index 2417c466902d0d2a7f26aec1582cb57f67bae36b..918c08de5e6a9778c831cc695f7159ab2f99a693 100644
 3--- a/plugins/juju/README.md
 4+++ b/plugins/juju/README.md
 5@@ -18,26 +18,36 @@ Naming convention:
 6 
 7 ### General
 8 
 9-| Alias  | Command                                     | Description                                            |
10-|--------|---------------------------------------------|--------------------------------------------------------|
11-| `jdl`  | `juju debug-log --ms`                       | Display log, with millisecond resolution               |
12-| `jdlr` | `juju debug-log --ms --replay`              | Replay entire log                                      |
13-| `jh`   | `juju help`                                 | Show help on a command or other topic                  |
14-| `jssl` | `juju juju show-status-log`                 | Output past statuses for the specified entity          |
15-| `jstj` | `juju status --format=json`                 | Show status in json format (more detailed)             |
16-| `jst`  | `juju status --relations --storage --color` | Show status, including relations and storage, in color |
17+| Alias   | Command                                     | Description                                            |
18+|---------|---------------------------------------------|--------------------------------------------------------|
19+| `j`     | `juju`                                      | The juju command                                       |
20+| `jcld`  | `juju clouds`                               | Lists all clouds with registered credentials           |
21+| `jclda` | `juju clouds --all`                         | Lists all clouds available to Juju                     |
22+| `jdl`   | `juju debug-log --ms`                       | Display log, with millisecond resolution               |
23+| `jdlr`  | `juju debug-log --ms --replay`              | Replay entire log                                      |
24+| `jh`    | `juju help`                                 | Show help on a command or other topic                  |
25+| `jssl`  | `juju show-status-log`                      | Output past statuses for the specified entity          |
26+| `jstj`  | `juju status --format=json`                 | Show status in json format (more detailed)             |
27+| `jst`   | `juju status --relations --color`           | Show status, including relations, in color             |
28+| `jsts`  | `juju status --relations --storage --color` | Show status, including relations and storage, in color |
29 
30 ### Bootstrap
31 
32-| Alias | Command                   | Description                               |
33-|-------|---------------------------|-------------------------------------------|
34-| `jb`  | `juju bootstrap`          | Initializing a Juju cloud environment     |
35-| `jbm` | `juju bootstrap microk8s` | Initializing a MicroK8s cloud environment |
36+| Alias   | Command                             | Description                                           |
37+|---------|-------------------------------------|-------------------------------------------------------|
38+| `jb`    | `juju bootstrap`                    | Initializing a Juju cloud environment                 |
39+| `jbng`  | `juju bootstrap --no-gui`           | Initializing a Juju cloud environment without GUI     |
40+| `jbl`   | `juju bootstrap localhost`          | Initializing an lxd cloud environment                 |
41+| `jblng` | `juju bootstrap --no-gui localhost` | Initializing an lxd cloud environment without GUI     |
42+| `jbm`   | `juju bootstrap microk8s`           | Initializing a MicroK8s cloud environment             |
43+| `jbmng` | `juju bootstrap --no-gui microk8s`  | Initializing a MicroK8s cloud environment without GUI |
44 
45 ### Controller
46 
47 | Alias    | Command                                                                               | Description                                                       |
48 |----------|---------------------------------------------------------------------------------------|-------------------------------------------------------------------|
49+| `jctl`   | `juju controllers`                                                                    | List all controllers                                              |
50+| `jctlr`  | `juju controllers --refresh`                                                          | List all controllers (download latest details)                    |
51 | `jdc`    | `juju destroy-controller --destroy-all-models`                                        | Destroy a controller                                              |
52 | `jdc!`   | `juju destroy-controller --destroy-all-models --force --no-wait -y`                   | Destroy a controller                                              |
53 | `jdcds`  | `juju destroy-controller --destroy-all-models --destroy-storage`                      | Destroy a controller and associated storage                       |
54diff --git a/plugins/juju/juju.plugin.zsh b/plugins/juju/juju.plugin.zsh
55index cf89418c674ca3aa5847bec96b997003755ffc82..81fcd6376b3a0d1ad79034240017dbdf0177614c 100644
56--- a/plugins/juju/juju.plugin.zsh
57+++ b/plugins/juju/juju.plugin.zsh
58@@ -17,11 +17,20 @@ unset completion_file
59 #   - `!` means --force --no-wait -y                         #
60 #   - `ds` suffix means --destroy-storage                    #
61 # ---------------------------------------------------------- #
62+alias j="juju"
63 alias jam="juju add-model --config logging-config=\"<root>=WARNING; unit=DEBUG\"\
64  --config update-status-hook-interval=\"60m\""
65 alias jb='juju bootstrap'
66+alias jbng='juju bootstrap --no-gui'
67+alias jbl='juju bootstrap localhost'
68+alias jblng='juju bootstrap --no-gui localhost'
69 alias jbm='juju bootstrap microk8s'
70+alias jbmng='juju bootstrap --no-gui microk8s'
71 alias jc='juju config'
72+alias jcld='juju clouds'
73+alias jclda='juju clouds --all'
74+alias jctl='juju controllers'
75+alias jctlr='juju controllers --refresh'
76 alias jdc='juju destroy-controller --destroy-all-models'
77 alias 'jdc!'='juju destroy-controller --destroy-all-models --force --no-wait -y'
78 alias jdcds='juju destroy-controller --destroy-all-models --destroy-storage'
79@@ -61,7 +70,8 @@ alias jshc='juju ssh --container'
80 alias jshm='juju show-model'
81 alias jssl='juju show-status-log'
82 alias jstj='juju status --format=json'
83-alias jst='juju status --relations --storage --color'
84+alias jst='juju status --relations --color'
85+alias jsts='juju status --relations --storage --color'
86 alias jsu='juju show-unit'
87 alias jsw='juju switch'
88