Skip to content

Commit 3b9baa8

Browse files
TracyYaoYaoyaoshi
authored andcommitted
[CDN][2023-05-01] Fix async operation options for migrate related APIs (Azure#24164)
Co-authored-by: yaoshi <yaoshi@microsoft.com>
1 parent 8041857 commit 3b9baa8

File tree

3 files changed

+65
-25
lines changed

3 files changed

+65
-25
lines changed

specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/cdn.json

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@
469469
},
470470
"x-ms-long-running-operation": true,
471471
"x-ms-long-running-operation-options": {
472-
"final-state-via": "azure-async-operation"
472+
"final-state-via": "location"
473473
}
474474
}
475475
},
@@ -2880,6 +2880,26 @@
28802880
"CanMigrateResult": {
28812881
"type": "object",
28822882
"description": "Result for canMigrate operation.",
2883+
"properties": {
2884+
"id": {
2885+
"description": "Resource ID.",
2886+
"readOnly": true,
2887+
"type": "string"
2888+
},
2889+
"type": {
2890+
"description": "Resource type.",
2891+
"readOnly": true,
2892+
"type": "string"
2893+
},
2894+
"properties": {
2895+
"x-ms-client-flatten": true,
2896+
"$ref": "#/definitions/CanMigrateProperties"
2897+
}
2898+
},
2899+
"x-ms-azure-resource": true
2900+
},
2901+
"CanMigrateProperties": {
2902+
"type": "object",
28832903
"properties": {
28842904
"canMigrate": {
28852905
"readOnly": true,
@@ -2907,8 +2927,7 @@
29072927
"type": "array",
29082928
"x-ms-identifiers": []
29092929
}
2910-
},
2911-
"x-ms-azure-resource": true
2930+
}
29122931
},
29132932
"MigrationErrorType": {
29142933
"description": "Error response indicates CDN service is not able to process the incoming request. The reason is provided in the error message.",
@@ -3001,22 +3020,33 @@
30013020
"type": "object",
30023021
"description": "Result for migrate operation.",
30033022
"properties": {
3004-
"migratedProfileResourceId": {
3023+
"id": {
3024+
"description": "Resource ID.",
30053025
"readOnly": true,
3006-
"description": "Arm resource id of the migrated profile",
3007-
"$ref": "#/definitions/ResourceReference"
3026+
"type": "string"
30083027
},
3009-
"errors": {
3010-
"items": {
3011-
"description": "List of migration errors",
3012-
"$ref": "#/definitions/MigrationErrorType"
3013-
},
3014-
"type": "array",
3015-
"x-ms-identifiers": []
3028+
"type": {
3029+
"description": "Resource type.",
3030+
"readOnly": true,
3031+
"type": "string"
3032+
},
3033+
"properties": {
3034+
"x-ms-client-flatten": true,
3035+
"$ref": "#/definitions/MigrateResultProperties"
30163036
}
30173037
},
30183038
"x-ms-azure-resource": true
30193039
},
3040+
"MigrateResultProperties": {
3041+
"type": "object",
3042+
"properties": {
3043+
"migratedProfileResourceId": {
3044+
"readOnly": true,
3045+
"description": "Arm resource id of the migrated profile",
3046+
"$ref": "#/definitions/ResourceReference"
3047+
}
3048+
}
3049+
},
30203050
"SsoUri": {
30213051
"description": "The URI required to login to the supplemental portal from the Azure portal.",
30223052
"type": "object",

specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_CanMigrate.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313
"responses": {
1414
"200": {
1515
"body": {
16-
"canMigrate": true,
17-
"defaultSku": "Standard_AzureFrontDoor",
18-
"errors": null
16+
"id": "/subscriptions/subid/resourcegroups/yaoshitest/providers/Microsoft.Cdn/operationresults/operationid/profileresults/DummyProfile/canmigrateresults/DummyProfile",
17+
"type": "Microsoft.Cdn/canmigrate",
18+
"properties": {
19+
"canMigrate": true,
20+
"defaultSku": "Standard_AzureFrontDoor",
21+
"errors": null
22+
}
1923
}
2024
},
2125
"202": {
2226
"headers": {
23-
"azure-asyncoperation": "https://management.azure.com/subscriptions/subid/resourcegroups/resourceGroupName/providers/Microsoft.Cdn/operationresults/operationId?api-version=2022-05-01-preview"
27+
"azure-asyncoperation": "https://management.azure.com/subscriptions/subid/resourcegroups/resourceGroupName/providers/Microsoft.Cdn/operationresults/operationId?api-version=2023-05-01"
2428
}
2529
}
2630
}

specification/cdn/resource-manager/Microsoft.Cdn/stable/2023-05-01/examples/Profiles_Migrate.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,27 @@
1616
"responses": {
1717
"200": {
1818
"body": {
19-
"migratedProfileResourceId": {
20-
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"
21-
},
22-
"errors": null
19+
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/operationresults/operationid/profileresults/profile1/migrateresults/profile1",
20+
"type": "Microsoft.Cdn/migrate",
21+
"properties": {
22+
"migratedProfileResourceId": {
23+
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"
24+
}
25+
}
2326
}
2427
},
2528
"202": {
2629
"headers": {
2730
"azure-asyncoperation": "https://management.azure.com/subscriptions/subid/resourcegroups/resourceGroupName/providers/Microsoft.Cdn/operationresults/operationId?api-version=2023-05-01"
2831
},
2932
"body": {
30-
"migratedProfileResourceId": {
31-
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"
32-
},
33-
"errors": null
33+
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/operationresults/operationid/profileresults/profile1/migrateresults/profile1",
34+
"type": "Microsoft.Cdn/migrate",
35+
"properties": {
36+
"migratedProfileResourceId": {
37+
"id": "/subscriptions/subid/resourcegroups/RG/providers/Microsoft.Cdn/profiles/profile1"
38+
}
39+
}
3440
}
3541
}
3642
}

0 commit comments

Comments
 (0)