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

rancher2.getClusterAlertRule

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 cluster alert rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as rancher2 from "@pulumi/rancher2";
    
    const foo = rancher2.getClusterAlertRule({
        clusterId: "<cluster_id>",
        name: "<cluster_alert_rule_name>",
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    foo = rancher2.get_cluster_alert_rule(cluster_id="<cluster_id>",
        name="<cluster_alert_rule_name>")
    
    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.LookupClusterAlertRule(ctx, &rancher2.LookupClusterAlertRuleArgs{
    			ClusterId: "<cluster_id>",
    			Name:      "<cluster_alert_rule_name>",
    		}, 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.GetClusterAlertRule.Invoke(new()
        {
            ClusterId = "<cluster_id>",
            Name = "<cluster_alert_rule_name>",
        });
    
    });
    
    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.GetClusterAlertRuleArgs;
    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.getClusterAlertRule(GetClusterAlertRuleArgs.builder()
                .clusterId("<cluster_id>")
                .name("<cluster_alert_rule_name>")
                .build());
    
        }
    }
    
    variables:
      foo:
        fn::invoke:
          Function: rancher2:getClusterAlertRule
          Arguments:
            clusterId: <cluster_id>
            name: <cluster_alert_rule_name>
    

    Using getClusterAlertRule

    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 getClusterAlertRule(args: GetClusterAlertRuleArgs, opts?: InvokeOptions): Promise<GetClusterAlertRuleResult>
    function getClusterAlertRuleOutput(args: GetClusterAlertRuleOutputArgs, opts?: InvokeOptions): Output<GetClusterAlertRuleResult>
    def get_cluster_alert_rule(cluster_id: Optional[str] = None,
                               labels: Optional[Mapping[str, Any]] = None,
                               name: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetClusterAlertRuleResult
    def get_cluster_alert_rule_output(cluster_id: Optional[pulumi.Input[str]] = None,
                               labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                               name: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetClusterAlertRuleResult]
    func LookupClusterAlertRule(ctx *Context, args *LookupClusterAlertRuleArgs, opts ...InvokeOption) (*LookupClusterAlertRuleResult, error)
    func LookupClusterAlertRuleOutput(ctx *Context, args *LookupClusterAlertRuleOutputArgs, opts ...InvokeOption) LookupClusterAlertRuleResultOutput

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

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

    The following arguments are supported:

    ClusterId string
    The cluster id where create cluster alert rule (string)
    Name string
    The cluster alert rule name (string)
    Labels Dictionary<string, object>
    (Computed) The cluster alert rule labels (map)
    ClusterId string
    The cluster id where create cluster alert rule (string)
    Name string
    The cluster alert rule name (string)
    Labels map[string]interface{}
    (Computed) The cluster alert rule labels (map)
    clusterId String
    The cluster id where create cluster alert rule (string)
    name String
    The cluster alert rule name (string)
    labels Map<String,Object>
    (Computed) The cluster alert rule labels (map)
    clusterId string
    The cluster id where create cluster alert rule (string)
    name string
    The cluster alert rule name (string)
    labels {[key: string]: any}
    (Computed) The cluster alert rule labels (map)
    cluster_id str
    The cluster id where create cluster alert rule (string)
    name str
    The cluster alert rule name (string)
    labels Mapping[str, Any]
    (Computed) The cluster alert rule labels (map)
    clusterId String
    The cluster id where create cluster alert rule (string)
    name String
    The cluster alert rule name (string)
    labels Map<Any>
    (Computed) The cluster alert rule labels (map)

    getClusterAlertRule Result

    The following output properties are available:

    Annotations Dictionary<string, object>
    (Computed) The cluster alert rule annotations (map)
    ClusterId string
    EventRule GetClusterAlertRuleEventRule
    (Computed) The cluster alert rule event rule. ConflictsWith: "metric_rule", "node_rule", "system_service_rule" (list Maxitems:1)
    GroupId string
    (Computed) The cluster alert rule alert group ID (string)
    GroupIntervalSeconds int
    (Computed) The cluster alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    (Computed) The cluster alert rule group wait seconds. Default: 180 (int)
    Id string
    The provider-assigned unique ID for this managed resource.
    Inherited bool
    (Computed) The cluster alert rule inherited. Default: true (bool)
    MetricRule GetClusterAlertRuleMetricRule
    (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    Name string
    NodeRule GetClusterAlertRuleNodeRule
    (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    (Optional) The cluster alert rule wait seconds. Default: 3600 (int)
    Severity string
    (Computed) The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    SystemServiceRule GetClusterAlertRuleSystemServiceRule
    (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1)
    Labels Dictionary<string, object>
    (Computed) The cluster alert rule labels (map)
    Annotations map[string]interface{}
    (Computed) The cluster alert rule annotations (map)
    ClusterId string
    EventRule GetClusterAlertRuleEventRule
    (Computed) The cluster alert rule event rule. ConflictsWith: "metric_rule", "node_rule", "system_service_rule" (list Maxitems:1)
    GroupId string
    (Computed) The cluster alert rule alert group ID (string)
    GroupIntervalSeconds int
    (Computed) The cluster alert rule group interval seconds. Default: 180 (int)
    GroupWaitSeconds int
    (Computed) The cluster alert rule group wait seconds. Default: 180 (int)
    Id string
    The provider-assigned unique ID for this managed resource.
    Inherited bool
    (Computed) The cluster alert rule inherited. Default: true (bool)
    MetricRule GetClusterAlertRuleMetricRule
    (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    Name string
    NodeRule GetClusterAlertRuleNodeRule
    (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    RepeatIntervalSeconds int
    (Optional) The cluster alert rule wait seconds. Default: 3600 (int)
    Severity string
    (Computed) The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    SystemServiceRule GetClusterAlertRuleSystemServiceRule
    (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1)
    Labels map[string]interface{}
    (Computed) The cluster alert rule labels (map)
    annotations Map<String,Object>
    (Computed) The cluster alert rule annotations (map)
    clusterId String
    eventRule GetClusterAlertRuleEventRule
    (Computed) The cluster alert rule event rule. ConflictsWith: "metric_rule", "node_rule", "system_service_rule" (list Maxitems:1)
    groupId String
    (Computed) The cluster alert rule alert group ID (string)
    groupIntervalSeconds Integer
    (Computed) The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Integer
    (Computed) The cluster alert rule group wait seconds. Default: 180 (int)
    id String
    The provider-assigned unique ID for this managed resource.
    inherited Boolean
    (Computed) The cluster alert rule inherited. Default: true (bool)
    metricRule GetClusterAlertRuleMetricRule
    (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name String
    nodeRule GetClusterAlertRuleNodeRule
    (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Integer
    (Optional) The cluster alert rule wait seconds. Default: 3600 (int)
    severity String
    (Computed) The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule GetClusterAlertRuleSystemServiceRule
    (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1)
    labels Map<String,Object>
    (Computed) The cluster alert rule labels (map)
    annotations {[key: string]: any}
    (Computed) The cluster alert rule annotations (map)
    clusterId string
    eventRule GetClusterAlertRuleEventRule
    (Computed) The cluster alert rule event rule. ConflictsWith: "metric_rule", "node_rule", "system_service_rule" (list Maxitems:1)
    groupId string
    (Computed) The cluster alert rule alert group ID (string)
    groupIntervalSeconds number
    (Computed) The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds number
    (Computed) The cluster alert rule group wait seconds. Default: 180 (int)
    id string
    The provider-assigned unique ID for this managed resource.
    inherited boolean
    (Computed) The cluster alert rule inherited. Default: true (bool)
    metricRule GetClusterAlertRuleMetricRule
    (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name string
    nodeRule GetClusterAlertRuleNodeRule
    (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds number
    (Optional) The cluster alert rule wait seconds. Default: 3600 (int)
    severity string
    (Computed) The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule GetClusterAlertRuleSystemServiceRule
    (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1)
    labels {[key: string]: any}
    (Computed) The cluster alert rule labels (map)
    annotations Mapping[str, Any]
    (Computed) The cluster alert rule annotations (map)
    cluster_id str
    event_rule GetClusterAlertRuleEventRule
    (Computed) The cluster alert rule event rule. ConflictsWith: "metric_rule", "node_rule", "system_service_rule" (list Maxitems:1)
    group_id str
    (Computed) The cluster alert rule alert group ID (string)
    group_interval_seconds int
    (Computed) The cluster alert rule group interval seconds. Default: 180 (int)
    group_wait_seconds int
    (Computed) The cluster alert rule group wait seconds. Default: 180 (int)
    id str
    The provider-assigned unique ID for this managed resource.
    inherited bool
    (Computed) The cluster alert rule inherited. Default: true (bool)
    metric_rule GetClusterAlertRuleMetricRule
    (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name str
    node_rule GetClusterAlertRuleNodeRule
    (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeat_interval_seconds int
    (Optional) The cluster alert rule wait seconds. Default: 3600 (int)
    severity str
    (Computed) The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    system_service_rule GetClusterAlertRuleSystemServiceRule
    (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1)
    labels Mapping[str, Any]
    (Computed) The cluster alert rule labels (map)
    annotations Map<Any>
    (Computed) The cluster alert rule annotations (map)
    clusterId String
    eventRule Property Map
    (Computed) The cluster alert rule event rule. ConflictsWith: "metric_rule", "node_rule", "system_service_rule" (list Maxitems:1)
    groupId String
    (Computed) The cluster alert rule alert group ID (string)
    groupIntervalSeconds Number
    (Computed) The cluster alert rule group interval seconds. Default: 180 (int)
    groupWaitSeconds Number
    (Computed) The cluster alert rule group wait seconds. Default: 180 (int)
    id String
    The provider-assigned unique ID for this managed resource.
    inherited Boolean
    (Computed) The cluster alert rule inherited. Default: true (bool)
    metricRule Property Map
    (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
    name String
    nodeRule Property Map
    (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
    repeatIntervalSeconds Number
    (Optional) The cluster alert rule wait seconds. Default: 3600 (int)
    severity String
    (Computed) The cluster alert rule severity. Supported values : "critical" | "info" | "warning". Default: critical (string)
    systemServiceRule Property Map
    (Computed) The cluster alert rule system service rule. ConflictsWith: `"event_rule", "metric_rule", "node_rule"`` (list Maxitems:1)
    labels Map<Any>
    (Computed) The cluster alert rule labels (map)

    Supporting Types

    GetClusterAlertRuleEventRule

    ResourceKind string
    Resource kind
    EventType string
    Event type
    ResourceKind string
    Resource kind
    EventType string
    Event type
    resourceKind String
    Resource kind
    eventType String
    Event type
    resourceKind string
    Resource kind
    eventType string
    Event type
    resource_kind str
    Resource kind
    event_type str
    Event type
    resourceKind String
    Resource kind
    eventType String
    Event type

    GetClusterAlertRuleMetricRule

    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

    GetClusterAlertRuleNodeRule

    Condition string
    Node rule condition
    CpuThreshold int
    Node rule cpu threshold
    MemThreshold int
    Node rule mem threshold
    NodeId string
    Node ID
    Selector Dictionary<string, object>
    Node rule selector
    Condition string
    Node rule condition
    CpuThreshold int
    Node rule cpu threshold
    MemThreshold int
    Node rule mem threshold
    NodeId string
    Node ID
    Selector map[string]interface{}
    Node rule selector
    condition String
    Node rule condition
    cpuThreshold Integer
    Node rule cpu threshold
    memThreshold Integer
    Node rule mem threshold
    nodeId String
    Node ID
    selector Map<String,Object>
    Node rule selector
    condition string
    Node rule condition
    cpuThreshold number
    Node rule cpu threshold
    memThreshold number
    Node rule mem threshold
    nodeId string
    Node ID
    selector {[key: string]: any}
    Node rule selector
    condition str
    Node rule condition
    cpu_threshold int
    Node rule cpu threshold
    mem_threshold int
    Node rule mem threshold
    node_id str
    Node ID
    selector Mapping[str, Any]
    Node rule selector
    condition String
    Node rule condition
    cpuThreshold Number
    Node rule cpu threshold
    memThreshold Number
    Node rule mem threshold
    nodeId String
    Node ID
    selector Map<Any>
    Node rule selector

    GetClusterAlertRuleSystemServiceRule

    Condition string
    System service rule condition
    Condition string
    System service rule condition
    condition String
    System service rule condition
    condition string
    System service rule condition
    condition str
    System service rule condition
    condition String
    System service rule condition

    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