@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
288 lines • 9.09 kB
JavaScript
"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.getAlertingRulesOutput = exports.getAlertingRules = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this data source to query detailed information of vmp alerting rules
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooWorkspace = new volcengine.vmp.Workspace("fooWorkspace", {
* instanceTypeId: "vmp.standard.15d",
* deleteProtectionEnabled: false,
* description: "acc-test-1",
* username: "admin123",
* password: "***********",
* });
* const fooContact = new volcengine.vmp.Contact("fooContact", {
* email: "acctest1@tftest.com",
* webhook: {
* address: "https://www.acctest1.com",
* },
* larkBotWebhook: {
* address: "https://www.acctest1.com",
* },
* dingTalkBotWebhook: {
* address: "https://www.dingacctest1.com",
* atMobiles: ["18046891812"],
* },
* phoneNumber: {
* countryCode: "+86",
* number: "18310101010",
* },
* });
* const foo1Contact = new volcengine.vmp.Contact("foo1Contact", {
* email: "acctest2@tftest.com",
* webhook: {
* address: "https://www.acctest2.com",
* },
* larkBotWebhook: {
* address: "https://www.acctest2.com",
* },
* dingTalkBotWebhook: {
* address: "https://www.dingacctest2.com",
* atMobiles: ["18046891813"],
* },
* phoneNumber: {
* countryCode: "+86",
* number: "18310101011",
* },
* });
* const fooContactGroup = new volcengine.vmp.ContactGroup("fooContactGroup", {contactIds: [fooContact.id]});
* const foo1ContactGroup = new volcengine.vmp.ContactGroup("foo1ContactGroup", {contactIds: [foo1Contact.id]});
* const fooNotifyPolicy = new volcengine.vmp.NotifyPolicy("fooNotifyPolicy", {
* description: "acc-test-1",
* levels: [
* {
* level: "P1",
* contactGroupIds: [fooContactGroup.id],
* channels: [
* "Email",
* "Webhook",
* ],
* },
* {
* level: "P0",
* contactGroupIds: [foo1ContactGroup.id],
* channels: ["LarkBotWebhook"],
* },
* ],
* });
* const fooNotifyGroupPolicy = new volcengine.vmp.NotifyGroupPolicy("fooNotifyGroupPolicy", {
* description: "acc-test-1",
* levels: [
* {
* level: "P2",
* groupBies: ["__rule__"],
* groupWait: "35",
* groupInterval: "30",
* repeatInterval: "30",
* },
* {
* level: "P0",
* groupBies: ["__rule__"],
* groupWait: "30",
* groupInterval: "30",
* repeatInterval: "30",
* },
* {
* level: "P1",
* groupBies: ["__rule__"],
* groupWait: "40",
* groupInterval: "45",
* repeatInterval: "30",
* },
* ],
* });
* const fooAlertingRule = new volcengine.vmp.AlertingRule("fooAlertingRule", {
* description: "acc-test-1",
* notifyPolicyId: fooNotifyPolicy.id,
* notifyGroupPolicyId: fooNotifyGroupPolicy.id,
* query: {
* workspaceId: fooWorkspace.id,
* promQl: "sum(up)",
* },
* levels: [
* {
* level: "P0",
* "for": "0s",
* comparator: ">=",
* threshold: 2,
* },
* {
* level: "P1",
* "for": "0s",
* comparator: ">=",
* threshold: 1,
* },
* {
* level: "P2",
* "for": "0s",
* comparator: ">=",
* threshold: 0.5,
* },
* ],
* });
* const fooAlertingRules = volcengine.vmp.getAlertingRulesOutput({
* ids: [fooAlertingRule.id],
* });
* ```
*/
function getAlertingRules(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("volcengine:vmp/getAlertingRules:getAlertingRules", {
"ids": args.ids,
"name": args.name,
"nameRegex": args.nameRegex,
"notifyGroupPolicyIds": args.notifyGroupPolicyIds,
"notifyPolicyIds": args.notifyPolicyIds,
"outputFile": args.outputFile,
"status": args.status,
"type": args.type,
"workspaceId": args.workspaceId,
}, opts);
}
exports.getAlertingRules = getAlertingRules;
/**
* Use this data source to query detailed information of vmp alerting rules
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooWorkspace = new volcengine.vmp.Workspace("fooWorkspace", {
* instanceTypeId: "vmp.standard.15d",
* deleteProtectionEnabled: false,
* description: "acc-test-1",
* username: "admin123",
* password: "***********",
* });
* const fooContact = new volcengine.vmp.Contact("fooContact", {
* email: "acctest1@tftest.com",
* webhook: {
* address: "https://www.acctest1.com",
* },
* larkBotWebhook: {
* address: "https://www.acctest1.com",
* },
* dingTalkBotWebhook: {
* address: "https://www.dingacctest1.com",
* atMobiles: ["18046891812"],
* },
* phoneNumber: {
* countryCode: "+86",
* number: "18310101010",
* },
* });
* const foo1Contact = new volcengine.vmp.Contact("foo1Contact", {
* email: "acctest2@tftest.com",
* webhook: {
* address: "https://www.acctest2.com",
* },
* larkBotWebhook: {
* address: "https://www.acctest2.com",
* },
* dingTalkBotWebhook: {
* address: "https://www.dingacctest2.com",
* atMobiles: ["18046891813"],
* },
* phoneNumber: {
* countryCode: "+86",
* number: "18310101011",
* },
* });
* const fooContactGroup = new volcengine.vmp.ContactGroup("fooContactGroup", {contactIds: [fooContact.id]});
* const foo1ContactGroup = new volcengine.vmp.ContactGroup("foo1ContactGroup", {contactIds: [foo1Contact.id]});
* const fooNotifyPolicy = new volcengine.vmp.NotifyPolicy("fooNotifyPolicy", {
* description: "acc-test-1",
* levels: [
* {
* level: "P1",
* contactGroupIds: [fooContactGroup.id],
* channels: [
* "Email",
* "Webhook",
* ],
* },
* {
* level: "P0",
* contactGroupIds: [foo1ContactGroup.id],
* channels: ["LarkBotWebhook"],
* },
* ],
* });
* const fooNotifyGroupPolicy = new volcengine.vmp.NotifyGroupPolicy("fooNotifyGroupPolicy", {
* description: "acc-test-1",
* levels: [
* {
* level: "P2",
* groupBies: ["__rule__"],
* groupWait: "35",
* groupInterval: "30",
* repeatInterval: "30",
* },
* {
* level: "P0",
* groupBies: ["__rule__"],
* groupWait: "30",
* groupInterval: "30",
* repeatInterval: "30",
* },
* {
* level: "P1",
* groupBies: ["__rule__"],
* groupWait: "40",
* groupInterval: "45",
* repeatInterval: "30",
* },
* ],
* });
* const fooAlertingRule = new volcengine.vmp.AlertingRule("fooAlertingRule", {
* description: "acc-test-1",
* notifyPolicyId: fooNotifyPolicy.id,
* notifyGroupPolicyId: fooNotifyGroupPolicy.id,
* query: {
* workspaceId: fooWorkspace.id,
* promQl: "sum(up)",
* },
* levels: [
* {
* level: "P0",
* "for": "0s",
* comparator: ">=",
* threshold: 2,
* },
* {
* level: "P1",
* "for": "0s",
* comparator: ">=",
* threshold: 1,
* },
* {
* level: "P2",
* "for": "0s",
* comparator: ">=",
* threshold: 0.5,
* },
* ],
* });
* const fooAlertingRules = volcengine.vmp.getAlertingRulesOutput({
* ids: [fooAlertingRule.id],
* });
* ```
*/
function getAlertingRulesOutput(args, opts) {
return pulumi.output(args).apply((a) => getAlertingRules(a, opts));
}
exports.getAlertingRulesOutput = getAlertingRulesOutput;
//# sourceMappingURL=getAlertingRules.js.map