UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

385 lines (384 loc) 11.2 kB
import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * 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], * }); * ``` */ export declare function getAlertingRules(args?: GetAlertingRulesArgs, opts?: pulumi.InvokeOptions): Promise<GetAlertingRulesResult>; /** * A collection of arguments for invoking getAlertingRules. */ export interface GetAlertingRulesArgs { /** * A list of vmp alerting rule IDs. */ ids?: string[]; /** * The name of vmp alerting rule. This field support fuzzy query. */ name?: string; /** * A Name Regex of Resource. */ nameRegex?: string; /** * A list of notify group policy IDs. */ notifyGroupPolicyIds?: string[]; /** * A list of notify policy IDs. */ notifyPolicyIds?: string[]; /** * File name where to save data source results. */ outputFile?: string; /** * The status of vmp alerting rule. Valid values: `Running`, `Disabled`. */ status?: string; /** * The type of vmp alerting rule. Valid values: `vmp/PromQL`. */ type?: string; /** * The workspace id of vmp alerting rule. */ workspaceId?: string; } /** * A collection of values returned by getAlertingRules. */ export interface GetAlertingRulesResult { /** * The collection of query. */ readonly alertingRules: outputs.vmp.GetAlertingRulesAlertingRule[]; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly ids?: string[]; /** * The name of the vmp alerting rule. */ readonly name?: string; readonly nameRegex?: string; readonly notifyGroupPolicyIds?: string[]; readonly notifyPolicyIds?: string[]; readonly outputFile?: string; /** * The status of the vmp alerting rule. */ readonly status?: string; /** * The total count of query. */ readonly totalCount: number; /** * The type of the vmp alerting rule. */ readonly type?: string; /** * The id of the workspace. */ readonly workspaceId?: string; } /** * 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], * }); * ``` */ export declare function getAlertingRulesOutput(args?: GetAlertingRulesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetAlertingRulesResult>; /** * A collection of arguments for invoking getAlertingRules. */ export interface GetAlertingRulesOutputArgs { /** * A list of vmp alerting rule IDs. */ ids?: pulumi.Input<pulumi.Input<string>[]>; /** * The name of vmp alerting rule. This field support fuzzy query. */ name?: pulumi.Input<string>; /** * A Name Regex of Resource. */ nameRegex?: pulumi.Input<string>; /** * A list of notify group policy IDs. */ notifyGroupPolicyIds?: pulumi.Input<pulumi.Input<string>[]>; /** * A list of notify policy IDs. */ notifyPolicyIds?: pulumi.Input<pulumi.Input<string>[]>; /** * File name where to save data source results. */ outputFile?: pulumi.Input<string>; /** * The status of vmp alerting rule. Valid values: `Running`, `Disabled`. */ status?: pulumi.Input<string>; /** * The type of vmp alerting rule. Valid values: `vmp/PromQL`. */ type?: pulumi.Input<string>; /** * The workspace id of vmp alerting rule. */ workspaceId?: pulumi.Input<string>; }