-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathSnapshot.tsp
More file actions
180 lines (164 loc) · 5.84 KB
/
Copy pathSnapshot.tsp
File metadata and controls
180 lines (164 loc) · 5.84 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
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "@typespec/versioning";
import "./models.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
using TypeSpec.Versioning;
using Common;
namespace ComputeDisk;
/**
* Snapshot resource.
*/
model Snapshot is Azure.ResourceManager.TrackedResource<SnapshotProperties> {
...ResourceNameParameter<
Resource = Snapshot,
KeyName = "snapshotName",
SegmentName = "snapshots",
NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
>;
/**
* Unused. Always Null.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
@visibility(Lifecycle.Read)
managedBy?: string;
/**
* The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same sku as the previous snapshot
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
sku?: SnapshotSku;
/**
* The extended location where the snapshot will be created. Extended location cannot be changed.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
extendedLocation?: ExtendedLocation;
}
@armResourceOperations
interface Snapshots {
/**
* Gets information about a snapshot.
*/
get is ComputeResourceRead<Snapshot>;
/**
* Creates or updates a snapshot.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
Snapshot,
Response =
| ArmResourceUpdatedResponse<Snapshot>
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Snapshot> &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot _: Snapshot;
})
>;
/**
* Updates (patches) a snapshot.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
@patch(#{ implicitOptionality: false })
update is ComputeCustomPatchAsync<
Snapshot,
SnapshotUpdate,
Response =
| ArmResourceUpdatedResponse<Snapshot>
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Snapshot> &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot _: Snapshot;
})
>;
/**
* Deletes a snapshot.
*/
#suppress "deprecated" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-core/no-response-body" "For backward compatibility"
delete is ComputeResourceDeleteAsync<Snapshot>;
/**
* Lists snapshots under a resource group.
*/
listByResourceGroup is ComputeResourceListByParent<
Snapshot,
Response = SnapshotList
>;
/**
* Lists snapshots under a subscription.
*/
list is ComputeListBySubscription<Snapshot, Response = SnapshotList>;
/**
* Grants access to a snapshot.
*/
@action("beginGetAccess")
grantAccess is ComputeResourceActionAsync<
Snapshot,
GrantAccessData,
AccessUri
>;
/**
* Revokes access to a snapshot.
*/
@action("endGetAccess")
revokeAccess is ComputeResourceActionAsync<
Snapshot,
void,
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;
/**
* Updates the immutability policy of a snapshot. Sets or extends an unlocked immutability policy with the specified duration and type. If the snapshot already has a locked policy, the request will be rejected. Use updateImmutabilityPolicyLock to lock an immutability policy.
*/
@added(Versions.v2026_03_02)
@action("updateImmutabilityPolicy")
updateImmutabilityPolicy is ComputeResourceActionAsync<
Snapshot,
ImmutabilityPolicyData,
Snapshot,
LroHeaders = ArmAsyncOperationHeader<FinalResult = Snapshot> &
ArmLroLocationHeader<FinalResult = Snapshot> &
Azure.Core.Foundations.RetryAfterHeader
>;
/**
* Locks the immutability policy of a snapshot. Once locked, the policy cannot be reduced or removed until the lock period expires.
*/
@added(Versions.v2026_03_02)
@action("updateImmutabilityPolicyLock")
updateImmutabilityPolicyLock is ComputeResourceActionAsync<
Snapshot,
ImmutabilityPolicyLockData,
Snapshot,
LroHeaders = ArmAsyncOperationHeader<FinalResult = Snapshot> &
ArmLroLocationHeader<FinalResult = Snapshot> &
Azure.Core.Foundations.RetryAfterHeader
>;
}
@@doc(
Snapshot.name,
"The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters."
);
@@doc(Snapshot.properties, "Snapshot resource properties.");
@@doc(
Snapshots.createOrUpdate::parameters.resource,
"Snapshot object supplied in the body of the Put disk operation."
);
@@doc(
Snapshots.update::parameters.properties,
"Snapshot object supplied in the body of the Patch snapshot operation."
);
@@doc(
Snapshots.grantAccess::parameters.body,
"Access data object supplied in the body of the get snapshot access operation."
);
@@doc(
Snapshots.updateImmutabilityPolicy::parameters.body,
"Immutability policy data supplied in the body of the update immutability policy operation."
);
@@doc(
Snapshots.updateImmutabilityPolicyLock::parameters.body,
"Immutability policy data supplied in the body of the update immutability policy lock operation."
);