-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathTarget.tsp
More file actions
339 lines (271 loc) · 8.6 KB
/
Copy pathTarget.tsp
File metadata and controls
339 lines (271 loc) · 8.6 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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "./ProvisioningState.tsp";
import "./SolutionVersion.tsp";
import "./State.tsp";
using TypeSpec.OpenAPI;
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.CommonTypes;
namespace Microsoft.Edge;
@doc("Resolved Configuration")
model ResolvedConfiguration {
@doc("Resolved Configuration as string")
configuration: string;
}
@doc("Solution Template Parameter")
model SolutionTemplateParameter {
@removed(Versions.v2025_06_01)
@doc("Solution Template Name")
solutionTemplate: string;
@removed(Versions.v2025_06_01)
@doc("Solution Template Version Name")
solutionTemplateVersion: string;
@added(Versions.v2025_06_01)
@doc("Solution Template Version ARM Id")
solutionTemplateVersionId: string;
@doc("Solution Instance Name")
@pattern("^(?!v-)(?!.*-v-)[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$")
solutionInstanceName?: string;
@doc("Solution Dependencies")
@Azure.ResourceManager.identifiers(#[])
solutionDependencies?: SolutionDependencyParameter[];
}
@doc("Solution Version Parameter")
model SolutionVersionParameter {
@removed(Versions.v2025_06_01)
@doc("Solution Name")
solution: string;
@removed(Versions.v2025_06_01)
@doc("Solution Version Name")
solutionVersion: string;
@removed(Versions.v2025_06_01)
@doc("Review ID")
reviewId: string;
@added(Versions.v2025_06_01)
@doc("Solution Version ARM Id")
solutionVersionId: string;
}
@doc("Update External Validation Status Parameter")
model UpdateExternalValidationStatusParameter {
@doc("Solution Version Id")
solutionVersionId: string;
@doc("Error Details if any failure is there")
errorDetails?: Azure.ResourceManager.Foundations.ErrorDetail;
@doc("External validation id")
externalValidationId: string;
@doc("Validation Status of external validation")
validationStatus: ValidationStatus;
}
@doc("Solution Dependency Context")
model SolutionDependencyParameter {
@doc("Solution Version Id")
solutionVersionId?: string;
@doc("Solution Template Id")
solutionTemplateId?: string;
@doc("Solution Template Version")
solutionTemplateVersion?: string;
@doc("Solution Instance Name")
@maxLength(24)
@pattern("^(?!v-)(?!.*-v-)[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$")
solutionInstanceName?: string;
@doc("Target Id")
targetId?: string;
@doc("Solution dependencies")
@Azure.ResourceManager.identifiers(#[])
dependencies?: SolutionDependencyParameter[];
}
@doc("Install Solution Parameter")
model InstallSolutionParameter {
@removed(Versions.v2025_06_01)
@doc("Solution Name")
solution: string;
@removed(Versions.v2025_06_01)
@doc("Solution Version Name")
solutionVersion: string;
@added(Versions.v2025_06_01)
@doc("Solution Version ARM Id")
solutionVersionId: string;
}
@doc("Uninstall Solution Parameter")
model UninstallSolutionParameter {
@removed(Versions.v2025_06_01)
@doc("Solution Name")
solutionName: string;
@added(Versions.v2025_06_01)
@doc("Solution Template ARM Id")
solutionTemplateId: string;
@doc("Solution Instance Name")
solutionInstanceName?: string;
}
@doc("Install Solution Parameter")
model RemoveRevisionParameter {
@removed(Versions.v2025_06_01)
@doc("Solution Name")
solution: string;
@added(Versions.v2025_06_01)
@doc("Solution Template ARM Id")
solutionTemplateId: string;
@doc("Solution Version Name")
solutionVersion: string;
}
@doc("Target Properties")
model TargetProperties {
@doc("Description of target")
description: string;
@doc("Display name of target")
displayName: string;
@added(Versions.v2025_06_01)
@doc("ArmId of Context")
contextId: Azure.Core.armResourceIdentifier<[
{
type: "Microsoft.Edge/contexts";
}
]>;
#suppress "@azure-tools/typespec-azure-core/no-unknown" "Suppress no-unknown to handle the datatype object used in dependent service"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Suppress arm-no-record to handle the datatype object used in dependent service"
@doc("target spec")
targetSpecification: Record<unknown>;
@doc("List of capabilities")
capabilities: string[];
@doc("Hierarchy Level")
hierarchyLevel: string;
@doc("Status of target")
@visibility(Lifecycle.Read)
status?: DeploymentStatus;
@doc("Scope of the target resource")
@pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
solutionScope?: string;
@doc("State of resource")
state?: ResourceState;
@doc("Provisioning state of resource")
@visibility(Lifecycle.Read)
provisioningState?: ProvisioningState;
}
@doc("The updatable properties of the Target.")
model TargetUpdateProperties {
@doc("Description of target")
description?: string;
@doc("Display name of target")
displayName?: string;
@added(Versions.v2025_06_01)
@doc("ArmId of Context")
contextId?: Azure.Core.armResourceIdentifier<[
{
type: "Microsoft.Edge/contexts";
}
]>;
#suppress "@azure-tools/typespec-azure-core/no-unknown" "Suppress no-unknown to handle the datatype object used in dependent service"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Suppress arm-no-record to handle the datatype object used in dependent service"
@doc("target spec")
targetSpecification?: Record<unknown>;
@doc("List of capabilities")
capabilities?: string[];
@doc("Hierarchy Level")
hierarchyLevel?: string;
@doc("Scope of the target resource")
@pattern("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$")
solutionScope?: string;
@doc("State of resource")
state?: ResourceState;
}
@doc("The type used for update operations of the Target.")
model TargetUpdate {
...ArmTagsProperty;
@doc("The resource-specific properties for this resource.")
properties?: TargetUpdateProperties;
}
@doc("Param that indicates if the delete should be forced")
model ForceDeleteParameter {
@doc("Force delete")
@query
forceDelete?: boolean = false;
}
@doc("Target Resource. Represents a resource to be deployed on the edge.")
model Target is Azure.ResourceManager.TrackedResource<TargetProperties> {
@doc("Name of the target")
@maxLength(61)
@minLength(3)
@pattern("^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?)*$")
@path
@key("targetName")
@segment("targets")
name: string;
...EntityTagProperty;
...ExtendedLocationProperty;
}
@armResourceOperations
interface Targets {
@doc("Get a Target Resource")
get is ArmResourceRead<Target>;
@doc("Create or update a Target Resource")
createOrUpdate is ArmResourceCreateOrReplaceAsync<Target>;
@doc("update a Target Resource")
update is ArmCustomPatchAsync<Target, TargetUpdate>;
@doc("Delete a Target Resource")
delete is ArmResourceDeleteWithoutOkAsync<
Target,
{
...DefaultBaseParameters<Target>;
...ForceDeleteParameter;
}
>;
@doc("List by specified resource group")
listByResourceGroup is ArmResourceListByParent<Target>;
@doc("List by subscription")
listBySubscription is ArmListBySubscription<Target>;
@doc("Post request to deploy")
installSolution is ArmResourceActionNoResponseContentAsync<
Target,
InstallSolutionParameter
>;
@doc("Post request to uninstall")
uninstallSolution is ArmResourceActionNoResponseContentAsync<
Target,
UninstallSolutionParameter
>;
@doc("Post request to remove solution version revision")
removeRevision is ArmResourceActionNoResponseContentAsync<
Target,
RemoveRevisionParameter
>;
@doc("Post request to resolve configuration")
resolveConfiguration is ArmResourceActionAsync<
Target,
SolutionTemplateParameter,
ResolvedConfiguration
>;
@doc("Post request to review configuration")
reviewSolutionVersion is ArmResourceActionAsync<
Target,
SolutionTemplateParameter,
SolutionVersion
>;
@doc("Post request to publish")
publishSolutionVersion is ArmResourceActionAsync<
Target,
SolutionVersionParameter,
SolutionVersion
>;
@doc("Post request to update external validation status")
updateExternalValidationStatus is ArmResourceActionAsync<
Target,
UpdateExternalValidationStatusParameter,
SolutionVersion
>;
@added(Versions.v2025_08_01)
@doc("Post request to unstage solution version")
unstageSolutionVersion is ArmResourceActionAsync<
Target,
SolutionVersionParameter,
SolutionVersion
>;
}