/
getRegionInstantSnapshot.go
201 lines (169 loc) · 12.6 KB
/
getRegionInstantSnapshot.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
// 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 the specified InstantSnapshot resource in the specified region.
func LookupRegionInstantSnapshot(ctx *pulumi.Context, args *LookupRegionInstantSnapshotArgs, opts ...pulumi.InvokeOption) (*LookupRegionInstantSnapshotResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupRegionInstantSnapshotResult
err := ctx.Invoke("google-native:compute/alpha:getRegionInstantSnapshot", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupRegionInstantSnapshotArgs struct {
InstantSnapshot string `pulumi:"instantSnapshot"`
Project *string `pulumi:"project"`
Region string `pulumi:"region"`
}
type LookupRegionInstantSnapshotResult struct {
// The architecture of the instant snapshot. Valid values are ARM64 or X86_64.
Architecture string `pulumi:"architecture"`
// 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"`
// Size of the source disk, specified in GB.
DiskSizeGb string `pulumi:"diskSizeGb"`
// Whether to attempt an application consistent instant snapshot by informing the OS to prepare for the snapshot process.
GuestFlush bool `pulumi:"guestFlush"`
// Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources.
Kind string `pulumi:"kind"`
// A fingerprint for the labels being applied to this InstantSnapshot, 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 InstantSnapshot.
LabelFingerprint string `pulumi:"labelFingerprint"`
// Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty.
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"`
// URL of the region where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
Region string `pulumi:"region"`
// Status information for the instant snapshot resource.
ResourceStatus InstantSnapshotResourceStatusResponse `pulumi:"resourceStatus"`
// Reserved for future use.
SatisfiesPzs bool `pulumi:"satisfiesPzs"`
// Server-defined URL for the resource.
SelfLink string `pulumi:"selfLink"`
// Server-defined URL for this resource's resource id.
SelfLinkWithId string `pulumi:"selfLinkWithId"`
// URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk
SourceDisk string `pulumi:"sourceDisk"`
// The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name.
SourceDiskId string `pulumi:"sourceDiskId"`
// The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY.
Status string `pulumi:"status"`
// URL of the zone where the instant snapshot 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 LookupRegionInstantSnapshotOutput(ctx *pulumi.Context, args LookupRegionInstantSnapshotOutputArgs, opts ...pulumi.InvokeOption) LookupRegionInstantSnapshotResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupRegionInstantSnapshotResult, error) {
args := v.(LookupRegionInstantSnapshotArgs)
r, err := LookupRegionInstantSnapshot(ctx, &args, opts...)
var s LookupRegionInstantSnapshotResult
if r != nil {
s = *r
}
return s, err
}).(LookupRegionInstantSnapshotResultOutput)
}
type LookupRegionInstantSnapshotOutputArgs struct {
InstantSnapshot pulumi.StringInput `pulumi:"instantSnapshot"`
Project pulumi.StringPtrInput `pulumi:"project"`
Region pulumi.StringInput `pulumi:"region"`
}
func (LookupRegionInstantSnapshotOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupRegionInstantSnapshotArgs)(nil)).Elem()
}
type LookupRegionInstantSnapshotResultOutput struct{ *pulumi.OutputState }
func (LookupRegionInstantSnapshotResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupRegionInstantSnapshotResult)(nil)).Elem()
}
func (o LookupRegionInstantSnapshotResultOutput) ToLookupRegionInstantSnapshotResultOutput() LookupRegionInstantSnapshotResultOutput {
return o
}
func (o LookupRegionInstantSnapshotResultOutput) ToLookupRegionInstantSnapshotResultOutputWithContext(ctx context.Context) LookupRegionInstantSnapshotResultOutput {
return o
}
// The architecture of the instant snapshot. Valid values are ARM64 or X86_64.
func (o LookupRegionInstantSnapshotResultOutput) Architecture() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Architecture }).(pulumi.StringOutput)
}
// Creation timestamp in RFC3339 text format.
func (o LookupRegionInstantSnapshotResultOutput) CreationTimestamp() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.CreationTimestamp }).(pulumi.StringOutput)
}
// An optional description of this resource. Provide this property when you create the resource.
func (o LookupRegionInstantSnapshotResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Description }).(pulumi.StringOutput)
}
// Size of the source disk, specified in GB.
func (o LookupRegionInstantSnapshotResultOutput) DiskSizeGb() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.DiskSizeGb }).(pulumi.StringOutput)
}
// Whether to attempt an application consistent instant snapshot by informing the OS to prepare for the snapshot process.
func (o LookupRegionInstantSnapshotResultOutput) GuestFlush() pulumi.BoolOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) bool { return v.GuestFlush }).(pulumi.BoolOutput)
}
// Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources.
func (o LookupRegionInstantSnapshotResultOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Kind }).(pulumi.StringOutput)
}
// A fingerprint for the labels being applied to this InstantSnapshot, 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 InstantSnapshot.
func (o LookupRegionInstantSnapshotResultOutput) LabelFingerprint() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.LabelFingerprint }).(pulumi.StringOutput)
}
// Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty.
func (o LookupRegionInstantSnapshotResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) 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 LookupRegionInstantSnapshotResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Name }).(pulumi.StringOutput)
}
// URL of the region where the instant snapshot 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 LookupRegionInstantSnapshotResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Region }).(pulumi.StringOutput)
}
// Status information for the instant snapshot resource.
func (o LookupRegionInstantSnapshotResultOutput) ResourceStatus() InstantSnapshotResourceStatusResponseOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) InstantSnapshotResourceStatusResponse {
return v.ResourceStatus
}).(InstantSnapshotResourceStatusResponseOutput)
}
// Reserved for future use.
func (o LookupRegionInstantSnapshotResultOutput) SatisfiesPzs() pulumi.BoolOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) bool { return v.SatisfiesPzs }).(pulumi.BoolOutput)
}
// Server-defined URL for the resource.
func (o LookupRegionInstantSnapshotResultOutput) SelfLink() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.SelfLink }).(pulumi.StringOutput)
}
// Server-defined URL for this resource's resource id.
func (o LookupRegionInstantSnapshotResultOutput) SelfLinkWithId() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.SelfLinkWithId }).(pulumi.StringOutput)
}
// URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk
func (o LookupRegionInstantSnapshotResultOutput) SourceDisk() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.SourceDisk }).(pulumi.StringOutput)
}
// The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name.
func (o LookupRegionInstantSnapshotResultOutput) SourceDiskId() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.SourceDiskId }).(pulumi.StringOutput)
}
// The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY.
func (o LookupRegionInstantSnapshotResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Status }).(pulumi.StringOutput)
}
// URL of the zone where the instant snapshot 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 LookupRegionInstantSnapshotResultOutput) Zone() pulumi.StringOutput {
return o.ApplyT(func(v LookupRegionInstantSnapshotResult) string { return v.Zone }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupRegionInstantSnapshotResultOutput{})
}