From 3ca81d42688c99375e5f194e9c161634b1698ffe Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Fri, 7 Aug 2020 16:35:13 +0800 Subject: [PATCH 1/3] Fix discriminator and add the sub-types --- .../stable/2019-11-01/storagecache.json | 165 +++++++++++------- 1 file changed, 105 insertions(+), 60 deletions(-) diff --git a/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json b/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json index 65ee658ffea2..6ce9d2d9c7b6 100644 --- a/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json +++ b/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json @@ -1432,8 +1432,23 @@ } }, "StorageTarget": { - "description": "A storage system being cached by a Cache.", "type": "object", + "description": "Type of the Storage Target.", + "allOf": [ + { + "$ref": "#/definitions/StorageTargetResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "StorageTarget properties", + "$ref": "#/definitions/StorageTargetProperties" + } + } + }, + "StorageTargetResource": { + "description": "Resource used by a Cache.", "properties": { "name": { "description": "Name of the Storage Target.", @@ -1449,69 +1464,99 @@ "description": "Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget", "readOnly": true, "type": "string" - }, - "properties": { - "x-ms-client-flatten": true, - "description": "Properties of the Storage Target.", - "type": "object", - "discriminator": "targetType", - "required": [ - "targetType" - ], - "properties": { - "junctions": { - "description": "List of Cache namespace junctions to target for namespace associations.", - "type": "array", - "items": { - "$ref": "#/definitions/NamespaceJunction" - } - }, - "targetType": { - "description": "Type of the Storage Target.", - "enum": [ - "nfs3", - "clfs", - "unknown" - ], - "x-ms-enum": { - "name": "StorageTargetType", - "modelAsString": true - }, - "type": "string" - }, - "provisioningState": { - "description": "ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property", - "enum": [ - "Succeeded", - "Failed", - "Cancelled", - "Creating", - "Deleting", - "Updating" - ], - "x-ms-enum": { - "name": "ProvisioningStateType", - "modelAsString": true - }, - "type": "string" - }, - "nfs3": { - "description": "Properties when targetType is nfs3.", - "$ref": "#/definitions/Nfs3Target" - }, - "clfs": { - "description": "Properties when targetType is clfs.", - "$ref": "#/definitions/ClfsTarget" - }, - "unknown": { - "description": "Properties when targetType is unknown.", - "$ref": "#/definitions/UnknownTarget" - } - } } }, "x-ms-azure-resource": true }, + "StorageTargetProperties": { + "x-ms-client-flatten": true, + "type": "object", + "description": "Properties of the Storage Target.", + "discriminator": "targetType", + "required": [ + "targetType" + ], + "properties": { + "junctions": { + "description": "List of Cache namespace junctions to target for namespace associations.", + "type": "array", + "items": { + "$ref": "#/definitions/NamespaceJunction" + } + }, + "targetType": { + "description": "Type of the Storage Target.", + "enum": [ + "nfs3", + "clfs", + "unknown" + ], + "x-ms-enum": { + "name": "StorageTargetType", + "modelAsString": true + }, + "type": "string" + }, + "provisioningState": { + "description": "ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property", + "enum": [ + "Succeeded", + "Failed", + "Cancelled", + "Creating", + "Deleting", + "Updating" + ], + "x-ms-enum": { + "name": "ProvisioningStateType", + "modelAsString": true + }, + "type": "string" + }, + "nfs3": { + "description": "Properties when targetType is nfs3.", + "$ref": "#/definitions/Nfs3Target" + }, + "clfs": { + "description": "Properties when targetType is clfs.", + "$ref": "#/definitions/ClfsTarget" + }, + "unknown": { + "description": "Properties when targetType is unknown.", + "$ref": "#/definitions/UnknownTarget" + } + } + }, + "Nfs3TargetProperties": { + "description": "An NFSv3 mount point for use as a Storage Target.", + "type": "object", + "x-ms-discriminator-value": "nfs3", + "allOf": [ + { + "$ref": "#/definitions/StorageTargetProperties" + } + ] + }, + "ClfsTargetProperties": { + "description": "Storage container for use as a CLFS Storage Target.", + "type": "object", + "x-ms-discriminator-value": "clfs", + "allOf": [ + { + "$ref": "#/definitions/StorageTargetProperties" + } + ] + }, + "UnknownTargetProperties": { + "description": "Storage container for use as an Unknown Storage Target.", + "type": "object", + "x-ms-discriminator-value": "unknown", + "allOf": [ + { + "$ref": "#/definitions/StorageTargetProperties" + } + ] + }, "NamespaceJunction": { "description": "A namespace junction.", "type": "object", From 88f16658dfa378660c4641d25d6f5ebf4e05d862 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Fri, 7 Aug 2020 16:51:00 +0800 Subject: [PATCH 2/3] Revert the changes on description --- .../stable/2019-11-01/storagecache.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json b/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json index 6ce9d2d9c7b6..b96c937b43a0 100644 --- a/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json +++ b/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json @@ -1432,8 +1432,8 @@ } }, "StorageTarget": { + "description": "A storage system being cached by a Cache.", "type": "object", - "description": "Type of the Storage Target.", "allOf": [ { "$ref": "#/definitions/StorageTargetResource" @@ -1654,4 +1654,4 @@ "description": "Client API version." } } -} +} \ No newline at end of file From c1d3172d711c2e1e4249c595e9c287591b9ded16 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Fri, 7 Aug 2020 19:51:25 +0800 Subject: [PATCH 3/3] Fix prettier --- .../Microsoft.StorageCache/stable/2019-11-01/storagecache.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json b/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json index b96c937b43a0..0b200e96f54a 100644 --- a/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json +++ b/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2019-11-01/storagecache.json @@ -1654,4 +1654,4 @@ "description": "Client API version." } } -} \ No newline at end of file +}