UNPKG

@canonical/jujulib

Version:
259 lines (222 loc) 30.9 kB
<!-- This file is automatically generated when building the project. Do not make changes to this file. Update the template generator/templates/readme.ts instead. --> # JS Jujulib This project provides a JavaScript API client library for interacting with the Juju WebSocket API. - [Getting Started](#getting-started) - [Client API Reference](#client-api-reference) - [Examples](#examples) - [Facade API Reference](#facade-api-reference) - [Library Maintenance](#library-maintenance) - [Updating Library Facades](#updating-library-facades) - [Releasing to NPM](#releasing-to-npm) ## Getting Started To access the Juju API, a connection must be made to either a Juju controller or a Juju model. ```javascript import { connect } from "@canonical/jujulib"; import Client from "@canonical/jujulib/dist/api/facades/client"; import ModelManager from "@canonical/jujulib/dist/api/facades/model-manager"; // Nodejs // import WebSocket from "ws"; const serverURL = "ws://localhost:17070"; const credentials = { username: "admin", password: "test", }; // Connect to the controller const controller = await connect(`${serverURL}/api`, { facades: [ModelManager], wsclass: WebSocket, }); let conn = await controller.login(credentials); // Get the list of models const modelManager = conn.facades.modelManager; const response = await modelManager.listModels({ tag: conn.info.user.identity, }); const models = response["user-models"]; console.log("models:", models); // Close the connection to the controller conn.transport.close(); // Login to each model for (const modelDetails of models) { const model = await connect( `${serverURL}/model/${modelDetails.model.uuid}/api`, { facades: [Client], wsclass: WebSocket, } ); conn = await model.login(credentials); // Get the details of the model const client = conn.facades.client; console.log("model details:", await client.fullStatus()); // Close the connection to the model conn.transport.close(); } ``` In the code above, a connection is established to the provided controller API URL where the client declares interest in using the facade `ModelManager`, and we establish a new connection with each model API to get the full details using the facade `Client`. **Note:** Facades are used to supported different versions of juju, when multiple versions of the same facade are supported by the juju API (like the two client versions in the example), the most recent version supported by the server is made available to the client. The `connect` method returns a `juju` object which is used to log into the controller or model by providing a user/pass credentials or [macaroons](https://github.com/juju/bakeryjs). See the [various examples](#examples). ## Client API Reference Visit the [full API documentation](https://juju.github.io/js-libjuju/) for detailed information on the Client API. ## Examples We have a number of examples showing how to perform a few common tasks. Those can be found in the `examples` folder. - [add-machine.js](https://github.com/juju/js-libjuju/blob/master/examples/add-machine.js) - [deploy.js](https://github.com/juju/js-libjuju/blob/master/examples/deploy.js) - [login-with-bakery.js](https://github.com/juju/js-libjuju/blob/master/examples/login-with-bakery.js) - [watch-all-models.js](https://github.com/juju/js-libjuju/blob/master/examples/watch-all-models.js) - [watch.js](https://github.com/juju/js-libjuju/blob/master/examples/watch.js) ## Facade API Reference Detailed Facade documentation is available as part of the [full API documentation](https://juju.github.io/js-libjuju/) or you can visit the facade source directly using the following links: |Facade|Versions| |-|-| |ActionPruner|<ul><li>[ActionPrunerV1.ts](https://juju.github.io/js-libjuju/modules/facades_action_pruner_ActionPrunerV1.html)</li></ul>| |Action|<ul><li>[ActionV6.ts](https://juju.github.io/js-libjuju/modules/facades_action_ActionV6.html)</li><li>[ActionV7.ts](https://juju.github.io/js-libjuju/modules/facades_action_ActionV7.html)</li></ul>| |Admin|<ul><li>[AdminV3.ts](https://juju.github.io/js-libjuju/modules/facades_admin_AdminV3.html)</li></ul>| |AgentLifeFlag|<ul><li>[AgentLifeFlagV1.ts](https://juju.github.io/js-libjuju/modules/facades_agent_life_flag_AgentLifeFlagV1.html)</li></ul>| |AgentTools|<ul><li>[AgentToolsV1.ts](https://juju.github.io/js-libjuju/modules/facades_agent_tools_AgentToolsV1.html)</li></ul>| |Agent|<ul><li>[AgentV2.ts](https://juju.github.io/js-libjuju/modules/facades_agent_AgentV2.html)</li><li>[AgentV3.ts](https://juju.github.io/js-libjuju/modules/facades_agent_AgentV3.html)</li></ul>| |AllModelWatcher|<ul><li>[AllModelWatcherV2.ts](https://juju.github.io/js-libjuju/modules/facades_all_model_watcher_AllModelWatcherV2.html)</li><li>[AllModelWatcherV3.ts](https://juju.github.io/js-libjuju/modules/facades_all_model_watcher_AllModelWatcherV3.html)</li><li>[AllModelWatcherV4.ts](https://juju.github.io/js-libjuju/modules/facades_all_model_watcher_AllModelWatcherV4.html)</li></ul>| |AllWatcher|<ul><li>[AllWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_all_watcher_AllWatcherV1.html)</li><li>[AllWatcherV2.ts](https://juju.github.io/js-libjuju/modules/facades_all_watcher_AllWatcherV2.html)</li><li>[AllWatcherV3.ts](https://juju.github.io/js-libjuju/modules/facades_all_watcher_AllWatcherV3.html)</li></ul>| |Annotations|<ul><li>[AnnotationsV2.ts](https://juju.github.io/js-libjuju/modules/facades_annotations_AnnotationsV2.html)</li></ul>| |ApplicationOffers|<ul><li>[ApplicationOffersV2.ts](https://juju.github.io/js-libjuju/modules/facades_application_offers_ApplicationOffersV2.html)</li><li>[ApplicationOffersV3.ts](https://juju.github.io/js-libjuju/modules/facades_application_offers_ApplicationOffersV3.html)</li><li>[ApplicationOffersV4.ts](https://juju.github.io/js-libjuju/modules/facades_application_offers_ApplicationOffersV4.html)</li></ul>| |ApplicationScaler|<ul><li>[ApplicationScalerV1.ts](https://juju.github.io/js-libjuju/modules/facades_application_scaler_ApplicationScalerV1.html)</li></ul>| |Application|<ul><li>[ApplicationV12.ts](https://juju.github.io/js-libjuju/modules/facades_application_ApplicationV12.html)</li><li>[ApplicationV13.ts](https://juju.github.io/js-libjuju/modules/facades_application_ApplicationV13.html)</li><li>[ApplicationV14.ts](https://juju.github.io/js-libjuju/modules/facades_application_ApplicationV14.html)</li><li>[ApplicationV15.ts](https://juju.github.io/js-libjuju/modules/facades_application_ApplicationV15.html)</li><li>[ApplicationV18.ts](https://juju.github.io/js-libjuju/modules/facades_application_ApplicationV18.html)</li><li>[ApplicationV19.ts](https://juju.github.io/js-libjuju/modules/facades_application_ApplicationV19.html)</li></ul>| |Backups|<ul><li>[BackupsV2.ts](https://juju.github.io/js-libjuju/modules/facades_backups_BackupsV2.html)</li><li>[BackupsV3.ts](https://juju.github.io/js-libjuju/modules/facades_backups_BackupsV3.html)</li></ul>| |Block|<ul><li>[BlockV2.ts](https://juju.github.io/js-libjuju/modules/facades_block_BlockV2.html)</li></ul>| |Bundle|<ul><li>[BundleV1.ts](https://juju.github.io/js-libjuju/modules/facades_bundle_BundleV1.html)</li><li>[BundleV4.ts](https://juju.github.io/js-libjuju/modules/facades_bundle_BundleV4.html)</li><li>[BundleV5.ts](https://juju.github.io/js-libjuju/modules/facades_bundle_BundleV5.html)</li><li>[BundleV6.ts](https://juju.github.io/js-libjuju/modules/facades_bundle_BundleV6.html)</li></ul>| |CAASAdmission|<ul><li>[CAASAdmissionV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasadmission_CAASAdmissionV1.html)</li></ul>| |CAASAgent|<ul><li>[CAASAgentV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasagent_CAASAgentV1.html)</li><li>[CAASAgentV2.ts](https://juju.github.io/js-libjuju/modules/facades_caasagent_CAASAgentV2.html)</li></ul>| |CAASApplicationProvisioner|<ul><li>[CAASApplicationProvisionerV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasapplication_provisioner_CAASApplicationProvisionerV1.html)</li></ul>| |CAASApplication|<ul><li>[CAASApplicationV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasapplication_CAASApplicationV1.html)</li></ul>| |CAASFirewallerEmbedded|<ul><li>[CAASFirewallerEmbeddedV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasfirewaller_embedded_CAASFirewallerEmbeddedV1.html)</li></ul>| |CAASFirewallerSidecar|<ul><li>[CAASFirewallerSidecarV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasfirewaller_sidecar_CAASFirewallerSidecarV1.html)</li></ul>| |CAASFirewaller|<ul><li>[CAASFirewallerV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasfirewaller_CAASFirewallerV1.html)</li></ul>| |CAASModelConfigManager|<ul><li>[CAASModelConfigManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasmodel_config_manager_CAASModelConfigManagerV1.html)</li></ul>| |CAASModelOperator|<ul><li>[CAASModelOperatorV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasmodel_operator_CAASModelOperatorV1.html)</li></ul>| |CAASOperatorProvisioner|<ul><li>[CAASOperatorProvisionerV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasoperator_provisioner_CAASOperatorProvisionerV1.html)</li></ul>| |CAASOperatorUpgrader|<ul><li>[CAASOperatorUpgraderV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasoperator_upgrader_CAASOperatorUpgraderV1.html)</li></ul>| |CAASOperator|<ul><li>[CAASOperatorV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasoperator_CAASOperatorV1.html)</li></ul>| |CAASUnitProvisioner|<ul><li>[CAASUnitProvisionerV1.ts](https://juju.github.io/js-libjuju/modules/facades_caasunit_provisioner_CAASUnitProvisionerV1.html)</li><li>[CAASUnitProvisionerV2.ts](https://juju.github.io/js-libjuju/modules/facades_caasunit_provisioner_CAASUnitProvisionerV2.html)</li></ul>| |CharmDownloader|<ul><li>[CharmDownloaderV1.ts](https://juju.github.io/js-libjuju/modules/facades_charm_downloader_CharmDownloaderV1.html)</li></ul>| |CharmHub|<ul><li>[CharmHubV1.ts](https://juju.github.io/js-libjuju/modules/facades_charm_hub_CharmHubV1.html)</li></ul>| |CharmRevisionUpdater|<ul><li>[CharmRevisionUpdaterV2.ts](https://juju.github.io/js-libjuju/modules/facades_charm_revision_updater_CharmRevisionUpdaterV2.html)</li></ul>| |Charms|<ul><li>[CharmsV2.ts](https://juju.github.io/js-libjuju/modules/facades_charms_CharmsV2.html)</li><li>[CharmsV4.ts](https://juju.github.io/js-libjuju/modules/facades_charms_CharmsV4.html)</li><li>[CharmsV5.ts](https://juju.github.io/js-libjuju/modules/facades_charms_CharmsV5.html)</li><li>[CharmsV6.ts](https://juju.github.io/js-libjuju/modules/facades_charms_CharmsV6.html)</li><li>[CharmsV7.ts](https://juju.github.io/js-libjuju/modules/facades_charms_CharmsV7.html)</li></ul>| |Cleaner|<ul><li>[CleanerV2.ts](https://juju.github.io/js-libjuju/modules/facades_cleaner_CleanerV2.html)</li></ul>| |Client|<ul><li>[ClientV2.ts](https://juju.github.io/js-libjuju/modules/facades_client_ClientV2.html)</li><li>[ClientV3.ts](https://juju.github.io/js-libjuju/modules/facades_client_ClientV3.html)</li><li>[ClientV5.ts](https://juju.github.io/js-libjuju/modules/facades_client_ClientV5.html)</li><li>[ClientV6.ts](https://juju.github.io/js-libjuju/modules/facades_client_ClientV6.html)</li><li>[ClientV7.ts](https://juju.github.io/js-libjuju/modules/facades_client_ClientV7.html)</li></ul>| |Cloud|<ul><li>[CloudV1.ts](https://juju.github.io/js-libjuju/modules/facades_cloud_CloudV1.html)</li><li>[CloudV2.ts](https://juju.github.io/js-libjuju/modules/facades_cloud_CloudV2.html)</li><li>[CloudV3.ts](https://juju.github.io/js-libjuju/modules/facades_cloud_CloudV3.html)</li><li>[CloudV4.ts](https://juju.github.io/js-libjuju/modules/facades_cloud_CloudV4.html)</li><li>[CloudV5.ts](https://juju.github.io/js-libjuju/modules/facades_cloud_CloudV5.html)</li><li>[CloudV7.ts](https://juju.github.io/js-libjuju/modules/facades_cloud_CloudV7.html)</li></ul>| |Controller|<ul><li>[ControllerV11.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV11.html)</li><li>[ControllerV3.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV3.html)</li><li>[ControllerV4.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV4.html)</li><li>[ControllerV5.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV5.html)</li><li>[ControllerV6.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV6.html)</li><li>[ControllerV7.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV7.html)</li><li>[ControllerV8.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV8.html)</li><li>[ControllerV9.ts](https://juju.github.io/js-libjuju/modules/facades_controller_ControllerV9.html)</li></ul>| |CredentialManager|<ul><li>[CredentialManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_credential_manager_CredentialManagerV1.html)</li></ul>| |CredentialValidator|<ul><li>[CredentialValidatorV2.ts](https://juju.github.io/js-libjuju/modules/facades_credential_validator_CredentialValidatorV2.html)</li></ul>| |CrossController|<ul><li>[CrossControllerV1.ts](https://juju.github.io/js-libjuju/modules/facades_cross_controller_CrossControllerV1.html)</li></ul>| |CrossModelRelations|<ul><li>[CrossModelRelationsV2.ts](https://juju.github.io/js-libjuju/modules/facades_cross_model_relations_CrossModelRelationsV2.html)</li></ul>| |CrossModelSecrets|<ul><li>[CrossModelSecretsV1.ts](https://juju.github.io/js-libjuju/modules/facades_cross_model_secrets_CrossModelSecretsV1.html)</li></ul>| |Deployer|<ul><li>[DeployerV1.ts](https://juju.github.io/js-libjuju/modules/facades_deployer_DeployerV1.html)</li></ul>| |DiskManager|<ul><li>[DiskManagerV2.ts](https://juju.github.io/js-libjuju/modules/facades_disk_manager_DiskManagerV2.html)</li></ul>| |EntityWatcher|<ul><li>[EntityWatcherV2.ts](https://juju.github.io/js-libjuju/modules/facades_entity_watcher_EntityWatcherV2.html)</li></ul>| |EnvironUpgrader|<ul><li>[EnvironUpgraderV1.ts](https://juju.github.io/js-libjuju/modules/facades_environ_upgrader_EnvironUpgraderV1.html)</li></ul>| |ExternalControllerUpdater|<ul><li>[ExternalControllerUpdaterV1.ts](https://juju.github.io/js-libjuju/modules/facades_external_controller_updater_ExternalControllerUpdaterV1.html)</li></ul>| |FanConfigurer|<ul><li>[FanConfigurerV1.ts](https://juju.github.io/js-libjuju/modules/facades_fan_configurer_FanConfigurerV1.html)</li></ul>| |FilesystemAttachmentsWatcher|<ul><li>[FilesystemAttachmentsWatcherV2.ts](https://juju.github.io/js-libjuju/modules/facades_filesystem_attachments_watcher_FilesystemAttachmentsWatcherV2.html)</li></ul>| |FirewallRules|<ul><li>[FirewallRulesV1.ts](https://juju.github.io/js-libjuju/modules/facades_firewall_rules_FirewallRulesV1.html)</li></ul>| |Firewaller|<ul><li>[FirewallerV5.ts](https://juju.github.io/js-libjuju/modules/facades_firewaller_FirewallerV5.html)</li><li>[FirewallerV7.ts](https://juju.github.io/js-libjuju/modules/facades_firewaller_FirewallerV7.html)</li></ul>| |HighAvailability|<ul><li>[HighAvailabilityV2.ts](https://juju.github.io/js-libjuju/modules/facades_high_availability_HighAvailabilityV2.html)</li></ul>| |HostKeyReporter|<ul><li>[HostKeyReporterV1.ts](https://juju.github.io/js-libjuju/modules/facades_host_key_reporter_HostKeyReporterV1.html)</li></ul>| |ImageManager|<ul><li>[ImageManagerV2.ts](https://juju.github.io/js-libjuju/modules/facades_image_manager_ImageManagerV2.html)</li></ul>| |ImageMetadataManager|<ul><li>[ImageMetadataManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_image_metadata_manager_ImageMetadataManagerV1.html)</li></ul>| |ImageMetadata|<ul><li>[ImageMetadataV3.ts](https://juju.github.io/js-libjuju/modules/facades_image_metadata_ImageMetadataV3.html)</li></ul>| |InstanceMutater|<ul><li>[InstanceMutaterV2.ts](https://juju.github.io/js-libjuju/modules/facades_instance_mutater_InstanceMutaterV2.html)</li><li>[InstanceMutaterV3.ts](https://juju.github.io/js-libjuju/modules/facades_instance_mutater_InstanceMutaterV3.html)</li></ul>| |InstancePoller|<ul><li>[InstancePollerV4.ts](https://juju.github.io/js-libjuju/modules/facades_instance_poller_InstancePollerV4.html)</li></ul>| |KeyManager|<ul><li>[KeyManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_key_manager_KeyManagerV1.html)</li></ul>| |KeyUpdater|<ul><li>[KeyUpdaterV1.ts](https://juju.github.io/js-libjuju/modules/facades_key_updater_KeyUpdaterV1.html)</li></ul>| |LeadershipService|<ul><li>[LeadershipServiceV2.ts](https://juju.github.io/js-libjuju/modules/facades_leadership_service_LeadershipServiceV2.html)</li></ul>| |LifeFlag|<ul><li>[LifeFlagV1.ts](https://juju.github.io/js-libjuju/modules/facades_life_flag_LifeFlagV1.html)</li></ul>| |LogForwarding|<ul><li>[LogForwardingV1.ts](https://juju.github.io/js-libjuju/modules/facades_log_forwarding_LogForwardingV1.html)</li></ul>| |Logger|<ul><li>[LoggerV1.ts](https://juju.github.io/js-libjuju/modules/facades_logger_LoggerV1.html)</li></ul>| |MachineActions|<ul><li>[MachineActionsV1.ts](https://juju.github.io/js-libjuju/modules/facades_machine_actions_MachineActionsV1.html)</li></ul>| |MachineManager|<ul><li>[MachineManagerV10.ts](https://juju.github.io/js-libjuju/modules/facades_machine_manager_MachineManagerV10.html)</li><li>[MachineManagerV6.ts](https://juju.github.io/js-libjuju/modules/facades_machine_manager_MachineManagerV6.html)</li><li>[MachineManagerV7.ts](https://juju.github.io/js-libjuju/modules/facades_machine_manager_MachineManagerV7.html)</li><li>[MachineManagerV9.ts](https://juju.github.io/js-libjuju/modules/facades_machine_manager_MachineManagerV9.html)</li></ul>| |MachineUndertaker|<ul><li>[MachineUndertakerV1.ts](https://juju.github.io/js-libjuju/modules/facades_machine_undertaker_MachineUndertakerV1.html)</li></ul>| |Machiner|<ul><li>[MachinerV4.ts](https://juju.github.io/js-libjuju/modules/facades_machiner_MachinerV4.html)</li><li>[MachinerV5.ts](https://juju.github.io/js-libjuju/modules/facades_machiner_MachinerV5.html)</li></ul>| |MeterStatus|<ul><li>[MeterStatusV2.ts](https://juju.github.io/js-libjuju/modules/facades_meter_status_MeterStatusV2.html)</li></ul>| |MetricsAdder|<ul><li>[MetricsAdderV2.ts](https://juju.github.io/js-libjuju/modules/facades_metrics_adder_MetricsAdderV2.html)</li></ul>| |MetricsDebug|<ul><li>[MetricsDebugV2.ts](https://juju.github.io/js-libjuju/modules/facades_metrics_debug_MetricsDebugV2.html)</li></ul>| |MetricsManager|<ul><li>[MetricsManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_metrics_manager_MetricsManagerV1.html)</li></ul>| |MigrationFlag|<ul><li>[MigrationFlagV1.ts](https://juju.github.io/js-libjuju/modules/facades_migration_flag_MigrationFlagV1.html)</li></ul>| |MigrationMaster|<ul><li>[MigrationMasterV2.ts](https://juju.github.io/js-libjuju/modules/facades_migration_master_MigrationMasterV2.html)</li><li>[MigrationMasterV3.ts](https://juju.github.io/js-libjuju/modules/facades_migration_master_MigrationMasterV3.html)</li></ul>| |MigrationMinion|<ul><li>[MigrationMinionV1.ts](https://juju.github.io/js-libjuju/modules/facades_migration_minion_MigrationMinionV1.html)</li></ul>| |MigrationStatusWatcher|<ul><li>[MigrationStatusWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_migration_status_watcher_MigrationStatusWatcherV1.html)</li></ul>| |MigrationTarget|<ul><li>[MigrationTargetV1.ts](https://juju.github.io/js-libjuju/modules/facades_migration_target_MigrationTargetV1.html)</li><li>[MigrationTargetV2.ts](https://juju.github.io/js-libjuju/modules/facades_migration_target_MigrationTargetV2.html)</li><li>[MigrationTargetV3.ts](https://juju.github.io/js-libjuju/modules/facades_migration_target_MigrationTargetV3.html)</li></ul>| |ModelConfig|<ul><li>[ModelConfigV2.ts](https://juju.github.io/js-libjuju/modules/facades_model_config_ModelConfigV2.html)</li><li>[ModelConfigV3.ts](https://juju.github.io/js-libjuju/modules/facades_model_config_ModelConfigV3.html)</li></ul>| |ModelGeneration|<ul><li>[ModelGenerationV4.ts](https://juju.github.io/js-libjuju/modules/facades_model_generation_ModelGenerationV4.html)</li></ul>| |ModelManager|<ul><li>[ModelManagerV2.ts](https://juju.github.io/js-libjuju/modules/facades_model_manager_ModelManagerV2.html)</li><li>[ModelManagerV3.ts](https://juju.github.io/js-libjuju/modules/facades_model_manager_ModelManagerV3.html)</li><li>[ModelManagerV4.ts](https://juju.github.io/js-libjuju/modules/facades_model_manager_ModelManagerV4.html)</li><li>[ModelManagerV5.ts](https://juju.github.io/js-libjuju/modules/facades_model_manager_ModelManagerV5.html)</li><li>[ModelManagerV8.ts](https://juju.github.io/js-libjuju/modules/facades_model_manager_ModelManagerV8.html)</li><li>[ModelManagerV9.ts](https://juju.github.io/js-libjuju/modules/facades_model_manager_ModelManagerV9.html)</li></ul>| |ModelSummaryWatcher|<ul><li>[ModelSummaryWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_model_summary_watcher_ModelSummaryWatcherV1.html)</li></ul>| |ModelUpgrader|<ul><li>[ModelUpgraderV1.ts](https://juju.github.io/js-libjuju/modules/facades_model_upgrader_ModelUpgraderV1.html)</li></ul>| |NotifyWatcher|<ul><li>[NotifyWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_notify_watcher_NotifyWatcherV1.html)</li></ul>| |OfferStatusWatcher|<ul><li>[OfferStatusWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_offer_status_watcher_OfferStatusWatcherV1.html)</li></ul>| |PayloadsHookContext|<ul><li>[PayloadsHookContextV1.ts](https://juju.github.io/js-libjuju/modules/facades_payloads_hook_context_PayloadsHookContextV1.html)</li></ul>| |Payloads|<ul><li>[PayloadsV1.ts](https://juju.github.io/js-libjuju/modules/facades_payloads_PayloadsV1.html)</li></ul>| |Pinger|<ul><li>[PingerV1.ts](https://juju.github.io/js-libjuju/modules/facades_pinger_PingerV1.html)</li></ul>| |Provisioner|<ul><li>[ProvisionerV11.ts](https://juju.github.io/js-libjuju/modules/facades_provisioner_ProvisionerV11.html)</li></ul>| |ProxyUpdater|<ul><li>[ProxyUpdaterV2.ts](https://juju.github.io/js-libjuju/modules/facades_proxy_updater_ProxyUpdaterV2.html)</li></ul>| |RaftLease|<ul><li>[RaftLeaseV1.ts](https://juju.github.io/js-libjuju/modules/facades_raft_lease_RaftLeaseV1.html)</li><li>[RaftLeaseV2.ts](https://juju.github.io/js-libjuju/modules/facades_raft_lease_RaftLeaseV2.html)</li></ul>| |Reboot|<ul><li>[RebootV2.ts](https://juju.github.io/js-libjuju/modules/facades_reboot_RebootV2.html)</li></ul>| |RelationStatusWatcher|<ul><li>[RelationStatusWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_relation_status_watcher_RelationStatusWatcherV1.html)</li></ul>| |RelationUnitsWatcher|<ul><li>[RelationUnitsWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_relation_units_watcher_RelationUnitsWatcherV1.html)</li></ul>| |RemoteRelationWatcher|<ul><li>[RemoteRelationWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_remote_relation_watcher_RemoteRelationWatcherV1.html)</li></ul>| |RemoteRelations|<ul><li>[RemoteRelationsV2.ts](https://juju.github.io/js-libjuju/modules/facades_remote_relations_RemoteRelationsV2.html)</li></ul>| |ResourcesHookContext|<ul><li>[ResourcesHookContextV1.ts](https://juju.github.io/js-libjuju/modules/facades_resources_hook_context_ResourcesHookContextV1.html)</li></ul>| |Resources|<ul><li>[ResourcesV1.ts](https://juju.github.io/js-libjuju/modules/facades_resources_ResourcesV1.html)</li><li>[ResourcesV2.ts](https://juju.github.io/js-libjuju/modules/facades_resources_ResourcesV2.html)</li><li>[ResourcesV3.ts](https://juju.github.io/js-libjuju/modules/facades_resources_ResourcesV3.html)</li></ul>| |Resumer|<ul><li>[ResumerV2.ts](https://juju.github.io/js-libjuju/modules/facades_resumer_ResumerV2.html)</li></ul>| |RetryStrategy|<ul><li>[RetryStrategyV1.ts](https://juju.github.io/js-libjuju/modules/facades_retry_strategy_RetryStrategyV1.html)</li></ul>| |SecretBackendsManager|<ul><li>[SecretBackendsManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_secret_backends_manager_SecretBackendsManagerV1.html)</li></ul>| |SecretBackendsRotateWatcher|<ul><li>[SecretBackendsRotateWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_secret_backends_rotate_watcher_SecretBackendsRotateWatcherV1.html)</li></ul>| |SecretBackends|<ul><li>[SecretBackendsV1.ts](https://juju.github.io/js-libjuju/modules/facades_secret_backends_SecretBackendsV1.html)</li></ul>| |SecretsDrain|<ul><li>[SecretsDrainV1.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_drain_SecretsDrainV1.html)</li></ul>| |SecretsManager|<ul><li>[SecretsManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_manager_SecretsManagerV1.html)</li><li>[SecretsManagerV2.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_manager_SecretsManagerV2.html)</li></ul>| |SecretsRevisionWatcher|<ul><li>[SecretsRevisionWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_revision_watcher_SecretsRevisionWatcherV1.html)</li></ul>| |SecretsRotationWatcher|<ul><li>[SecretsRotationWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_rotation_watcher_SecretsRotationWatcherV1.html)</li></ul>| |SecretsTriggerWatcher|<ul><li>[SecretsTriggerWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_trigger_watcher_SecretsTriggerWatcherV1.html)</li></ul>| |Secrets|<ul><li>[SecretsV1.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_SecretsV1.html)</li><li>[SecretsV2.ts](https://juju.github.io/js-libjuju/modules/facades_secrets_SecretsV2.html)</li></ul>| |Singular|<ul><li>[SingularV2.ts](https://juju.github.io/js-libjuju/modules/facades_singular_SingularV2.html)</li></ul>| |Spaces|<ul><li>[SpacesV6.ts](https://juju.github.io/js-libjuju/modules/facades_spaces_SpacesV6.html)</li></ul>| |SSHClient|<ul><li>[SSHClientV2.ts](https://juju.github.io/js-libjuju/modules/facades_sshclient_SSHClientV2.html)</li><li>[SSHClientV3.ts](https://juju.github.io/js-libjuju/modules/facades_sshclient_SSHClientV3.html)</li><li>[SSHClientV4.ts](https://juju.github.io/js-libjuju/modules/facades_sshclient_SSHClientV4.html)</li></ul>| |StatusHistory|<ul><li>[StatusHistoryV2.ts](https://juju.github.io/js-libjuju/modules/facades_status_history_StatusHistoryV2.html)</li></ul>| |StorageProvisioner|<ul><li>[StorageProvisionerV4.ts](https://juju.github.io/js-libjuju/modules/facades_storage_provisioner_StorageProvisionerV4.html)</li></ul>| |Storage|<ul><li>[StorageV6.ts](https://juju.github.io/js-libjuju/modules/facades_storage_StorageV6.html)</li></ul>| |StringsWatcher|<ul><li>[StringsWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_strings_watcher_StringsWatcherV1.html)</li></ul>| |Subnets|<ul><li>[SubnetsV4.ts](https://juju.github.io/js-libjuju/modules/facades_subnets_SubnetsV4.html)</li><li>[SubnetsV5.ts](https://juju.github.io/js-libjuju/modules/facades_subnets_SubnetsV5.html)</li></ul>| |Undertaker|<ul><li>[UndertakerV1.ts](https://juju.github.io/js-libjuju/modules/facades_undertaker_UndertakerV1.html)</li></ul>| |UnitAssigner|<ul><li>[UnitAssignerV1.ts](https://juju.github.io/js-libjuju/modules/facades_unit_assigner_UnitAssignerV1.html)</li></ul>| |Uniter|<ul><li>[UniterV16.ts](https://juju.github.io/js-libjuju/modules/facades_uniter_UniterV16.html)</li><li>[UniterV18.ts](https://juju.github.io/js-libjuju/modules/facades_uniter_UniterV18.html)</li><li>[UniterV19.ts](https://juju.github.io/js-libjuju/modules/facades_uniter_UniterV19.html)</li></ul>| |UpgradeSeries|<ul><li>[UpgradeSeriesV3.ts](https://juju.github.io/js-libjuju/modules/facades_upgrade_series_UpgradeSeriesV3.html)</li></ul>| |UpgradeSteps|<ul><li>[UpgradeStepsV2.ts](https://juju.github.io/js-libjuju/modules/facades_upgrade_steps_UpgradeStepsV2.html)</li></ul>| |Upgrader|<ul><li>[UpgraderV1.ts](https://juju.github.io/js-libjuju/modules/facades_upgrader_UpgraderV1.html)</li></ul>| |UserManager|<ul><li>[UserManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_user_manager_UserManagerV1.html)</li><li>[UserManagerV2.ts](https://juju.github.io/js-libjuju/modules/facades_user_manager_UserManagerV2.html)</li><li>[UserManagerV3.ts](https://juju.github.io/js-libjuju/modules/facades_user_manager_UserManagerV3.html)</li></ul>| |UserSecretsDrain|<ul><li>[UserSecretsDrainV1.ts](https://juju.github.io/js-libjuju/modules/facades_user_secrets_drain_UserSecretsDrainV1.html)</li></ul>| |UserSecretsManager|<ul><li>[UserSecretsManagerV1.ts](https://juju.github.io/js-libjuju/modules/facades_user_secrets_manager_UserSecretsManagerV1.html)</li></ul>| |VolumeAttachmentPlansWatcher|<ul><li>[VolumeAttachmentPlansWatcherV1.ts](https://juju.github.io/js-libjuju/modules/facades_volume_attachment_plans_watcher_VolumeAttachmentPlansWatcherV1.html)</li></ul>| |VolumeAttachmentsWatcher|<ul><li>[VolumeAttachmentsWatcherV2.ts](https://juju.github.io/js-libjuju/modules/facades_volume_attachments_watcher_VolumeAttachmentsWatcherV2.html)</li></ul>| ## Library Maintenance ### Updating Library Facades The Juju facade API files are generated from a supplied Juju schema. To generate this schema you will need to clone the [Juju repository](https://github.com/juju/juju/) and then run `make rebuild-schema` or `go run github.com/juju/juju/generate/schemagen -admin-facades --facade-group=client,jimm ./apiserver/facades/schema.json` to generate a schema file that contains the publicly available facades as well as the set of facades for JAAS. Other `--facade-group` options are `latest` and `all`. After generating a new schema run `yarn store-schema ../path/to/juju` which will store the updated schema and necessary meta data in this project. To update the facades, run `yarn generate-facades` on this project. This will generate the facades using the locally stored schema, sha, and version the schema was generated from. Finally, update `CLIENT_VERSION` in `api/client.ts` with the highest support version. ### Releasing to NPM - Update the version number in `package.json`, respecting semver, create a PR and land it. - Build package with `yarn run build`. - Upgrade the [Juju Dashboard](https://github.com/canonical-web-and-design/jaas-dashboard) to this version using `yarn link` and ensure that everything works as expected. - Create a [new release](https://github.com/juju/js-libjuju/releases/new) on GitHub, setting the tag and title to the version number from above and include any relevant changes in the release notes (use the 'Generate release notes' to show changes since the last release and create a full changelog link, but rewrite the changes to help them make sense to consumers of the library). - Clone a fresh copy of the repository: `git clone git@github.com:juju/js-libjuju.git`. - Install the dependencies and build the package with `yarn install && yarn run build`. - Now you can publish to NPM with `yarn publish`.