From dc78d42d4ccbe6f0028b346895a56c5961f50621 Mon Sep 17 00:00:00 2001 From: qinl-li <63257243+qinl-li@users.noreply.github.com> Date: Thu, 6 May 2021 18:39:52 -0700 Subject: [PATCH 1/6] Import keys.json with rotation policy parameters --- .../examples/createKey.json | 53 ++ .../2021-04-01-preview/examples/getKey.json | 48 ++ .../examples/getKeyVersion.json | 49 ++ .../examples/listKeyVersions.json | 58 ++ .../2021-04-01-preview/examples/listKeys.json | 55 ++ .../preview/2021-04-01-preview/keys.json | 681 ++++++++++++++++++ 6 files changed, 944 insertions(+) create mode 100644 specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json create mode 100644 specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json create mode 100644 specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json create mode 100644 specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json create mode 100644 specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json create mode 100644 specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json new file mode 100644 index 000000000000..cd5fc27c78f4 --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sample-group", + "vaultName": "sample-vault-name", + "keyName": "sample-key-name", + "api-version": "2019-09-01", + "parameters": { + "properties": { + "kty": "RSA" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name", + "name": "sample-key-name", + "type": "Microsoft.KeyVault/vaults/keys", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1598533051, + "updated": 1598533051, + "recoveryLevel": "Purgeable" + }, + "kty": "RSA", + "keyOps": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "keySize": 2048, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name", + "keyUriWithVersion": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc" + } + } + }, + "default": { + "headers": {}, + "body": { + "error": { + "code": "", + "message": "" + } + } + } + } +} diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json new file mode 100644 index 000000000000..5936a21e00c0 --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sample-group", + "vaultName": "sample-vault-name", + "keyName": "sample-key-name", + "api-version": "2019-09-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name", + "name": "sample-key-name", + "type": "Microsoft.KeyVault/vaults/keys", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1598533051, + "updated": 1598533051, + "recoveryLevel": "Purgeable" + }, + "kty": "RSA", + "keyOps": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "keySize": 2048, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name", + "keyUriWithVersion": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc" + } + } + }, + "default": { + "headers": {}, + "body": { + "error": { + "code": "", + "message": "" + } + } + } + } +} diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json new file mode 100644 index 000000000000..768c9f95ae3f --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sample-group", + "vaultName": "sample-vault-name", + "keyName": "sample-key-name", + "keyVersion": "fd618d9519b74f9aae94ade66b876acc", + "api-version": "2019-09-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/fd618d9519b74f9aae94ade66b876acc", + "name": "fd618d9519b74f9aae94ade66b876acc", + "type": "Microsoft.KeyVault/vaults/keys/versions", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1598533051, + "updated": 1598533051, + "recoveryLevel": "Purgeable" + }, + "kty": "RSA", + "keyOps": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "keySize": 2048, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name", + "keyUriWithVersion": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/fd618d9519b74f9aae94ade66b876acc" + } + } + }, + "default": { + "headers": {}, + "body": { + "error": { + "code": "", + "message": "" + } + } + } + } +} diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json new file mode 100644 index 000000000000..8dc7c32ffbcd --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json @@ -0,0 +1,58 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sample-group", + "vaultName": "sample-vault-name", + "keyName": "sample-key-name", + "api-version": "2019-09-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/c2296aa24acf4daf86942bff5aca73dd", + "name": "c2296aa24acf4daf86942bff5aca73dd", + "type": "Microsoft.KeyVault/vaults/keys/versions", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1598641074, + "updated": 1598641074, + "recoveryLevel": "Purgeable" + }, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name", + "keyUriWithVersion": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/c2296aa24acf4daf86942bff5aca73dd" + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name/versions/d5a04667b6f44b0ca62825f5eae93da6", + "name": "d5a04667b6f44b0ca62825f5eae93da6", + "type": "Microsoft.KeyVault/vaults/keys/versions", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1598641295, + "updated": 1598641295, + "recoveryLevel": "Purgeable" + }, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name", + "keyUriWithVersion": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name/d5a04667b6f44b0ca62825f5eae93da6" + } + } + ] + } + }, + "default": { + "headers": {}, + "body": { + "error": { + "code": "", + "message": "" + } + } + } + } +} diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json new file mode 100644 index 000000000000..b24f0dca2b9d --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "sample-group", + "vaultName": "sample-vault-name", + "api-version": "2019-09-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name-1", + "name": "sample-key-name-1", + "type": "Microsoft.KeyVault/vaults/keys", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1596493796, + "updated": 1596493796, + "recoveryLevel": "Purgeable" + }, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name-1" + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-group/providers/Microsoft.KeyVault/vaults/sample-vault-name/keys/sample-key-name-2", + "name": "sample-key-name-2", + "type": "Microsoft.KeyVault/vaults/keys", + "location": "westus", + "properties": { + "attributes": { + "enabled": true, + "created": 1596493797, + "updated": 1596493797, + "recoveryLevel": "Purgeable" + }, + "keyUri": "https://sample-vault-name.vault.azure.net:443/keys/sample-key-name-2" + } + } + ] + } + }, + "default": { + "headers": {}, + "body": { + "error": { + "code": "", + "message": "" + } + } + } + } +} diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json new file mode 100644 index 000000000000..7502e72f4134 --- /dev/null +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json @@ -0,0 +1,681 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-09-01", + "title": "KeyVaultManagementClient", + "description": "The Azure management API provides a RESTful set of web services that interact with Azure Key Vault." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}": { + "put": { + "tags": [ + "Keys" + ], + "operationId": "Keys_CreateIfNotExist", + "description": "Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group which contains the specified key vault." + }, + { + "name": "vaultName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "The name of the key vault which contains the key to be created." + }, + { + "name": "keyName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{1,127}$", + "description": "The name of the key to be created." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/KeyCreateParameters" + }, + "description": "The parameters used to create the specified key." + } + ], + "responses": { + "200": { + "description": "The created key.", + "schema": { + "$ref": "#/definitions/Key" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Create a key": { + "$ref": "./examples/createKey.json" + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + }, + "get": { + "tags": [ + "Keys" + ], + "operationId": "Keys_Get", + "description": "Gets the current version of the specified key from the specified key vault.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group which contains the specified key vault." + }, + { + "name": "vaultName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "The name of the vault which contains the key to be retrieved." + }, + { + "name": "keyName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{1,127}$", + "description": "The name of the key to be retrieved." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The retrieved key.", + "schema": { + "$ref": "#/definitions/Key" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Get a key": { + "$ref": "./examples/getKey.json" + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys": { + "get": { + "tags": [ + "Keys" + ], + "operationId": "Keys_List", + "description": "Lists the keys in the specified key vault.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group which contains the specified key vault." + }, + { + "name": "vaultName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "The name of the vault which contains the keys to be retrieved." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The retrieved page of keys.", + "schema": { + "$ref": "#/definitions/KeyListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "List keys in the vault": { + "$ref": "./examples/listKeys.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions/{keyVersion}": { + "get": { + "tags": [ + "Keys" + ], + "operationId": "Keys_GetVersion", + "description": "Gets the specified version of the specified key in the specified key vault.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group which contains the specified key vault." + }, + { + "name": "vaultName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "The name of the vault which contains the key version to be retrieved." + }, + { + "name": "keyName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{1,127}$", + "description": "The name of the key version to be retrieved." + }, + { + "name": "keyVersion", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-fA-F0-9]{32}$", + "description": "The version of the key to be retrieved." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The retrieved key version.", + "schema": { + "$ref": "#/definitions/Key" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Get a key version": { + "$ref": "./examples/getKeyVersion.json" + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions": { + "get": { + "tags": [ + "Keys" + ], + "operationId": "Keys_ListVersions", + "description": "Lists the versions of the specified key in the specified key vault.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group which contains the specified key vault." + }, + { + "name": "vaultName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "The name of the vault which contains the key versions to be retrieved." + }, + { + "name": "keyName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{1,127}$", + "description": "The name of the key versions to be retrieved." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The retrieved page of key versions.", + "schema": { + "$ref": "#/definitions/KeyListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "List key versions in the vault": { + "$ref": "./examples/listKeyVersions.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + } + }, + "definitions": { + "Attributes": { + "properties": { + "enabled": { + "type": "boolean", + "description": "Determines whether or not the object is enabled." + }, + "nbf": { + "x-ms-client-name": "NotBefore", + "type": "integer", + "format": "int64", + "description": "Not before date in seconds since 1970-01-01T00:00:00Z." + }, + "exp": { + "x-ms-client-name": "Expires", + "type": "integer", + "format": "int64", + "description": "Expiry date in seconds since 1970-01-01T00:00:00Z." + }, + "created": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Creation time in seconds since 1970-01-01T00:00:00Z." + }, + "updated": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Last updated time in seconds since 1970-01-01T00:00:00Z." + }, + "recoveryLevel": { + "type": "string", + "description": "The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.", + "enum": [ + "Purgeable", + "Recoverable+Purgeable", + "Recoverable", + "Recoverable+ProtectedSubscription" + ], + "x-ms-enum": { + "name": "DeletionRecoveryLevel", + "modelAsString": true + }, + "readOnly": true, + "x-nullable": false + } + }, + "description": "The object attributes managed by the Azure Key Vault service." + }, + "KeyProperties": { + "properties": { + "attributes": { + "$ref": "#/definitions/KeyAttributes", + "description": "The attributes of the key." + }, + "kty": { + "type": "string", + "minLength": 1, + "description": "The type of the key. For valid values, see JsonWebKeyType.", + "enum": [ + "EC", + "EC-HSM", + "RSA", + "RSA-HSM" + ], + "x-ms-enum": { + "name": "JsonWebKeyType", + "modelAsString": true + } + }, + "keyOps": { + "type": "array", + "items": { + "type": "string", + "description": "The permitted JSON web key operations of the key. For more information, see JsonWebKeyOperation.", + "enum": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey", + "import" + ], + "x-ms-enum": { + "name": "JsonWebKeyOperation", + "modelAsString": true + } + } + }, + "keySize": { + "type": "integer", + "format": "int32", + "description": "The key size in bits. For example: 2048, 3072, or 4096 for RSA." + }, + "curveName": { + "type": "string", + "description": "The elliptic curve name. For valid values, see JsonWebKeyCurveName.", + "enum": [ + "P-256", + "P-384", + "P-521", + "P-256K" + ], + "x-ms-enum": { + "name": "JsonWebKeyCurveName", + "modelAsString": true + } + }, + "keyUri": { + "type": "string", + "description": "The URI to retrieve the current version of the key.", + "readOnly": true + }, + "keyUriWithVersion": { + "type": "string", + "description": "The URI to retrieve the specific version of the key.", + "readOnly": true + }, + "rotationPolicyParameters": { + "$ref": "#/definitions/RotationPolicyParameters", + "required": false, + "description": "The parameters to set rotation policy for the key." + }, + "rotationPolicy":{ + "$ref": "#/definitions/RotationPolicy", + "description": "Key rotation policy in response. It will be omitted in input." + } + }, + "description": "The properties of the key." + }, + "KeyAttributes": { + "allOf": [ + { + "$ref": "#/definitions/Attributes" + } + ], + "description": "The attributes of the key." + }, + "KeyCreateParameters": { + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The tags that will be assigned to the key." + }, + "properties": { + "$ref": "#/definitions/KeyProperties", + "description": "The properties of the key to be created." + } + }, + "description": "The parameters used to create a key.", + "required": [ + "properties" + ], + "x-ms-azure-resource": true + }, + "Key": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/KeyProperties", + "description": "The properties of the key." + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "./keyvault.json#/definitions/Resource" + } + ], + "description": "The key resource." + }, + "KeyListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Key" + }, + "description": "The key resources." + }, + "nextLink": { + "type": "string", + "description": "The URL to get the next page of keys." + } + }, + "description": "The page of keys." + }, + "RotationPolicyParameters": { + "properties": { + "rotateTriggerType": { + "type": "string", + "description": "Key rotation trigger type", + "enum": [ + "timeAfterCreate", + "timeBeforeExpiry" + ] + }, + "rotateTriggerValue": { + "type": "string", + "description": "The time duration to trigger key autoroation. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" + }, + "notifyTriggerType": { + "type": "string", + "description": "Notification trigger type", + "enum": [ + "timeBeforeExpiry" + ] + }, + "notifyTriggerValue": { + "type": "string", + "description": "The time duration to trigger event. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" + }, + "expiryTime": { + "type": "string", + "description": "The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" + } + }, + "description": "The parameters only used for setting key rotation policy. It will be omitted in output." + }, + "RotationPolicy":{ + "properties": { + "attributes":{ + "$ref": "#/definitions/KeyRotationPolicyAttributes", + "description": "The attributes of key rotation policy." + }, + "lifetimeActions":{ + "type": "array", + "items": { + "$ref": "#/definitions/LifetimeAction" + }, + "description": "The lifetimeActions for key rotation action." + } + } + }, + "KeyRotationPolicyAttributes": { + "properties": { + "created": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Creation time in seconds since 1970-01-01T00:00:00Z." + }, + "updated": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Last updated time in seconds since 1970-01-01T00:00:00Z." + }, + "expiryTime": { + "type": "string", + "description": "The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'." + } + } + }, + "LifetimeAction": { + "properties": { + "trigger":{ + "$ref": "#/definitions/Trigger", + "description": "The trigger of key rotation policy lifetimeAction." + }, + "action":{ + "$ref": "#/definitions/Action", + "description": "The action of key rotation policy lifetimeAction." + } + } + }, + "Trigger": { + "properties": { + "timeAfterCreate":{ + "type": "string", + "description": "The time duration after key creation to rotate the key. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'." + }, + "timeBeforeExpiry":{ + "type": "string", + "description": "The time duration before key expiring to rotate the key. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'." + } + } + }, + "Action": { + "properties":{ + "type":{ + "type": "string", + "description": "The type of action.", + "enum": [ + "rotate", + "notify" + ], + "x-ms-enum": { + "name": "type", + "modelAsString": false + } + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} From 3b06e1df056d6606d669c3a1f074ee84fc930bfb Mon Sep 17 00:00:00 2001 From: qinl-li <63257243+qinl-li@users.noreply.github.com> Date: Tue, 11 May 2021 16:39:55 -0700 Subject: [PATCH 2/6] Update --- .../examples/createKey.json | 2 +- .../2021-04-01-preview/examples/getKey.json | 2 +- .../examples/getKeyVersion.json | 2 +- .../examples/listKeyVersions.json | 2 +- .../2021-04-01-preview/examples/listKeys.json | 2 +- .../preview/2021-04-01-preview/keys.json | 102 ++++++++---------- .../keyvault/resource-manager/readme.md | 1 + 7 files changed, 53 insertions(+), 60 deletions(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json index cd5fc27c78f4..5524232b01bf 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/createKey.json @@ -4,7 +4,7 @@ "resourceGroupName": "sample-group", "vaultName": "sample-vault-name", "keyName": "sample-key-name", - "api-version": "2019-09-01", + "api-version": "2021-04-01-preview", "parameters": { "properties": { "kty": "RSA" diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json index 5936a21e00c0..042d8d8276cd 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKey.json @@ -4,7 +4,7 @@ "resourceGroupName": "sample-group", "vaultName": "sample-vault-name", "keyName": "sample-key-name", - "api-version": "2019-09-01" + "api-version": "2021-04-01-preview" }, "responses": { "200": { diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json index 768c9f95ae3f..5ac40ea13ce2 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/getKeyVersion.json @@ -5,7 +5,7 @@ "vaultName": "sample-vault-name", "keyName": "sample-key-name", "keyVersion": "fd618d9519b74f9aae94ade66b876acc", - "api-version": "2019-09-01" + "api-version": "2021-04-01-preview" }, "responses": { "200": { diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json index 8dc7c32ffbcd..207aa53a9a1e 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeyVersions.json @@ -4,7 +4,7 @@ "resourceGroupName": "sample-group", "vaultName": "sample-vault-name", "keyName": "sample-key-name", - "api-version": "2019-09-01" + "api-version": "2021-04-01-preview" }, "responses": { "200": { diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json index b24f0dca2b9d..c64851348641 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/examples/listKeys.json @@ -3,7 +3,7 @@ "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "sample-group", "vaultName": "sample-vault-name", - "api-version": "2019-09-01" + "api-version": "2021-04-01-preview" }, "responses": { "200": { diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json index 7502e72f4134..669615635c53 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2019-09-01", + "version": "2021-04-01-preview", "title": "KeyVaultManagementClient", "description": "The Azure management API provides a RESTful set of web services that interact with Azure Key Vault." }, @@ -350,55 +350,6 @@ } }, "definitions": { - "Attributes": { - "properties": { - "enabled": { - "type": "boolean", - "description": "Determines whether or not the object is enabled." - }, - "nbf": { - "x-ms-client-name": "NotBefore", - "type": "integer", - "format": "int64", - "description": "Not before date in seconds since 1970-01-01T00:00:00Z." - }, - "exp": { - "x-ms-client-name": "Expires", - "type": "integer", - "format": "int64", - "description": "Expiry date in seconds since 1970-01-01T00:00:00Z." - }, - "created": { - "type": "integer", - "format": "int64", - "readOnly": true, - "description": "Creation time in seconds since 1970-01-01T00:00:00Z." - }, - "updated": { - "type": "integer", - "format": "int64", - "readOnly": true, - "description": "Last updated time in seconds since 1970-01-01T00:00:00Z." - }, - "recoveryLevel": { - "type": "string", - "description": "The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.", - "enum": [ - "Purgeable", - "Recoverable+Purgeable", - "Recoverable", - "Recoverable+ProtectedSubscription" - ], - "x-ms-enum": { - "name": "DeletionRecoveryLevel", - "modelAsString": true - }, - "readOnly": true, - "x-nullable": false - } - }, - "description": "The object attributes managed by the Azure Key Vault service." - }, "KeyProperties": { "properties": { "attributes": { @@ -482,12 +433,53 @@ "description": "The properties of the key." }, "KeyAttributes": { - "allOf": [ - { - "$ref": "#/definitions/Attributes" + "properties": { + "enabled": { + "type": "boolean", + "description": "Determines whether or not the object is enabled." + }, + "nbf": { + "x-ms-client-name": "NotBefore", + "type": "integer", + "format": "int64", + "description": "Not before date in seconds since 1970-01-01T00:00:00Z." + }, + "exp": { + "x-ms-client-name": "Expires", + "type": "integer", + "format": "int64", + "description": "Expiry date in seconds since 1970-01-01T00:00:00Z." + }, + "created": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Creation time in seconds since 1970-01-01T00:00:00Z." + }, + "updated": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Last updated time in seconds since 1970-01-01T00:00:00Z." + }, + "recoveryLevel": { + "type": "string", + "description": "The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval.", + "enum": [ + "Purgeable", + "Recoverable+Purgeable", + "Recoverable", + "Recoverable+ProtectedSubscription" + ], + "x-ms-enum": { + "name": "DeletionRecoveryLevel", + "modelAsString": true + }, + "readOnly": true, + "x-nullable": false } - ], - "description": "The attributes of the key." + }, + "description": "The object attributes managed by the Azure Key Vault service." }, "KeyCreateParameters": { "properties": { diff --git a/specification/keyvault/resource-manager/readme.md b/specification/keyvault/resource-manager/readme.md index d67c4002ad4c..b1bb8a39579a 100644 --- a/specification/keyvault/resource-manager/readme.md +++ b/specification/keyvault/resource-manager/readme.md @@ -36,6 +36,7 @@ These settings apply only when `--tag=package-preview-2021-04` is specified on t ```yaml $(tag) == 'package-preview-2021-04' input-file: + - Microsoft.KeyVault/preview/2021-04-01-preview/keys.json - Microsoft.KeyVault/preview/2021-04-01-preview/common.json - Microsoft.KeyVault/preview/2021-04-01-preview/keyvault.json - Microsoft.KeyVault/preview/2021-04-01-preview/managedHsm.json From 8442b6a626a5bc68bc9e762f97a070ca5ec21176 Mon Sep 17 00:00:00 2001 From: qinl-li <63257243+qinl-li@users.noreply.github.com> Date: Tue, 11 May 2021 16:45:14 -0700 Subject: [PATCH 3/6] Fixed spelling --- .../Microsoft.KeyVault/preview/2021-04-01-preview/keys.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json index 669615635c53..aea1a2ff503b 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json @@ -547,7 +547,7 @@ }, "rotateTriggerValue": { "type": "string", - "description": "The time duration to trigger key autoroation. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" + "description": "The time duration to trigger key rotation. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" }, "notifyTriggerType": { "type": "string", From 52e258d2d2edf68b0bb568951a65e92ef3cd8c17 Mon Sep 17 00:00:00 2001 From: qinl-li <63257243+qinl-li@users.noreply.github.com> Date: Tue, 11 May 2021 16:50:28 -0700 Subject: [PATCH 4/6] prettier fix --- .../preview/2021-04-01-preview/keys.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json index aea1a2ff503b..9e2fd17cb672 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json @@ -425,7 +425,7 @@ "required": false, "description": "The parameters to set rotation policy for the key." }, - "rotationPolicy":{ + "rotationPolicy": { "$ref": "#/definitions/RotationPolicy", "description": "Key rotation policy in response. It will be omitted in input." } @@ -567,19 +567,19 @@ }, "description": "The parameters only used for setting key rotation policy. It will be omitted in output." }, - "RotationPolicy":{ + "RotationPolicy": { "properties": { - "attributes":{ + "attributes": { "$ref": "#/definitions/KeyRotationPolicyAttributes", "description": "The attributes of key rotation policy." - }, - "lifetimeActions":{ + }, + "lifetimeActions": { "type": "array", "items": { "$ref": "#/definitions/LifetimeAction" }, "description": "The lifetimeActions for key rotation action." - } + } } }, "KeyRotationPolicyAttributes": { @@ -604,11 +604,11 @@ }, "LifetimeAction": { "properties": { - "trigger":{ + "trigger": { "$ref": "#/definitions/Trigger", "description": "The trigger of key rotation policy lifetimeAction." }, - "action":{ + "action": { "$ref": "#/definitions/Action", "description": "The action of key rotation policy lifetimeAction." } @@ -616,19 +616,19 @@ }, "Trigger": { "properties": { - "timeAfterCreate":{ + "timeAfterCreate": { "type": "string", "description": "The time duration after key creation to rotate the key. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'." }, - "timeBeforeExpiry":{ + "timeBeforeExpiry": { "type": "string", "description": "The time duration before key expiring to rotate the key. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'." } } }, "Action": { - "properties":{ - "type":{ + "properties": { + "type": { "type": "string", "description": "The type of action.", "enum": [ From da5d596c49df54fdfeab426cf8dbf03d3ce862da Mon Sep 17 00:00:00 2001 From: qinl-li <63257243+qinl-li@users.noreply.github.com> Date: Thu, 27 May 2021 17:55:01 -0700 Subject: [PATCH 5/6] Remove keyrotationpolicy parameters --- .../preview/2021-04-01-preview/keys.json | 39 +------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json index 9e2fd17cb672..40f9efd2b261 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json @@ -420,14 +420,9 @@ "description": "The URI to retrieve the specific version of the key.", "readOnly": true }, - "rotationPolicyParameters": { - "$ref": "#/definitions/RotationPolicyParameters", - "required": false, - "description": "The parameters to set rotation policy for the key." - }, "rotationPolicy": { "$ref": "#/definitions/RotationPolicy", - "description": "Key rotation policy in response. It will be omitted in input." + "description": "Key rotation policy in response. It will be used for both output and input. Omitted if empty" } }, "description": "The properties of the key." @@ -535,38 +530,6 @@ }, "description": "The page of keys." }, - "RotationPolicyParameters": { - "properties": { - "rotateTriggerType": { - "type": "string", - "description": "Key rotation trigger type", - "enum": [ - "timeAfterCreate", - "timeBeforeExpiry" - ] - }, - "rotateTriggerValue": { - "type": "string", - "description": "The time duration to trigger key rotation. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" - }, - "notifyTriggerType": { - "type": "string", - "description": "Notification trigger type", - "enum": [ - "timeBeforeExpiry" - ] - }, - "notifyTriggerValue": { - "type": "string", - "description": "The time duration to trigger event. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" - }, - "expiryTime": { - "type": "string", - "description": "The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'" - } - }, - "description": "The parameters only used for setting key rotation policy. It will be omitted in output." - }, "RotationPolicy": { "properties": { "attributes": { From 529cea41dd4df266c2d1460d99d274fa7f6068d9 Mon Sep 17 00:00:00 2001 From: qinl-li <63257243+qinl-li@users.noreply.github.com> Date: Thu, 3 Jun 2021 09:40:50 -0700 Subject: [PATCH 6/6] Change type name --- .../Microsoft.KeyVault/preview/2021-04-01-preview/keys.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json index 40f9efd2b261..31deba9a7489 100644 --- a/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json +++ b/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-04-01-preview/keys.json @@ -599,7 +599,7 @@ "notify" ], "x-ms-enum": { - "name": "type", + "name": "KeyRotationPolicyActionType", "modelAsString": false } }