1. Packages
  2. Alicloud Provider
  3. API Docs
  4. chatbot
  5. getAgents
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.chatbot.getAgents

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides the Chatbot Agents of the current Alibaba Cloud user.

    NOTE: Available in v1.203.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const nameRegex = alicloud.chatbot.getAgents({
        nameRegex: "^my-Agent",
    });
    export const alicloudChatbotAgentsId1 = nameRegex.then(nameRegex => nameRegex.agents?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    name_regex = alicloud.chatbot.get_agents(name_regex="^my-Agent")
    pulumi.export("alicloudChatbotAgentsId1", name_regex.agents[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/chatbot"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		nameRegex, err := chatbot.GetAgents(ctx, &chatbot.GetAgentsArgs{
    			NameRegex: pulumi.StringRef("^my-Agent"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alicloudChatbotAgentsId1", nameRegex.Agents[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var nameRegex = AliCloud.Chatbot.GetAgents.Invoke(new()
        {
            NameRegex = "^my-Agent",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudChatbotAgentsId1"] = nameRegex.Apply(getAgentsResult => getAgentsResult.Agents[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.chatbot.ChatbotFunctions;
    import com.pulumi.alicloud.chatbot.inputs.GetAgentsArgs;
    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 nameRegex = ChatbotFunctions.getAgents(GetAgentsArgs.builder()
                .nameRegex("^my-Agent")
                .build());
    
            ctx.export("alicloudChatbotAgentsId1", nameRegex.applyValue(getAgentsResult -> getAgentsResult.agents()[0].id()));
        }
    }
    
    variables:
      nameRegex:
        fn::invoke:
          Function: alicloud:chatbot:getAgents
          Arguments:
            nameRegex: ^my-Agent
    outputs:
      alicloudChatbotAgentsId1: ${nameRegex.agents[0].id}
    

    Using getAgents

    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 getAgents(args: GetAgentsArgs, opts?: InvokeOptions): Promise<GetAgentsResult>
    function getAgentsOutput(args: GetAgentsOutputArgs, opts?: InvokeOptions): Output<GetAgentsResult>
    def get_agents(agent_name: Optional[str] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   page_number: Optional[int] = None,
                   page_size: Optional[int] = None,
                   opts: Optional[InvokeOptions] = None) -> GetAgentsResult
    def get_agents_output(agent_name: Optional[pulumi.Input[str]] = None,
                   name_regex: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   page_number: Optional[pulumi.Input[int]] = None,
                   page_size: Optional[pulumi.Input[int]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetAgentsResult]
    func GetAgents(ctx *Context, args *GetAgentsArgs, opts ...InvokeOption) (*GetAgentsResult, error)
    func GetAgentsOutput(ctx *Context, args *GetAgentsOutputArgs, opts ...InvokeOption) GetAgentsResultOutput

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

    public static class GetAgents 
    {
        public static Task<GetAgentsResult> InvokeAsync(GetAgentsArgs args, InvokeOptions? opts = null)
        public static Output<GetAgentsResult> Invoke(GetAgentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAgentsResult> getAgents(GetAgentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:chatbot/getAgents:getAgents
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AgentName string
    The name of the agent.
    NameRegex string
    A regex string to filter resulting chatbot agents by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    AgentName string
    The name of the agent.
    NameRegex string
    A regex string to filter resulting chatbot agents by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    agentName String
    The name of the agent.
    nameRegex String
    A regex string to filter resulting chatbot agents by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    agentName string
    The name of the agent.
    nameRegex string
    A regex string to filter resulting chatbot agents by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    agent_name str
    The name of the agent.
    name_regex str
    A regex string to filter resulting chatbot agents by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    agentName String
    The name of the agent.
    nameRegex String
    A regex string to filter resulting chatbot agents by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number

    getAgents Result

    The following output properties are available:

    AgentName string
    The agent Name.
    Agents List<Pulumi.AliCloud.Chatbot.Outputs.GetAgentsAgent>
    A list of availability zones. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of chatbot agents names.
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    AgentName string
    The agent Name.
    Agents []GetAgentsAgent
    A list of availability zones. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of chatbot agents names.
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    agentName String
    The agent Name.
    agents List<GetAgentsAgent>
    A list of availability zones. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of chatbot agents names.
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    agentName string
    The agent Name.
    agents GetAgentsAgent[]
    A list of availability zones. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of chatbot agents names.
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    agent_name str
    The agent Name.
    agents Sequence[GetAgentsAgent]
    A list of availability zones. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of chatbot agents names.
    name_regex str
    output_file str
    page_number int
    page_size int
    agentName String
    The agent Name.
    agents List<Property Map>
    A list of availability zones. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of chatbot agents names.
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number

    Supporting Types

    GetAgentsAgent

    AgentId string
    The agent id.
    AgentKey string
    Service space signature, which is used when PAAS interface specifies the service space.
    AgentName string
    The name of the agent.
    Id string
    ID of the agent.
    AgentId string
    The agent id.
    AgentKey string
    Service space signature, which is used when PAAS interface specifies the service space.
    AgentName string
    The name of the agent.
    Id string
    ID of the agent.
    agentId String
    The agent id.
    agentKey String
    Service space signature, which is used when PAAS interface specifies the service space.
    agentName String
    The name of the agent.
    id String
    ID of the agent.
    agentId string
    The agent id.
    agentKey string
    Service space signature, which is used when PAAS interface specifies the service space.
    agentName string
    The name of the agent.
    id string
    ID of the agent.
    agent_id str
    The agent id.
    agent_key str
    Service space signature, which is used when PAAS interface specifies the service space.
    agent_name str
    The name of the agent.
    id str
    ID of the agent.
    agentId String
    The agent id.
    agentKey String
    Service space signature, which is used when PAAS interface specifies the service space.
    agentName String
    The name of the agent.
    id String
    ID of the agent.

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi