generated from pulumi/pulumi-tf-provider-boilerplate
/
qos.go
256 lines (209 loc) · 7.84 KB
/
qos.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package rocketmq
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Sag Qos resource. Smart Access Gateway (SAG) supports quintuple-based QoS functions to differentiate traffic of different services and ensure high-priority traffic bandwidth.
//
// For information about Sag Qos and how to use it, see [What is Qos](https://www.alibabacloud.com/help/doc-detail/131306.htm).
//
// > **NOTE:** Available in 1.60.0+
//
// > **NOTE:** Only the following regions support. [`cn-shanghai`, `cn-shanghai-finance-1`, `cn-hongkong`, `ap-southeast-1`, `ap-southeast-2`, `ap-southeast-3`, `ap-southeast-5`, `ap-northeast-1`, `eu-central-1`]
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/rocketmq"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := rocketmq.NewQos(ctx, "default", nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// The Sag Qos can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:rocketmq/qos:Qos example qos-abc123456
//
// ```
type Qos struct {
pulumi.CustomResourceState
// The name of the QoS policy to be created. The name can contain 2 to 128 characters including a-z, A-Z, 0-9, periods, underlines, and hyphens. The name must start with an English letter, but cannot start with http:// or https://.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewQos registers a new resource with the given unique name, arguments, and options.
func NewQos(ctx *pulumi.Context,
name string, args *QosArgs, opts ...pulumi.ResourceOption) (*Qos, error) {
if args == nil {
args = &QosArgs{}
}
opts = pkgResourceDefaultOpts(opts)
var resource Qos
err := ctx.RegisterResource("alicloud:rocketmq/qos:Qos", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetQos gets an existing Qos resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetQos(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *QosState, opts ...pulumi.ResourceOption) (*Qos, error) {
var resource Qos
err := ctx.ReadResource("alicloud:rocketmq/qos:Qos", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Qos resources.
type qosState struct {
// The name of the QoS policy to be created. The name can contain 2 to 128 characters including a-z, A-Z, 0-9, periods, underlines, and hyphens. The name must start with an English letter, but cannot start with http:// or https://.
Name *string `pulumi:"name"`
}
type QosState struct {
// The name of the QoS policy to be created. The name can contain 2 to 128 characters including a-z, A-Z, 0-9, periods, underlines, and hyphens. The name must start with an English letter, but cannot start with http:// or https://.
Name pulumi.StringPtrInput
}
func (QosState) ElementType() reflect.Type {
return reflect.TypeOf((*qosState)(nil)).Elem()
}
type qosArgs struct {
// The name of the QoS policy to be created. The name can contain 2 to 128 characters including a-z, A-Z, 0-9, periods, underlines, and hyphens. The name must start with an English letter, but cannot start with http:// or https://.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a Qos resource.
type QosArgs struct {
// The name of the QoS policy to be created. The name can contain 2 to 128 characters including a-z, A-Z, 0-9, periods, underlines, and hyphens. The name must start with an English letter, but cannot start with http:// or https://.
Name pulumi.StringPtrInput
}
func (QosArgs) ElementType() reflect.Type {
return reflect.TypeOf((*qosArgs)(nil)).Elem()
}
type QosInput interface {
pulumi.Input
ToQosOutput() QosOutput
ToQosOutputWithContext(ctx context.Context) QosOutput
}
func (*Qos) ElementType() reflect.Type {
return reflect.TypeOf((**Qos)(nil)).Elem()
}
func (i *Qos) ToQosOutput() QosOutput {
return i.ToQosOutputWithContext(context.Background())
}
func (i *Qos) ToQosOutputWithContext(ctx context.Context) QosOutput {
return pulumi.ToOutputWithContext(ctx, i).(QosOutput)
}
// QosArrayInput is an input type that accepts QosArray and QosArrayOutput values.
// You can construct a concrete instance of `QosArrayInput` via:
//
// QosArray{ QosArgs{...} }
type QosArrayInput interface {
pulumi.Input
ToQosArrayOutput() QosArrayOutput
ToQosArrayOutputWithContext(context.Context) QosArrayOutput
}
type QosArray []QosInput
func (QosArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Qos)(nil)).Elem()
}
func (i QosArray) ToQosArrayOutput() QosArrayOutput {
return i.ToQosArrayOutputWithContext(context.Background())
}
func (i QosArray) ToQosArrayOutputWithContext(ctx context.Context) QosArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(QosArrayOutput)
}
// QosMapInput is an input type that accepts QosMap and QosMapOutput values.
// You can construct a concrete instance of `QosMapInput` via:
//
// QosMap{ "key": QosArgs{...} }
type QosMapInput interface {
pulumi.Input
ToQosMapOutput() QosMapOutput
ToQosMapOutputWithContext(context.Context) QosMapOutput
}
type QosMap map[string]QosInput
func (QosMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Qos)(nil)).Elem()
}
func (i QosMap) ToQosMapOutput() QosMapOutput {
return i.ToQosMapOutputWithContext(context.Background())
}
func (i QosMap) ToQosMapOutputWithContext(ctx context.Context) QosMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(QosMapOutput)
}
type QosOutput struct{ *pulumi.OutputState }
func (QosOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Qos)(nil)).Elem()
}
func (o QosOutput) ToQosOutput() QosOutput {
return o
}
func (o QosOutput) ToQosOutputWithContext(ctx context.Context) QosOutput {
return o
}
// The name of the QoS policy to be created. The name can contain 2 to 128 characters including a-z, A-Z, 0-9, periods, underlines, and hyphens. The name must start with an English letter, but cannot start with http:// or https://.
func (o QosOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Qos) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type QosArrayOutput struct{ *pulumi.OutputState }
func (QosArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Qos)(nil)).Elem()
}
func (o QosArrayOutput) ToQosArrayOutput() QosArrayOutput {
return o
}
func (o QosArrayOutput) ToQosArrayOutputWithContext(ctx context.Context) QosArrayOutput {
return o
}
func (o QosArrayOutput) Index(i pulumi.IntInput) QosOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Qos {
return vs[0].([]*Qos)[vs[1].(int)]
}).(QosOutput)
}
type QosMapOutput struct{ *pulumi.OutputState }
func (QosMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Qos)(nil)).Elem()
}
func (o QosMapOutput) ToQosMapOutput() QosMapOutput {
return o
}
func (o QosMapOutput) ToQosMapOutputWithContext(ctx context.Context) QosMapOutput {
return o
}
func (o QosMapOutput) MapIndex(k pulumi.StringInput) QosOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Qos {
return vs[0].(map[string]*Qos)[vs[1].(string)]
}).(QosOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*QosInput)(nil)).Elem(), &Qos{})
pulumi.RegisterInputType(reflect.TypeOf((*QosArrayInput)(nil)).Elem(), QosArray{})
pulumi.RegisterInputType(reflect.TypeOf((*QosMapInput)(nil)).Elem(), QosMap{})
pulumi.RegisterOutputType(QosOutput{})
pulumi.RegisterOutputType(QosArrayOutput{})
pulumi.RegisterOutputType(QosMapOutput{})
}