UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

41 lines • 1.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Failover = exports.BaseFailover = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../../core/resource.js"); const path_1 = require("../../../../internal/utils/path.js"); var BaseFailover = /* @__PURE__ */ (() => { class BaseFailover extends resource_1.APIResource { /** * Triggers a manual failover for a specific WARP Connector Tunnel, setting the * specified client as the active connector. The tunnel must be configured for high * availability (HA) and the client must be linked to the tunnel. * * @example * ```ts * const failover = * await client.zeroTrust.tunnels.warpConnector.failover.update( * 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', * { * account_id: '699d98642c564d2e855e9661899b7252', * client_id: '1bedc50d-42b3-473c-b108-ff3d10c0d925', * }, * ); * ``` */ update(tunnelID, params, options) { const { account_id, ...body } = params; return this._client.put((0, path_1.path) `/accounts/${account_id}/warp_connector/${tunnelID}/failover`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseFailover._key = Object.freeze(['zeroTrust', 'tunnels', 'warpConnector', 'failover']); return BaseFailover; })(); exports.BaseFailover = BaseFailover; class Failover extends BaseFailover { } exports.Failover = Failover; //# sourceMappingURL=failover.js.map