1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. arms
  5. getAlertRobots
Alibaba Cloud v3.72.0 published on Friday, Jan 3, 2025 by Pulumi

alicloud.arms.getAlertRobots

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.72.0 published on Friday, Jan 3, 2025 by Pulumi

    This data source provides the Arms Alert Robots of the current Alibaba Cloud user.

    NOTE: Available since v1.237.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.arms.AlertRobot("default", {
        alertRobotName: "my-AlertRobot",
        robotType: "wechat",
        robotAddr: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23",
    });
    const nameRegex = alicloud.arms.getAlertRobotsOutput({
        alertRobotName: _default.alertRobotName,
    });
    export const armsAlertRobotId = nameRegex.apply(nameRegex => nameRegex.robots?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.arms.AlertRobot("default",
        alert_robot_name="my-AlertRobot",
        robot_type="wechat",
        robot_addr="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23")
    name_regex = alicloud.arms.get_alert_robots_output(alert_robot_name=default.alert_robot_name)
    pulumi.export("armsAlertRobotId", name_regex.robots[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := arms.NewAlertRobot(ctx, "default", &arms.AlertRobotArgs{
    			AlertRobotName: pulumi.String("my-AlertRobot"),
    			RobotType:      pulumi.String("wechat"),
    			RobotAddr:      pulumi.String("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23"),
    		})
    		if err != nil {
    			return err
    		}
    		nameRegex := arms.GetAlertRobotsOutput(ctx, arms.GetAlertRobotsOutputArgs{
    			AlertRobotName: _default.AlertRobotName,
    		}, nil)
    		ctx.Export("armsAlertRobotId", nameRegex.ApplyT(func(nameRegex arms.GetAlertRobotsResult) (*string, error) {
    			return &nameRegex.Robots[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.Arms.AlertRobot("default", new()
        {
            AlertRobotName = "my-AlertRobot",
            RobotType = "wechat",
            RobotAddr = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23",
        });
    
        var nameRegex = AliCloud.Arms.GetAlertRobots.Invoke(new()
        {
            AlertRobotName = @default.AlertRobotName,
        });
    
        return new Dictionary<string, object?>
        {
            ["armsAlertRobotId"] = nameRegex.Apply(getAlertRobotsResult => getAlertRobotsResult.Robots[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.arms.AlertRobot;
    import com.pulumi.alicloud.arms.AlertRobotArgs;
    import com.pulumi.alicloud.arms.ArmsFunctions;
    import com.pulumi.alicloud.arms.inputs.GetAlertRobotsArgs;
    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) {
            var default_ = new AlertRobot("default", AlertRobotArgs.builder()
                .alertRobotName("my-AlertRobot")
                .robotType("wechat")
                .robotAddr("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23")
                .build());
    
            final var nameRegex = ArmsFunctions.getAlertRobots(GetAlertRobotsArgs.builder()
                .alertRobotName(default_.alertRobotName())
                .build());
    
            ctx.export("armsAlertRobotId", nameRegex.applyValue(getAlertRobotsResult -> getAlertRobotsResult).applyValue(nameRegex -> nameRegex.applyValue(getAlertRobotsResult -> getAlertRobotsResult.robots()[0].id())));
        }
    }
    
    resources:
      default:
        type: alicloud:arms:AlertRobot
        properties:
          alertRobotName: my-AlertRobot
          robotType: wechat
          robotAddr: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=1c704e23
    variables:
      nameRegex:
        fn::invoke:
          function: alicloud:arms:getAlertRobots
          arguments:
            alertRobotName: ${default.alertRobotName}
    outputs:
      armsAlertRobotId: ${nameRegex.robots[0].id}
    

    Using getAlertRobots

    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 getAlertRobots(args: GetAlertRobotsArgs, opts?: InvokeOptions): Promise<GetAlertRobotsResult>
    function getAlertRobotsOutput(args: GetAlertRobotsOutputArgs, opts?: InvokeOptions): Output<GetAlertRobotsResult>
    def get_alert_robots(alert_robot_name: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         robot_type: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetAlertRobotsResult
    def get_alert_robots_output(alert_robot_name: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         robot_type: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetAlertRobotsResult]
    func GetAlertRobots(ctx *Context, args *GetAlertRobotsArgs, opts ...InvokeOption) (*GetAlertRobotsResult, error)
    func GetAlertRobotsOutput(ctx *Context, args *GetAlertRobotsOutputArgs, opts ...InvokeOption) GetAlertRobotsResultOutput

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

    public static class GetAlertRobots 
    {
        public static Task<GetAlertRobotsResult> InvokeAsync(GetAlertRobotsArgs args, InvokeOptions? opts = null)
        public static Output<GetAlertRobotsResult> Invoke(GetAlertRobotsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAlertRobotsResult> getAlertRobots(GetAlertRobotsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:arms/getAlertRobots:getAlertRobots
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AlertRobotName string
    The robot name.
    Ids List<string>
    A list of Alert Robot IDs.
    NameRegex string
    A regex string to filter results by Alert Robot name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RobotType string
    The robot type.
    AlertRobotName string
    The robot name.
    Ids []string
    A list of Alert Robot IDs.
    NameRegex string
    A regex string to filter results by Alert Robot name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RobotType string
    The robot type.
    alertRobotName String
    The robot name.
    ids List<String>
    A list of Alert Robot IDs.
    nameRegex String
    A regex string to filter results by Alert Robot name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    robotType String
    The robot type.
    alertRobotName string
    The robot name.
    ids string[]
    A list of Alert Robot IDs.
    nameRegex string
    A regex string to filter results by Alert Robot name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    robotType string
    The robot type.
    alert_robot_name str
    The robot name.
    ids Sequence[str]
    A list of Alert Robot IDs.
    name_regex str
    A regex string to filter results by Alert Robot name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    robot_type str
    The robot type.
    alertRobotName String
    The robot name.
    ids List<String>
    A list of Alert Robot IDs.
    nameRegex String
    A regex string to filter results by Alert Robot name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    robotType String
    The robot type.

    getAlertRobots Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Alert Robot IDs.
    Names List<string>
    A list of Alert Robot names.
    Robots List<Pulumi.AliCloud.Arms.Outputs.GetAlertRobotsRobot>
    A list of Arms Alert Robots. Each element contains the following attributes:
    AlertRobotName string
    NameRegex string
    OutputFile string
    RobotType string
    The type of the robot.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Alert Robot IDs.
    Names []string
    A list of Alert Robot names.
    Robots []GetAlertRobotsRobot
    A list of Arms Alert Robots. Each element contains the following attributes:
    AlertRobotName string
    NameRegex string
    OutputFile string
    RobotType string
    The type of the robot.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Alert Robot IDs.
    names List<String>
    A list of Alert Robot names.
    robots List<GetAlertRobotsRobot>
    A list of Arms Alert Robots. Each element contains the following attributes:
    alertRobotName String
    nameRegex String
    outputFile String
    robotType String
    The type of the robot.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Alert Robot IDs.
    names string[]
    A list of Alert Robot names.
    robots GetAlertRobotsRobot[]
    A list of Arms Alert Robots. Each element contains the following attributes:
    alertRobotName string
    nameRegex string
    outputFile string
    robotType string
    The type of the robot.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Alert Robot IDs.
    names Sequence[str]
    A list of Alert Robot names.
    robots Sequence[GetAlertRobotsRobot]
    A list of Arms Alert Robots. Each element contains the following attributes:
    alert_robot_name str
    name_regex str
    output_file str
    robot_type str
    The type of the robot.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Alert Robot IDs.
    names List<String>
    A list of Alert Robot names.
    robots List<Property Map>
    A list of Arms Alert Robots. Each element contains the following attributes:
    alertRobotName String
    nameRegex String
    outputFile String
    robotType String
    The type of the robot.

    Supporting Types

    GetAlertRobotsRobot

    CreateTime string
    The creation time of the resource.
    DailyNoc string
    Specifies whether the alert robot receives daily notifications.
    DailyNocTime string
    The time of the daily notification.
    Id string
    The ID of the Alert Robot.
    RobotAddr string
    The webhook url of the robot.
    RobotId string
    The id of the robot.
    RobotName string
    The name of the robot.
    RobotType string
    The robot type.
    CreateTime string
    The creation time of the resource.
    DailyNoc string
    Specifies whether the alert robot receives daily notifications.
    DailyNocTime string
    The time of the daily notification.
    Id string
    The ID of the Alert Robot.
    RobotAddr string
    The webhook url of the robot.
    RobotId string
    The id of the robot.
    RobotName string
    The name of the robot.
    RobotType string
    The robot type.
    createTime String
    The creation time of the resource.
    dailyNoc String
    Specifies whether the alert robot receives daily notifications.
    dailyNocTime String
    The time of the daily notification.
    id String
    The ID of the Alert Robot.
    robotAddr String
    The webhook url of the robot.
    robotId String
    The id of the robot.
    robotName String
    The name of the robot.
    robotType String
    The robot type.
    createTime string
    The creation time of the resource.
    dailyNoc string
    Specifies whether the alert robot receives daily notifications.
    dailyNocTime string
    The time of the daily notification.
    id string
    The ID of the Alert Robot.
    robotAddr string
    The webhook url of the robot.
    robotId string
    The id of the robot.
    robotName string
    The name of the robot.
    robotType string
    The robot type.
    create_time str
    The creation time of the resource.
    daily_noc str
    Specifies whether the alert robot receives daily notifications.
    daily_noc_time str
    The time of the daily notification.
    id str
    The ID of the Alert Robot.
    robot_addr str
    The webhook url of the robot.
    robot_id str
    The id of the robot.
    robot_name str
    The name of the robot.
    robot_type str
    The robot type.
    createTime String
    The creation time of the resource.
    dailyNoc String
    Specifies whether the alert robot receives daily notifications.
    dailyNocTime String
    The time of the daily notification.
    id String
    The ID of the Alert Robot.
    robotAddr String
    The webhook url of the robot.
    robotId String
    The id of the robot.
    robotName String
    The name of the robot.
    robotType String
    The robot type.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.72.0 published on Friday, Jan 3, 2025 by Pulumi