diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md index dcedef2d2c63..5a6085cf8f3a 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md @@ -8,12 +8,8 @@ Run `dotnet msbuild /t:GenerateCode` in src directory to re-generate. ``` yaml title: Azure.Security.KeyVault.Administration input-file: - - $(this-folder)/swagger/rbac.json - - $(this-folder)/swagger/backuprestore.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/189fe8eb8d1ce60c9a782bbd1a0d632ffd70f1ae/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/rbac.json + - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/189fe8eb8d1ce60c9a782bbd1a0d632ffd70f1ae/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2-preview/backuprestore.json namespace: Azure.Security.KeyVault.Administration include-csproj: disable ``` - -Note the input file should be restored to -the below path pending a service fix. -https://raw.githubusercontent.com/Azure/azure-rest-api-specs/001730d4c5b19d69b1edf43894a1e931f9591e58/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.2/rbac.json diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/backuprestore.json b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/backuprestore.json deleted file mode 100644 index 9a6587443dd8..000000000000 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/backuprestore.json +++ /dev/null @@ -1,425 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "KeyVaultClient", - "description": "The key vault client performs cryptographic key operations and vault operations against the Key Vault service.", - "version": "7.2-preview" - }, - "x-ms-parameterized-host": { - "hostTemplate": "{vaultBaseUrl}", - "useSchemePrefix": false, - "positionInOperation": "first", - "parameters": [ - { - "name": "vaultBaseUrl", - "description": "The vault name, for example https://myvault.vault.azure.net.", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - } - ] - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/backup": { - "post": { - "tags": [ - "FullBackup" - ], - "operationId": "FullBackup", - "description": "Creates a full backup using a user-provided SAS token to an Azure blob storage container.", - "parameters": [ - { - "in": "body", - "name": "azureStorageBlobContainerUri", - "schema": { - "$ref": "#/definitions/SASTokenParameter" - }, - "description": "Azure blob shared access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "202": { - "description": "Started full backup", - "headers": { - "Retry-After": { - "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", - "type": "integer" - }, - "Azure-AsyncOperation": { - "description": "The URI to poll for completion status.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/FullBackupOperation" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "Create full backup": { - "$ref": "./examples/FullBackup-example.json" - } - } - } - }, - "/backup/{jobId}/pending": { - "get": { - "tags": [ - "FullBackup" - ], - "operationId": "FullBackupStatus", - "description": "Returns the status of full backup operation", - "parameters": [ - { - "name": "jobId", - "in": "path", - "required": true, - "type": "string", - "description": "The id returned as part of the backup request" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns the full backup status", - "schema": { - "$ref": "#/definitions/FullBackupOperation" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "Full backup status": { - "$ref": "./examples/FullBackup-pending-example.json" - } - } - } - }, - "/restore": { - "put": { - "tags": [ - "FullRestore" - ], - "operationId": "FullRestoreOperation", - "description": "Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder", - "parameters": [ - { - "name": "restoreBlobDetails", - "in": "body", - "schema": { - "$ref": "#/definitions/RestoreOperationParameters" - }, - "description": "The Azure blob SAS token pointing to a folder where the previous successful full backup was stored" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "202": { - "description": "Started restore operation from the previously stored backup", - "headers": { - "Retry-After": { - "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", - "type": "integer" - }, - "Azure-AsyncOperation": { - "description": "The URI to poll for completion status.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/FullRestoreOperation" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "Create full restore from backup": { - "$ref": "./examples/FullRestore-example.json" - } - } - } - }, - "/restore/{jobId}/pending": { - "get": { - "tags": [ - "FullRestore" - ], - "operationId": "FullRestoreStatus", - "description": "Returns the status of full restore operation", - "parameters": [ - { - "name": "jobId", - "in": "path", - "required": true, - "type": "string", - "description": "The Job Id returned part of the full restore operation" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns the full restore status", - "schema": { - "$ref": "#/definitions/FullRestoreOperation" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "Full restore status": { - "$ref": "./examples/FullRestore-pending-example.json" - } - } - } - }, - "/keys/{keyName}/restore": { - "put": { - "tags": [ - "Keys" - ], - "operationId": "SelectiveKeyRestoreOperation", - "description": "Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder", - "parameters": [ - { - "name": "keyName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the key to be restored from the user supplied backup" - }, - { - "name": "restoreBlobDetails", - "in": "body", - "schema": { - "$ref": "#/definitions/SelectiveKeyRestoreOperationParameters" - }, - "description": "The Azure blob SAS token pointing to a folder where the previous successful full backup was stored" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "202": { - "description": "Started selective key restore operation from the previously stored backup", - "headers": { - "Retry-After": { - "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", - "type": "integer" - }, - "Azure-AsyncOperation": { - "description": "The URI to poll for completion status.", - "type": "string" - } - }, - "schema": { - "$ref": "#/definitions/SelectiveKeyRestoreOperation" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "Selectively restore key from a backup": { - "$ref": "./examples/SelectiveRestore-example.json" - } - } - } - } - }, - "definitions": { - "RestoreOperationParameters": { - "properties": { - "sasTokenParameters": { - "$ref": "#/definitions/SASTokenParameter" - }, - "folderToRestore": { - "type": "string", - "description": "The Folder name of the blob where the previous successful full backup was stored" - } - }, - "required": [ - "folderToRestore", - "sasTokenParameters" - ] - }, - "SelectiveKeyRestoreOperationParameters": { - "properties": { - "sasTokenParameters": { - "$ref": "#/definitions/SASTokenParameter" - }, - "folder": { - "type": "string", - "description": "The Folder name of the blob where the previous successful full backup was stored" - } - }, - "required": [ - "folder", - "sasTokenParameters" - ] - }, - "SelectiveKeyRestoreOperation": { - "properties": { - "status": { - "type": "string", - "description": "Status of the restore operation." - }, - "statusDetails": { - "type": "string", - "description": "The status details of restore operation." - }, - "error": { - "$ref": "common.json#/definitions/Error", - "description": "Error encountered, if any, during the selective key restore operation." - }, - "jobId": { - "type": "string", - "description": "Identifier for the selective key restore operation." - }, - "startTime": { - "type": "integer", - "format": "unixtime", - "description": "The start time of the restore operation" - }, - "endTime": { - "type": "integer", - "format": "unixtime", - "description": "The end time of the restore operation" - } - }, - "description": "Selective Key Restore operation" - }, - "SASTokenParameter": { - "properties": { - "storageResourceUri": { - "type": "string", - "description": "Azure Blob storage container Uri" - }, - "token": { - "type": "string", - "description": "The SAS token pointing to an Azure Blob storage container" - } - }, - "required": [ - "storageResourceUri", - "token" - ] - }, - "FullBackupOperation": { - "properties": { - "status": { - "type": "string", - "description": "Status of the backup operation." - }, - "statusDetails": { - "type": "string", - "description": "The status details of backup operation." - }, - "error": { - "$ref": "common.json#/definitions/Error", - "description": "Error encountered, if any, during the full backup operation." - }, - "startTime": { - "type": "integer", - "format": "unixtime", - "description": "The start time of the backup operation in UTC" - }, - "endTime": { - "type": "integer", - "format": "unixtime", - "description": "The end time of the backup operation in UTC" - }, - "jobId": { - "type": "string", - "description": "Identifier for the full backup operation." - }, - "azureStorageBlobContainerUri": { - "type": "string", - "description": "The Azure blob storage container Uri which contains the full backup" - } - }, - "description": "Full backup operation" - }, - "FullRestoreOperation": { - "properties": { - "status": { - "type": "string", - "description": "Status of the restore operation." - }, - "statusDetails": { - "type": "string", - "description": "The status details of restore operation." - }, - "error": { - "$ref": "common.json#/definitions/Error", - "description": "Error encountered, if any, during the full restore operation." - }, - "jobId": { - "type": "string", - "description": "Identifier for the full restore operation." - }, - "startTime": { - "type": "integer", - "format": "unixtime", - "description": "The start time of the restore operation" - }, - "endTime": { - "type": "integer", - "format": "unixtime", - "description": "The end time of the restore operation" - } - }, - "description": "Full restore operation" - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client API version." - } - } -} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/common.json b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/common.json deleted file mode 100644 index 6b913677029b..000000000000 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/common.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "KeyVaultClient", - "description": "The key vault client performs cryptographic key operations and vault operations against the Key Vault service.", - "version": "7.2-preview" - }, - "paths": {}, - "definitions": { - "Attributes": { - "properties": { - "enabled": { - "type": "boolean", - "description": "Determines whether the object is enabled." - }, - "nbf": { - "x-ms-client-name": "NotBefore", - "type": "integer", - "format": "unixtime", - "description": "Not before date in UTC." - }, - "exp": { - "x-ms-client-name": "Expires", - "type": "integer", - "format": "unixtime", - "description": "Expiry date in UTC." - }, - "created": { - "type": "integer", - "format": "unixtime", - "readOnly": true, - "description": "Creation time in UTC." - }, - "updated": { - "type": "integer", - "format": "unixtime", - "readOnly": true, - "description": "Last updated time in UTC." - } - }, - "description": "The object attributes managed by the KeyVault service." - }, - "KeyVaultError": { - "properties": { - "error": { - "readOnly": true, - "$ref": "#/definitions/Error" - } - }, - "description": "The key vault error exception." - }, - "Error": { - "properties": { - "code": { - "type": "string", - "readOnly": true, - "description": "The error code." - }, - "message": { - "type": "string", - "readOnly": true, - "description": "The error message." - }, - "innererror": { - "x-ms-client-name": "innerError", - "readOnly": true, - "$ref": "#/definitions/Error" - } - }, - "description": "The key vault server error." - } - } -} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/rbac.json b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/rbac.json deleted file mode 100644 index a15c7e1d7dfb..000000000000 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/swagger/rbac.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "KeyVaultClient", - "description": "The key vault client performs cryptographic key operations and vault operations against the Key Vault service.", - "version": "7.2-preview" - }, - "x-ms-parameterized-host": { - "hostTemplate": "{vaultBaseUrl}", - "useSchemePrefix": false, - "positionInOperation": "first", - "parameters": [ - { - "name": "vaultBaseUrl", - "description": "The vault name, for example https://myvault.vault.azure.net.", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - } - ] - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/{scope}/providers/Microsoft.Authorization/roleDefinitions": { - "get": { - "tags": [ - "RoleDefinitions" - ], - "operationId": "RoleDefinitions_List", - "description": "Get all role definitions that are applicable at scope and above.", - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the role definition.", - "x-ms-skip-url-encoding": true - }, - { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of role definitions.", - "schema": { - "$ref": "#/definitions/RoleDefinitionListResult" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "ListRoleDefinitions": { - "$ref": "./examples/ListRoleDefinitions-example.json" - } - }, - "x-ms-odata": "#/definitions/RoleDefinitionFilter" - } - }, - "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}": { - "delete": { - "tags": [ - "RoleAssignments" - ], - "operationId": "RoleAssignments_Delete", - "description": "Deletes a role assignment.", - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the role assignment to delete.", - "x-ms-skip-url-encoding": true - }, - { - "name": "roleAssignmentName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the role assignment to delete." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the role assignment.", - "schema": { - "$ref": "#/definitions/RoleAssignment" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "DeleteRoleAssignments": { - "$ref": "./examples/DeleteRoleAssignments-example.json" - } - } - }, - "put": { - "tags": [ - "RoleAssignments" - ], - "operationId": "RoleAssignments_Create", - "description": "Creates a role assignment.", - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the role assignment to create.", - "x-ms-skip-url-encoding": true - }, - { - "name": "roleAssignmentName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the role assignment to create. It can be any valid GUID." - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RoleAssignmentCreateParameters" - }, - "description": "Parameters for the role assignment." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "201": { - "description": "Created - Returns information about the role assignment.", - "schema": { - "$ref": "#/definitions/RoleAssignment" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "PutRoleAssignments": { - "$ref": "./examples/PutRoleAssignments-example.json" - } - } - }, - "get": { - "tags": [ - "RoleAssignments" - ], - "operationId": "RoleAssignments_Get", - "description": "Get the specified role assignment.", - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the role assignment.", - "x-ms-skip-url-encoding": true - }, - { - "name": "roleAssignmentName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the role assignment to get." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns information about the role assignment.", - "schema": { - "$ref": "#/definitions/RoleAssignment" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-examples": { - "GetRoleAssignments": { - "$ref": "./examples/GetRoleAssignments-example.json" - } - } - } - }, - "/{scope}/providers/Microsoft.Authorization/roleAssignments": { - "get": { - "tags": [ - "RoleAssignments" - ], - "operationId": "RoleAssignments_ListForScope", - "description": "Gets role assignments for a scope.", - "parameters": [ - { - "name": "scope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope of the role assignments.", - "x-ms-skip-url-encoding": true - }, - { - "name": "$filter", - "in": "query", - "required": false, - "type": "string", - "description": "The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for the specified principal." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns an array of role assignments.", - "schema": { - "$ref": "#/definitions/RoleAssignmentListResult" - } - }, - "default": { - "description": "Key Vault error response describing why the operation failed.", - "schema": { - "$ref": "common.json#/definitions/KeyVaultError" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, - "x-ms-examples": { - "ListRoleAssignments": { - "$ref": "./examples/ListRoleAssignments-example.json" - } - }, - "x-ms-odata": "#/definitions/RoleAssignmentFilter" - } - } - }, - "definitions": { - "RoleAssignmentFilter": { - "properties": { - "principalId": { - "type": "string", - "description": "Returns role assignment of the specific principal." - } - }, - "description": "Role Assignments filter" - }, - "RoleAssignmentPropertiesWithScope": { - "properties": { - "scope": { - "type": "string", - "description": "The role assignment scope." - }, - "roleDefinitionId": { - "type": "string", - "description": "The role definition ID." - }, - "principalId": { - "type": "string", - "description": "The principal ID." - } - }, - "description": "Role assignment properties with scope." - }, - "RoleAssignment": { - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "The role assignment ID." - }, - "name": { - "type": "string", - "readOnly": true, - "description": "The role assignment name." - }, - "type": { - "type": "string", - "readOnly": true, - "description": "The role assignment type." - }, - "properties": { - "$ref": "#/definitions/RoleAssignmentPropertiesWithScope", - "description": "Role assignment properties." - } - }, - "description": "Role Assignments" - }, - "RoleAssignmentListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleAssignment" - }, - "description": "Role assignment list." - }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } - }, - "description": "Role assignment list operation result." - }, - "RoleAssignmentProperties": { - "properties": { - "roleDefinitionId": { - "type": "string", - "description": "The role definition ID used in the role assignment." - }, - "principalId": { - "type": "string", - "description": "The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group." - } - }, - "required": [ - "roleDefinitionId", - "principalId" - ], - "description": "Role assignment properties." - }, - "RoleAssignmentCreateParameters": { - "properties": { - "properties": { - "$ref": "#/definitions/RoleAssignmentProperties", - "description": "Role assignment properties." - } - }, - "required": [ - "properties" - ], - "description": "Role assignment create parameters." - }, - "RoleDefinitionFilter": { - "properties": { - "roleName": { - "type": "string", - "description": "Returns role definition with the specific name." - } - }, - "description": "Role Definitions filter" - }, - "Permission": { - "properties": { - "actions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Allowed actions." - }, - "notActions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Denied actions." - }, - "dataActions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Allowed Data actions." - }, - "notDataActions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Denied Data actions." - } - }, - "description": "Role definition permissions." - }, - "RoleDefinitionProperties": { - "properties": { - "roleName": { - "type": "string", - "description": "The role name." - }, - "description": { - "type": "string", - "description": "The role definition description." - }, - "type": { - "type": "string", - "description": "The role type.", - "x-ms-client-name": "roleType" - }, - "permissions": { - "type": "array", - "items": { - "$ref": "#/definitions/Permission" - }, - "description": "Role definition permissions." - }, - "assignableScopes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Role definition assignable scopes." - } - }, - "description": "Role definition properties." - }, - "RoleDefinition": { - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "The role definition ID." - }, - "name": { - "type": "string", - "readOnly": true, - "description": "The role definition name." - }, - "type": { - "type": "string", - "readOnly": true, - "description": "The role definition type." - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/RoleDefinitionProperties", - "description": "Role definition properties." - } - }, - "description": "Role definition." - }, - "RoleDefinitionListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/RoleDefinition" - }, - "description": "Role definition list." - }, - "nextLink": { - "type": "string", - "description": "The URL to use for getting the next set of results." - } - }, - "description": "Role definition list operation result." - } - }, - "parameters": { - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client API version." - } - } -}