Skip to content

Commit 502762c

Browse files
Rui ZhanCopilot
andcommitted
Document ImmutabilityPolicyLockData.type behavior for Unlocked value
Addresses ARM API review feedback: explicitly document what happens when type: 'Unlocked' is sent to the updateImmutabilityPolicyLock action. The lock action has all privileges of updateImmutabilityPolicy, so both Locked and Unlocked values are accepted. Updated descriptions on the ImmutabilityPolicyLockData model, its type property, and the action itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 78589ce commit 502762c

12 files changed

Lines changed: 202 additions & 134 deletions

File tree

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/Disk.tsp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ interface Disks {
6969
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
7070
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
7171
Disk,
72-
Response = ArmResourceUpdatedResponse<Disk> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Disk> &
73-
Azure.Core.Foundations.RetryAfterHeader> & {
74-
@bodyRoot _: Disk;
75-
})
72+
Response =
73+
| ArmResourceUpdatedResponse<Disk>
74+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Disk> &
75+
Azure.Core.Foundations.RetryAfterHeader> & {
76+
@bodyRoot _: Disk;
77+
})
7678
>;
7779

7880
/**
@@ -83,10 +85,12 @@ interface Disks {
8385
update is ComputeCustomPatchAsync<
8486
Disk,
8587
DiskUpdate,
86-
Response = ArmResponse<Disk> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Disk> &
87-
Azure.Core.Foundations.RetryAfterHeader> & {
88-
@bodyRoot _: Disk;
89-
})
88+
Response =
89+
| ArmResponse<Disk>
90+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Disk> &
91+
Azure.Core.Foundations.RetryAfterHeader> & {
92+
@bodyRoot _: Disk;
93+
})
9094
>;
9195

9296
/**
@@ -125,16 +129,20 @@ interface Disks {
125129
>;
126130
}
127131

128-
@@doc(Disk.name,
132+
@@doc(
133+
Disk.name,
129134
"The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters."
130135
);
131136
@@doc(Disk.properties, "Disk resource properties.");
132-
@@doc(Disks.createOrUpdate::parameters.resource,
137+
@@doc(
138+
Disks.createOrUpdate::parameters.resource,
133139
"Disk object supplied in the body of the Put disk operation."
134140
);
135-
@@doc(Disks.update::parameters.properties,
141+
@@doc(
142+
Disks.update::parameters.properties,
136143
"Disk object supplied in the body of the Patch disk operation."
137144
);
138-
@@doc(Disks.grantAccess::parameters.body,
145+
@@doc(
146+
Disks.grantAccess::parameters.body,
139147
"Access data object supplied in the body of the get disk access operation."
140148
);

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/DiskAccess.tsp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ interface DiskAccesses {
4444
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
4545
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
4646
DiskAccess,
47-
Response = ArmResourceUpdatedResponse<DiskAccess> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskAccess> &
48-
Azure.Core.Foundations.RetryAfterHeader> & {
49-
@bodyRoot _: DiskAccess;
50-
})
47+
Response =
48+
| ArmResourceUpdatedResponse<DiskAccess>
49+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskAccess> &
50+
Azure.Core.Foundations.RetryAfterHeader> & {
51+
@bodyRoot _: DiskAccess;
52+
})
5153
>;
5254

5355
/**
@@ -58,10 +60,12 @@ interface DiskAccesses {
5860
update is ComputeCustomPatchAsync<
5961
DiskAccess,
6062
DiskAccessUpdate,
61-
Response = ArmResponse<DiskAccess> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskAccess> &
62-
Azure.Core.Foundations.RetryAfterHeader> & {
63-
@bodyRoot _: DiskAccess;
64-
})
63+
Response =
64+
| ArmResponse<DiskAccess>
65+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskAccess> &
66+
Azure.Core.Foundations.RetryAfterHeader> & {
67+
@bodyRoot _: DiskAccess;
68+
})
6569
>;
6670

6771
/**
@@ -97,13 +101,16 @@ interface DiskAccesses {
97101
>;
98102
}
99103

100-
@@doc(DiskAccess.name,
104+
@@doc(
105+
DiskAccess.name,
101106
"The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters."
102107
);
103108
@@doc(DiskAccess.properties, "");
104-
@@doc(DiskAccesses.createOrUpdate::parameters.resource,
109+
@@doc(
110+
DiskAccesses.createOrUpdate::parameters.resource,
105111
"disk access object supplied in the body of the Put disk access operation."
106112
);
107-
@@doc(DiskAccesses.update::parameters.properties,
113+
@@doc(
114+
DiskAccesses.update::parameters.properties,
108115
"disk access object supplied in the body of the Patch disk access operation."
109116
);

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/DiskEncryptionSet.tsp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ interface DiskEncryptionSets {
4444
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
4545
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
4646
DiskEncryptionSet,
47-
Response = ArmResourceUpdatedResponse<DiskEncryptionSet> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskEncryptionSet> &
48-
Azure.Core.Foundations.RetryAfterHeader> & {
49-
@bodyRoot _: DiskEncryptionSet;
50-
})
47+
Response =
48+
| ArmResourceUpdatedResponse<DiskEncryptionSet>
49+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskEncryptionSet> &
50+
Azure.Core.Foundations.RetryAfterHeader> & {
51+
@bodyRoot _: DiskEncryptionSet;
52+
})
5153
>;
5254

5355
/**
@@ -58,10 +60,12 @@ interface DiskEncryptionSets {
5860
update is ComputeCustomPatchAsync<
5961
DiskEncryptionSet,
6062
DiskEncryptionSetUpdate,
61-
Response = ArmResponse<DiskEncryptionSet> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskEncryptionSet> &
62-
Azure.Core.Foundations.RetryAfterHeader> & {
63-
@bodyRoot _: DiskEncryptionSet;
64-
})
63+
Response =
64+
| ArmResponse<DiskEncryptionSet>
65+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = DiskEncryptionSet> &
66+
Azure.Core.Foundations.RetryAfterHeader> & {
67+
@bodyRoot _: DiskEncryptionSet;
68+
})
6569
>;
6670

6771
/**
@@ -102,13 +106,16 @@ interface DiskEncryptionSets {
102106
>;
103107
}
104108

105-
@@doc(DiskEncryptionSet.name,
109+
@@doc(
110+
DiskEncryptionSet.name,
106111
"The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters."
107112
);
108113
@@doc(DiskEncryptionSet.properties, "");
109-
@@doc(DiskEncryptionSets.createOrUpdate::parameters.resource,
114+
@@doc(
115+
DiskEncryptionSets.createOrUpdate::parameters.resource,
110116
"disk encryption set object supplied in the body of the Put disk encryption set operation."
111117
);
112-
@@doc(DiskEncryptionSets.update::parameters.properties,
118+
@@doc(
119+
DiskEncryptionSets.update::parameters.properties,
113120
"disk encryption set object supplied in the body of the Patch disk encryption set operation."
114121
);

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/DiskRestorePoint.tsp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ interface DiskRestorePoints {
105105
}
106106

107107
@@doc(DiskRestorePoint.name, "The name of the disk restore point created.");
108-
@@doc(DiskRestorePoint.properties,
108+
@@doc(
109+
DiskRestorePoint.properties,
109110
"Properties of an incremental disk restore point"
110111
);
111-
@@doc(DiskRestorePoints.grantAccess::parameters.body,
112+
@@doc(
113+
DiskRestorePoints.grantAccess::parameters.body,
112114
"Access data object supplied in the body of the get disk access operation."
113115
);

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/PrivateEndpointConnection.tsp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ interface PrivateEndpointConnections {
4848
@operationId("DiskAccesses_UpdateAPrivateEndpointConnection")
4949
updateAPrivateEndpointConnection is ComputeResourceCreateOrReplaceAsync<
5050
PrivateEndpointConnection,
51-
Response = ArmResourceUpdatedResponse<PrivateEndpointConnection> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = PrivateEndpointConnection> &
52-
Azure.Core.Foundations.RetryAfterHeader> & {
53-
@bodyRoot _: PrivateEndpointConnection;
54-
})
51+
Response =
52+
| ArmResourceUpdatedResponse<PrivateEndpointConnection>
53+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = PrivateEndpointConnection> &
54+
Azure.Core.Foundations.RetryAfterHeader> & {
55+
@bodyRoot _: PrivateEndpointConnection;
56+
})
5557
>;
5658

5759
/**
@@ -78,10 +80,12 @@ interface PrivateEndpointConnections {
7880
>;
7981
}
8082

81-
@@doc(PrivateEndpointConnection.name,
83+
@@doc(
84+
PrivateEndpointConnection.name,
8285
"The name of the private endpoint connection."
8386
);
8487
@@doc(PrivateEndpointConnection.properties, "Resource properties.");
85-
@@doc(PrivateEndpointConnections.updateAPrivateEndpointConnection::parameters.resource,
88+
@@doc(
89+
PrivateEndpointConnections.updateAPrivateEndpointConnection::parameters.resource,
8690
"private endpoint connection object supplied in the body of the Put private endpoint connection operation."
8791
);

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/Snapshot.tsp

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ interface Snapshots {
5858
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
5959
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
6060
Snapshot,
61-
Response = ArmResourceUpdatedResponse<Snapshot> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Snapshot> &
62-
Azure.Core.Foundations.RetryAfterHeader> & {
63-
@bodyRoot _: Snapshot;
64-
})
61+
Response =
62+
| ArmResourceUpdatedResponse<Snapshot>
63+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Snapshot> &
64+
Azure.Core.Foundations.RetryAfterHeader> & {
65+
@bodyRoot _: Snapshot;
66+
})
6567
>;
6668

6769
/**
@@ -72,10 +74,12 @@ interface Snapshots {
7274
update is ComputeCustomPatchAsync<
7375
Snapshot,
7476
SnapshotUpdate,
75-
Response = ArmResourceUpdatedResponse<Snapshot> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Snapshot> &
76-
Azure.Core.Foundations.RetryAfterHeader> & {
77-
@bodyRoot _: Snapshot;
78-
})
77+
Response =
78+
| ArmResourceUpdatedResponse<Snapshot>
79+
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Snapshot> &
80+
Azure.Core.Foundations.RetryAfterHeader> & {
81+
@bodyRoot _: Snapshot;
82+
})
7983
>;
8084

8185
/**
@@ -135,7 +139,10 @@ interface Snapshots {
135139
>;
136140

137141
/**
138-
* Locks the immutability policy of a snapshot. Once locked, the policy cannot be reduced or removed until the lock period expires.
142+
* Locks or updates the immutability policy of a snapshot. This action requires elevated roles such as 'Owner' or 'Administrator'.
143+
* When type is set to 'Locked', the policy is locked and the immutability duration cannot be reduced until expiry.
144+
* When type is set to 'Unlocked', the policy is set or updated as an unlocked policy — this is functionally equivalent to calling
145+
* updateImmutabilityPolicy, but requires elevated privileges. This action has all the privileges of updateImmutabilityPolicy.
139146
*/
140147
@added(Versions.v2026_03_02)
141148
@action("updateImmutabilityPolicyLock")
@@ -149,23 +156,28 @@ interface Snapshots {
149156
>;
150157
}
151158

152-
@@doc(Snapshot.name,
159+
@@doc(
160+
Snapshot.name,
153161
"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, _ and -. The max name length is 80 characters."
154162
);
155163
@@doc(Snapshot.properties, "Snapshot resource properties.");
156-
@@doc(Snapshots.createOrUpdate::parameters.resource,
164+
@@doc(
165+
Snapshots.createOrUpdate::parameters.resource,
157166
"Snapshot object supplied in the body of the Put disk operation."
158167
);
159-
@@doc(Snapshots.update::parameters.properties,
168+
@@doc(
169+
Snapshots.update::parameters.properties,
160170
"Snapshot object supplied in the body of the Patch snapshot operation."
161171
);
162-
@@doc(Snapshots.grantAccess::parameters.body,
172+
@@doc(
173+
Snapshots.grantAccess::parameters.body,
163174
"Access data object supplied in the body of the get snapshot access operation."
164175
);
165-
@@doc(Snapshots.updateImmutabilityPolicy::parameters.body,
176+
@@doc(
177+
Snapshots.updateImmutabilityPolicy::parameters.body,
166178
"Immutability policy data supplied in the body of the update immutability policy operation."
167179
);
168-
@@doc(Snapshots.updateImmutabilityPolicyLock::parameters.body,
180+
@@doc(
181+
Snapshots.updateImmutabilityPolicyLock::parameters.body,
169182
"Immutability policy data supplied in the body of the update immutability policy lock operation."
170183
);
171-

0 commit comments

Comments
 (0)