forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getCustomImage.go
207 lines (176 loc) · 8.5 KB
/
getCustomImage.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
// 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 devtestlab
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get custom image.
// Azure REST API version: 2018-09-15.
//
// Other available API versions: 2016-05-15.
func LookupCustomImage(ctx *pulumi.Context, args *LookupCustomImageArgs, opts ...pulumi.InvokeOption) (*LookupCustomImageResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupCustomImageResult
err := ctx.Invoke("azure-native:devtestlab:getCustomImage", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupCustomImageArgs struct {
// Specify the $expand query. Example: 'properties($select=vm)'
Expand *string `pulumi:"expand"`
// The name of the lab.
LabName string `pulumi:"labName"`
// The name of the custom image.
Name string `pulumi:"name"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A custom image.
type LookupCustomImageResult struct {
// The author of the custom image.
Author *string `pulumi:"author"`
// The creation date of the custom image.
CreationDate string `pulumi:"creationDate"`
// Storage information about the plan related to this custom image
CustomImagePlan *CustomImagePropertiesFromPlanResponse `pulumi:"customImagePlan"`
// Storage information about the data disks present in the custom image
DataDiskStorageInfo []DataDiskStorageTypeInfoResponse `pulumi:"dataDiskStorageInfo"`
// The description of the custom image.
Description *string `pulumi:"description"`
// The identifier of the resource.
Id string `pulumi:"id"`
// Whether or not the custom images underlying offer/plan has been enabled for programmatic deployment
IsPlanAuthorized *bool `pulumi:"isPlanAuthorized"`
// The location of the resource.
Location *string `pulumi:"location"`
// The Managed Image Id backing the custom image.
ManagedImageId *string `pulumi:"managedImageId"`
// The Managed Snapshot Id backing the custom image.
ManagedSnapshotId *string `pulumi:"managedSnapshotId"`
// The name of the resource.
Name string `pulumi:"name"`
// The provisioning status of the resource.
ProvisioningState string `pulumi:"provisioningState"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
// The type of the resource.
Type string `pulumi:"type"`
// The unique immutable identifier of a resource (Guid).
UniqueIdentifier string `pulumi:"uniqueIdentifier"`
// The VHD from which the image is to be created.
Vhd *CustomImagePropertiesCustomResponse `pulumi:"vhd"`
// The virtual machine from which the image is to be created.
Vm *CustomImagePropertiesFromVmResponse `pulumi:"vm"`
}
func LookupCustomImageOutput(ctx *pulumi.Context, args LookupCustomImageOutputArgs, opts ...pulumi.InvokeOption) LookupCustomImageResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupCustomImageResult, error) {
args := v.(LookupCustomImageArgs)
r, err := LookupCustomImage(ctx, &args, opts...)
var s LookupCustomImageResult
if r != nil {
s = *r
}
return s, err
}).(LookupCustomImageResultOutput)
}
type LookupCustomImageOutputArgs struct {
// Specify the $expand query. Example: 'properties($select=vm)'
Expand pulumi.StringPtrInput `pulumi:"expand"`
// The name of the lab.
LabName pulumi.StringInput `pulumi:"labName"`
// The name of the custom image.
Name pulumi.StringInput `pulumi:"name"`
// The name of the resource group.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupCustomImageOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCustomImageArgs)(nil)).Elem()
}
// A custom image.
type LookupCustomImageResultOutput struct{ *pulumi.OutputState }
func (LookupCustomImageResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCustomImageResult)(nil)).Elem()
}
func (o LookupCustomImageResultOutput) ToLookupCustomImageResultOutput() LookupCustomImageResultOutput {
return o
}
func (o LookupCustomImageResultOutput) ToLookupCustomImageResultOutputWithContext(ctx context.Context) LookupCustomImageResultOutput {
return o
}
// The author of the custom image.
func (o LookupCustomImageResultOutput) Author() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *string { return v.Author }).(pulumi.StringPtrOutput)
}
// The creation date of the custom image.
func (o LookupCustomImageResultOutput) CreationDate() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomImageResult) string { return v.CreationDate }).(pulumi.StringOutput)
}
// Storage information about the plan related to this custom image
func (o LookupCustomImageResultOutput) CustomImagePlan() CustomImagePropertiesFromPlanResponsePtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *CustomImagePropertiesFromPlanResponse { return v.CustomImagePlan }).(CustomImagePropertiesFromPlanResponsePtrOutput)
}
// Storage information about the data disks present in the custom image
func (o LookupCustomImageResultOutput) DataDiskStorageInfo() DataDiskStorageTypeInfoResponseArrayOutput {
return o.ApplyT(func(v LookupCustomImageResult) []DataDiskStorageTypeInfoResponse { return v.DataDiskStorageInfo }).(DataDiskStorageTypeInfoResponseArrayOutput)
}
// The description of the custom image.
func (o LookupCustomImageResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
// The identifier of the resource.
func (o LookupCustomImageResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomImageResult) string { return v.Id }).(pulumi.StringOutput)
}
// Whether or not the custom images underlying offer/plan has been enabled for programmatic deployment
func (o LookupCustomImageResultOutput) IsPlanAuthorized() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *bool { return v.IsPlanAuthorized }).(pulumi.BoolPtrOutput)
}
// The location of the resource.
func (o LookupCustomImageResultOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *string { return v.Location }).(pulumi.StringPtrOutput)
}
// The Managed Image Id backing the custom image.
func (o LookupCustomImageResultOutput) ManagedImageId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *string { return v.ManagedImageId }).(pulumi.StringPtrOutput)
}
// The Managed Snapshot Id backing the custom image.
func (o LookupCustomImageResultOutput) ManagedSnapshotId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *string { return v.ManagedSnapshotId }).(pulumi.StringPtrOutput)
}
// The name of the resource.
func (o LookupCustomImageResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomImageResult) string { return v.Name }).(pulumi.StringOutput)
}
// The provisioning status of the resource.
func (o LookupCustomImageResultOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomImageResult) string { return v.ProvisioningState }).(pulumi.StringOutput)
}
// The tags of the resource.
func (o LookupCustomImageResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupCustomImageResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
// The type of the resource.
func (o LookupCustomImageResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomImageResult) string { return v.Type }).(pulumi.StringOutput)
}
// The unique immutable identifier of a resource (Guid).
func (o LookupCustomImageResultOutput) UniqueIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomImageResult) string { return v.UniqueIdentifier }).(pulumi.StringOutput)
}
// The VHD from which the image is to be created.
func (o LookupCustomImageResultOutput) Vhd() CustomImagePropertiesCustomResponsePtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *CustomImagePropertiesCustomResponse { return v.Vhd }).(CustomImagePropertiesCustomResponsePtrOutput)
}
// The virtual machine from which the image is to be created.
func (o LookupCustomImageResultOutput) Vm() CustomImagePropertiesFromVmResponsePtrOutput {
return o.ApplyT(func(v LookupCustomImageResult) *CustomImagePropertiesFromVmResponse { return v.Vm }).(CustomImagePropertiesFromVmResponsePtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCustomImageResultOutput{})
}