diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelCreateMax.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelCreateMax.json new file mode 100644 index 000000000000..fe6131a05b41 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelCreateMax.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "myRG", + "serverName": "myServer", + "databaseName": "myDatabase", + "schemaName": "dbo", + "tableName": "myTable", + "columnName": "myColumn", + "sensitivityLabelSource": "current", + "api-version": "2017-03-01-preview", + "parameters": { + "properties": { + "labelName": "PII", + "informationType": "PhoneNumber" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current", + "name": "current", + "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", + "properties": { + "labelName": "PII", + "informationType": "PhoneNumber" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current", + "name": "current", + "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", + "properties": { + "labelName": "PII", + "informationType": "PhoneNumber" + } + } + } + } +} diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelDelete.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelDelete.json new file mode 100644 index 000000000000..d696fb91ed5e --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelDelete.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "myRG", + "serverName": "myServer", + "databaseName": "myDatabase", + "schemaName": "dbo", + "tableName": "myTable", + "columnName": "myColumn", + "sensitivityLabelSource": "current", + "api-version": "2017-03-01-preview" + }, + "responses": { + "200": { + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelGet.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelGet.json new file mode 100644 index 000000000000..e3e5f81b1493 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/ColumnSensitivtyLabelGet.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "myRG", + "serverName": "myServer", + "databaseName": "myDatabase", + "schemaName": "dbo", + "tableName": "myTable", + "columnName": "myColumn", + "sensitivityLabelSource": "current", + "api-version": "2017-03-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current", + "name": "current", + "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", + "properties": { + "labelName": "PII", + "informationType": "PhoneNumber" + } + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/SensitivityLabelsListByDatabaseMax.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/SensitivityLabelsListByDatabaseMax.json new file mode 100644 index 000000000000..112d9cb25068 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/SensitivityLabelsListByDatabaseMax.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "myRG", + "serverName": "myServer", + "databaseName": "myDatabase", + "api-version": "2017-03-01-preview", + "filter": "Name eq 'current'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current", + "name": "current", + "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", + "properties": { + "labelName": "Sensitive", + "informationType": "Financial" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/SensitivityLabelsListByDatabaseMin.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/SensitivityLabelsListByDatabaseMin.json new file mode 100644 index 000000000000..33441c2f00c6 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/examples/SensitivityLabelsListByDatabaseMin.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "myRG", + "serverName": "myServer", + "databaseName": "myDatabase", + "api-version": "2017-03-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current", + "name": "current", + "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", + "properties": { + "labelName": "Sensitive", + "informationType": "Financial" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn2/sensitivityLabels/recommended", + "name": "recommended", + "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels", + "properties": { + "labelName": "PII", + "informationType": "Email" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json new file mode 100644 index 000000000000..d685a49e501f --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json @@ -0,0 +1,463 @@ +{ + "swagger": "2.0", + "info": { + "version": "2017-03-01-preview", + "title": "SqlManagementClient", + "description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels": { + "get": { + "tags": [ + "SensitivityLabels" + ], + "description": "Gets the sensitivity labels of a given database", + "operationId": "SensitivityLabels_ListByDatabase", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "$filter", + "in": "query", + "description": "An OData filter expression that filters elements in the collection.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the sensitivity labels.", + "schema": { + "$ref": "#/definitions/SensitivityLabelListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 SensitivityLabelsInvalidODataQuery - The specified OData query is either not valid or not supported\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance." + } + }, + "x-ms-odata": "#/definitions/SensitivityLabel", + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Gets the current sensitivity labels of a given database": { + "$ref": "./examples/SensitivityLabelsListByDatabaseMax.json" + }, + "Gets the sensitivity labels of a given database": { + "$ref": "./examples/SensitivityLabelsListByDatabaseMin.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}": { + "get": { + "tags": [ + "SensitivityLabels" + ], + "description": "Gets the sensitivity label of a given column", + "operationId": "SensitivityLabels_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "schemaName", + "in": "path", + "description": "The name of the schema.", + "required": true, + "type": "string" + }, + { + "name": "tableName", + "in": "path", + "description": "The name of the table.", + "required": true, + "type": "string" + }, + { + "name": "columnName", + "in": "path", + "description": "The name of the column.", + "required": true, + "type": "string" + }, + { + "name": "sensitivityLabelSource", + "in": "path", + "description": "The source of the sensitivity label.", + "required": true, + "type": "string", + "enum": [ + "current", + "recommended" + ], + "x-ms-enum": { + "name": "SensitivityLabelSource", + "modelAsString": false + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the sensitivity label.", + "schema": { + "$ref": "#/definitions/SensitivityLabel" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 SensitivityLabelSourceNameNotSupported - The specified sensitivity label source is not valid\n\n * 404 SensitivityLabelsColumnNotFound - The specified schema/table/column could not be found\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SensitivityLabelsLabelNotFound - The specified sensitivity label could not be found\n\n * 501 SensitivityLabelRecommendedSourceNameNotSupported - 'Recommended' sensitivity label source is not supported yet" + } + }, + "x-ms-examples": { + "Gets the sensitivity label of a given column": { + "$ref": "./examples/ColumnSensitivtyLabelGet.json" + } + } + }, + "put": { + "tags": [ + "SensitivityLabels" + ], + "description": "Creates or updates the sensitivity label of a given column", + "operationId": "SensitivityLabels_CreateOrUpdate", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "schemaName", + "in": "path", + "description": "The name of the schema.", + "required": true, + "type": "string" + }, + { + "name": "tableName", + "in": "path", + "description": "The name of the table.", + "required": true, + "type": "string" + }, + { + "name": "columnName", + "in": "path", + "description": "The name of the column.", + "required": true, + "type": "string" + }, + { + "name": "sensitivityLabelSource", + "in": "path", + "description": "The source of the sensitivity label.", + "required": true, + "type": "string", + "enum": [ + "current" + ], + "x-ms-enum": { + "name": "WritableSensitivityLabelSource", + "modelAsString": false + } + }, + { + "name": "parameters", + "in": "body", + "description": "The column sensitivity label resource.", + "required": true, + "schema": { + "$ref": "#/definitions/SensitivityLabel" + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully updated the sensitivity label.", + "schema": { + "$ref": "#/definitions/SensitivityLabel" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 SensitivityLabelSourceNameNotSupported - The specified sensitivity label source is not valid\n\n * 400 InvalidSensitivityLabelResource - The specified sensitivity label resource is not valid\n\n * 400 SensitivityLabelLabelNameAndInfoTypeNotProvided - At least one of LabelName and InformationType must be specified\n\n * 400 LabelNameTooLong - Label name cannot exceed {0} characters\n\n * 400 InformationTypeTooLong - Information type cannot exceed {0} characters\n\n * 404 SensitivityLabelsColumnNotFound - The specified schema/table/column could not be found\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SensitivityLabelsLabelNotFound - The specified sensitivity label could not be found\n\n * 501 SensitivityLabelRecommendedSourceNameNotSupported - 'Recommended' sensitivity label source is not supported yet" + }, + "201": { + "description": "Successfully created the sensitivity label.", + "schema": { + "$ref": "#/definitions/SensitivityLabel" + } + } + }, + "x-ms-examples": { + "Updates the sensitivity label of a given column with all parameters": { + "$ref": "./examples/ColumnSensitivtyLabelCreateMax.json" + } + } + }, + "delete": { + "tags": [ + "SensitivityLabels" + ], + "description": "Deletes the sensitivity label of a given column", + "operationId": "SensitivityLabels_Delete", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "schemaName", + "in": "path", + "description": "The name of the schema.", + "required": true, + "type": "string" + }, + { + "name": "tableName", + "in": "path", + "description": "The name of the table.", + "required": true, + "type": "string" + }, + { + "name": "columnName", + "in": "path", + "description": "The name of the column.", + "required": true, + "type": "string" + }, + { + "name": "sensitivityLabelSource", + "in": "path", + "description": "The source of the sensitivity label.", + "required": true, + "type": "string", + "enum": [ + "current" + ], + "x-ms-enum": { + "name": "WritableSensitivityLabelSource", + "modelAsString": false + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully deleted the sensitivity label." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 SensitivityLabelSourceNameNotSupported - The specified sensitivity label source is not valid\n\n * 404 SensitivityLabelsColumnNotFound - The specified schema/table/column could not be found\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 SensitivityLabelsLabelNotFound - The specified sensitivity label could not be found\n\n * 501 SensitivityLabelRecommendedSourceNameNotSupported - 'Recommended' sensitivity label source is not supported yet" + } + }, + "x-ms-examples": { + "Deletes the sensitivity label of a given column": { + "$ref": "./examples/ColumnSensitivtyLabelDelete.json" + } + } + } + } + }, + "definitions": { + "SensitivityLabelProperties": { + "description": "Properties of a sensitivity label.", + "type": "object", + "properties": { + "labelName": { + "description": "The label name.", + "type": "string" + }, + "informationType": { + "description": "The information type.", + "type": "string" + } + } + }, + "SensitivityLabel": { + "description": "A sensitivity label.", + "type": "object", + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/SensitivityLabelProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + }, + "SensitivityLabelListResult": { + "description": "A list of sensitivity labels.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/SensitivityLabel" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "The subscription ID that identifies an Azure subscription.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for the request.", + "required": true, + "type": "string", + "x-ms-parameter-location": "client" + }, + "ResourceGroupParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "description": "The name of the server.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ManagedInstanceNameParameter": { + "name": "managedInstanceName", + "in": "path", + "description": "The name of the managed instance.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DatabaseNameParameter": { + "name": "databaseName", + "in": "path", + "description": "The name of the database.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "BlobAuditingPolicyNameParameter": { + "name": "blobAuditingPolicyName", + "in": "path", + "description": "The name of the blob auditing policy.", + "required": true, + "type": "string", + "enum": [ + "default" + ], + "x-ms-parameter-location": "method" + }, + "SqlVirtualMachineInstanceNameParameter": { + "name": "sqlVirtualMachineInstanceName", + "in": "path", + "description": "The name of the SqlVirtualMachineInstance.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "SqlVirtualMachineContainerNameParameter": { + "name": "sqlVirtualMachineContainerName", + "in": "path", + "description": "The name of the SqlVirtualMachineContainer.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "VirtualClusterNameParameter": { + "name": "virtualClusterName", + "in": "path", + "description": "The name of the virtual cluster.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + }, + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/readme.md b/specification/sql/resource-manager/readme.md index bc665e5f6fa4..16a08ea194ac 100644 --- a/specification/sql/resource-manager/readme.md +++ b/specification/sql/resource-manager/readme.md @@ -88,6 +88,7 @@ input-file: - Microsoft.Sql/preview/2017-03-01-preview/jobs.json - Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json - Microsoft.Sql/preview/2017-03-01-preview/managedDatabases.json +- Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json - Microsoft.Sql/preview/2017-03-01-preview/serverAutomaticTuning.json - Microsoft.Sql/preview/2017-03-01-preview/serverDnsAliases.json - Microsoft.Sql/preview/2017-03-01-preview/serverSecurityAlertPolicies.json @@ -164,6 +165,7 @@ input-file: - Microsoft.Sql/preview/2017-03-01-preview/longTermRetention.json - Microsoft.Sql/preview/2017-03-01-preview/managedDatabases.json - Microsoft.Sql/preview/2017-03-01-preview/renameDatabase.json +- Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json - Microsoft.Sql/preview/2017-03-01-preview/serverAutomaticTuning.json - Microsoft.Sql/preview/2017-03-01-preview/serverDnsAliases.json - Microsoft.Sql/preview/2017-03-01-preview/serverSecurityAlertPolicies.json @@ -230,6 +232,7 @@ input-file: - Microsoft.Sql/preview/2017-03-01-preview/jobs.json - Microsoft.Sql/preview/2017-03-01-preview/managedDatabases.json - Microsoft.Sql/preview/2017-03-01-preview/renameDatabase.json +- Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json - Microsoft.Sql/preview/2017-03-01-preview/serverAutomaticTuning.json - Microsoft.Sql/preview/2017-03-01-preview/serverDnsAliases.json - Microsoft.Sql/preview/2017-03-01-preview/serverSecurityAlertPolicies.json @@ -297,6 +300,7 @@ input-file: - Microsoft.Sql/preview/2017-03-01-preview/jobs.json - Microsoft.Sql/preview/2017-03-01-preview/managedDatabases.json - Microsoft.Sql/preview/2017-03-01-preview/renameDatabase.json +- Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json - Microsoft.Sql/preview/2017-03-01-preview/serverAutomaticTuning.json - Microsoft.Sql/preview/2017-03-01-preview/serverDnsAliases.json - Microsoft.Sql/preview/2017-03-01-preview/serverSecurityAlertPolicies.json @@ -434,6 +438,7 @@ input-file: - ./Microsoft.Sql/preview/2017-03-01-preview/managedDatabases.json - ./Microsoft.Sql/preview/2017-03-01-preview/renameDatabase.json - ./Microsoft.Sql/preview/2017-03-01-preview/restorePoints.json + - ./Microsoft.Sql/preview/2017-03-01-preview/sensitivityLabels.json - ./Microsoft.Sql/preview/2017-03-01-preview/serverAutomaticTuning.json - ./Microsoft.Sql/preview/2017-03-01-preview/serverDnsAliases.json - ./Microsoft.Sql/preview/2017-03-01-preview/serverSecurityAlertPolicies.json