UNPKG

@pulumi/sumologic

Version:

A Pulumi package for creating and managing sumologic cloud resources.

155 lines 6.93 kB
"use strict"; // *** 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.MutingSchedule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides the ability to create, read, delete, and update [MutingSchedule](https://help.sumologic.com/docs/alerts/monitors/muting-schedules/). * * ## Example One-Time Muting Schedule From 12AM to 1AM on 2023-08-05 for All Monitors * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const mutingSchedule = new sumologic.MutingSchedule("muting_schedule", { * name: "One-Time Schedule for All Monitors", * type: "MutingSchedulesLibraryMutingSchedule", * contentType: "MutingSchedule", * monitor: { * all: true, * }, * schedule: { * timezone: "America/Los_Angeles", * startDate: "2023-08-05", * startTime: "00:00", * duration: 60, * }, * }); * ``` * * ## Example Daily Muting Schedule From 9AM to 10AM and 5PM to 6PM Starting On 2023-08-05 for a Monitor or Folder * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const mutingSchedule = new sumologic.MutingSchedule("muting_schedule", { * name: "Daily schedule at 9am and 5pm for 30 minutes for all monitors", * type: "MutingSchedulesLibraryMutingSchedule", * contentType: "MutingSchedule", * monitor: { * ids: ["0000000000000002"], * }, * schedule: { * timezone: "America/Los_Angeles", * startDate: "2023-08-05", * startTime: "00:00", * duration: 60, * rrule: "FREQ=DAILY;INTERVAL=1;BYHOUR=9,17", * }, * }); * ``` * * ## Example Muting Schedule for an Alert Group on All Monitors Every 3rd Saturday from 12AM to 1AM * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const mutingSchedule = new sumologic.MutingSchedule("muting_schedule", { * name: "Muting alerts from us-east-1 every 3rd saturday from 12AM to 1AM", * type: "MutingSchedulesLibraryMutingSchedule", * contentType: "MutingSchedule", * monitor: { * all: true, * }, * notificationGroups: [{ * groupKey: "region", * groupValues: ["us-east-1"], * }], * schedule: { * timezone: "America/Los_Angeles", * startDate: "2023-08-05", * startTime: "00:00", * duration: 60, * rrule: "FREQ=MONTHLY;INTERVAL=1;BYDAY=+3SA", * }, * }); * ``` */ class MutingSchedule extends pulumi.CustomResource { /** * Get an existing MutingSchedule 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 MutingSchedule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MutingSchedule. 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'] === MutingSchedule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["contentType"] = state ? state.contentType : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["createdBy"] = state ? state.createdBy : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["isMutable"] = state ? state.isMutable : undefined; resourceInputs["isSystem"] = state ? state.isSystem : undefined; resourceInputs["modifiedAt"] = state ? state.modifiedAt : undefined; resourceInputs["modifiedBy"] = state ? state.modifiedBy : undefined; resourceInputs["monitor"] = state ? state.monitor : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["notificationGroups"] = state ? state.notificationGroups : undefined; resourceInputs["parentId"] = state ? state.parentId : undefined; resourceInputs["schedule"] = state ? state.schedule : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.schedule === undefined) && !opts.urn) { throw new Error("Missing required property 'schedule'"); } resourceInputs["contentType"] = args ? args.contentType : undefined; resourceInputs["createdAt"] = args ? args.createdAt : undefined; resourceInputs["createdBy"] = args ? args.createdBy : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["isMutable"] = args ? args.isMutable : undefined; resourceInputs["isSystem"] = args ? args.isSystem : undefined; resourceInputs["modifiedAt"] = args ? args.modifiedAt : undefined; resourceInputs["modifiedBy"] = args ? args.modifiedBy : undefined; resourceInputs["monitor"] = args ? args.monitor : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["notificationGroups"] = args ? args.notificationGroups : undefined; resourceInputs["parentId"] = args ? args.parentId : undefined; resourceInputs["schedule"] = args ? args.schedule : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["version"] = args ? args.version : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MutingSchedule.__pulumiType, name, resourceInputs, opts); } } exports.MutingSchedule = MutingSchedule; /** @internal */ MutingSchedule.__pulumiType = 'sumologic:index/mutingSchedule:MutingSchedule'; //# sourceMappingURL=mutingSchedule.js.map