-
Notifications
You must be signed in to change notification settings - Fork 5
/
getScalingRules.go
80 lines (75 loc) · 2.37 KB
/
getScalingRules.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
78
79
80
// *** 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 scaling rule resources.
//
// ## 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 := "scaling_rule_name"
// opt1 := "scaling_group_id"
// scalingrulesDs, err := ess.GetScalingRules(ctx, &ess.GetScalingRulesArgs{
// Ids: []string{
// "scaling_rule_id1",
// "scaling_rule_id2",
// },
// NameRegex: &opt0,
// ScalingGroupId: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstScalingRule", scalingrulesDs.Rules[0].Id)
// return nil
// })
// }
// ```
func GetScalingRules(ctx *pulumi.Context, args *GetScalingRulesArgs, opts ...pulumi.InvokeOption) (*GetScalingRulesResult, error) {
var rv GetScalingRulesResult
err := ctx.Invoke("alicloud:ess/getScalingRules:getScalingRules", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getScalingRules.
type GetScalingRulesArgs struct {
// A list of scaling rule IDs.
Ids []string `pulumi:"ids"`
// A regex string to filter resulting scaling rules by name.
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
// Scaling group id the scaling rules belong to.
ScalingGroupId *string `pulumi:"scalingGroupId"`
// Type of scaling rule.
Type *string `pulumi:"type"`
}
// A collection of values returned by getScalingRules.
type GetScalingRulesResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of scaling rule ids.
Ids []string `pulumi:"ids"`
NameRegex *string `pulumi:"nameRegex"`
// A list of scaling rule names.
Names []string `pulumi:"names"`
OutputFile *string `pulumi:"outputFile"`
// A list of scaling rules. Each element contains the following attributes:
Rules []GetScalingRulesRule `pulumi:"rules"`
// ID of the scaling group.
ScalingGroupId *string `pulumi:"scalingGroupId"`
// Type of the scaling rule.
Type *string `pulumi:"type"`
}