UNPKG

@canonical/jujulib

Version:
60 lines (59 loc) 1.82 kB
/** Juju RetryStrategy version 1. This facade is available on: Controller-machine-agent Machine-agent Unit-agent Models NOTE: This file was generated using the Juju schema from Juju 3.3 at the git SHA 65fa4c1ee5. Do not manually edit this file. */ import { autoBind } from "../../utils.js"; /** RetryStrategyAPI implements RetryStrategy */ class RetryStrategyV1 { constructor(transport, info) { this.NAME = "RetryStrategy"; this.VERSION = 1; this._transport = transport; this._info = info; // Automatically bind all methods to instances. autoBind(this); } /** RetryStrategy returns RetryStrategyResults that can be used by any code that uses to configure the retry timer that's currently in juju utils. */ retryStrategy(params) { return new Promise((resolve, reject) => { const req = { type: "RetryStrategy", request: "RetryStrategy", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } /** WatchRetryStrategy watches for changes to the model. Currently we only allow changes to the boolean that determines whether retries should be attempted or not. */ watchRetryStrategy(params) { return new Promise((resolve, reject) => { const req = { type: "RetryStrategy", request: "WatchRetryStrategy", version: 1, params: params, }; this._transport.write(req, resolve, reject); }); } } RetryStrategyV1.NAME = "RetryStrategy"; RetryStrategyV1.VERSION = 1; export default RetryStrategyV1; //# sourceMappingURL=RetryStrategyV1.js.map