1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. chatbot
  5. PublishTask
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.chatbot.PublishTask

Explore with Pulumi AI

Provides a Chatbot Publish Task resource.

For information about Chatbot Publish Task and how to use it, see What is Publish Task.

NOTE: Available since v1.203.0+.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = alicloud.chatbot.getAgents({});
const defaultPublishTask = new alicloud.chatbot.PublishTask("default", {
    bizType: "faq",
    agentKey: _default.then(_default => _default.agents?.[0]?.agentKey),
});
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.chatbot.get_agents()
default_publish_task = alicloud.chatbot.PublishTask("default",
    biz_type="faq",
    agent_key=default.agents[0].agent_key)
Copy
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 {
		_default, err := chatbot.GetAgents(ctx, &chatbot.GetAgentsArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = chatbot.NewPublishTask(ctx, "default", &chatbot.PublishTaskArgs{
			BizType:  pulumi.String("faq"),
			AgentKey: pulumi.String(_default.Agents[0].AgentKey),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = AliCloud.Chatbot.GetAgents.Invoke();

    var defaultPublishTask = new AliCloud.Chatbot.PublishTask("default", new()
    {
        BizType = "faq",
        AgentKey = @default.Apply(@default => @default.Apply(getAgentsResult => getAgentsResult.Agents[0]?.AgentKey)),
    });

});
Copy
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 com.pulumi.alicloud.chatbot.PublishTask;
import com.pulumi.alicloud.chatbot.PublishTaskArgs;
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 default = ChatbotFunctions.getAgents();

        var defaultPublishTask = new PublishTask("defaultPublishTask", PublishTaskArgs.builder()
            .bizType("faq")
            .agentKey(default_.agents()[0].agentKey())
            .build());

    }
}
Copy
resources:
  defaultPublishTask:
    type: alicloud:chatbot:PublishTask
    name: default
    properties:
      bizType: faq
      agentKey: ${default.agents[0].agentKey}
variables:
  default:
    fn::invoke:
      function: alicloud:chatbot:getAgents
      arguments: {}
Copy

Create PublishTask Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new PublishTask(name: string, args: PublishTaskArgs, opts?: CustomResourceOptions);
@overload
def PublishTask(resource_name: str,
                args: PublishTaskArgs,
                opts: Optional[ResourceOptions] = None)

@overload
def PublishTask(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                biz_type: Optional[str] = None,
                agent_key: Optional[str] = None,
                data_id_lists: Optional[Sequence[str]] = None)
func NewPublishTask(ctx *Context, name string, args PublishTaskArgs, opts ...ResourceOption) (*PublishTask, error)
public PublishTask(string name, PublishTaskArgs args, CustomResourceOptions? opts = null)
public PublishTask(String name, PublishTaskArgs args)
public PublishTask(String name, PublishTaskArgs args, CustomResourceOptions options)
type: alicloud:chatbot:PublishTask
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. PublishTaskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. PublishTaskArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. PublishTaskArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. PublishTaskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PublishTaskArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var publishTaskResource = new AliCloud.Chatbot.PublishTask("publishTaskResource", new()
{
    BizType = "string",
    AgentKey = "string",
    DataIdLists = new[]
    {
        "string",
    },
});
Copy
example, err := chatbot.NewPublishTask(ctx, "publishTaskResource", &chatbot.PublishTaskArgs{
	BizType:  pulumi.String("string"),
	AgentKey: pulumi.String("string"),
	DataIdLists: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var publishTaskResource = new PublishTask("publishTaskResource", PublishTaskArgs.builder()
    .bizType("string")
    .agentKey("string")
    .dataIdLists("string")
    .build());
Copy
publish_task_resource = alicloud.chatbot.PublishTask("publishTaskResource",
    biz_type="string",
    agent_key="string",
    data_id_lists=["string"])
Copy
const publishTaskResource = new alicloud.chatbot.PublishTask("publishTaskResource", {
    bizType: "string",
    agentKey: "string",
    dataIdLists: ["string"],
});
Copy
type: alicloud:chatbot:PublishTask
properties:
    agentKey: string
    bizType: string
    dataIdLists:
        - string
Copy

PublishTask Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The PublishTask resource accepts the following input properties:

BizType
This property is required.
Changes to this property will trigger replacement.
string
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
AgentKey string
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
DataIdLists List<string>
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
BizType
This property is required.
Changes to this property will trigger replacement.
string
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
AgentKey string
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
DataIdLists []string
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
bizType
This property is required.
Changes to this property will trigger replacement.
String
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
agentKey String
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
dataIdLists List<String>
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
bizType
This property is required.
Changes to this property will trigger replacement.
string
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
agentKey string
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
dataIdLists string[]
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
biz_type
This property is required.
Changes to this property will trigger replacement.
str
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
agent_key str
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
data_id_lists Sequence[str]
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
bizType
This property is required.
Changes to this property will trigger replacement.
String
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
agentKey String
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
dataIdLists List<String>
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.

Outputs

All input properties are implicitly available as output properties. Additionally, the PublishTask resource produces the following output properties:

CreateTime string
UTC time of task creation
Id string
The provider-assigned unique ID for this managed resource.
ModifyTime string
UTC time for task modification
Status string
The status of the task.
CreateTime string
UTC time of task creation
Id string
The provider-assigned unique ID for this managed resource.
ModifyTime string
UTC time for task modification
Status string
The status of the task.
createTime String
UTC time of task creation
id String
The provider-assigned unique ID for this managed resource.
modifyTime String
UTC time for task modification
status String
The status of the task.
createTime string
UTC time of task creation
id string
The provider-assigned unique ID for this managed resource.
modifyTime string
UTC time for task modification
status string
The status of the task.
create_time str
UTC time of task creation
id str
The provider-assigned unique ID for this managed resource.
modify_time str
UTC time for task modification
status str
The status of the task.
createTime String
UTC time of task creation
id String
The provider-assigned unique ID for this managed resource.
modifyTime String
UTC time for task modification
status String
The status of the task.

Look up Existing PublishTask Resource

Get an existing PublishTask resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PublishTaskState, opts?: CustomResourceOptions): PublishTask
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        agent_key: Optional[str] = None,
        biz_type: Optional[str] = None,
        create_time: Optional[str] = None,
        data_id_lists: Optional[Sequence[str]] = None,
        modify_time: Optional[str] = None,
        status: Optional[str] = None) -> PublishTask
func GetPublishTask(ctx *Context, name string, id IDInput, state *PublishTaskState, opts ...ResourceOption) (*PublishTask, error)
public static PublishTask Get(string name, Input<string> id, PublishTaskState? state, CustomResourceOptions? opts = null)
public static PublishTask get(String name, Output<String> id, PublishTaskState state, CustomResourceOptions options)
resources:  _:    type: alicloud:chatbot:PublishTask    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AgentKey string
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
BizType Changes to this property will trigger replacement. string
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
CreateTime string
UTC time of task creation
DataIdLists List<string>
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
ModifyTime string
UTC time for task modification
Status string
The status of the task.
AgentKey string
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
BizType Changes to this property will trigger replacement. string
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
CreateTime string
UTC time of task creation
DataIdLists []string
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
ModifyTime string
UTC time for task modification
Status string
The status of the task.
agentKey String
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
bizType Changes to this property will trigger replacement. String
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
createTime String
UTC time of task creation
dataIdLists List<String>
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
modifyTime String
UTC time for task modification
status String
The status of the task.
agentKey string
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
bizType Changes to this property will trigger replacement. string
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
createTime string
UTC time of task creation
dataIdLists string[]
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
modifyTime string
UTC time for task modification
status string
The status of the task.
agent_key str
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
biz_type Changes to this property will trigger replacement. str
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
create_time str
UTC time of task creation
data_id_lists Sequence[str]
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
modify_time str
UTC time for task modification
status str
The status of the task.
agentKey String
The business space key. If you do not set it, the default business space is accessed. The key value is obtained on the business management page of the primary account.
bizType Changes to this property will trigger replacement. String
The type of the publishing unit. Please use the CreateInstancePublishTask API to publish the robot.
createTime String
UTC time of task creation
dataIdLists List<String>
Additional release information. Currently supported: If the BizType is faq, enter the category Id in this field to indicate that only the knowledge under these categories is published.
modifyTime String
UTC time for task modification
status String
The status of the task.

Import

Chatbot Publish Task can be imported using the id, e.g.

$ pulumi import alicloud:chatbot/publishTask:PublishTask example <id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.