1. Packages
  2. Rancher2
  3. API Docs
  4. getProjectAlertRule
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

rancher2.getProjectAlertRule

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as rancher2 from "@pulumi/rancher2";
    
    const foo = rancher2.getProjectAlertRule({
        name: "<project_alert_rule_name>",
        projectId: "<project_id>",
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    foo = rancher2.get_project_alert_rule(name="<project_alert_rule_name>",
        project_id="<project_id>")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/go/rancher2"
    	"github.com/pulumi/pulumi/sdk/v3/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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Rancher2 = Pulumi.Rancher2;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = Rancher2.GetProjectAlertRule.Invoke(new()
        {
            Name = "<project_alert_rule_name>",
            ProjectId = "<project_id>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.Rancher2Functions;
    import com.pulumi.rancher2.inputs.GetProjectAlertRuleArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var foo = Rancher2Functions.getProjectAlertRule(GetProjectAlertRuleArgs.builder()
                .name("<project_alert_rule_name>")
                .projectId("<project_id>")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: rancher2:getProjectAlertRule
          Arguments:
            name: <project_alert_rule_name>
            projectId: <project_id>
    

    Using getProjectAlertRule

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProjectAlertRule(args: GetProjectAlertRuleArgs, opts?: InvokeOptions): Promise<GetProjectAlertRuleResult>
    function getProjectAlertRuleOutput(args: GetProjectAlertRuleOutputArgs, opts?: InvokeOptions): Output<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
    def get_project_alert_rule_output(labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                               name: Optional[pulumi.Input[str]] = None,
                               project_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetProjectAlertRuleResult]
    func LookupProjectAlertRule(ctx *Context, args *LookupProjectAlertRuleArgs, opts ...InvokeOption) (*LookupProjectAlertRuleResult, error)
    func LookupProjectAlertRuleOutput(ctx *Context, args *LookupProjectAlertRuleOutputArgs, opts ...InvokeOption) LookupProjectAlertRuleResultOutput

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

    public static class GetProjectAlertRule 
    {
        public static Task<GetProjectAlertRuleResult> InvokeAsync(GetProjectAlertRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectAlertRuleResult> Invoke(GetProjectAlertRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectAlertRuleResult> getProjectAlertRule(GetProjectAlertRuleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: rancher2:index/getProjectAlertRule:getProjectAlertRule
      arguments:
        # arguments dictionary

    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 Map<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 {[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)
    name String
    The project alert rule name (string)
    projectId String
    The project id where create project alert rule (string)
    labels Map<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 Map<String,Object>
    (Computed) The project alert rule annotations (map)
    groupId String
    (Computed) The project alert rule alert group ID (string)
    groupIntervalSeconds Integer
    (Computed) The project alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Integer
    (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 Integer
    (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,Object>
    (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)
    annotations Map<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 Property Map
    (Computed) The project alert rule metric rule. ConflictsWith: `"pod_rule", "workload_rule"`` (list Maxitems:1)
    name String
    podRule Property Map
    (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 Property Map
    (Computed) The project alert rule workload rule. ConflictsWith: `"metric_rule", "pod_rule"`` (list Maxitems:1)
    labels Map<Any>
    (Computed) The project alert rule labels (map)

    Supporting Types

    GetProjectAlertRuleMetricRule

    Duration string
    Metric rule duration
    Expression string
    Metric rule expression
    ThresholdValue double
    Metric rule threshold value
    Comparison string
    Metric rule comparison
    Description string
    Metric rule description
    Duration string
    Metric rule duration
    Expression string
    Metric rule expression
    ThresholdValue float64
    Metric rule threshold value
    Comparison string
    Metric rule comparison
    Description string
    Metric rule description
    duration String
    Metric rule duration
    expression String
    Metric rule expression
    thresholdValue Double
    Metric rule threshold value
    comparison String
    Metric rule comparison
    description String
    Metric rule description
    duration string
    Metric rule duration
    expression string
    Metric rule expression
    thresholdValue number
    Metric rule threshold value
    comparison string
    Metric rule comparison
    description string
    Metric rule description
    duration str
    Metric rule duration
    expression str
    Metric rule expression
    threshold_value float
    Metric rule threshold value
    comparison str
    Metric rule comparison
    description str
    Metric rule description
    duration String
    Metric rule duration
    expression String
    Metric rule expression
    thresholdValue Number
    Metric rule threshold value
    comparison String
    Metric rule comparison
    description String
    Metric rule description

    GetProjectAlertRulePodRule

    PodId string
    Pod ID
    Condition string
    Pod rule condition
    RestartIntervalSeconds int
    Pod rule restart interval seconds
    RestartTimes int
    Pod rule restart times
    PodId string
    Pod ID
    Condition string
    Pod rule condition
    RestartIntervalSeconds int
    Pod rule restart interval seconds
    RestartTimes int
    Pod rule restart times
    podId String
    Pod ID
    condition String
    Pod rule condition
    restartIntervalSeconds Integer
    Pod rule restart interval seconds
    restartTimes Integer
    Pod rule restart times
    podId string
    Pod ID
    condition string
    Pod rule condition
    restartIntervalSeconds number
    Pod rule restart interval seconds
    restartTimes number
    Pod rule restart times
    pod_id str
    Pod ID
    condition str
    Pod rule condition
    restart_interval_seconds int
    Pod rule restart interval seconds
    restart_times int
    Pod rule restart times
    podId String
    Pod ID
    condition String
    Pod rule condition
    restartIntervalSeconds Number
    Pod rule restart interval seconds
    restartTimes Number
    Pod rule restart times

    GetProjectAlertRuleWorkloadRule

    AvailablePercentage int
    Workload rule available percentage
    Selector Dictionary<string, object>
    Workload rule selector
    WorkloadId string
    Workload ID
    AvailablePercentage int
    Workload rule available percentage
    Selector map[string]interface{}
    Workload rule selector
    WorkloadId string
    Workload ID
    availablePercentage Integer
    Workload rule available percentage
    selector Map<String,Object>
    Workload rule selector
    workloadId String
    Workload ID
    availablePercentage number
    Workload rule available percentage
    selector {[key: string]: any}
    Workload rule selector
    workloadId string
    Workload ID
    available_percentage int
    Workload rule available percentage
    selector Mapping[str, Any]
    Workload rule selector
    workload_id str
    Workload ID
    availablePercentage Number
    Workload rule available percentage
    selector Map<Any>
    Workload rule selector
    workloadId String
    Workload ID

    Package Details

    Repository
    Rancher2 pulumi/pulumi-rancher2
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rancher2 Terraform Provider.
    rancher2 logo
    Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi