-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathContext.tsp
More file actions
189 lines (153 loc) · 4.98 KB
/
Copy pathContext.tsp
File metadata and controls
189 lines (153 loc) · 4.98 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
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 "./State.tsp";
using TypeSpec.OpenAPI;
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.CommonTypes;
namespace Microsoft.Edge;
@doc("Capability, to match in Solution Templates & Targets")
model Capability {
@doc("Name of Capability")
name: string;
@doc("Description of Capability")
description: string;
@doc("State of resource")
state?: ResourceState;
}
@doc("Hierarchy, to tag Sites / Hierarchy Provider nodes with what they represent")
model Hierarchy {
@doc("Name of Hierarchy")
name: string;
@doc("Description of Hierarchy")
description: string;
}
@doc("Context Properties")
model ContextProperties {
@added(Versions.v2025_08_01)
@doc("A unique identifier for the context, generated by the system")
@visibility(Lifecycle.Read)
uniqueIdentifier?: string;
@doc("List of Capabilities")
@Azure.ResourceManager.identifiers(#[])
capabilities: Capability[];
@doc("List of Hierarchies")
@Azure.ResourceManager.identifiers(#[])
hierarchies: Hierarchy[];
@doc("Provisioning state of resource")
@visibility(Lifecycle.Read)
provisioningState?: ProvisioningState;
}
@doc("The updatable properties of the Context.")
model ContextUpdateProperties {
@doc("List of Capabilities")
@Azure.ResourceManager.identifiers(#[])
capabilities?: Capability[];
@doc("List of Hierarchies")
@Azure.ResourceManager.identifiers(#[])
hierarchies?: Hierarchy[];
}
@doc("The type used for update operations of the Context.")
model ContextUpdate {
...Azure.ResourceManager.Foundations.ArmTagsProperty;
@doc("The resource-specific properties for this resource.")
properties?: ContextUpdateProperties;
}
@doc("Context Resource")
model Context is Azure.ResourceManager.TrackedResource<ContextProperties> {
@doc("The name of the Context.")
@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("contextName")
@segment("contexts")
name: string;
}
@armResourceOperations
interface Contexts {
@doc("Get Context Resource")
get is ArmResourceRead<Context>;
@doc("Create or update Context Resource")
createOrUpdate is ArmResourceCreateOrReplaceAsync<Context>;
@doc("update an Context Resource")
update is ArmCustomPatchAsync<Context, ContextUpdate>;
@doc("List by specified resource group")
listByResourceGroup is ArmResourceListByParent<Context>;
@doc("List by subscription")
listBySubscription is ArmListBySubscription<Context>;
@doc("Delete Context Resource")
delete is ArmResourceDeleteWithoutOkAsync<Context>;
@removed(Versions.v2025_06_01)
@doc("Post request to resolve configuration")
resolve is ArmResourceActionAsync<
Context,
WorkflowTemplateReviewParameter,
WorkflowVersion
>;
@removed(Versions.v2025_06_01)
@doc("Post request to review configuration")
review is ArmResourceActionAsync<
Context,
WorkflowTemplateReviewParameter,
WorkflowVersion
>;
@removed(Versions.v2025_06_01)
@doc("Post request to publish")
publish is ArmResourceActionAsync<
Context,
WorkflowVersionParameter,
WorkflowVersion
>;
@removed(Versions.v2025_06_01)
@doc("Post request to execute")
execute is ArmResourceActionAsync<
Context,
WorkflowExecuteParameter,
Execution
>;
}
@removed(Versions.v2025_06_01)
@doc("Workflow Version Parameter")
model WorkflowVersionParameter {
@doc("Workflow Name")
workflowName?: string;
@doc("Workflow Version Name")
workflowVersion: string;
@doc("Review ID")
reviewId: string;
}
@removed(Versions.v2025_06_01)
@doc("Workflow Template Review Parameter")
model WorkflowTemplateReviewParameter {
@doc("Workflow Template Name")
workflowTemplateName?: string;
@doc("Workflow Template Version Name")
workflowTemplateVersion: string;
#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" "field is loosely defined and dependent on customer scenarios"
@doc("Stage to Target Map")
stageTargetMap: Record<unknown>;
}
@removed(Versions.v2025_06_01)
@doc("Workflow Template Execute Parameter")
model WorkflowExecuteParameter {
@doc("Workflow Name")
workflow?: string;
@doc("Workflow Version Name")
workflowVersion: string;
@doc("Workflow first stage")
stage?: string;
#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" "field is loosely defined and dependent on customer scenarios"
@doc("Inputs from execution")
inputs?: Record<unknown>;
}