Skip to content

Commit ca6a761

Browse files
committed
Addresses the LRO_RESPONSE_HEADER guideline.
This commit ensures the following invariant in managedHsm.json: ``` If an operation can return a 202 Accepted response, then we insert '"x-ms-long-running-operation": true,' directly below the operationId, and we insert a Location header in the operation as well as the corresponding example. ```
1 parent 7f877af commit ca6a761

File tree

7 files changed

+48
-25
lines changed

7 files changed

+48
-25
lines changed

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/examples/DeletedManagedHsm_Purge.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"api-version": "2022-07-01"
77
},
88
"responses": {
9-
"202": {}
9+
"202": {
10+
"headers": {
11+
"Location": "https://some.endpoint.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1?api-version=2022-07-01&kv-operation=abJjb2RkIjoiAGVsZXRlTWFuYWdlZEhzbUFzeW5jYm9"
12+
}
13+
}
1014
}
1115
}

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/examples/ManagedHsm_CreateOrUpdate.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
},
2828
"responses": {
2929
"202": {
30+
"headers": {
31+
"Location": "https://some.endpoint.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1?api-version=2022-07-01&kv-operation=abJjb2RkIjoiAGVsZXRlTWFuYWdlZEhzbUFzeW5jYm9"
32+
},
3033
"body": {
3134
"properties": {
3235
"tenantId": "00000000-0000-0000-0000-000000000000",

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/examples/ManagedHsm_Delete.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
},
88
"responses": {
99
"200": {},
10-
"202": {},
10+
"202": {
11+
"headers": {
12+
"Location": "https://some.endpoint.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1?api-version=2022-07-01&kv-operation=abJjb2RkIjoiAGVsZXRlTWFuYWdlZEhzbUFzeW5jYm9"
13+
}
14+
},
1115
"204": {}
1216
}
1317
}

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/examples/ManagedHsm_Get.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@
3434
}
3535
}
3636
},
37-
"202": {
38-
"headers": {
39-
"Retry-After": "60",
40-
"Location": "https://some.endpoint.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1?api-version=2022-07-01&kv-operation=abJjb2RkIjoiAGVsZXRlTWFuYWdlZEhzbUFzeW5jYm9"
41-
}
42-
},
4337
"204": {}
4438
}
4539
}

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/examples/ManagedHsm_Update.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
}
4444
},
4545
"202": {
46+
"headers": {
47+
"Location": "https://some.endpoint.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/hsm-group/providers/Microsoft.KeyVault/managedHSMs/hsm1?api-version=2022-07-01&kv-operation=abJjb2RkIjoiAGVsZXRlTWFuYWdlZEhzbUFzeW5jYm9"
48+
},
4649
"body": {
4750
"properties": {
4851
"tenantId": "00000000-0000-0000-0000-000000000000",

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/examples/ManagedHsm_deletePrivateEndpointConnection.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
},
2020
"202": {
2121
"headers": {
22-
"Retry-After": "60",
2322
"Location": "https://some.endpoint.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/managedhsms/sample-mhsm/privateEndpointConnections/sample-pec?operationid=25334578"
2423
}
2524
},

specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-07-01/managedHsm.json

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
"responses": {
7373
"202": {
7474
"description": "Accepted and the operation will complete asynchronously.",
75+
"headers": {
76+
"Location": {
77+
"description": "The URI to poll for completion status.",
78+
"type": "string"
79+
}
80+
},
7581
"schema": {
7682
"$ref": "#/definitions/ManagedHsm"
7783
}
@@ -132,6 +138,12 @@
132138
"responses": {
133139
"202": {
134140
"description": "Accepted and the operation will complete asynchronously.",
141+
"headers": {
142+
"Location": {
143+
"description": "The URI to poll for completion status.",
144+
"type": "string"
145+
}
146+
},
135147
"schema": {
136148
"$ref": "#/definitions/ManagedHsm"
137149
}
@@ -160,6 +172,7 @@
160172
"ManagedHsms"
161173
],
162174
"operationId": "ManagedHsms_Delete",
175+
"x-ms-long-running-operation": true,
163176
"description": "Deletes the specified managed HSM Pool.",
164177
"parameters": [
165178
{
@@ -184,7 +197,13 @@
184197
"description": "Request successful. Resource does not exist."
185198
},
186199
"202": {
187-
"description": "Accepted and the operation will complete asynchronously."
200+
"description": "Accepted and the operation will complete asynchronously.",
201+
"headers": {
202+
"Location": {
203+
"description": "The URI to poll for completion status.",
204+
"type": "string"
205+
}
206+
}
188207
},
189208
"200": {
190209
"description": "Delete successful."
@@ -200,8 +219,7 @@
200219
"Delete a managed HSM Pool": {
201220
"$ref": "./examples/ManagedHsm_Delete.json"
202221
}
203-
},
204-
"x-ms-long-running-operation": true
222+
}
205223
},
206224
"get": {
207225
"tags": [
@@ -234,9 +252,6 @@
234252
"$ref": "#/definitions/ManagedHsm"
235253
}
236254
},
237-
"202": {
238-
"description": "Accepted and the operation will complete asynchronously."
239-
},
240255
"204": {
241256
"description": "Request successful. Resource does not exist."
242257
},
@@ -493,6 +508,7 @@
493508
"ManagedHsms"
494509
],
495510
"operationId": "ManagedHsms_PurgeDeleted",
511+
"x-ms-long-running-operation": true,
496512
"description": "Permanently deletes the specified managed HSM.",
497513
"parameters": [
498514
{
@@ -518,7 +534,13 @@
518534
],
519535
"responses": {
520536
"202": {
521-
"description": "Accepted and the operation will complete asynchronously."
537+
"description": "Accepted and the operation will complete asynchronously.",
538+
"headers": {
539+
"Location": {
540+
"description": "The URI to poll for completion status.",
541+
"type": "string"
542+
}
543+
}
522544
},
523545
"default": {
524546
"description": "The error response describing why the operation failed.",
@@ -531,8 +553,7 @@
531553
"Purge a managed HSM Pool": {
532554
"$ref": "./examples/DeletedManagedHsm_Purge.json"
533555
}
534-
},
535-
"x-ms-long-running-operation": true
556+
}
536557
}
537558
},
538559
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}": {
@@ -664,6 +685,7 @@
664685
"MHSMPrivateEndpointConnections"
665686
],
666687
"operationId": "MHSMPrivateEndpointConnections_Delete",
688+
"x-ms-long-running-operation": true,
667689
"description": "Deletes the specified private endpoint connection associated with the managed hsm pool.",
668690
"x-ms-examples": {
669691
"ManagedHsmDeletePrivateEndpointConnection": {
@@ -704,11 +726,6 @@
704726
"202": {
705727
"description": "The private endpoint connection is being deleted.",
706728
"headers": {
707-
"Retry-After": {
708-
"description": "The recommended number of seconds to wait before calling the URI specified in the location header.",
709-
"type": "integer",
710-
"format": "int32"
711-
},
712729
"Location": {
713730
"description": "The URI to poll for completion status.",
714731
"type": "string"
@@ -724,8 +741,7 @@
724741
"$ref": "common.json#/definitions/CloudError"
725742
}
726743
}
727-
},
728-
"x-ms-long-running-operation": true
744+
}
729745
}
730746
},
731747
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateLinkResources": {

0 commit comments

Comments
 (0)