/
getScheduledTasks.go
77 lines (72 loc) · 2.43 KB
/
getScheduledTasks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ess
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// This data source provides available scheduled task resources.
//
// > **NOTE:** Available in 1.72.0+
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/ess"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "scheduled_task_name"
// opt1 := "scheduled_task_id"
// ds, err := ess.GetScheduledTasks(ctx, &ess.GetScheduledTasksArgs{
// NameRegex: &opt0,
// ScheduledTaskId: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstScheduledTask", ds.Tasks[0].Id)
// return nil
// })
// }
// ```
func GetScheduledTasks(ctx *pulumi.Context, args *GetScheduledTasksArgs, opts ...pulumi.InvokeOption) (*GetScheduledTasksResult, error) {
var rv GetScheduledTasksResult
err := ctx.Invoke("alicloud:ess/getScheduledTasks:getScheduledTasks", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getScheduledTasks.
type GetScheduledTasksArgs struct {
// A list of scheduled task IDs.
Ids []string `pulumi:"ids"`
// A regex string to filter resulting scheduled tasks by name.
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
// The operation to be performed when a scheduled task is triggered.
ScheduledAction *string `pulumi:"scheduledAction"`
// The id of the scheduled task.
ScheduledTaskId *string `pulumi:"scheduledTaskId"`
}
// A collection of values returned by getScheduledTasks.
type GetScheduledTasksResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of scheduled task ids.
Ids []string `pulumi:"ids"`
NameRegex *string `pulumi:"nameRegex"`
// A list of scheduled task names.
Names []string `pulumi:"names"`
OutputFile *string `pulumi:"outputFile"`
// The operation to be performed when a scheduled task is triggered.
ScheduledAction *string `pulumi:"scheduledAction"`
ScheduledTaskId *string `pulumi:"scheduledTaskId"`
// A list of scheduled tasks. Each element contains the following attributes:
Tasks []GetScheduledTasksTask `pulumi:"tasks"`
}