generated from pulumi/pulumi-tf-provider-boilerplate
/
getNodePool.go
289 lines (250 loc) · 11.1 KB
/
getNodePool.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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
// 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 cce
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// To get the specified node pool in a cluster.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Cce"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Cce"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cfg := config.New(ctx, "")
// clusterId := cfg.RequireObject("clusterId")
// nodePoolName := cfg.RequireObject("nodePoolName")
// _, err := Cce.GetNodePool(ctx, &cce.GetNodePoolArgs{
// ClusterId: clusterId,
// Name: pulumi.StringRef(nodePoolName),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupNodePool(ctx *pulumi.Context, args *LookupNodePoolArgs, opts ...pulumi.InvokeOption) (*LookupNodePoolResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupNodePoolResult
err := ctx.Invoke("huaweicloud:Cce/getNodePool:getNodePool", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getNodePool.
type LookupNodePoolArgs struct {
// Specifies the ID of container cluster.
ClusterId string `pulumi:"clusterId"`
// Specifies the name of the node pool.
Name *string `pulumi:"name"`
// Specifies the ID of the node pool.
NodePoolId *string `pulumi:"nodePoolId"`
// Specifies the region in which to obtain the CCE node pools.
// If omitted, the provider-level region will be used.
Region *string `pulumi:"region"`
// Specifies the state of the node pool.
Status *string `pulumi:"status"`
}
// A collection of values returned by getNodePool.
type LookupNodePoolResult struct {
// The name of the available partition (AZ).
AvailabilityZone string `pulumi:"availabilityZone"`
ClusterId string `pulumi:"clusterId"`
// Current number of nodes in the node pool.
CurrentNodeCount int `pulumi:"currentNodeCount"`
// Represents the data disk to be created. Structure is documented below.
DataVolumes []GetNodePoolDataVolume `pulumi:"dataVolumes"`
// Extended parameter.
ExtendParam map[string]string `pulumi:"extendParam"`
// The flavor ID.
FlavorId string `pulumi:"flavorId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Initial number of nodes in the node pool.
InitialNodeCount int `pulumi:"initialNodeCount"`
// Key pair name when logging in to select the key pair mode.
KeyPair string `pulumi:"keyPair"`
// Tags of a Kubernetes node, key/value pair format.
Labels map[string]string `pulumi:"labels"`
// Maximum number of nodes allowed if auto scaling is enabled.
MaxNodeCount int `pulumi:"maxNodeCount"`
// The maximum number of instances a node is allowed to create.
MaxPods int `pulumi:"maxPods"`
// Minimum number of nodes allowed if auto scaling is enabled.
MinNodeCount int `pulumi:"minNodeCount"`
Name string `pulumi:"name"`
NodePoolId string `pulumi:"nodePoolId"`
// Operating System of the node.
Os string `pulumi:"os"`
// Weight of a node pool. A node pool with a higher weight has a higher priority during scaling.
Priority int `pulumi:"priority"`
Region string `pulumi:"region"`
// It corresponds to the system disk related configuration. Structure is documented below.
RootVolumes []GetNodePoolRootVolume `pulumi:"rootVolumes"`
// Interval between two scaling operations, in minutes.
ScaleDownCooldownTime int `pulumi:"scaleDownCooldownTime"`
// Whether auto scaling is enabled.
ScallEnable bool `pulumi:"scallEnable"`
Status string `pulumi:"status"`
// The ID of the subnet to which the NIC belongs.
SubnetId string `pulumi:"subnetId"`
// Tags of a VM node, key/value pair format.
Tags map[string]string `pulumi:"tags"`
// Node Pool type.
Type string `pulumi:"type"`
}
func LookupNodePoolOutput(ctx *pulumi.Context, args LookupNodePoolOutputArgs, opts ...pulumi.InvokeOption) LookupNodePoolResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupNodePoolResult, error) {
args := v.(LookupNodePoolArgs)
r, err := LookupNodePool(ctx, &args, opts...)
var s LookupNodePoolResult
if r != nil {
s = *r
}
return s, err
}).(LookupNodePoolResultOutput)
}
// A collection of arguments for invoking getNodePool.
type LookupNodePoolOutputArgs struct {
// Specifies the ID of container cluster.
ClusterId pulumi.StringInput `pulumi:"clusterId"`
// Specifies the name of the node pool.
Name pulumi.StringPtrInput `pulumi:"name"`
// Specifies the ID of the node pool.
NodePoolId pulumi.StringPtrInput `pulumi:"nodePoolId"`
// Specifies the region in which to obtain the CCE node pools.
// If omitted, the provider-level region will be used.
Region pulumi.StringPtrInput `pulumi:"region"`
// Specifies the state of the node pool.
Status pulumi.StringPtrInput `pulumi:"status"`
}
func (LookupNodePoolOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodePoolArgs)(nil)).Elem()
}
// A collection of values returned by getNodePool.
type LookupNodePoolResultOutput struct{ *pulumi.OutputState }
func (LookupNodePoolResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodePoolResult)(nil)).Elem()
}
func (o LookupNodePoolResultOutput) ToLookupNodePoolResultOutput() LookupNodePoolResultOutput {
return o
}
func (o LookupNodePoolResultOutput) ToLookupNodePoolResultOutputWithContext(ctx context.Context) LookupNodePoolResultOutput {
return o
}
// The name of the available partition (AZ).
func (o LookupNodePoolResultOutput) AvailabilityZone() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.AvailabilityZone }).(pulumi.StringOutput)
}
func (o LookupNodePoolResultOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.ClusterId }).(pulumi.StringOutput)
}
// Current number of nodes in the node pool.
func (o LookupNodePoolResultOutput) CurrentNodeCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.CurrentNodeCount }).(pulumi.IntOutput)
}
// Represents the data disk to be created. Structure is documented below.
func (o LookupNodePoolResultOutput) DataVolumes() GetNodePoolDataVolumeArrayOutput {
return o.ApplyT(func(v LookupNodePoolResult) []GetNodePoolDataVolume { return v.DataVolumes }).(GetNodePoolDataVolumeArrayOutput)
}
// Extended parameter.
func (o LookupNodePoolResultOutput) ExtendParam() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNodePoolResult) map[string]string { return v.ExtendParam }).(pulumi.StringMapOutput)
}
// The flavor ID.
func (o LookupNodePoolResultOutput) FlavorId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.FlavorId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupNodePoolResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.Id }).(pulumi.StringOutput)
}
// Initial number of nodes in the node pool.
func (o LookupNodePoolResultOutput) InitialNodeCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.InitialNodeCount }).(pulumi.IntOutput)
}
// Key pair name when logging in to select the key pair mode.
func (o LookupNodePoolResultOutput) KeyPair() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.KeyPair }).(pulumi.StringOutput)
}
// Tags of a Kubernetes node, key/value pair format.
func (o LookupNodePoolResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNodePoolResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// Maximum number of nodes allowed if auto scaling is enabled.
func (o LookupNodePoolResultOutput) MaxNodeCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.MaxNodeCount }).(pulumi.IntOutput)
}
// The maximum number of instances a node is allowed to create.
func (o LookupNodePoolResultOutput) MaxPods() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.MaxPods }).(pulumi.IntOutput)
}
// Minimum number of nodes allowed if auto scaling is enabled.
func (o LookupNodePoolResultOutput) MinNodeCount() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.MinNodeCount }).(pulumi.IntOutput)
}
func (o LookupNodePoolResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupNodePoolResultOutput) NodePoolId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.NodePoolId }).(pulumi.StringOutput)
}
// Operating System of the node.
func (o LookupNodePoolResultOutput) Os() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.Os }).(pulumi.StringOutput)
}
// Weight of a node pool. A node pool with a higher weight has a higher priority during scaling.
func (o LookupNodePoolResultOutput) Priority() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.Priority }).(pulumi.IntOutput)
}
func (o LookupNodePoolResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.Region }).(pulumi.StringOutput)
}
// It corresponds to the system disk related configuration. Structure is documented below.
func (o LookupNodePoolResultOutput) RootVolumes() GetNodePoolRootVolumeArrayOutput {
return o.ApplyT(func(v LookupNodePoolResult) []GetNodePoolRootVolume { return v.RootVolumes }).(GetNodePoolRootVolumeArrayOutput)
}
// Interval between two scaling operations, in minutes.
func (o LookupNodePoolResultOutput) ScaleDownCooldownTime() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodePoolResult) int { return v.ScaleDownCooldownTime }).(pulumi.IntOutput)
}
// Whether auto scaling is enabled.
func (o LookupNodePoolResultOutput) ScallEnable() pulumi.BoolOutput {
return o.ApplyT(func(v LookupNodePoolResult) bool { return v.ScallEnable }).(pulumi.BoolOutput)
}
func (o LookupNodePoolResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.Status }).(pulumi.StringOutput)
}
// The ID of the subnet to which the NIC belongs.
func (o LookupNodePoolResultOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.SubnetId }).(pulumi.StringOutput)
}
// Tags of a VM node, key/value pair format.
func (o LookupNodePoolResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNodePoolResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// Node Pool type.
func (o LookupNodePoolResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodePoolResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupNodePoolResultOutput{})
}