forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDtlEnvironment.tsp
More file actions
119 lines (108 loc) · 3.55 KB
/
DtlEnvironment.tsp
File metadata and controls
119 lines (108 loc) · 3.55 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
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
namespace Microsoft.DevTestLab;
/**
* An environment, which is essentially an ARM template deployment.
*/
@parentResource(User)
model DtlEnvironment
is Azure.ResourceManager.ProxyResource<EnvironmentProperties, false> {
...ResourceNameParameter<
Resource = DtlEnvironment,
SegmentName = "environments",
NamePattern = ""
>;
}
@armResourceOperations
interface DtlEnvironments {
/**
* Get environment.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Environments_Get")
get is ArmResourceRead<
DtlEnvironment,
Parameters = {
/**
* Specify the $expand query. Example: 'properties($select=deploymentProperties)'
*/
@query("$expand")
$expand?: string;
}
>;
/**
* Create or replace an existing environment. This operation can take a while to complete.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Environments_CreateOrUpdate")
createOrUpdate is ArmResourceCreateOrReplaceAsync<
DtlEnvironment,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;
/**
* Allows modifying tags of environments. All other properties will be ignored.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@patch(#{ implicitOptionality: false })
@operationId("Environments_Update")
update is ArmCustomPatchSync<
DtlEnvironment,
PatchModel = DtlEnvironmentFragment
>;
/**
* Delete environment. This operation can take a while to complete.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
@operationId("Environments_Delete")
delete is ArmResourceDeleteWithoutOkAsync<
DtlEnvironment,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;
/**
* List environments in a given user profile.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Environments_List")
list is ArmResourceListByParent<
DtlEnvironment,
Parameters = {
/**
* Specify the $expand query. Example: 'properties($select=deploymentProperties)'
*/
@query("$expand")
$expand?: string;
/**
* The filter to apply to the operation. Example: '$filter=contains(name,'myName')
*/
@query("$filter")
$filter?: string;
/**
* The maximum number of resources to return from the operation. Example: '$top=10'
*/
@query("$top")
$top?: int32;
/**
* The ordering expression for the results, using OData notation. Example: '$orderby=name desc'
*/
@query("$orderby")
$orderby?: string;
},
Response = ArmResponse<DtlEnvironmentList>
>;
}
@@doc(DtlEnvironment.name, "The name of the environment.");
@@doc(DtlEnvironment.properties, "The properties of the resource.");
@@doc(DtlEnvironments.createOrUpdate::parameters.resource,
"An environment, which is essentially an ARM template deployment."
);
@@doc(DtlEnvironments.update::parameters.properties,
"An environment, which is essentially an ARM template deployment."
);