generated from pulumi/pulumi-tf-provider-boilerplate
/
getNode.go
247 lines (214 loc) · 8.68 KB
/
getNode.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
// 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 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")
// nodeName := cfg.RequireObject("nodeName")
// _, err := Cce.GetNode(ctx, &cce.GetNodeArgs{
// ClusterId: clusterId,
// Name: pulumi.StringRef(nodeName),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupNode(ctx *pulumi.Context, args *LookupNodeArgs, opts ...pulumi.InvokeOption) (*LookupNodeResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupNodeResult
err := ctx.Invoke("huaweicloud:Cce/getNode:getNode", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getNode.
type LookupNodeArgs struct {
// Specifies the ID of container cluster.
ClusterId string `pulumi:"clusterId"`
// Specifies the name of the node.
Name *string `pulumi:"name"`
// Specifies the ID of the node.
NodeId *string `pulumi:"nodeId"`
// Specifies the region in which to obtain the CCE nodes.
// If omitted, the provider-level region will be used.
Region *string `pulumi:"region"`
// Specifies the state of the node.
Status *string `pulumi:"status"`
}
// A collection of values returned by getNode.
type LookupNodeResult struct {
// Available partitions where the node is located.
AvailabilityZone string `pulumi:"availabilityZone"`
// Node's billing mode: The value is 0 (on demand).
BillingMode int `pulumi:"billingMode"`
ClusterId string `pulumi:"clusterId"`
// Represents the data disk to be created. Structure is documented below.
DataVolumes []GetNodeDataVolume `pulumi:"dataVolumes"`
// The ID of ECS group to which the node belongs.
EcsGroupId string `pulumi:"ecsGroupId"`
// The flavor ID to be used.
FlavorId string `pulumi:"flavorId"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Key pair name when logging in to select the key pair mode.
KeyPair string `pulumi:"keyPair"`
Name string `pulumi:"name"`
NodeId string `pulumi:"nodeId"`
// Operating System of the node.
Os string `pulumi:"os"`
// Private IP of the node.
PrivateIp string `pulumi:"privateIp"`
// Elastic IP parameters of the node.
PublicIp string `pulumi:"publicIp"`
Region string `pulumi:"region"`
// It corresponds to the system disk related configuration. Structure is documented below.
RootVolumes []GetNodeRootVolume `pulumi:"rootVolumes"`
// The node's virtual machine ID in ECS.
ServerId string `pulumi:"serverId"`
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"`
}
func LookupNodeOutput(ctx *pulumi.Context, args LookupNodeOutputArgs, opts ...pulumi.InvokeOption) LookupNodeResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupNodeResult, error) {
args := v.(LookupNodeArgs)
r, err := LookupNode(ctx, &args, opts...)
var s LookupNodeResult
if r != nil {
s = *r
}
return s, err
}).(LookupNodeResultOutput)
}
// A collection of arguments for invoking getNode.
type LookupNodeOutputArgs struct {
// Specifies the ID of container cluster.
ClusterId pulumi.StringInput `pulumi:"clusterId"`
// Specifies the name of the node.
Name pulumi.StringPtrInput `pulumi:"name"`
// Specifies the ID of the node.
NodeId pulumi.StringPtrInput `pulumi:"nodeId"`
// Specifies the region in which to obtain the CCE nodes.
// If omitted, the provider-level region will be used.
Region pulumi.StringPtrInput `pulumi:"region"`
// Specifies the state of the node.
Status pulumi.StringPtrInput `pulumi:"status"`
}
func (LookupNodeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodeArgs)(nil)).Elem()
}
// A collection of values returned by getNode.
type LookupNodeResultOutput struct{ *pulumi.OutputState }
func (LookupNodeResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodeResult)(nil)).Elem()
}
func (o LookupNodeResultOutput) ToLookupNodeResultOutput() LookupNodeResultOutput {
return o
}
func (o LookupNodeResultOutput) ToLookupNodeResultOutputWithContext(ctx context.Context) LookupNodeResultOutput {
return o
}
// Available partitions where the node is located.
func (o LookupNodeResultOutput) AvailabilityZone() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.AvailabilityZone }).(pulumi.StringOutput)
}
// Node's billing mode: The value is 0 (on demand).
func (o LookupNodeResultOutput) BillingMode() pulumi.IntOutput {
return o.ApplyT(func(v LookupNodeResult) int { return v.BillingMode }).(pulumi.IntOutput)
}
func (o LookupNodeResultOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.ClusterId }).(pulumi.StringOutput)
}
// Represents the data disk to be created. Structure is documented below.
func (o LookupNodeResultOutput) DataVolumes() GetNodeDataVolumeArrayOutput {
return o.ApplyT(func(v LookupNodeResult) []GetNodeDataVolume { return v.DataVolumes }).(GetNodeDataVolumeArrayOutput)
}
// The ID of ECS group to which the node belongs.
func (o LookupNodeResultOutput) EcsGroupId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.EcsGroupId }).(pulumi.StringOutput)
}
// The flavor ID to be used.
func (o LookupNodeResultOutput) FlavorId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.FlavorId }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupNodeResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Id }).(pulumi.StringOutput)
}
// Key pair name when logging in to select the key pair mode.
func (o LookupNodeResultOutput) KeyPair() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.KeyPair }).(pulumi.StringOutput)
}
func (o LookupNodeResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupNodeResultOutput) NodeId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.NodeId }).(pulumi.StringOutput)
}
// Operating System of the node.
func (o LookupNodeResultOutput) Os() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Os }).(pulumi.StringOutput)
}
// Private IP of the node.
func (o LookupNodeResultOutput) PrivateIp() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.PrivateIp }).(pulumi.StringOutput)
}
// Elastic IP parameters of the node.
func (o LookupNodeResultOutput) PublicIp() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.PublicIp }).(pulumi.StringOutput)
}
func (o LookupNodeResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Region }).(pulumi.StringOutput)
}
// It corresponds to the system disk related configuration. Structure is documented below.
func (o LookupNodeResultOutput) RootVolumes() GetNodeRootVolumeArrayOutput {
return o.ApplyT(func(v LookupNodeResult) []GetNodeRootVolume { return v.RootVolumes }).(GetNodeRootVolumeArrayOutput)
}
// The node's virtual machine ID in ECS.
func (o LookupNodeResultOutput) ServerId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.ServerId }).(pulumi.StringOutput)
}
func (o LookupNodeResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Status }).(pulumi.StringOutput)
}
// The ID of the subnet to which the NIC belongs.
func (o LookupNodeResultOutput) SubnetId() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.SubnetId }).(pulumi.StringOutput)
}
// Tags of a VM node, key/value pair format.
func (o LookupNodeResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNodeResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupNodeResultOutput{})
}