]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/juju/README.md
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / juju / README.md
1 # juju plugin
2
3 This plugin provides useful aliases and functions for [juju](https://juju.is/) (for TAB completion,
4 refer to the [official repo](https://github.com/juju/juju/blob/develop/etc/bash_completion.d/juju)).
5
6 To use this plugin, add `juju` to the plugins array in your zshrc file.
7
8 ```zsh
9 plugins=(... juju)
10 ```
11
12 ## Aliases
13
14 Naming convention:
15
16 - `!` suffix: `--force --no-wait -y`.
17 - `ds` suffix: `--destroy-storage`.
18 - `jsh` prefix means `juju show-*`.
19
20 ### General
21
22 | Alias   | Command                                     | Description                                            |
23 |---------|---------------------------------------------|--------------------------------------------------------|
24 | `j`     | `juju`                                      | The juju command                                       |
25 | `jcld`  | `juju clouds`                               | Lists all clouds with registered credentials           |
26 | `jclda` | `juju clouds --all`                         | Lists all clouds available to Juju                     |
27 | `jdl`   | `juju debug-log --ms`                       | Display log, with millisecond resolution               |
28 | `jdlr`  | `juju debug-log --ms --replay`              | Replay entire log                                      |
29 | `jh`    | `juju help`                                 | Show help on a command or other topic                  |
30 | `jshsl` | `juju show-status-log`                      | Output past statuses for the specified entity          |
31 | `jstj`  | `juju status --format=json`                 | Show status in json format (more detailed)             |
32 | `jst`   | `juju status --relations --color`           | Show status, including relations, in color             |
33 | `jsts`  | `juju status --relations --storage --color` | Show status, including relations and storage, in color |
34
35 ### Bootstrap
36
37 | Alias   | Command                             | Description                                           |
38 |---------|-------------------------------------|-------------------------------------------------------|
39 | `jb`    | `juju bootstrap`                    | Initializing a Juju cloud environment                 |
40 | `jbng`  | `juju bootstrap --no-gui`           | Initializing a Juju cloud environment without GUI     |
41 | `jbl`   | `juju bootstrap localhost`          | Initializing an lxd cloud environment                 |
42 | `jblng` | `juju bootstrap --no-gui localhost` | Initializing an lxd cloud environment without GUI     |
43 | `jbm`   | `juju bootstrap microk8s`           | Initializing a MicroK8s cloud environment             |
44 | `jbmng` | `juju bootstrap --no-gui microk8s`  | Initializing a MicroK8s cloud environment without GUI |
45
46 ### Controller
47
48 | Alias    | Command                                                                               | Description                                                       |
49 |----------|---------------------------------------------------------------------------------------|-------------------------------------------------------------------|
50 | `jctl`   | `juju controllers`                                                                    | List all controllers                                              |
51 | `jctlr`  | `juju controllers --refresh`                                                          | List all controllers (download latest details)                    |
52 | `jdc`    | `juju destroy-controller --destroy-all-models`                                        | Destroy a controller                                              |
53 | `jdc!`   | `juju destroy-controller --destroy-all-models --force --no-wait -y`                   | Destroy a controller                                              |
54 | `jdcds`  | `juju destroy-controller --destroy-all-models --destroy-storage`                      | Destroy a controller and associated storage                       |
55 | `jdcds!` | `juju destroy-controller --destroy-all-models --destroy-storage --force --no-wait -y` | Destroy a controller and associated storage                       |
56 | `jkc`    | `juju kill-controller -y -t 0`                                                        | Forcibly terminate all associated resources for a Juju controller |
57 | `jshc`   | `juju show-controller`                                                                | Shows detailed information of a controller                    |
58 | `jsw`    | `juju switch`                                                                         | Select or identify the current controller and model               |
59
60 ### Model
61
62 | Alias    | Command                                                     | Description                                           |
63 |----------|-------------------------------------------------------------|-------------------------------------------------------|
64 | `jam`    | `juju add-model`                                            | Add a hosted model                                    |
65 | `jdm`    | `juju destroy-model`                                        | Non-recoverable, complete removal of a model          |
66 | `jdm!`   | `juju destroy-model --force --no-wait -y`                   | Non-recoverable, complete removal of a model          |
67 | `jdmds`  | `juju destroy-model --destroy-storage`                      | Non-recoverable, complete removal of a model          |
68 | `jdmds!` | `juju destroy-model --destroy-storage --force --no-wait -y` | Non-recoverable, complete removal of a model          |
69 | `jmc`    | `juju model-config`                                         | Display or set configuration values on a model        |
70 | `jm`     | `juju models`                                               | List models a user can access on a controller         |
71 | `jshm`   | `juju show-model`                                           | Show information about the current or specified model |
72 | `jsw`    | `juju switch`                                               | Select or identify the current controller and model   |
73
74 ### Application / unit
75
76 | Alias    | Command                                                       | Description                                                               |
77 |----------|---------------------------------------------------------------|---------------------------------------------------------------------------|
78 | `jc`     | `juju config`                                                 | Get, set, or reset configuration for a deployed application               |
79 | `jde`    | `juju deploy --channel=edge`                                  | Deploy a new application or bundle from the edge channel                  |
80 | `jd`     | `juju deploy`                                                 | Deploy a new application or bundle                                        |
81 | `jra`    | `juju run-action`                                             | Queue an action for execution                                             |
82 | `jraw`   | `juju run-action --wait`                                      | Queue an action for execution and wait for results, with optional timeout |
83 | `jrm`    | `juju remove-application`                                     | Remove application                                                        |
84 | `jrm!`   | `juju remove-application --force --no-wait`                   | Remove application forcefully                                             |
85 | `jrmds`  | `juju remove-application --destroy-storage`                   | Remove application and destroy attached storage                           |
86 | `jrmds!` | `juju remove-application --destroy-storage --force --no-wait` | Remove application forcefully, destroying attached storage                |
87 | `jrp`    | `juju refresh --path`                                         | Upgrade charm from local charm file                                       |
88 | `jsa`    | `juju scale-application`                                      | Set the desired number of application units                               |
89 | `jssh`   | `juju ssh`                                                    | Initiate an SSH session or execute a command on a Juju target             |
90 | `jsshc`  | `juju ssh --container`                                        | Initiate an SSH session or execute a command on a given container         |
91 | `jshu`   | `juju show-unit`                                              | Displays information about a unit                                         |
92
93 ### Storage
94
95 | Alias   | Command                       | Description                                     |
96 |---------|-------------------------------|-------------------------------------------------|
97 | `jrs`   | `juju remove-storage`         | Remove storage                                  |
98 | `jrs!`  | `juju remove-storage --force` | Remove storage even if it is currently attached |
99
100 ### Relation
101
102 | Alias     | Command                        | Description                                                       |
103 |-----------|--------------------------------|-------------------------------------------------------------------|
104 | `jrel`    | `juju relate`                  | Relate two applications                                           |
105 | `jrmrel`  | `juju remove-relation`         | Remove an existing relation between two applications.             |
106 | `jrmrel!` | `juju remove-relation --force` | Remove an existing relation between two applications, forcefully. |
107
108 ### Cross-model relation (CMR)
109
110 | Alias    | Command            | Description                                                    |
111 |----------|--------------------|----------------------------------------------------------------|
112 | `jex`    | `juju expose`      | Make an application publicly available over the network        |
113 | `jof`    | `juju offer`       | Offer application endpoints for use in other models            |
114 | `jcon`   | `juju consume`     | Add a remote offer to the model                                |
115 | `jrmsas` | `juju remove-saas` | Remove consumed applications (SAAS) from the model             |
116 | `junex`  | `juju unexpose`    | Remove public availability over the network for an application |
117
118 ### Bundle
119
120 | Alias | Command              | Description                                                 |
121 |-------|----------------------|-------------------------------------------------------------|
122 | `jeb` | `juju export-bundle` | Export the current model configuration as a reusable bundle |
123
124 ## Functions
125
126 - `jaddr <app_name> [unit_num]`: display app or unit IP address.
127 - `jreld <relation_name> <app_name> <unit_num>`: display app and unit relation data.
128 - `jclean`: destroy all controllers
129 - `wjst [interval_secs] [args_for_watch]`: watch juju status, with optional interval
130   (default: 5s); you may pass additional arguments to `watch`.