/
getStoragePool.go
199 lines (167 loc) · 10.9 KB
/
getStoragePool.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
// 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 alpha
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Returns a specified storage pool. Gets a list of available storage pools by making a list() request.
func LookupStoragePool(ctx *pulumi.Context, args *LookupStoragePoolArgs, opts ...pulumi.InvokeOption) (*LookupStoragePoolResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupStoragePoolResult
err := ctx.Invoke("google-native:compute/alpha:getStoragePool", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupStoragePoolArgs struct {
Project *string `pulumi:"project"`
StoragePool string `pulumi:"storagePool"`
Zone string `pulumi:"zone"`
}
type LookupStoragePoolResult struct {
// Provisioning type of the byte capacity of the pool.
CapacityProvisioningType string `pulumi:"capacityProvisioningType"`
// Creation timestamp in RFC3339 text format.
CreationTimestamp string `pulumi:"creationTimestamp"`
// An optional description of this resource. Provide this property when you create the resource.
Description string `pulumi:"description"`
// Type of the resource. Always compute#storagePool for storage pools.
Kind string `pulumi:"kind"`
// A fingerprint for the labels being applied to this storage pool, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a storage pool.
LabelFingerprint string `pulumi:"labelFingerprint"`
// Labels to apply to this storage pool. These can be later modified by the setLabels method.
Labels map[string]string `pulumi:"labels"`
// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Name string `pulumi:"name"`
// Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS.
PerformanceProvisioningType string `pulumi:"performanceProvisioningType"`
// Provsioned IOPS of the storage pool.
ProvisionedIops string `pulumi:"provisionedIops"`
// Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput.
ProvisionedThroughput string `pulumi:"provisionedThroughput"`
// Status information for the storage pool resource.
ResourceStatus StoragePoolResourceStatusResponse `pulumi:"resourceStatus"`
// Server-defined fully-qualified URL for this resource.
SelfLink string `pulumi:"selfLink"`
// Server-defined URL for this resource's resource id.
SelfLinkWithId string `pulumi:"selfLinkWithId"`
// Size, in GiB, of the storage pool.
SizeGb string `pulumi:"sizeGb"`
// The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting.
State string `pulumi:"state"`
// Status information for the storage pool resource.
Status StoragePoolResourceStatusResponse `pulumi:"status"`
// Type of the storage pool.
StoragePoolType string `pulumi:"storagePoolType"`
// URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Zone string `pulumi:"zone"`
}
func LookupStoragePoolOutput(ctx *pulumi.Context, args LookupStoragePoolOutputArgs, opts ...pulumi.InvokeOption) LookupStoragePoolResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupStoragePoolResult, error) {
args := v.(LookupStoragePoolArgs)
r, err := LookupStoragePool(ctx, &args, opts...)
var s LookupStoragePoolResult
if r != nil {
s = *r
}
return s, err
}).(LookupStoragePoolResultOutput)
}
type LookupStoragePoolOutputArgs struct {
Project pulumi.StringPtrInput `pulumi:"project"`
StoragePool pulumi.StringInput `pulumi:"storagePool"`
Zone pulumi.StringInput `pulumi:"zone"`
}
func (LookupStoragePoolOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupStoragePoolArgs)(nil)).Elem()
}
type LookupStoragePoolResultOutput struct{ *pulumi.OutputState }
func (LookupStoragePoolResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupStoragePoolResult)(nil)).Elem()
}
func (o LookupStoragePoolResultOutput) ToLookupStoragePoolResultOutput() LookupStoragePoolResultOutput {
return o
}
func (o LookupStoragePoolResultOutput) ToLookupStoragePoolResultOutputWithContext(ctx context.Context) LookupStoragePoolResultOutput {
return o
}
// Provisioning type of the byte capacity of the pool.
func (o LookupStoragePoolResultOutput) CapacityProvisioningType() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.CapacityProvisioningType }).(pulumi.StringOutput)
}
// Creation timestamp in RFC3339 text format.
func (o LookupStoragePoolResultOutput) CreationTimestamp() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.CreationTimestamp }).(pulumi.StringOutput)
}
// An optional description of this resource. Provide this property when you create the resource.
func (o LookupStoragePoolResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.Description }).(pulumi.StringOutput)
}
// Type of the resource. Always compute#storagePool for storage pools.
func (o LookupStoragePoolResultOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.Kind }).(pulumi.StringOutput)
}
// A fingerprint for the labels being applied to this storage pool, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a storage pool.
func (o LookupStoragePoolResultOutput) LabelFingerprint() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.LabelFingerprint }).(pulumi.StringOutput)
}
// Labels to apply to this storage pool. These can be later modified by the setLabels method.
func (o LookupStoragePoolResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupStoragePoolResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
func (o LookupStoragePoolResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.Name }).(pulumi.StringOutput)
}
// Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS.
func (o LookupStoragePoolResultOutput) PerformanceProvisioningType() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.PerformanceProvisioningType }).(pulumi.StringOutput)
}
// Provsioned IOPS of the storage pool.
func (o LookupStoragePoolResultOutput) ProvisionedIops() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.ProvisionedIops }).(pulumi.StringOutput)
}
// Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput.
func (o LookupStoragePoolResultOutput) ProvisionedThroughput() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.ProvisionedThroughput }).(pulumi.StringOutput)
}
// Status information for the storage pool resource.
func (o LookupStoragePoolResultOutput) ResourceStatus() StoragePoolResourceStatusResponseOutput {
return o.ApplyT(func(v LookupStoragePoolResult) StoragePoolResourceStatusResponse { return v.ResourceStatus }).(StoragePoolResourceStatusResponseOutput)
}
// Server-defined fully-qualified URL for this resource.
func (o LookupStoragePoolResultOutput) SelfLink() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.SelfLink }).(pulumi.StringOutput)
}
// Server-defined URL for this resource's resource id.
func (o LookupStoragePoolResultOutput) SelfLinkWithId() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.SelfLinkWithId }).(pulumi.StringOutput)
}
// Size, in GiB, of the storage pool.
func (o LookupStoragePoolResultOutput) SizeGb() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.SizeGb }).(pulumi.StringOutput)
}
// The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting.
func (o LookupStoragePoolResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.State }).(pulumi.StringOutput)
}
// Status information for the storage pool resource.
func (o LookupStoragePoolResultOutput) Status() StoragePoolResourceStatusResponseOutput {
return o.ApplyT(func(v LookupStoragePoolResult) StoragePoolResourceStatusResponse { return v.Status }).(StoragePoolResourceStatusResponseOutput)
}
// Type of the storage pool.
func (o LookupStoragePoolResultOutput) StoragePoolType() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.StoragePoolType }).(pulumi.StringOutput)
}
// URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
func (o LookupStoragePoolResultOutput) Zone() pulumi.StringOutput {
return o.ApplyT(func(v LookupStoragePoolResult) string { return v.Zone }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupStoragePoolResultOutput{})
}