Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.chatbot.getAgents
Explore with Pulumi AI
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:
- Agent
Name string - The name of the agent.
- Name
Regex string - A regex string to filter resulting chatbot agents by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int
- Agent
Name string - The name of the agent.
- Name
Regex string - A regex string to filter resulting chatbot agents by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int
- agent
Name String - The name of the agent.
- name
Regex String - A regex string to filter resulting chatbot agents by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Integer - page
Size Integer
- agent
Name string - The name of the agent.
- name
Regex string - A regex string to filter resulting chatbot agents by name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - page
Number number - page
Size 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
- agent
Name String - The name of the agent.
- name
Regex String - A regex string to filter resulting chatbot agents by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Number - page
Size Number
getAgents Result
The following output properties are available:
- Agent
Name string - The agent Name.
- Agents
List<Pulumi.
Ali Cloud. Chatbot. Outputs. Get Agents Agent> - 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.
- Name
Regex string - Output
File string - Page
Number int - Page
Size int
- Agent
Name string - The agent Name.
- Agents
[]Get
Agents Agent - 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.
- Name
Regex string - Output
File string - Page
Number int - Page
Size int
- agent
Name String - The agent Name.
- agents
List<Get
Agents Agent> - 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.
- name
Regex String - output
File String - page
Number Integer - page
Size Integer
- agent
Name string - The agent Name.
- agents
Get
Agents Agent[] - 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.
- name
Regex string - output
File string - page
Number number - page
Size number
- agent_
name str - The agent Name.
- agents
Sequence[Get
Agents Agent] - 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
- agent
Name 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.
- name
Regex String - output
File String - page
Number Number - page
Size Number
Supporting Types
GetAgentsAgent
- 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.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.