@pulumi/juniper-mist
Version:
A Pulumi package for creating and managing Juniper Mist resources.
128 lines • 6.51 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpgradeDevice = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource can be used to upgrade the firmware of a single device (Wi-Fi Access Points, Switches and SRX/SSR Gateways).
*
* The resource will send the upgrade command to Mist, which will take care of deploying the new firmware version to the device, and reboot it if required.
*
* The time required to upgrade a device depends on the type of device and its hardware. By default, the resource will track the upgrade process and only return the result once the device is upgraded and rebooted (unless `reboot`==`false` or `rebootAt` is set).\
* If required it is possible to run the upgrade in async mode (attribute `sync`=`false`). In this case, the resource will only trigger the upgrade and return the Mist response, but will not track the upgrade progress.
*
* The list of available firmware versions can be retrieved with the `junipermist.device.getVersions` data source.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as junipermist from "@pulumi/juniper-mist";
*
* const apUpgrade = new junipermist.UpgradeDevice("ap_upgrade", {
* siteId: terraformTest.id,
* deviceId: apOne.id,
* targetVersion: "0.14.29543",
* });
* const switchUpgrade = new junipermist.UpgradeDevice("switch_upgrade", {
* siteId: terraformTest.id,
* deviceId: switchOne.id,
* targetVersion: "24.2R1-S1.10",
* reboot: true,
* syncUpgradeTimeout: 3600,
* });
* ```
*/
class UpgradeDevice extends pulumi.CustomResource {
/**
* Get an existing UpgradeDevice resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new UpgradeDevice(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of UpgradeDevice. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === UpgradeDevice.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoUpgradeStat"] = state?.autoUpgradeStat;
resourceInputs["configTimestamp"] = state?.configTimestamp;
resourceInputs["configVersion"] = state?.configVersion;
resourceInputs["deviceId"] = state?.deviceId;
resourceInputs["deviceVersion"] = state?.deviceVersion;
resourceInputs["extIp"] = state?.extIp;
resourceInputs["fwupdate"] = state?.fwupdate;
resourceInputs["reboot"] = state?.reboot;
resourceInputs["rebootAt"] = state?.rebootAt;
resourceInputs["siteId"] = state?.siteId;
resourceInputs["snapshot"] = state?.snapshot;
resourceInputs["startTime"] = state?.startTime;
resourceInputs["status"] = state?.status;
resourceInputs["syncUpgrade"] = state?.syncUpgrade;
resourceInputs["syncUpgradeRefreshInterval"] = state?.syncUpgradeRefreshInterval;
resourceInputs["syncUpgradeStartTimeout"] = state?.syncUpgradeStartTimeout;
resourceInputs["syncUpgradeTimeout"] = state?.syncUpgradeTimeout;
resourceInputs["tagId"] = state?.tagId;
resourceInputs["tagUuid"] = state?.tagUuid;
resourceInputs["targetVersion"] = state?.targetVersion;
resourceInputs["timestamp"] = state?.timestamp;
}
else {
const args = argsOrState;
if (args?.deviceId === undefined && !opts.urn) {
throw new Error("Missing required property 'deviceId'");
}
if (args?.siteId === undefined && !opts.urn) {
throw new Error("Missing required property 'siteId'");
}
if (args?.targetVersion === undefined && !opts.urn) {
throw new Error("Missing required property 'targetVersion'");
}
resourceInputs["deviceId"] = args?.deviceId;
resourceInputs["reboot"] = args?.reboot;
resourceInputs["rebootAt"] = args?.rebootAt;
resourceInputs["siteId"] = args?.siteId;
resourceInputs["snapshot"] = args?.snapshot;
resourceInputs["startTime"] = args?.startTime;
resourceInputs["syncUpgrade"] = args?.syncUpgrade;
resourceInputs["syncUpgradeRefreshInterval"] = args?.syncUpgradeRefreshInterval;
resourceInputs["syncUpgradeStartTimeout"] = args?.syncUpgradeStartTimeout;
resourceInputs["syncUpgradeTimeout"] = args?.syncUpgradeTimeout;
resourceInputs["targetVersion"] = args?.targetVersion;
resourceInputs["autoUpgradeStat"] = undefined /*out*/;
resourceInputs["configTimestamp"] = undefined /*out*/;
resourceInputs["configVersion"] = undefined /*out*/;
resourceInputs["deviceVersion"] = undefined /*out*/;
resourceInputs["extIp"] = undefined /*out*/;
resourceInputs["fwupdate"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagId"] = undefined /*out*/;
resourceInputs["tagUuid"] = undefined /*out*/;
resourceInputs["timestamp"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UpgradeDevice.__pulumiType, name, resourceInputs, opts);
}
}
exports.UpgradeDevice = UpgradeDevice;
/** @internal */
UpgradeDevice.__pulumiType = 'junipermist:index/upgradeDevice:UpgradeDevice';
//# sourceMappingURL=upgradeDevice.js.map