/
getInstance.go
213 lines (179 loc) · 9.94 KB
/
getInstance.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
// 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 v1beta1
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 specific instance.
func LookupInstance(ctx *pulumi.Context, args *LookupInstanceArgs, opts ...pulumi.InvokeOption) (*LookupInstanceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupInstanceResult
err := ctx.Invoke("google-native:file/v1beta1:getInstance", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupInstanceArgs struct {
InstanceId string `pulumi:"instanceId"`
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
}
type LookupInstanceResult struct {
// The storage capacity of the instance in gigabytes (GB = 1024^3 bytes). This capacity can be increased up to `max_capacity_gb` GB in multipliers of `capacity_step_size_gb` GB.
CapacityGb string `pulumi:"capacityGb"`
// The increase/decrease capacity step size.
CapacityStepSizeGb string `pulumi:"capacityStepSizeGb"`
// The time when the instance was created.
CreateTime string `pulumi:"createTime"`
// The description of the instance (2048 characters or less).
Description string `pulumi:"description"`
// Directory Services configuration for Kerberos-based authentication. Should only be set if protocol is "NFS_V4_1".
DirectoryServices DirectoryServicesConfigResponse `pulumi:"directoryServices"`
// Server-specified ETag for the instance resource to prevent simultaneous updates from overwriting each other.
Etag string `pulumi:"etag"`
// File system shares on the instance. For this version, only a single file share is supported.
FileShares []FileShareConfigResponse `pulumi:"fileShares"`
// KMS key name used for data encryption.
KmsKeyName string `pulumi:"kmsKeyName"`
// Resource labels to represent user provided metadata.
Labels map[string]string `pulumi:"labels"`
// The max capacity of the instance.
MaxCapacityGb string `pulumi:"maxCapacityGb"`
// The max number of shares allowed.
MaxShareCount string `pulumi:"maxShareCount"`
// Indicates whether this instance uses a multi-share configuration with which it can have more than one file-share or none at all. File-shares are added, updated and removed through the separate file-share APIs.
MultiShareEnabled bool `pulumi:"multiShareEnabled"`
// The resource name of the instance, in the format `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
Name string `pulumi:"name"`
// VPC networks to which the instance is connected. For this version, only a single network is supported.
Networks []NetworkConfigResponse `pulumi:"networks"`
// Immutable. The protocol indicates the access protocol for all shares in the instance. This field is immutable and it cannot be changed after the instance has been created. Default value: `NFS_V3`.
Protocol string `pulumi:"protocol"`
// Reserved for future use.
SatisfiesPzs bool `pulumi:"satisfiesPzs"`
// The instance state.
State string `pulumi:"state"`
// Additional information about the instance state, if available.
StatusMessage string `pulumi:"statusMessage"`
// Field indicates all the reasons the instance is in "SUSPENDED" state.
SuspensionReasons []string `pulumi:"suspensionReasons"`
// The service tier of the instance.
Tier string `pulumi:"tier"`
}
func LookupInstanceOutput(ctx *pulumi.Context, args LookupInstanceOutputArgs, opts ...pulumi.InvokeOption) LookupInstanceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupInstanceResult, error) {
args := v.(LookupInstanceArgs)
r, err := LookupInstance(ctx, &args, opts...)
var s LookupInstanceResult
if r != nil {
s = *r
}
return s, err
}).(LookupInstanceResultOutput)
}
type LookupInstanceOutputArgs struct {
InstanceId pulumi.StringInput `pulumi:"instanceId"`
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupInstanceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupInstanceArgs)(nil)).Elem()
}
type LookupInstanceResultOutput struct{ *pulumi.OutputState }
func (LookupInstanceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupInstanceResult)(nil)).Elem()
}
func (o LookupInstanceResultOutput) ToLookupInstanceResultOutput() LookupInstanceResultOutput {
return o
}
func (o LookupInstanceResultOutput) ToLookupInstanceResultOutputWithContext(ctx context.Context) LookupInstanceResultOutput {
return o
}
// The storage capacity of the instance in gigabytes (GB = 1024^3 bytes). This capacity can be increased up to `max_capacity_gb` GB in multipliers of `capacity_step_size_gb` GB.
func (o LookupInstanceResultOutput) CapacityGb() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.CapacityGb }).(pulumi.StringOutput)
}
// The increase/decrease capacity step size.
func (o LookupInstanceResultOutput) CapacityStepSizeGb() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.CapacityStepSizeGb }).(pulumi.StringOutput)
}
// The time when the instance was created.
func (o LookupInstanceResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// The description of the instance (2048 characters or less).
func (o LookupInstanceResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Description }).(pulumi.StringOutput)
}
// Directory Services configuration for Kerberos-based authentication. Should only be set if protocol is "NFS_V4_1".
func (o LookupInstanceResultOutput) DirectoryServices() DirectoryServicesConfigResponseOutput {
return o.ApplyT(func(v LookupInstanceResult) DirectoryServicesConfigResponse { return v.DirectoryServices }).(DirectoryServicesConfigResponseOutput)
}
// Server-specified ETag for the instance resource to prevent simultaneous updates from overwriting each other.
func (o LookupInstanceResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Etag }).(pulumi.StringOutput)
}
// File system shares on the instance. For this version, only a single file share is supported.
func (o LookupInstanceResultOutput) FileShares() FileShareConfigResponseArrayOutput {
return o.ApplyT(func(v LookupInstanceResult) []FileShareConfigResponse { return v.FileShares }).(FileShareConfigResponseArrayOutput)
}
// KMS key name used for data encryption.
func (o LookupInstanceResultOutput) KmsKeyName() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.KmsKeyName }).(pulumi.StringOutput)
}
// Resource labels to represent user provided metadata.
func (o LookupInstanceResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupInstanceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// The max capacity of the instance.
func (o LookupInstanceResultOutput) MaxCapacityGb() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.MaxCapacityGb }).(pulumi.StringOutput)
}
// The max number of shares allowed.
func (o LookupInstanceResultOutput) MaxShareCount() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.MaxShareCount }).(pulumi.StringOutput)
}
// Indicates whether this instance uses a multi-share configuration with which it can have more than one file-share or none at all. File-shares are added, updated and removed through the separate file-share APIs.
func (o LookupInstanceResultOutput) MultiShareEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupInstanceResult) bool { return v.MultiShareEnabled }).(pulumi.BoolOutput)
}
// The resource name of the instance, in the format `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
func (o LookupInstanceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Name }).(pulumi.StringOutput)
}
// VPC networks to which the instance is connected. For this version, only a single network is supported.
func (o LookupInstanceResultOutput) Networks() NetworkConfigResponseArrayOutput {
return o.ApplyT(func(v LookupInstanceResult) []NetworkConfigResponse { return v.Networks }).(NetworkConfigResponseArrayOutput)
}
// Immutable. The protocol indicates the access protocol for all shares in the instance. This field is immutable and it cannot be changed after the instance has been created. Default value: `NFS_V3`.
func (o LookupInstanceResultOutput) Protocol() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Protocol }).(pulumi.StringOutput)
}
// Reserved for future use.
func (o LookupInstanceResultOutput) SatisfiesPzs() pulumi.BoolOutput {
return o.ApplyT(func(v LookupInstanceResult) bool { return v.SatisfiesPzs }).(pulumi.BoolOutput)
}
// The instance state.
func (o LookupInstanceResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.State }).(pulumi.StringOutput)
}
// Additional information about the instance state, if available.
func (o LookupInstanceResultOutput) StatusMessage() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.StatusMessage }).(pulumi.StringOutput)
}
// Field indicates all the reasons the instance is in "SUSPENDED" state.
func (o LookupInstanceResultOutput) SuspensionReasons() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupInstanceResult) []string { return v.SuspensionReasons }).(pulumi.StringArrayOutput)
}
// The service tier of the instance.
func (o LookupInstanceResultOutput) Tier() pulumi.StringOutput {
return o.ApplyT(func(v LookupInstanceResult) string { return v.Tier }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupInstanceResultOutput{})
}