From 026cb504951b2723d33a0e5b895156f8a4d51e9a Mon Sep 17 00:00:00 2001 From: Jiacheng Liu Date: Fri, 26 Mar 2021 01:02:53 -0700 Subject: [PATCH 1/4] Add SystemData --- .../examples/createVault.json | 16 ++++++ .../examples/createVaultWithNetworkAcls.json | 16 ++++++ .../2021-04-01-preview/examples/getVault.json | 8 +++ .../examples/listVaultByResourceGroup.json | 8 +++ .../examples/listVaultBySubscription.json | 8 +++ .../examples/updateVault.json | 16 ++++++ .../preview/2021-04-01-preview/keyvault.json | 51 +++++++++++++++++++ 7 files changed, 123 insertions(+) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVault.json index a617601b509a..45db7c427752 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVault.json @@ -78,6 +78,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", @@ -151,6 +159,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVaultWithNetworkAcls.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVaultWithNetworkAcls.json index 94a0c81e20c3..1731eb6745c1 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVaultWithNetworkAcls.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createVaultWithNetworkAcls.json @@ -43,6 +43,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", @@ -80,6 +88,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getVault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getVault.json index 067484abf881..6bf7d8e8bd99 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getVault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getVault.json @@ -13,6 +13,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultByResourceGroup.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultByResourceGroup.json index 2f4fbc1871aa..bef73365e25e 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultByResourceGroup.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultByResourceGroup.json @@ -15,6 +15,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultBySubscription.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultBySubscription.json index b3c30c448e8a..1a50419d3d8e 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultBySubscription.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listVaultBySubscription.json @@ -14,6 +14,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/updateVault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/updateVault.json index fecc408f6e11..6bf150e3657b 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/updateVault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/updateVault.json @@ -77,6 +77,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", @@ -150,6 +158,14 @@ "type": "Microsoft.KeyVault/vaults", "location": "westus", "tags": {}, + "systemData": { + "createdBy": "keyVaultUser1", + "createdByType": "User", + "createdAt": "2020-01-01T12:00:00.0000000Z", + "lastModifiedBy": "keyVaultUser2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-01T12:00:00.0000000Z" + }, "properties": { "sku": { "family": "A", diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json index 68740d0cb80b..d845e24933ad 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json @@ -1532,6 +1532,10 @@ }, "description": "Tags assigned to the key vault resource." }, + "systemData": { + "description": "System metadata for the key vault.", + "$ref": "#/definitions/SystemData" + }, "properties": { "$ref": "#/definitions/VaultProperties", "description": "Properties of the vault" @@ -1931,6 +1935,53 @@ } }, "description": "Properties of a private link resource." + }, + "SystemData": { + "description": "Metadata pertaining to creation and last modification of key vault resource.", + "type": "object", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created key vault resource." + }, + "createdByType": { + "description": "The type of identity that created key vault resource.", + "$ref": "#/definitions/IdentityType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of key vault resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified key vault resource." + }, + "lastModifiedByType": { + "description": "The type of identity that last modified key vault resource.", + "$ref": "#/definitions/IdentityType" + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of key vault resource last modification (UTC)." + } + } + }, + "IdentityType": { + "type": "string", + "description": "The type of identity.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "identityType", + "modelAsString": true + } } }, "parameters": { From c178e6b59a6cb25ee20072711a594fb4a75467ad Mon Sep 17 00:00:00 2001 From: Jiacheng Liu Date: Mon, 29 Mar 2021 21:05:13 -0700 Subject: [PATCH 2/4] Try to use the common type for SystemData --- .../preview/2021-04-01-preview/keyvault.json | 50 +------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json index d845e24933ad..3ee414b68f69 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json @@ -1533,8 +1533,7 @@ "description": "Tags assigned to the key vault resource." }, "systemData": { - "description": "System metadata for the key vault.", - "$ref": "#/definitions/SystemData" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" }, "properties": { "$ref": "#/definitions/VaultProperties", @@ -1935,53 +1934,6 @@ } }, "description": "Properties of a private link resource." - }, - "SystemData": { - "description": "Metadata pertaining to creation and last modification of key vault resource.", - "type": "object", - "readOnly": true, - "properties": { - "createdBy": { - "type": "string", - "description": "The identity that created key vault resource." - }, - "createdByType": { - "description": "The type of identity that created key vault resource.", - "$ref": "#/definitions/IdentityType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "description": "The timestamp of key vault resource creation (UTC)." - }, - "lastModifiedBy": { - "type": "string", - "description": "The identity that last modified key vault resource." - }, - "lastModifiedByType": { - "description": "The type of identity that last modified key vault resource.", - "$ref": "#/definitions/IdentityType" - }, - "lastModifiedAt": { - "type": "string", - "format": "date-time", - "description": "The timestamp of key vault resource last modification (UTC)." - } - } - }, - "IdentityType": { - "type": "string", - "description": "The type of identity.", - "enum": [ - "User", - "Application", - "ManagedIdentity", - "Key" - ], - "x-ms-enum": { - "name": "identityType", - "modelAsString": true - } } }, "parameters": { From 635fa2d8c8d7516aa17c2633d042d4f67eb4c733 Mon Sep 17 00:00:00 2001 From: Jiacheng Liu Date: Mon, 29 Mar 2021 23:21:37 -0700 Subject: [PATCH 3/4] Revert "Try to use the common type for SystemData" This reverts commit c178e6b59a6cb25ee20072711a594fb4a75467ad. --- .../preview/2021-04-01-preview/keyvault.json | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json index 3ee414b68f69..d845e24933ad 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json @@ -1533,7 +1533,8 @@ "description": "Tags assigned to the key vault resource." }, "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" + "description": "System metadata for the key vault.", + "$ref": "#/definitions/SystemData" }, "properties": { "$ref": "#/definitions/VaultProperties", @@ -1934,6 +1935,53 @@ } }, "description": "Properties of a private link resource." + }, + "SystemData": { + "description": "Metadata pertaining to creation and last modification of key vault resource.", + "type": "object", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created key vault resource." + }, + "createdByType": { + "description": "The type of identity that created key vault resource.", + "$ref": "#/definitions/IdentityType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of key vault resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified key vault resource." + }, + "lastModifiedByType": { + "description": "The type of identity that last modified key vault resource.", + "$ref": "#/definitions/IdentityType" + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of key vault resource last modification (UTC)." + } + } + }, + "IdentityType": { + "type": "string", + "description": "The type of identity.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "identityType", + "modelAsString": true + } } }, "parameters": { From 0abee98428e6af22fc049f7523880b3aa65816e7 Mon Sep 17 00:00:00 2001 From: Jiacheng Liu Date: Mon, 29 Mar 2021 23:28:49 -0700 Subject: [PATCH 4/4] Move systemData to common json file --- .../preview/2021-04-01-preview/common.json | 46 +++++++++++++++++ .../preview/2021-04-01-preview/keyvault.json | 49 +------------------ .../2021-04-01-preview/managedHsm.json | 2 +- 3 files changed, 48 insertions(+), 49 deletions(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/common.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/common.json index df391f013240..49b1026fce06 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/common.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/common.json @@ -29,6 +29,52 @@ } }, "x-ms-external": true + }, + "SystemData": { + "description": "Metadata pertaining to creation and last modification of the key vault resource.", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created the key vault resource." + }, + "createdByType": { + "description": "The type of identity that created the key vault resource.", + "$ref": "#/definitions/IdentityType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the key vault resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the key vault resource." + }, + "lastModifiedByType": { + "description": "The type of identity that last modified the key vault resource.", + "$ref": "#/definitions/IdentityType" + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the key vault resource last modification (UTC)." + } + } + }, + "IdentityType": { + "type": "string", + "description": "The type of identity.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "identityType", + "modelAsString": true + } } } } diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json index d845e24933ad..6208d83b20f8 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json @@ -1534,7 +1534,7 @@ }, "systemData": { "description": "System metadata for the key vault.", - "$ref": "#/definitions/SystemData" + "$ref": "common.json#/definitions/SystemData" }, "properties": { "$ref": "#/definitions/VaultProperties", @@ -1935,53 +1935,6 @@ } }, "description": "Properties of a private link resource." - }, - "SystemData": { - "description": "Metadata pertaining to creation and last modification of key vault resource.", - "type": "object", - "readOnly": true, - "properties": { - "createdBy": { - "type": "string", - "description": "The identity that created key vault resource." - }, - "createdByType": { - "description": "The type of identity that created key vault resource.", - "$ref": "#/definitions/IdentityType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "description": "The timestamp of key vault resource creation (UTC)." - }, - "lastModifiedBy": { - "type": "string", - "description": "The identity that last modified key vault resource." - }, - "lastModifiedByType": { - "description": "The type of identity that last modified key vault resource.", - "$ref": "#/definitions/IdentityType" - }, - "lastModifiedAt": { - "type": "string", - "format": "date-time", - "description": "The timestamp of key vault resource last modification (UTC)." - } - } - }, - "IdentityType": { - "type": "string", - "description": "The type of identity.", - "enum": [ - "User", - "Application", - "ManagedIdentity", - "Key" - ], - "x-ms-enum": { - "name": "identityType", - "modelAsString": true - } } }, "parameters": { diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/managedHsm.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/managedHsm.json index 10c84594d258..71e5594d45ef 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/managedHsm.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/managedHsm.json @@ -962,7 +962,7 @@ "description": "Resource tags" }, "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" + "$ref": "common.json#/definitions/SystemData" } }, "description": "Managed HSM resource",