Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi
rancher2.getClusterAlertRule
Explore with Pulumi AI
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:
- 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)
getClusterAlertRule Result
The following output properties are available:
- Annotations Dictionary<string, object>
- (Computed) The cluster alert rule annotations (map)
- Cluster
Id string - Event
Rule GetCluster Alert Rule Event Rule - (Computed) The cluster alert rule event rule. ConflictsWith:
"metric_rule", "node_rule", "system_service_rule"
(list Maxitems:1) - Group
Id string - (Computed) The cluster alert rule alert group ID (string)
- Group
Interval intSeconds - (Computed) The cluster alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - (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) - Metric
Rule GetCluster Alert Rule Metric Rule - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- Name string
- Node
Rule GetCluster Alert Rule Node Rule - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - (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) - System
Service GetRule Cluster Alert Rule System Service Rule - (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)
- Cluster
Id string - Event
Rule GetCluster Alert Rule Event Rule - (Computed) The cluster alert rule event rule. ConflictsWith:
"metric_rule", "node_rule", "system_service_rule"
(list Maxitems:1) - Group
Id string - (Computed) The cluster alert rule alert group ID (string)
- Group
Interval intSeconds - (Computed) The cluster alert rule group interval seconds. Default:
180
(int) - Group
Wait intSeconds - (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) - Metric
Rule GetCluster Alert Rule Metric Rule - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- Name string
- Node
Rule GetCluster Alert Rule Node Rule - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- Repeat
Interval intSeconds - (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) - System
Service GetRule Cluster Alert Rule System Service Rule - (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)
- cluster
Id String - event
Rule GetCluster Alert Rule Event Rule - (Computed) The cluster alert rule event rule. ConflictsWith:
"metric_rule", "node_rule", "system_service_rule"
(list Maxitems:1) - group
Id String - (Computed) The cluster alert rule alert group ID (string)
- group
Interval IntegerSeconds - (Computed) The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait IntegerSeconds - (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) - metric
Rule GetCluster Alert Rule Metric Rule - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- name String
- node
Rule GetCluster Alert Rule Node Rule - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval IntegerSeconds - (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) - system
Service GetRule Cluster Alert Rule System Service Rule - (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)
- cluster
Id string - event
Rule GetCluster Alert Rule Event Rule - (Computed) The cluster alert rule event rule. ConflictsWith:
"metric_rule", "node_rule", "system_service_rule"
(list Maxitems:1) - group
Id string - (Computed) The cluster alert rule alert group ID (string)
- group
Interval numberSeconds - (Computed) The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait numberSeconds - (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) - metric
Rule GetCluster Alert Rule Metric Rule - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- name string
- node
Rule GetCluster Alert Rule Node Rule - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval numberSeconds - (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) - system
Service GetRule Cluster Alert Rule System Service Rule - (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 GetCluster Alert Rule Event Rule - (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_ intseconds - (Computed) The cluster alert rule group interval seconds. Default:
180
(int) - group_
wait_ intseconds - (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 GetCluster Alert Rule Metric Rule - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- name str
- node_
rule GetCluster Alert Rule Node Rule - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat_
interval_ intseconds - (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_ Getrule Cluster Alert Rule System Service Rule - (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)
- cluster
Id String - event
Rule Property Map - (Computed) The cluster alert rule event rule. ConflictsWith:
"metric_rule", "node_rule", "system_service_rule"
(list Maxitems:1) - group
Id String - (Computed) The cluster alert rule alert group ID (string)
- group
Interval NumberSeconds - (Computed) The cluster alert rule group interval seconds. Default:
180
(int) - group
Wait NumberSeconds - (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) - metric
Rule Property Map - (Computed) The cluster alert rule metric rule. ConflictsWith: `"event_rule", "node_rule", "system_service_rule"`` (list Maxitems:1)
- name String
- node
Rule Property Map - (Computed) The cluster alert rule node rule. ConflictsWith: `"event_rule", "metric_rule", "system_service_rule"`` (list Maxitems:1)
- repeat
Interval NumberSeconds - (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) - system
Service Property MapRule - (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
- Resource
Kind string - Resource kind
- Event
Type string - Event type
- Resource
Kind string - Resource kind
- Event
Type string - Event type
- resource
Kind String - Resource kind
- event
Type String - Event type
- resource
Kind string - Resource kind
- event
Type string - Event type
- resource_
kind str - Resource kind
- event_
type str - Event type
- resource
Kind String - Resource kind
- event
Type String - Event type
GetClusterAlertRuleMetricRule
- Duration string
- Metric rule duration
- Expression string
- Metric rule expression
- Threshold
Value 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
- Threshold
Value 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
- threshold
Value 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
- threshold
Value 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
- threshold
Value Number - Metric rule threshold value
- comparison String
- Metric rule comparison
- description String
- Metric rule description
GetClusterAlertRuleNodeRule
- Condition string
- Node rule condition
- Cpu
Threshold int - Node rule cpu threshold
- Mem
Threshold int - Node rule mem threshold
- Node
Id string - Node ID
- Selector Dictionary<string, object>
- Node rule selector
- Condition string
- Node rule condition
- Cpu
Threshold int - Node rule cpu threshold
- Mem
Threshold int - Node rule mem threshold
- Node
Id string - Node ID
- Selector map[string]interface{}
- Node rule selector
- condition String
- Node rule condition
- cpu
Threshold Integer - Node rule cpu threshold
- mem
Threshold Integer - Node rule mem threshold
- node
Id String - Node ID
- selector Map<String,Object>
- Node rule selector
- condition string
- Node rule condition
- cpu
Threshold number - Node rule cpu threshold
- mem
Threshold number - Node rule mem threshold
- node
Id 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
- cpu
Threshold Number - Node rule cpu threshold
- mem
Threshold Number - Node rule mem threshold
- node
Id 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.