@pulumi/wavefront
Version:
A Pulumi package for creating and managing wavefront cloud resources.
106 lines • 5.15 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MaintenanceWindow = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Wavefront Maintenance Window Resource. This allows maintenance windows to be created, updated, and deleted.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as wavefront from "@pulumi/wavefront";
*
* const basic = new wavefront.MaintenanceWindow("basic", {
* reason: "Routine maintenance for 2020",
* title: "Routine maintenance",
* startTimeInSeconds: 1600123456,
* endTimeInSeconds: 1601123456,
* relevantHostNames: [
* "my_hostname",
* "my_other_hostname",
* ],
* });
* ```
*
* ## Import
*
* Maintenance windows can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import wavefront:index/maintenanceWindow:MaintenanceWindow basic 1600383357095
* ```
*/
class MaintenanceWindow extends pulumi.CustomResource {
/**
* Get an existing MaintenanceWindow 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 MaintenanceWindow(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MaintenanceWindow. 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'] === MaintenanceWindow.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["endTimeInSeconds"] = state ? state.endTimeInSeconds : undefined;
resourceInputs["hostTagGroupHostNamesGroupAnded"] = state ? state.hostTagGroupHostNamesGroupAnded : undefined;
resourceInputs["reason"] = state ? state.reason : undefined;
resourceInputs["relevantCustomerTags"] = state ? state.relevantCustomerTags : undefined;
resourceInputs["relevantHostNames"] = state ? state.relevantHostNames : undefined;
resourceInputs["relevantHostTags"] = state ? state.relevantHostTags : undefined;
resourceInputs["relevantHostTagsAnded"] = state ? state.relevantHostTagsAnded : undefined;
resourceInputs["startTimeInSeconds"] = state ? state.startTimeInSeconds : undefined;
resourceInputs["title"] = state ? state.title : undefined;
}
else {
const args = argsOrState;
if ((!args || args.endTimeInSeconds === undefined) && !opts.urn) {
throw new Error("Missing required property 'endTimeInSeconds'");
}
if ((!args || args.reason === undefined) && !opts.urn) {
throw new Error("Missing required property 'reason'");
}
if ((!args || args.startTimeInSeconds === undefined) && !opts.urn) {
throw new Error("Missing required property 'startTimeInSeconds'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["endTimeInSeconds"] = args ? args.endTimeInSeconds : undefined;
resourceInputs["hostTagGroupHostNamesGroupAnded"] = args ? args.hostTagGroupHostNamesGroupAnded : undefined;
resourceInputs["reason"] = args ? args.reason : undefined;
resourceInputs["relevantCustomerTags"] = args ? args.relevantCustomerTags : undefined;
resourceInputs["relevantHostNames"] = args ? args.relevantHostNames : undefined;
resourceInputs["relevantHostTags"] = args ? args.relevantHostTags : undefined;
resourceInputs["relevantHostTagsAnded"] = args ? args.relevantHostTagsAnded : undefined;
resourceInputs["startTimeInSeconds"] = args ? args.startTimeInSeconds : undefined;
resourceInputs["title"] = args ? args.title : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MaintenanceWindow.__pulumiType, name, resourceInputs, opts);
}
}
exports.MaintenanceWindow = MaintenanceWindow;
/** @internal */
MaintenanceWindow.__pulumiType = 'wavefront:index/maintenanceWindow:MaintenanceWindow';
//# sourceMappingURL=maintenanceWindow.js.map