/
getNode.go
214 lines (181 loc) · 11.2 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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1alpha1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets the details of a node.
func LookupNode(ctx *pulumi.Context, args *LookupNodeArgs, opts ...pulumi.InvokeOption) (*LookupNodeResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupNodeResult
err := ctx.Invoke("google-native:tpu/v1alpha1:getNode", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupNodeArgs struct {
Location string `pulumi:"location"`
NodeId string `pulumi:"nodeId"`
Project *string `pulumi:"project"`
}
type LookupNodeResult struct {
// The type of hardware accelerators associated with this node.
AcceleratorType string `pulumi:"acceleratorType"`
// The API version that created this Node.
ApiVersion string `pulumi:"apiVersion"`
// The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user's provided network, or the provided network is peered with another network that is using that CIDR block.
CidrBlock string `pulumi:"cidrBlock"`
// The time when the node was created.
CreateTime string `pulumi:"createTime"`
// The user-supplied description of the TPU. Maximum of 512 characters.
Description string `pulumi:"description"`
// The health status of the TPU node.
Health string `pulumi:"health"`
// If this field is populated, it contains a description of why the TPU Node is unhealthy.
HealthDescription string `pulumi:"healthDescription"`
// DEPRECATED! Use network_endpoints instead. The network address for the TPU Node as visible to Compute Engine instances.
//
// Deprecated: Output only. DEPRECATED! Use network_endpoints instead. The network address for the TPU Node as visible to Compute Engine instances.
IpAddress string `pulumi:"ipAddress"`
// Resource labels to represent user-provided metadata.
Labels map[string]string `pulumi:"labels"`
// Immutable. The name of the TPU
Name string `pulumi:"name"`
// The name of a network they wish to peer the TPU node to. It must be a preexisting Compute Engine network inside of the project on which this API has been activated. If none is provided, "default" will be used.
Network string `pulumi:"network"`
// The network endpoints where TPU workers can be accessed and sent work. It is recommended that Tensorflow clients of the node reach out to the 0th entry in this map first.
NetworkEndpoints []NetworkEndpointResponse `pulumi:"networkEndpoints"`
// DEPRECATED! Use network_endpoints instead. The network port for the TPU Node as visible to Compute Engine instances.
//
// Deprecated: Output only. DEPRECATED! Use network_endpoints instead. The network port for the TPU Node as visible to Compute Engine instances.
Port string `pulumi:"port"`
// The scheduling options for this node.
SchedulingConfig SchedulingConfigResponse `pulumi:"schedulingConfig"`
// The service account used to run the tensor flow services within the node. To share resources, including Google Cloud Storage data, with the Tensorflow job running in the Node, this account must have permissions to that data.
ServiceAccount string `pulumi:"serviceAccount"`
// The current state for the TPU Node.
State string `pulumi:"state"`
// The Symptoms that have occurred to the TPU Node.
Symptoms []SymptomResponse `pulumi:"symptoms"`
// The version of Tensorflow running in the Node.
TensorflowVersion string `pulumi:"tensorflowVersion"`
// Whether the VPC peering for the node is set up through Service Networking API. The VPC Peering should be set up before provisioning the node. If this field is set, cidr_block field should not be specified. If the network, that you want to peer the TPU Node to, is Shared VPC networks, the node must be created with this this field enabled.
UseServiceNetworking bool `pulumi:"useServiceNetworking"`
}
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)
}
type LookupNodeOutputArgs struct {
Location pulumi.StringInput `pulumi:"location"`
NodeId pulumi.StringInput `pulumi:"nodeId"`
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupNodeOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupNodeArgs)(nil)).Elem()
}
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
}
// The type of hardware accelerators associated with this node.
func (o LookupNodeResultOutput) AcceleratorType() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.AcceleratorType }).(pulumi.StringOutput)
}
// The API version that created this Node.
func (o LookupNodeResultOutput) ApiVersion() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.ApiVersion }).(pulumi.StringOutput)
}
// The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user's provided network, or the provided network is peered with another network that is using that CIDR block.
func (o LookupNodeResultOutput) CidrBlock() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.CidrBlock }).(pulumi.StringOutput)
}
// The time when the node was created.
func (o LookupNodeResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// The user-supplied description of the TPU. Maximum of 512 characters.
func (o LookupNodeResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Description }).(pulumi.StringOutput)
}
// The health status of the TPU node.
func (o LookupNodeResultOutput) Health() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Health }).(pulumi.StringOutput)
}
// If this field is populated, it contains a description of why the TPU Node is unhealthy.
func (o LookupNodeResultOutput) HealthDescription() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.HealthDescription }).(pulumi.StringOutput)
}
// DEPRECATED! Use network_endpoints instead. The network address for the TPU Node as visible to Compute Engine instances.
//
// Deprecated: Output only. DEPRECATED! Use network_endpoints instead. The network address for the TPU Node as visible to Compute Engine instances.
func (o LookupNodeResultOutput) IpAddress() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.IpAddress }).(pulumi.StringOutput)
}
// Resource labels to represent user-provided metadata.
func (o LookupNodeResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupNodeResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// Immutable. The name of the TPU
func (o LookupNodeResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Name }).(pulumi.StringOutput)
}
// The name of a network they wish to peer the TPU node to. It must be a preexisting Compute Engine network inside of the project on which this API has been activated. If none is provided, "default" will be used.
func (o LookupNodeResultOutput) Network() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Network }).(pulumi.StringOutput)
}
// The network endpoints where TPU workers can be accessed and sent work. It is recommended that Tensorflow clients of the node reach out to the 0th entry in this map first.
func (o LookupNodeResultOutput) NetworkEndpoints() NetworkEndpointResponseArrayOutput {
return o.ApplyT(func(v LookupNodeResult) []NetworkEndpointResponse { return v.NetworkEndpoints }).(NetworkEndpointResponseArrayOutput)
}
// DEPRECATED! Use network_endpoints instead. The network port for the TPU Node as visible to Compute Engine instances.
//
// Deprecated: Output only. DEPRECATED! Use network_endpoints instead. The network port for the TPU Node as visible to Compute Engine instances.
func (o LookupNodeResultOutput) Port() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.Port }).(pulumi.StringOutput)
}
// The scheduling options for this node.
func (o LookupNodeResultOutput) SchedulingConfig() SchedulingConfigResponseOutput {
return o.ApplyT(func(v LookupNodeResult) SchedulingConfigResponse { return v.SchedulingConfig }).(SchedulingConfigResponseOutput)
}
// The service account used to run the tensor flow services within the node. To share resources, including Google Cloud Storage data, with the Tensorflow job running in the Node, this account must have permissions to that data.
func (o LookupNodeResultOutput) ServiceAccount() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.ServiceAccount }).(pulumi.StringOutput)
}
// The current state for the TPU Node.
func (o LookupNodeResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.State }).(pulumi.StringOutput)
}
// The Symptoms that have occurred to the TPU Node.
func (o LookupNodeResultOutput) Symptoms() SymptomResponseArrayOutput {
return o.ApplyT(func(v LookupNodeResult) []SymptomResponse { return v.Symptoms }).(SymptomResponseArrayOutput)
}
// The version of Tensorflow running in the Node.
func (o LookupNodeResultOutput) TensorflowVersion() pulumi.StringOutput {
return o.ApplyT(func(v LookupNodeResult) string { return v.TensorflowVersion }).(pulumi.StringOutput)
}
// Whether the VPC peering for the node is set up through Service Networking API. The VPC Peering should be set up before provisioning the node. If this field is set, cidr_block field should not be specified. If the network, that you want to peer the TPU Node to, is Shared VPC networks, the node must be created with this this field enabled.
func (o LookupNodeResultOutput) UseServiceNetworking() pulumi.BoolOutput {
return o.ApplyT(func(v LookupNodeResult) bool { return v.UseServiceNetworking }).(pulumi.BoolOutput)
}
func init() {
pulumi.RegisterOutputType(LookupNodeResultOutput{})
}