Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getProjectAlertRule

Use this data source to retrieve information about a Rancher v2 project alert rule.

Example Usage

using Pulumi;
using Rancher2 = Pulumi.Rancher2;

class MyStack : Stack
{
    public MyStack()
    {
        var foo = Output.Create(Rancher2.GetProjectAlertRule.InvokeAsync(new Rancher2.GetProjectAlertRuleArgs
        {
            Name = "<project_alert_rule_name>",
            ProjectId = "<project_id>",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-rancher2/sdk/v2/go/rancher2"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := rancher2.LookupProjectAlertRule(ctx, &rancher2.LookupProjectAlertRuleArgs{
            Name:      "<project_alert_rule_name>",
            ProjectId: "<project_id>",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_rancher2 as rancher2

foo = rancher2.get_project_alert_rule(name="<project_alert_rule_name>",
    project_id="<project_id>")
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";

const foo = pulumi.output(rancher2.getProjectAlertRule({
    name: "<project_alert_rule_name>",
    projectId: "<project_id>",
}, { async: true }));

Using getProjectAlertRule

function getProjectAlertRule(args: GetProjectAlertRuleArgs, opts?: InvokeOptions): Promise<GetProjectAlertRuleResult>
def get_project_alert_rule(labels: Optional[Mapping[str, Any]] = None, name: Optional[str] = None, project_id: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetProjectAlertRuleResult
func LookupProjectAlertRule(ctx *Context, args *LookupProjectAlertRuleArgs, opts ...InvokeOption) (*LookupProjectAlertRuleResult, error)

Note: This function is named LookupProjectAlertRule in the Go SDK.

public static class GetProjectAlertRule {
    public static Task<GetProjectAlertRuleResult> InvokeAsync(GetProjectAlertRuleArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The project alert rule name (string)

ProjectId string

The project id where create project alert rule (string)

Labels Dictionary<string, object>

(Computed) The project alert rule labels (map)

Name string

The project alert rule name (string)

ProjectId string

The project id where create project alert rule (string)

Labels map[string]interface{}

(Computed) The project alert rule labels (map)

name string

The project alert rule name (string)

projectId string

The project id where create project alert rule (string)

labels {[key: string]: any}

(Computed) The project alert rule labels (map)

name str

The project alert rule name (string)

project_id str

The project id where create project alert rule (string)

labels Mapping[str, Any]

(Computed) The project alert rule labels (map)

getProjectAlertRule Result

The following output properties are available:

Annotations Dictionary<string, object>

(Computed) The project alert rule annotations (map)

GroupId string

(Computed) The project alert rule alert group ID (string)

GroupIntervalSeconds int

(Computed) The project alert rule group interval seconds. Default: 180 (int)

GroupWaitSeconds int

(Computed) The project alert rule group wait seconds. Default: 180 (int)

Id string

The provider-assigned unique ID for this managed resource.

Inherited bool

(Computed) The project alert rule inherited. Default: true (bool)

MetricRule GetProjectAlertRuleMetricRule

(Computed) The project alert rule metric rule. ConflictsWith: "pod_rule", "workload_rule"` (list Maxitems:1)

Name string
PodRule GetProjectAlertRulePodRule

(Computed) The project alert rule pod rule. ConflictsWith: "metric_rule", "workload_rule"` (list Maxitems:1)

ProjectId string
RepeatIntervalSeconds int

(Computed) The project alert rule wait seconds. Default: 3600 (int)

Severity string

(Computed) The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)

WorkloadRule GetProjectAlertRuleWorkloadRule

(Computed) The project alert rule workload rule. ConflictsWith: "metric_rule", "pod_rule"` (list Maxitems:1)

Labels Dictionary<string, object>

(Computed) The project alert rule labels (map)

Annotations map[string]interface{}

(Computed) The project alert rule annotations (map)

GroupId string

(Computed) The project alert rule alert group ID (string)

GroupIntervalSeconds int

(Computed) The project alert rule group interval seconds. Default: 180 (int)

GroupWaitSeconds int

(Computed) The project alert rule group wait seconds. Default: 180 (int)

Id string

The provider-assigned unique ID for this managed resource.

Inherited bool

(Computed) The project alert rule inherited. Default: true (bool)

MetricRule GetProjectAlertRuleMetricRule

(Computed) The project alert rule metric rule. ConflictsWith: "pod_rule", "workload_rule"` (list Maxitems:1)

Name string
PodRule GetProjectAlertRulePodRule

(Computed) The project alert rule pod rule. ConflictsWith: "metric_rule", "workload_rule"` (list Maxitems:1)

ProjectId string
RepeatIntervalSeconds int

(Computed) The project alert rule wait seconds. Default: 3600 (int)

Severity string

(Computed) The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)

WorkloadRule GetProjectAlertRuleWorkloadRule

(Computed) The project alert rule workload rule. ConflictsWith: "metric_rule", "pod_rule"` (list Maxitems:1)

Labels map[string]interface{}

(Computed) The project alert rule labels (map)

annotations {[key: string]: any}

(Computed) The project alert rule annotations (map)

groupId string

(Computed) The project alert rule alert group ID (string)

groupIntervalSeconds number

(Computed) The project alert rule group interval seconds. Default: 180 (int)

groupWaitSeconds number

(Computed) The project alert rule group wait seconds. Default: 180 (int)

id string

The provider-assigned unique ID for this managed resource.

inherited boolean

(Computed) The project alert rule inherited. Default: true (bool)

metricRule GetProjectAlertRuleMetricRule

(Computed) The project alert rule metric rule. ConflictsWith: "pod_rule", "workload_rule"` (list Maxitems:1)

name string
podRule GetProjectAlertRulePodRule

(Computed) The project alert rule pod rule. ConflictsWith: "metric_rule", "workload_rule"` (list Maxitems:1)

projectId string
repeatIntervalSeconds number

(Computed) The project alert rule wait seconds. Default: 3600 (int)

severity string

(Computed) The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)

workloadRule GetProjectAlertRuleWorkloadRule

(Computed) The project alert rule workload rule. ConflictsWith: "metric_rule", "pod_rule"` (list Maxitems:1)

labels {[key: string]: any}

(Computed) The project alert rule labels (map)

annotations Mapping[str, Any]

(Computed) The project alert rule annotations (map)

group_id str

(Computed) The project alert rule alert group ID (string)

group_interval_seconds int

(Computed) The project alert rule group interval seconds. Default: 180 (int)

group_wait_seconds int

(Computed) The project alert rule group wait seconds. Default: 180 (int)

id str

The provider-assigned unique ID for this managed resource.

inherited bool

(Computed) The project alert rule inherited. Default: true (bool)

metric_rule GetProjectAlertRuleMetricRule

(Computed) The project alert rule metric rule. ConflictsWith: "pod_rule", "workload_rule"` (list Maxitems:1)

name str
pod_rule GetProjectAlertRulePodRule

(Computed) The project alert rule pod rule. ConflictsWith: "metric_rule", "workload_rule"` (list Maxitems:1)

project_id str
repeat_interval_seconds int

(Computed) The project alert rule wait seconds. Default: 3600 (int)

severity str

(Computed) The project alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)

workload_rule GetProjectAlertRuleWorkloadRule

(Computed) The project alert rule workload rule. ConflictsWith: "metric_rule", "pod_rule"` (list Maxitems:1)

labels Mapping[str, Any]

(Computed) The project alert rule labels (map)

Supporting Types

GetProjectAlertRuleMetricRule

Duration string
Expression string
ThresholdValue float64
Comparison string
Description string

GetProjectAlertRulePodRule

GetProjectAlertRuleWorkloadRule

AvailablePercentage int
Selector Dictionary<string, object>
WorkloadId string
AvailablePercentage int
Selector map[string]interface{}
WorkloadId string
availablePercentage number
selector {[key: string]: any}
workloadId string
available_percentage int
selector Mapping[str, Any]
workload_id str

Package Details

Repository
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.