Back to Ohmyzsh

juju plugin

plugins/juju/README.md

latest10.7 KB
Original Source

juju plugin

This plugin provides useful aliases and functions for juju (for TAB completion, refer to the official repo).

To use this plugin, add juju to the plugins array in your zshrc file.

zsh
plugins=(... juju)

Aliases

Naming convention:

  • ! suffix: --force --no-wait -y.
  • ds suffix: --destroy-storage.
  • jsh prefix means juju show-*.

General

AliasCommandDescription
jjujuThe juju command
jcldjuju cloudsLists all clouds with registered credentials
jcldajuju clouds --allLists all clouds available to Juju
jdljuju debug-log --msDisplay log, with millisecond resolution
jdlrjuju debug-log --ms --replayReplay entire log
jhjuju helpShow help on a command or other topic
jshsljuju show-status-logOutput past statuses for the specified entity
jstjjuju status --format=jsonShow status in json format (more detailed)
jstjuju status --relations --colorShow status, including relations, in color
jstsjuju status --relations --storage --colorShow status, including relations and storage, in color

Bootstrap

AliasCommandDescription
jbjuju bootstrapInitializing a Juju cloud environment
jbngjuju bootstrap --no-guiInitializing a Juju cloud environment without GUI
jbljuju bootstrap localhostInitializing an lxd cloud environment
jblngjuju bootstrap --no-gui localhostInitializing an lxd cloud environment without GUI
jbmjuju bootstrap microk8sInitializing a MicroK8s cloud environment
jbmngjuju bootstrap --no-gui microk8sInitializing a MicroK8s cloud environment without GUI

Controller

AliasCommandDescription
jctljuju controllersList all controllers
jctlrjuju controllers --refreshList all controllers (download latest details)
jdcjuju destroy-controller --destroy-all-modelsDestroy a controller
jdc!juju destroy-controller --destroy-all-models --force --no-wait -yDestroy a controller
jdcdsjuju destroy-controller --destroy-all-models --destroy-storageDestroy a controller and associated storage
jdcds!juju destroy-controller --destroy-all-models --destroy-storage --force --no-wait -yDestroy a controller and associated storage
jkcjuju kill-controller -y -t 0Forcibly terminate all associated resources for a Juju controller
jshcjuju show-controllerShows detailed information of a controller
jswjuju switchSelect or identify the current controller and model

Model

AliasCommandDescription
jamjuju add-modelAdd a hosted model
jdmjuju destroy-modelNon-recoverable, complete removal of a model
jdm!juju destroy-model --force --no-wait -yNon-recoverable, complete removal of a model
jdmdsjuju destroy-model --destroy-storageNon-recoverable, complete removal of a model
jdmds!juju destroy-model --destroy-storage --force --no-wait -yNon-recoverable, complete removal of a model
jmcjuju model-configDisplay or set configuration values on a model
jmjuju modelsList models a user can access on a controller
jshmjuju show-modelShow information about the current or specified model
jswjuju switchSelect or identify the current controller and model

Application / unit

AliasCommandDescription
jcjuju configGet, set, or reset configuration for a deployed application
jdejuju deploy --channel=edgeDeploy a new application or bundle from the edge channel
jdjuju deployDeploy a new application or bundle
jrajuju run-actionQueue an action for execution
jrawjuju run-action --waitQueue an action for execution and wait for results, with optional timeout
jrmjuju remove-applicationRemove application
jrm!juju remove-application --force --no-waitRemove application forcefully
jrmdsjuju remove-application --destroy-storageRemove application and destroy attached storage
jrmds!juju remove-application --destroy-storage --force --no-waitRemove application forcefully, destroying attached storage
jrpjuju refresh --pathUpgrade charm from local charm file
jsajuju scale-applicationSet the desired number of application units
jsshjuju sshInitiate an SSH session or execute a command on a Juju target
jsshcjuju ssh --containerInitiate an SSH session or execute a command on a given container
jshujuju show-unitDisplays information about a unit

Storage

AliasCommandDescription
jrsjuju remove-storageRemove storage
jrs!juju remove-storage --forceRemove storage even if it is currently attached

Relation

AliasCommandDescription
jreljuju relateRelate two applications
jrmreljuju remove-relationRemove an existing relation between two applications.
jrmrel!juju remove-relation --forceRemove an existing relation between two applications, forcefully.

Cross-model relation (CMR)

AliasCommandDescription
jexjuju exposeMake an application publicly available over the network
jofjuju offerOffer application endpoints for use in other models
jconjuju consumeAdd a remote offer to the model
jrmsasjuju remove-saasRemove consumed applications (SAAS) from the model
junexjuju unexposeRemove public availability over the network for an application

Bundle

AliasCommandDescription
jebjuju export-bundleExport the current model configuration as a reusable bundle

Functions

  • jaddr <app_name> [unit_num]: display app or unit IP address.
  • jreld <relation_name> <app_name> <unit_num>: display app and unit relation data.
  • jclean: destroy all controllers
  • jcontroller: display the controller your are connected to.
  • jmodel: display the model your are connected to.
  • wjst [interval_secs] [args_for_watch]: watch juju status, with optional interval (default: 5s); you may pass additional arguments to watch.