generated from pulumi/pulumi-tf-provider-boilerplate
/
getProduct.go
266 lines (238 loc) · 9.94 KB
/
getProduct.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
257
258
259
260
261
262
263
264
265
266
// 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 dms
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get the ID of an available HuaweiCloud DMS product.
//
// ## Example Usage
// ### Filter DMS kafka product list by I/O specification
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dms"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dms"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Dms.GetProduct(ctx, &dms.GetProductArgs{
// Engine: "kafka",
// InstanceType: "cluster",
// PartitionNum: pulumi.StringRef("300"),
// Storage: pulumi.StringRef("600"),
// StorageSpecCode: pulumi.StringRef("dms.physical.storage.high"),
// Version: pulumi.StringRef("1.1.0"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Filter DMS kafka product list by underlying VM specification
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Dms"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Dms"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Dms.GetProduct(ctx, &dms.GetProductArgs{
// Engine: "kafka",
// InstanceType: "cluster",
// Version: pulumi.StringRef("2.3.0"),
// VmSpecification: pulumi.StringRef("c6.large.2"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetProduct(ctx *pulumi.Context, args *GetProductArgs, opts ...pulumi.InvokeOption) (*GetProductResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetProductResult
err := ctx.Invoke("huaweicloud:Dms/getProduct:getProduct", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getProduct.
type GetProductArgs struct {
// Indicates the list of availability zones with available resources.
AvailabilityZones []string `pulumi:"availabilityZones"`
// Indicates the baseline bandwidth of a DMS instance.
// The valid values are **100MB**, **300MB**, **600MB** and **1200MB**.
Bandwidth *string `pulumi:"bandwidth"`
// Indicates the name of a message engine. The valid values are **kafka**, **rabbitmq**.
Engine string `pulumi:"engine"`
// Indicates an instance type. The valid values are **single** and **cluster**.
InstanceType string `pulumi:"instanceType"`
// Deprecated: io_type has deprecated, please use storage_spec_code
IoType *string `pulumi:"ioType"`
// Indicates the number of nodes in a cluster.
NodeNum *string `pulumi:"nodeNum"`
// Indicates the maximum number of topics that can be created for a Kafka instance.
// The valid values are **300**, **900** and **1800**.
PartitionNum *string `pulumi:"partitionNum"`
// The region in which to obtain the dms products. If omitted, the provider-level region
// will be used.
Region *string `pulumi:"region"`
// Indicates the storage capacity of the resource.
// The default value is the storage capacity of the product.
Storage *string `pulumi:"storage"`
// Indicates an I/O specification.
// The valid values are **dms.physical.storage.high** and **dms.physical.storage.ultra**.
StorageSpecCode *string `pulumi:"storageSpecCode"`
// Indicates the version of a message engine.
Version *string `pulumi:"version"`
// Indicates underlying VM specification, such as **c6.large.2**.
VmSpecification *string `pulumi:"vmSpecification"`
}
// A collection of values returned by getProduct.
type GetProductResult struct {
AvailabilityZones []string `pulumi:"availabilityZones"`
Bandwidth string `pulumi:"bandwidth"`
Engine string `pulumi:"engine"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
InstanceType string `pulumi:"instanceType"`
// Deprecated: io_type has deprecated, please use storage_spec_code
IoType string `pulumi:"ioType"`
NodeNum string `pulumi:"nodeNum"`
PartitionNum string `pulumi:"partitionNum"`
Region string `pulumi:"region"`
Storage string `pulumi:"storage"`
StorageSpecCode string `pulumi:"storageSpecCode"`
// The available I/O specifications.
StorageSpecCodes []string `pulumi:"storageSpecCodes"`
Version string `pulumi:"version"`
VmSpecification string `pulumi:"vmSpecification"`
}
func GetProductOutput(ctx *pulumi.Context, args GetProductOutputArgs, opts ...pulumi.InvokeOption) GetProductResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetProductResult, error) {
args := v.(GetProductArgs)
r, err := GetProduct(ctx, &args, opts...)
var s GetProductResult
if r != nil {
s = *r
}
return s, err
}).(GetProductResultOutput)
}
// A collection of arguments for invoking getProduct.
type GetProductOutputArgs struct {
// Indicates the list of availability zones with available resources.
AvailabilityZones pulumi.StringArrayInput `pulumi:"availabilityZones"`
// Indicates the baseline bandwidth of a DMS instance.
// The valid values are **100MB**, **300MB**, **600MB** and **1200MB**.
Bandwidth pulumi.StringPtrInput `pulumi:"bandwidth"`
// Indicates the name of a message engine. The valid values are **kafka**, **rabbitmq**.
Engine pulumi.StringInput `pulumi:"engine"`
// Indicates an instance type. The valid values are **single** and **cluster**.
InstanceType pulumi.StringInput `pulumi:"instanceType"`
// Deprecated: io_type has deprecated, please use storage_spec_code
IoType pulumi.StringPtrInput `pulumi:"ioType"`
// Indicates the number of nodes in a cluster.
NodeNum pulumi.StringPtrInput `pulumi:"nodeNum"`
// Indicates the maximum number of topics that can be created for a Kafka instance.
// The valid values are **300**, **900** and **1800**.
PartitionNum pulumi.StringPtrInput `pulumi:"partitionNum"`
// The region in which to obtain the dms products. If omitted, the provider-level region
// will be used.
Region pulumi.StringPtrInput `pulumi:"region"`
// Indicates the storage capacity of the resource.
// The default value is the storage capacity of the product.
Storage pulumi.StringPtrInput `pulumi:"storage"`
// Indicates an I/O specification.
// The valid values are **dms.physical.storage.high** and **dms.physical.storage.ultra**.
StorageSpecCode pulumi.StringPtrInput `pulumi:"storageSpecCode"`
// Indicates the version of a message engine.
Version pulumi.StringPtrInput `pulumi:"version"`
// Indicates underlying VM specification, such as **c6.large.2**.
VmSpecification pulumi.StringPtrInput `pulumi:"vmSpecification"`
}
func (GetProductOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetProductArgs)(nil)).Elem()
}
// A collection of values returned by getProduct.
type GetProductResultOutput struct{ *pulumi.OutputState }
func (GetProductResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetProductResult)(nil)).Elem()
}
func (o GetProductResultOutput) ToGetProductResultOutput() GetProductResultOutput {
return o
}
func (o GetProductResultOutput) ToGetProductResultOutputWithContext(ctx context.Context) GetProductResultOutput {
return o
}
func (o GetProductResultOutput) AvailabilityZones() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetProductResult) []string { return v.AvailabilityZones }).(pulumi.StringArrayOutput)
}
func (o GetProductResultOutput) Bandwidth() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.Bandwidth }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) Engine() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.Engine }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetProductResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) InstanceType() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.InstanceType }).(pulumi.StringOutput)
}
// Deprecated: io_type has deprecated, please use storage_spec_code
func (o GetProductResultOutput) IoType() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.IoType }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) NodeNum() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.NodeNum }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) PartitionNum() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.PartitionNum }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.Region }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) Storage() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.Storage }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) StorageSpecCode() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.StorageSpecCode }).(pulumi.StringOutput)
}
// The available I/O specifications.
func (o GetProductResultOutput) StorageSpecCodes() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetProductResult) []string { return v.StorageSpecCodes }).(pulumi.StringArrayOutput)
}
func (o GetProductResultOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.Version }).(pulumi.StringOutput)
}
func (o GetProductResultOutput) VmSpecification() pulumi.StringOutput {
return o.ApplyT(func(v GetProductResult) string { return v.VmSpecification }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetProductResultOutput{})
}