This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
diskPool.go
229 lines (205 loc) · 8.23 KB
/
diskPool.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20200315preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Response for Disk pool request.
type DiskPool struct {
pulumi.CustomResourceState
// List of additional capabilities for Disk pool.
AdditionalCapabilities pulumi.StringArrayOutput `pulumi:"additionalCapabilities"`
// Logical zone for Disk pool resource; example: ["1"].
AvailabilityZones pulumi.StringArrayOutput `pulumi:"availabilityZones"`
// List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
Disks DiskResponseArrayOutput `pulumi:"disks"`
// The geo-location where the resource lives.
Location pulumi.StringOutput `pulumi:"location"`
// The name of the resource
Name pulumi.StringOutput `pulumi:"name"`
// State of the operation on the resource.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// Operational status of the Disk pool.
Status pulumi.StringOutput `pulumi:"status"`
// Azure Resource ID of a Subnet for the Disk pool.
SubnetId pulumi.StringOutput `pulumi:"subnetId"`
// Resource metadata required by ARM RPC
SystemData SystemMetadataResponseOutput `pulumi:"systemData"`
// Resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Determines the SKU of VM deployed for Disk pool
Tier pulumi.StringOutput `pulumi:"tier"`
// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewDiskPool registers a new resource with the given unique name, arguments, and options.
func NewDiskPool(ctx *pulumi.Context,
name string, args *DiskPoolArgs, opts ...pulumi.ResourceOption) (*DiskPool, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AvailabilityZones == nil {
return nil, errors.New("invalid value for required argument 'AvailabilityZones'")
}
if args.DiskPoolName == nil {
return nil, errors.New("invalid value for required argument 'DiskPoolName'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.SubnetId == nil {
return nil, errors.New("invalid value for required argument 'SubnetId'")
}
if args.Tier == nil {
return nil, errors.New("invalid value for required argument 'Tier'")
}
var resource DiskPool
err := ctx.RegisterResource("azure-nextgen:storagepool/v20200315preview:DiskPool", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDiskPool gets an existing DiskPool resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDiskPool(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DiskPoolState, opts ...pulumi.ResourceOption) (*DiskPool, error) {
var resource DiskPool
err := ctx.ReadResource("azure-nextgen:storagepool/v20200315preview:DiskPool", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DiskPool resources.
type diskPoolState struct {
// List of additional capabilities for Disk pool.
AdditionalCapabilities []string `pulumi:"additionalCapabilities"`
// Logical zone for Disk pool resource; example: ["1"].
AvailabilityZones []string `pulumi:"availabilityZones"`
// List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
Disks []DiskResponse `pulumi:"disks"`
// The geo-location where the resource lives.
Location *string `pulumi:"location"`
// The name of the resource
Name *string `pulumi:"name"`
// State of the operation on the resource.
ProvisioningState *string `pulumi:"provisioningState"`
// Operational status of the Disk pool.
Status *string `pulumi:"status"`
// Azure Resource ID of a Subnet for the Disk pool.
SubnetId *string `pulumi:"subnetId"`
// Resource metadata required by ARM RPC
SystemData *SystemMetadataResponse `pulumi:"systemData"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Determines the SKU of VM deployed for Disk pool
Tier *string `pulumi:"tier"`
// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type *string `pulumi:"type"`
}
type DiskPoolState struct {
// List of additional capabilities for Disk pool.
AdditionalCapabilities pulumi.StringArrayInput
// Logical zone for Disk pool resource; example: ["1"].
AvailabilityZones pulumi.StringArrayInput
// List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
Disks DiskResponseArrayInput
// The geo-location where the resource lives.
Location pulumi.StringPtrInput
// The name of the resource
Name pulumi.StringPtrInput
// State of the operation on the resource.
ProvisioningState pulumi.StringPtrInput
// Operational status of the Disk pool.
Status pulumi.StringPtrInput
// Azure Resource ID of a Subnet for the Disk pool.
SubnetId pulumi.StringPtrInput
// Resource metadata required by ARM RPC
SystemData SystemMetadataResponsePtrInput
// Resource tags.
Tags pulumi.StringMapInput
// Determines the SKU of VM deployed for Disk pool
Tier pulumi.StringPtrInput
// The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type pulumi.StringPtrInput
}
func (DiskPoolState) ElementType() reflect.Type {
return reflect.TypeOf((*diskPoolState)(nil)).Elem()
}
type diskPoolArgs struct {
// List of additional capabilities for a Disk pool.
AdditionalCapabilities []string `pulumi:"additionalCapabilities"`
// Logical zone for Disk pool resource; example: ["1"].
AvailabilityZones []string `pulumi:"availabilityZones"`
// The name of the Disk pool.
DiskPoolName string `pulumi:"diskPoolName"`
// List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
Disks []Disk `pulumi:"disks"`
// The geo-location where the resource lives.
Location *string `pulumi:"location"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Azure Resource ID of a Subnet for the Disk pool.
SubnetId string `pulumi:"subnetId"`
// Resource tags.
Tags map[string]string `pulumi:"tags"`
// Determines the SKU of VM deployed for Disk pool
Tier string `pulumi:"tier"`
}
// The set of arguments for constructing a DiskPool resource.
type DiskPoolArgs struct {
// List of additional capabilities for a Disk pool.
AdditionalCapabilities pulumi.StringArrayInput
// Logical zone for Disk pool resource; example: ["1"].
AvailabilityZones pulumi.StringArrayInput
// The name of the Disk pool.
DiskPoolName pulumi.StringInput
// List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
Disks DiskArrayInput
// The geo-location where the resource lives.
Location pulumi.StringPtrInput
// The name of the resource group. The name is case insensitive.
ResourceGroupName pulumi.StringInput
// Azure Resource ID of a Subnet for the Disk pool.
SubnetId pulumi.StringInput
// Resource tags.
Tags pulumi.StringMapInput
// Determines the SKU of VM deployed for Disk pool
Tier pulumi.StringInput
}
func (DiskPoolArgs) ElementType() reflect.Type {
return reflect.TypeOf((*diskPoolArgs)(nil)).Elem()
}
type DiskPoolInput interface {
pulumi.Input
ToDiskPoolOutput() DiskPoolOutput
ToDiskPoolOutputWithContext(ctx context.Context) DiskPoolOutput
}
func (*DiskPool) ElementType() reflect.Type {
return reflect.TypeOf((*DiskPool)(nil))
}
func (i *DiskPool) ToDiskPoolOutput() DiskPoolOutput {
return i.ToDiskPoolOutputWithContext(context.Background())
}
func (i *DiskPool) ToDiskPoolOutputWithContext(ctx context.Context) DiskPoolOutput {
return pulumi.ToOutputWithContext(ctx, i).(DiskPoolOutput)
}
type DiskPoolOutput struct {
*pulumi.OutputState
}
func (DiskPoolOutput) ElementType() reflect.Type {
return reflect.TypeOf((*DiskPool)(nil))
}
func (o DiskPoolOutput) ToDiskPoolOutput() DiskPoolOutput {
return o
}
func (o DiskPoolOutput) ToDiskPoolOutputWithContext(ctx context.Context) DiskPoolOutput {
return o
}
func init() {
pulumi.RegisterOutputType(DiskPoolOutput{})
}