From 76f4cee693de8686fb31f0e3f4c402c352ace10a Mon Sep 17 00:00:00 2001 From: Antoine Gosselin Date: Mon, 10 Feb 2020 13:23:17 -0800 Subject: [PATCH 1/4] Use common types. Fix definitions for proper .NET SDK generation. --- .../2015-08-31-preview/ManagedIdentity.json | 47 +++---------- .../stable/2018-11-30/ManagedIdentity.json | 70 ++++--------------- 2 files changed, 23 insertions(+), 94 deletions(-) diff --git a/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json b/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json index 722c03ad7349..b51e07e16e42 100644 --- a/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json +++ b/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json @@ -351,28 +351,12 @@ } }, "definitions": { - "Resource": { + "Identity": { "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "The id of the resource." - }, - "name": { - "type": "string", - "readOnly": true, - "description": "The name of the resource." - }, "location": { "type": "string", "description": "The Azure region where the resource lives." - } - }, - "x-ms-azure-resource": true, - "description": "Describes common properties of a resource." - }, - "Identity": { - "properties": { + }, "tags": { "type": "object", "additionalProperties": { @@ -385,18 +369,6 @@ "readOnly": true, "description": "The properties associated with the identity.", "$ref": "#/definitions/IdentityProperties" - }, - "type": { - "type": "string", - "readOnly": true, - "enum": [ - "Microsoft.ManagedIdentity/userAssignedIdentities" - ], - "x-ms-enum": { - "name": "UserAssignedIdentities", - "modelAsString": true - }, - "description": "The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities" } }, "required": [ @@ -404,24 +376,22 @@ ], "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" } ], - "x-ms-azure-resource": true, "description": "Describes an identity resource." }, "SystemAssignedIdentity": { "properties": { + "location": { + "type": "string", + "description": "The Azure region where the resource lives." + }, "properties": { "x-ms-client-flatten": true, "readOnly": true, "description": "The properties associated with the identity.", "$ref": "#/definitions/IdentityProperties" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "The type of resource i.e. Microsoft.Compute/virtualMachineScaleSets" } }, "required": [ @@ -429,10 +399,9 @@ ], "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" } ], - "x-ms-azure-resource": true, "description": "Describes a system assigned identity resource." }, "IdentityProperties": { diff --git a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json index 1b7501907af1..d63b972a49fd 100644 --- a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json +++ b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json @@ -254,7 +254,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/IdentityPatch" + "$ref": "#/definitions/IdentityUpdate" }, "description": "Parameters to update the identity" } @@ -351,28 +351,12 @@ } }, "definitions": { - "Resource": { + "Identity": { "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "The id of the resource." - }, - "name": { - "type": "string", - "readOnly": true, - "description": "The name of the resource." - }, "location": { "type": "string", "description": "The Azure region where the resource lives." - } - }, - "x-ms-azure-resource": true, - "description": "Describes common properties of a resource." - }, - "Identity": { - "properties": { + }, "tags": { "type": "object", "additionalProperties": { @@ -385,18 +369,6 @@ "readOnly": true, "description": "The properties associated with the identity.", "$ref": "#/definitions/UserAssignedIdentityProperties" - }, - "type": { - "type": "string", - "readOnly": true, - "enum": [ - "Microsoft.ManagedIdentity/userAssignedIdentities" - ], - "x-ms-enum": { - "name": "UserAssignedIdentities", - "modelAsString": true - }, - "description": "The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities" } }, "required": [ @@ -404,14 +376,17 @@ ], "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" } ], - "x-ms-azure-resource": true, "description": "Describes an identity resource." }, - "IdentityPatch": { + "IdentityUpdate": { "properties": { + "location": { + "type": "string", + "description": "The Azure region where the resource lives." + }, "tags": { "type": "object", "additionalProperties": { @@ -424,40 +399,26 @@ "readOnly": true, "description": "The properties associated with the identity.", "$ref": "#/definitions/UserAssignedIdentityProperties" - }, - "type": { - "type": "string", - "readOnly": true, - "enum": [ - "Microsoft.ManagedIdentity/userAssignedIdentities" - ], - "x-ms-enum": { - "name": "UserAssignedIdentities", - "modelAsString": true - }, - "description": "The type of resource i.e. Microsoft.ManagedIdentity/userAssignedIdentities" } }, "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" } ], - "x-ms-azure-resource": true, "description": "Describes an identity resource." }, "SystemAssignedIdentity": { "properties": { + "location": { + "type": "string", + "description": "The Azure region where the resource lives." + }, "properties": { "x-ms-client-flatten": true, "readOnly": true, "description": "The properties associated with the identity.", "$ref": "#/definitions/SystemAssignedIdentityProperties" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "The type of resource i.e. Microsoft.Compute/virtualMachineScaleSets" } }, "required": [ @@ -465,10 +426,9 @@ ], "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" } ], - "x-ms-azure-resource": true, "description": "Describes a system assigned identity resource." }, "SystemAssignedIdentityProperties": { From f7e347d66c158c90b8405f31d63162ec589bf453 Mon Sep 17 00:00:00 2001 From: Antoine Gosselin Date: Thu, 20 Feb 2020 11:16:55 -0800 Subject: [PATCH 2/4] Use tracked and proxy resource types --- .../2015-08-31-preview/ManagedIdentity.json | 36 +++++++------- .../stable/2018-11-30/ManagedIdentity.json | 47 ++++++++++++------- 2 files changed, 48 insertions(+), 35 deletions(-) diff --git a/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json b/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json index b51e07e16e42..0c5cbed37da1 100644 --- a/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json +++ b/specification/msi/resource-manager/Microsoft.ManagedIdentity/preview/2015-08-31-preview/ManagedIdentity.json @@ -353,17 +353,6 @@ "definitions": { "Identity": { "properties": { - "location": { - "type": "string", - "description": "The Azure region where the resource lives." - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - }, "properties": { "x-ms-client-flatten": true, "readOnly": true, @@ -371,12 +360,9 @@ "$ref": "#/definitions/IdentityProperties" } }, - "required": [ - "location" - ], "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource" } ], "description": "Describes an identity resource." @@ -385,7 +371,23 @@ "properties": { "location": { "type": "string", - "description": "The Azure region where the resource lives." + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags" }, "properties": { "x-ms-client-flatten": true, @@ -399,7 +401,7 @@ ], "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" } ], "description": "Describes a system assigned identity resource." diff --git a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json index d63b972a49fd..16695c387b30 100644 --- a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json +++ b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json @@ -353,17 +353,6 @@ "definitions": { "Identity": { "properties": { - "location": { - "type": "string", - "description": "The Azure region where the resource lives." - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - }, "properties": { "x-ms-client-flatten": true, "readOnly": true, @@ -371,12 +360,9 @@ "$ref": "#/definitions/UserAssignedIdentityProperties" } }, - "required": [ - "location" - ], "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource" } ], "description": "Describes an identity resource." @@ -385,13 +371,22 @@ "properties": { "location": { "type": "string", - "description": "The Azure region where the resource lives." + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" }, "tags": { "type": "object", "additionalProperties": { "type": "string" }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], "description": "Resource tags" }, "properties": { @@ -412,7 +407,23 @@ "properties": { "location": { "type": "string", - "description": "The Azure region where the resource lives." + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags" }, "properties": { "x-ms-client-flatten": true, @@ -426,7 +437,7 @@ ], "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" } ], "description": "Describes a system assigned identity resource." From 2d1e54a77c5a4a8da8d548b18e9dcb0fd542b02c Mon Sep 17 00:00:00 2001 From: Antoine Gosselin Date: Mon, 24 Feb 2020 13:47:23 -0800 Subject: [PATCH 3/4] Revert reference of IdentityPatch to Identity resource --- .../stable/2018-11-30/ManagedIdentity.json | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json index 16695c387b30..9b3dbd4c8bb6 100644 --- a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json +++ b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json @@ -254,7 +254,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/IdentityUpdate" + "$ref": "#/definitions/Identity" }, "description": "Parameters to update the identity" } @@ -367,42 +367,6 @@ ], "description": "Describes an identity resource." }, - "IdentityUpdate": { - "properties": { - "location": { - "type": "string", - "x-ms-mutability": [ - "read", - "create" - ], - "description": "The geo-location where the resource lives" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-ms-mutability": [ - "read", - "create", - "update" - ], - "description": "Resource tags" - }, - "properties": { - "x-ms-client-flatten": true, - "readOnly": true, - "description": "The properties associated with the identity.", - "$ref": "#/definitions/UserAssignedIdentityProperties" - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" - } - ], - "description": "Describes an identity resource." - }, "SystemAssignedIdentity": { "properties": { "location": { From 7982d4edc92142d0605df0ae697bb61a46e06b70 Mon Sep 17 00:00:00 2001 From: Antoine Gosselin Date: Mon, 24 Feb 2020 15:37:33 -0800 Subject: [PATCH 4/4] Revert the previous revert --- .../stable/2018-11-30/ManagedIdentity.json | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json index 9b3dbd4c8bb6..16695c387b30 100644 --- a/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json +++ b/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json @@ -254,7 +254,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Identity" + "$ref": "#/definitions/IdentityUpdate" }, "description": "Parameters to update the identity" } @@ -367,6 +367,42 @@ ], "description": "Describes an identity resource." }, + "IdentityUpdate": { + "properties": { + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "readOnly": true, + "description": "The properties associated with the identity.", + "$ref": "#/definitions/UserAssignedIdentityProperties" + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/Resource" + } + ], + "description": "Describes an identity resource." + }, "SystemAssignedIdentity": { "properties": { "location": {