Skip to content

Commit

Permalink
Add missing SensitivityLabels APIs to fix S360 issues (Azure#17562)
Browse files Browse the repository at this point in the history
* add the missing SensitivityLabels APIs to fix S360 issues

* add example files
  • Loading branch information
ericshape authored and FredericHeem committed Mar 7, 2022
1 parent 413b636 commit 2159075
Show file tree
Hide file tree
Showing 4 changed files with 202 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
"description": "Successfully disabled the sensitivity recommendations on the given column."
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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."
"description": "*** Error Responses: ***\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout."
}
},
"x-ms-examples": {
Expand Down Expand Up @@ -412,7 +412,7 @@
"description": "Successfully enabled the sensitivity recommendations on the given column."
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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."
"description": "*** Error Responses: ***\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout."
}
},
"x-ms-examples": {
Expand All @@ -422,6 +422,59 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels": {
"get": {
"tags": [
"ManagedDatabaseSensitivityLabels"
],
"description": "Gets the sensitivity labels of a given database",
"operationId": "ManagedDatabaseSensitivityLabels_ListByDatabase",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"$ref": "#/parameters/DatabaseNameParameter"
},
{
"name": "$filter",
"in": "query",
"description": "An OData filter expression that filters elements in the collection.",
"required": false,
"type": "string"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the sensitivity labels.",
"schema": {
"$ref": "#/definitions/SensitivityLabelListResult"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.\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.\n\n * 503 DatabaseUnavailable - The operation failed because the database is unavailable."
}
},
"x-ms-odata": "#/definitions/SensitivityLabel",
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"Gets the current and recommended sensitivity labels of a given database": {
"$ref": "./examples/ManagedDatabaseSensitivityLabelsListByDatabase.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels": {
"get": {
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
"description": "Successfully enabled the sensitivity recommendations on the given column."
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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."
"description": "*** Error Responses: ***\n\n * 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout."
}
},
"x-ms-examples": {
Expand Down Expand Up @@ -373,7 +373,7 @@
"description": "Successfully disabled the sensitivity recommendation on the given column."
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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."
"description": "*** Error Responses: ***\n\n * 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.\n\n * 404 SensitivityLabelsColumnNotFound - The column {0} could not be found in table {2}.{1}\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 SubscriptionNotFound - The requested subscription was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout."
}
},
"x-ms-examples": {
Expand All @@ -383,6 +383,59 @@
}
}
},
"/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": "../../../common/v1/types.json#/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": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the sensitivity labels.",
"schema": {
"$ref": "#/definitions/SensitivityLabelListResult"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 DatawarehouseDatabaseIsDeactivated - Could not execute Data Classification operation because the database is paused. Please resume it.\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.\n\n * 503 DatabaseUnavailable - The operation failed because the database is unavailable."
}
},
"x-ms-odata": "#/definitions/SensitivityLabel",
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"Gets the current and recommended sensitivity labels of a given database": {
"$ref": "./examples/SensitivityLabelsListByDatabase.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}": {
"get": {
"tags": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "myRG",
"managedInstanceName": "myManagedInstanceName",
"databaseName": "myDatabase",
"api-version": "2021-08-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current",
"name": "current",
"type": "Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels",
"properties": {
"schemaName": "dbo",
"tableName": "myTable",
"columnName": "myColumn",
"informationType": "Financial",
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
"labelId": "05e6eaa1-075a-4fb4-a732-a92215a2444a",
"labelName": "Sensitive",
"rank": "Critical"
}
},
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn2/sensitivityLabels/recommended",
"name": "recommended",
"type": "Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels",
"properties": {
"schemaName": "dbo",
"tableName": "myTable",
"columnName": "myColumn2",
"informationType": "Email",
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
"labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
"labelName": "PII",
"rank": "Medium"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "myRG",
"serverName": "myServer",
"databaseName": "myDatabase",
"api-version": "2021-08-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": {
"schemaName": "dbo",
"tableName": "myTable",
"columnName": "myColumn",
"informationType": "Financial",
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
"labelId": "05e6eaa1-075a-4fb4-a732-a92215a2444a",
"labelName": "Sensitive"
}
},
{
"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": {
"schemaName": "dbo",
"tableName": "myTable",
"columnName": "myColumn2",
"informationType": "Email",
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
"labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
"labelName": "PII"
}
}
]
}
}
}
}

0 comments on commit 2159075

Please sign in to comment.