forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpool.tsp
More file actions
265 lines (207 loc) · 6.09 KB
/
pool.tsp
File metadata and controls
265 lines (207 loc) · 6.09 KB
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
import "@typespec/rest";
import "@typespec/openapi";
import "@azure-tools/typespec-azure-resource-manager";
using TypeSpec.OpenAPI;
using TypeSpec.Http;
using TypeSpec.Rest;
using Azure.ResourceManager;
namespace Microsoft.ContainerStorage;
@armResourceOperations
interface Pools {
get is ArmResourceRead<Pool>;
#suppress "@azure-tools/typespec-azure-core/invalid-final-state" "MUST CHANGE ON NEXT UPDATE"
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "location",
}
)
@Azure.Core.useFinalStateVia("azure-async-operation")
createOrUpdate is ArmResourceCreateOrReplaceAsync<
Pool,
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
delete is ArmResourceDeleteWithoutOkAsync<Pool>;
update is ArmResourcePatchAsync<Pool, PoolProperties>;
listByResourceGroup is ArmResourceListByParent<Pool>;
listBySubscription is ArmListBySubscription<Pool>;
}
@doc("Pool resource")
model Pool is TrackedResource<PoolProperties> {
@doc("Pool Object")
@minLength(3)
@maxLength(253)
@pattern("^[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]$")
@key("poolName")
@path
@segment("pools")
name: string;
}
@doc("Pool Properties")
model PoolProperties {
@doc("The status of the last operation.")
@visibility("read")
provisioningState?: ProvisioningState;
@doc("The operational status of the resource")
@visibility("read")
status?: ResourceOperationalStatus;
@visibility("read", "create")
@maxItems(3)
@doc("List of availability zones that resources can be created in.")
zones?: Zone[];
@doc("Resources represent the resources the pool should have.")
resources?: Resources;
@doc("Type of the Pool: ephemeralDisk, azureDisk, or elasticsan.")
poolType: PoolType;
@doc("ReclaimPolicy defines what happens to the backend storage when StoragePool is deleted")
@visibility("read", "create")
reclaimPolicy?: ReclaimPolicy;
@doc("List of resources that should have access to the pool. Typically ARM references to AKS clusters or ACI Container Groups. For local and standard this must be a single reference. For ElasticSAN there can be many.")
assignments?: Assignment[];
}
@doc("Availability Zones")
union Zone {
string,
@doc("First availability zone.")
Zone1: "1",
@doc("Second availability zone.")
Zone2: "2",
@doc("Third availability zone.")
Zone3: "3",
}
@doc("Resource Requests for the pool.")
model Resources {
@doc("Requests for capacity for the pool.")
requests?: Requests;
}
@doc("Requests for capacity for the pool.")
model Requests {
@doc("Requested capacity of the pool in GiB.")
@minValue(1024)
@maxValue(65536)
storage?: int64 = 1024;
}
@doc("Type of the Pool: ephemeralDisk, azureDisk, or elasticsan")
model PoolType {
@doc("Disk Pool Properties")
azureDisk?: AzureDisk;
@doc("Elastic San Pool Properties")
elasticSan?: ElasticSan;
@doc("Ephemeral Pool Properties")
ephemeralDisk?: EphemeralDisk;
}
@doc("Reclaim policy")
union ReclaimPolicy {
string,
@doc("Delete resource")
"Delete",
@doc("Retain resource")
"Retain",
}
@doc("Model for disk for that pool is using")
model Disk {
@doc("ID is the disk identifier visible to the OS. It is typically the WWN or disk ID in formats such as eui.e8238fa6bf530001001b448b45263379 or 0x5002cf6cbc5dd460")
id: string;
@doc("Reference is the location of the disk in an external system.")
reference: string;
}
@doc("Properties shared between azureDisk and elasticSan")
model ProvisionedPoolProperties<SkuType> {
@visibility("read")
@doc("Managed resource group for the pool.")
resourceGroup?: string;
@visibility("read", "create")
@doc("Sku name")
skuName?: SkuType;
@doc("Encryption specifies the encryption configuration for the Azure Disk pool")
@visibility("read", "create")
encryption?: Encryption;
}
@doc("Properties shared between the azureDisk and ephemeralDisk")
model DiskPoolProperties {
@doc("Only required if individual disk selection is desired. Path to disk, e.g. <nodename>:/dev/sda or WWN. Supports specifying multiple disks (same syntax as tags).")
disks?: Disk[];
}
@doc("Azure Disk Pool Properties")
model AzureDisk {
...ProvisionedPoolProperties<AzureDiskSkuName>;
...DiskPoolProperties;
}
@doc("SKU of the underlying managed disk")
union AzureDiskSkuName {
string,
@doc("Premium_LRS SKU")
"Premium_LRS",
@doc("Standard_LRS SKU")
"Standard_LRS",
@doc("StandardSSD_LRS SKU")
"StandardSSD_LRS",
@doc("UltraSSD_LRS SKU")
"UltraSSD_LRS",
@doc("Premium_ZRS SKU")
"Premium_ZRS",
@doc("PremiumV2_LRS SKU")
"PremiumV2_LRS",
@doc("StandardSSD_ZRS SKU")
"StandardSSD_ZRS",
}
@doc("Encryption key properties for the pool.")
model Encryption {
@doc("The name of the key vault key.")
keyName: string;
@doc("The URI of the key vault.")
keyVaultUri: string;
...Legacy.ManagedServiceIdentityV4Property;
}
@doc("Elastic San Pool Properties")
model ElasticSan {
...ProvisionedPoolProperties<ElasticSanSkuName>;
}
/** Sku Name enum type */
@doc("ElasticSAN SKUs")
union ElasticSanSkuName {
string,
@doc("Premium_LRS SKU")
"Premium_LRS",
@doc("Premium_ZRS SKU")
"Premium_ZRS",
}
@doc("Ephemeral Disk Pool Properties")
model EphemeralDisk {
@doc("The number of data copies. Default 3.")
@minValue(1)
@maxValue(3)
replicas?: int64 = 3;
...DiskPoolProperties;
}
@doc("Provisioning state of the resource.")
@Azure.Core.lroStatus
union ProvisioningState {
string,
ResourceProvisioningState,
@doc("The resource is being provisioned")
Provisioning: "Provisioning",
@doc("The resource is updating")
Updating: "Updating",
@doc("The resource is being deleted")
Deleting: "Deleting",
@doc("The resource create request has been accepted")
Accepted: "Accepted",
}
@doc("Status of the resource")
model ResourceOperationalStatus {
@doc("state of the resource")
state: ResourceOperationStatusState;
@doc("Reason for state.")
message?: string;
}
@doc("State of the resource.")
union ResourceOperationStatusState {
string,
@doc("The resource is pending.")
"Pending",
@doc("The resource is available.")
"Available",
@doc("The resource is unavailable.")
"Unavailable",
}