Skip to content

Commit 9ce10cd

Browse files
Long Runing operation header Added to servicebus/EventHub namespace Patch API. (#38482)
* Updates * updates * updates * updates * updates * updateS * 'updates * updates * updates * updates * updates * updates * update * update * Refactor folder * updates * updateS * updateS * Updates * updates' * updates' * updates * Lintdiff suppression * updates --------- Co-authored-by: Tong Xu (MSFT) <[email protected]>
1 parent ba25c0c commit 9ce10cd

File tree

10 files changed

+78
-188
lines changed

10 files changed

+78
-188
lines changed

specification/eventhub/resource-manager/Microsoft.EventHub/Eventhub/EHNamespace.tsp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ interface EHNamespaces {
6363
* Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation is idempotent.
6464
*/
6565
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
66+
@Azure.Core.useFinalStateVia("azure-async-operation")
6667
@patch(#{ implicitOptionality: false })
6768
update is ArmCustomPatchSync<
6869
EHNamespace,
6970
PatchModel = EHNamespace,
70-
Response = ArmResponse<EHNamespace> | ArmResourceCreatedSyncResponse<EHNamespace> | AcceptedResponse,
71+
Response = ArmResponse<EHNamespace> | ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = EHNamespace> &
72+
Azure.Core.Foundations.RetryAfterHeader>,
7173
Error = ErrorResponse
7274
>;
7375

specification/eventhub/resource-manager/Microsoft.EventHub/Eventhub/examples/2025-05-01-preview/NameSpaces/EHNameSpaceUpdate.json

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,62 +71,12 @@
7171
"tags": {}
7272
}
7373
},
74-
"201": {
75-
"body": {
76-
"name": "NamespaceSample",
77-
"type": "Microsoft.EventHub/Namespaces",
78-
"id": "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/namespaces/NamespaceSample",
79-
"identity": {
80-
"type": "SystemAssigned, UserAssigned",
81-
"principalId": "PrincipalIdGUID",
82-
"tenantId": "TenantIdGUID",
83-
"userAssignedIdentities": {
84-
"/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1": {
85-
"clientId": "ClientIdGUID",
86-
"principalId": "PrincipalIdGUID"
87-
}
88-
}
89-
},
90-
"location": "East US",
91-
"properties": {
92-
"createdAt": "2021-01-30T00:28:38.963Z",
93-
"disableLocalAuth": false,
94-
"encryption": {
95-
"keySource": "Microsoft.KeyVault",
96-
"keyVaultProperties": [
97-
{
98-
"identity": {
99-
"userAssignedIdentity": "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1"
100-
},
101-
"keyName": "Samplekey",
102-
"keyVaultUri": "https://sample-keyvault-user.vault-int.azure-int.net",
103-
"keyVersion": ""
104-
}
105-
],
106-
"requireInfrastructureEncryption": false
107-
},
108-
"isAutoInflateEnabled": false,
109-
"maximumThroughputUnits": 0,
110-
"metricId": "MetricGUID:NamespaceSample",
111-
"platformCapabilities": {
112-
"confidentialCompute": {
113-
"mode": "Disabled"
114-
}
115-
},
116-
"provisioningState": "ActivatingIdentity",
117-
"serviceBusEndpoint": "https://NamespaceSample.servicebus.windows-int.net:443/",
118-
"updatedAt": "2021-01-30T00:31:13.657Z",
119-
"zoneRedundant": false
120-
},
121-
"sku": {
122-
"name": "Standard",
123-
"capacity": 1,
124-
"tier": "Standard"
125-
},
126-
"tags": {}
74+
"202": {
75+
"headers": {
76+
"azure-asyncoperation": "http://azure.async.operation/status",
77+
"Location": "https://management.azure.com/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/namespaces/NamespaceSample?api-version=2025-05-01-preview"
12778
}
128-
},
129-
"202": {}
79+
}
13080
},
13181
"operationId": "Namespaces_Update",
13282
"title": "NamespacesUpdate"

specification/eventhub/resource-manager/Microsoft.EventHub/Eventhub/preview/2025-05-01-preview/examples/NameSpaces/EHNameSpaceUpdate.json

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,62 +71,12 @@
7171
"tags": {}
7272
}
7373
},
74-
"201": {
75-
"body": {
76-
"name": "NamespaceSample",
77-
"type": "Microsoft.EventHub/Namespaces",
78-
"id": "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/namespaces/NamespaceSample",
79-
"identity": {
80-
"type": "SystemAssigned, UserAssigned",
81-
"principalId": "PrincipalIdGUID",
82-
"tenantId": "TenantIdGUID",
83-
"userAssignedIdentities": {
84-
"/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1": {
85-
"clientId": "ClientIdGUID",
86-
"principalId": "PrincipalIdGUID"
87-
}
88-
}
89-
},
90-
"location": "East US",
91-
"properties": {
92-
"createdAt": "2021-01-30T00:28:38.963Z",
93-
"disableLocalAuth": false,
94-
"encryption": {
95-
"keySource": "Microsoft.KeyVault",
96-
"keyVaultProperties": [
97-
{
98-
"identity": {
99-
"userAssignedIdentity": "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1"
100-
},
101-
"keyName": "Samplekey",
102-
"keyVaultUri": "https://sample-keyvault-user.vault-int.azure-int.net",
103-
"keyVersion": ""
104-
}
105-
],
106-
"requireInfrastructureEncryption": false
107-
},
108-
"isAutoInflateEnabled": false,
109-
"maximumThroughputUnits": 0,
110-
"metricId": "MetricGUID:NamespaceSample",
111-
"platformCapabilities": {
112-
"confidentialCompute": {
113-
"mode": "Disabled"
114-
}
115-
},
116-
"provisioningState": "ActivatingIdentity",
117-
"serviceBusEndpoint": "https://NamespaceSample.servicebus.windows-int.net:443/",
118-
"updatedAt": "2021-01-30T00:31:13.657Z",
119-
"zoneRedundant": false
120-
},
121-
"sku": {
122-
"name": "Standard",
123-
"capacity": 1,
124-
"tier": "Standard"
125-
},
126-
"tags": {}
74+
"202": {
75+
"headers": {
76+
"azure-asyncoperation": "http://azure.async.operation/status",
77+
"Location": "https://management.azure.com/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/namespaces/NamespaceSample?api-version=2025-05-01-preview"
12778
}
128-
},
129-
"202": {}
79+
}
13080
},
13181
"operationId": "Namespaces_Update",
13282
"title": "NamespacesUpdate"

specification/eventhub/resource-manager/Microsoft.EventHub/Eventhub/preview/2025-05-01-preview/openapi.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -983,14 +983,24 @@
983983
"$ref": "#/definitions/EHNamespace"
984984
}
985985
},
986-
"201": {
987-
"description": "Resource 'EHNamespace' create operation succeeded",
988-
"schema": {
989-
"$ref": "#/definitions/EHNamespace"
990-
}
991-
},
992986
"202": {
993-
"description": "The request has been accepted for processing, but processing has not yet completed."
987+
"description": "Resource operation accepted.",
988+
"headers": {
989+
"Azure-AsyncOperation": {
990+
"type": "string",
991+
"format": "uri",
992+
"description": "A link to the status monitor"
993+
},
994+
"Location": {
995+
"type": "string",
996+
"description": "The Location header contains the URL where the status of the long running operation can be checked."
997+
},
998+
"Retry-After": {
999+
"type": "integer",
1000+
"format": "int32",
1001+
"description": "The Retry-After header can indicate how long the client should wait before polling the operation status."
1002+
}
1003+
}
9941004
},
9951005
"default": {
9961006
"description": "An unexpected error response.",
@@ -1003,7 +1013,12 @@
10031013
"NamespacesUpdate": {
10041014
"$ref": "./examples/NameSpaces/EHNameSpaceUpdate.json"
10051015
}
1006-
}
1016+
},
1017+
"x-ms-long-running-operation-options": {
1018+
"final-state-via": "azure-async-operation",
1019+
"final-state-schema": "#/definitions/EHNamespace"
1020+
},
1021+
"x-ms-long-running-operation": true
10071022
},
10081023
"delete": {
10091024
"operationId": "Namespaces_Delete",

specification/eventhub/resource-manager/Microsoft.EventHub/Eventhub/readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ directive:
325325
- suppress: LroErrorContent
326326
from: namespaces.json
327327
reason: Suppress it for now to avoid breaking change because it is referenced by many files.
328+
- suppress: LroErrorContent
329+
from: openapi.json
330+
reason: Suppress it for now to avoid breaking change because it is referenced by many files.
328331
329332
- suppress: LroLocationHeader
330333
from: Clusters-preview.json

specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus/SBNamespace.tsp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@ interface SBNamespaces {
6767
*/
6868
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
6969
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
70+
@Azure.Core.useFinalStateVia("azure-async-operation")
7071
@patch(#{ implicitOptionality: false })
7172
update is ArmCustomPatchSync<
7273
SBNamespace,
7374
PatchModel = SBNamespaceUpdateParameters,
74-
Response = ArmResponse<SBNamespace> | ArmResourceCreatedSyncResponse<SBNamespace> | AcceptedResponse,
75+
Response = ArmResponse<SBNamespace> | ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = SBNamespace> &
76+
Azure.Core.Foundations.RetryAfterHeader>,
7577
Error = ErrorResponse
7678
>;
7779

specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus/examples/2025-05-01-preview/NameSpaces/SBNameSpaceUpdate.json

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,12 @@
4343
}
4444
}
4545
},
46-
"201": {
47-
"body": {
48-
"name": "sdk-Namespace-3285",
49-
"type": "Microsoft.ServiceBus/Namespaces",
50-
"id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-3285",
51-
"location": "South Central US",
52-
"properties": {
53-
"createdAt": "2017-05-25T23:07:58.17Z",
54-
"disableLocalAuth": false,
55-
"metricId": "5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-3285",
56-
"minimumTlsVersion": "1.2",
57-
"platformCapabilities": {
58-
"confidentialCompute": {
59-
"mode": "Disabled"
60-
}
61-
},
62-
"provisioningState": "Updating",
63-
"serviceBusEndpoint": "https://sdk-Namespace-3285.servicebus.windows-int.net:443/",
64-
"updatedAt": "2017-05-25T23:08:45.497Z"
65-
},
66-
"sku": {
67-
"name": "Standard",
68-
"tier": "Standard"
69-
},
70-
"tags": {
71-
"tag3": "value3",
72-
"tag4": "value4"
73-
}
46+
"202": {
47+
"headers": {
48+
"azure-asyncoperation": "http://azure.async.operation/status",
49+
"Location": "https://management.azure.com/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ServiceBus/namespaces/NamespaceSample?api-version=2025-05-01-preview"
7450
}
75-
},
76-
"202": {}
51+
}
7752
},
7853
"operationId": "Namespaces_Update",
7954
"title": "NameSpaceUpdate"

specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus/preview/2025-05-01-preview/examples/NameSpaces/SBNameSpaceUpdate.json

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,12 @@
4343
}
4444
}
4545
},
46-
"201": {
47-
"body": {
48-
"name": "sdk-Namespace-3285",
49-
"type": "Microsoft.ServiceBus/Namespaces",
50-
"id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-3285",
51-
"location": "South Central US",
52-
"properties": {
53-
"createdAt": "2017-05-25T23:07:58.17Z",
54-
"disableLocalAuth": false,
55-
"metricId": "5f750a97-50d9-4e36-8081-c9ee4c0210d4:sdk-namespace-3285",
56-
"minimumTlsVersion": "1.2",
57-
"platformCapabilities": {
58-
"confidentialCompute": {
59-
"mode": "Disabled"
60-
}
61-
},
62-
"provisioningState": "Updating",
63-
"serviceBusEndpoint": "https://sdk-Namespace-3285.servicebus.windows-int.net:443/",
64-
"updatedAt": "2017-05-25T23:08:45.497Z"
65-
},
66-
"sku": {
67-
"name": "Standard",
68-
"tier": "Standard"
69-
},
70-
"tags": {
71-
"tag3": "value3",
72-
"tag4": "value4"
73-
}
46+
"202": {
47+
"headers": {
48+
"azure-asyncoperation": "http://azure.async.operation/status",
49+
"Location": "https://management.azure.com/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ServiceBus/namespaces/NamespaceSample?api-version=2025-05-01-preview"
7450
}
75-
},
76-
"202": {}
51+
}
7752
},
7853
"operationId": "Namespaces_Update",
7954
"title": "NameSpaceUpdate"

specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus/preview/2025-05-01-preview/servicebus.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,24 @@
427427
"$ref": "#/definitions/SBNamespace"
428428
}
429429
},
430-
"201": {
431-
"description": "Resource 'SBNamespace' create operation succeeded",
432-
"schema": {
433-
"$ref": "#/definitions/SBNamespace"
434-
}
435-
},
436430
"202": {
437-
"description": "The request has been accepted for processing, but processing has not yet completed."
431+
"description": "Resource operation accepted.",
432+
"headers": {
433+
"Azure-AsyncOperation": {
434+
"type": "string",
435+
"format": "uri",
436+
"description": "A link to the status monitor"
437+
},
438+
"Location": {
439+
"type": "string",
440+
"description": "The Location header contains the URL where the status of the long running operation can be checked."
441+
},
442+
"Retry-After": {
443+
"type": "integer",
444+
"format": "int32",
445+
"description": "The Retry-After header can indicate how long the client should wait before polling the operation status."
446+
}
447+
}
438448
},
439449
"default": {
440450
"description": "An unexpected error response.",
@@ -447,7 +457,12 @@
447457
"NameSpaceUpdate": {
448458
"$ref": "./examples/NameSpaces/SBNameSpaceUpdate.json"
449459
}
450-
}
460+
},
461+
"x-ms-long-running-operation-options": {
462+
"final-state-via": "azure-async-operation",
463+
"final-state-schema": "#/definitions/SBNamespace"
464+
},
465+
"x-ms-long-running-operation": true
451466
},
452467
"delete": {
453468
"operationId": "Namespaces_Delete",

specification/servicebus/resource-manager/Microsoft.ServiceBus/ServiceBus/readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ directive:
288288
- suppress: PutResponseCodes
289289
from: AuthorizationRules.json
290290
reason: Breaking change in order to change the API response code.
291+
- suppress: LroErrorContent
292+
from: servicebus.json
293+
reason: Suppress it for now to avoid breaking change because it is referenced by many files.Will update in next api version.Please scope the suppression to the Namespaces PATCH operation only.
291294
```
292295

293296

0 commit comments

Comments
 (0)