Skip to content

Commit 2159075

Browse files
ericshapeFredericHeem
authored andcommitted
Add missing SensitivityLabels APIs to fix S360 issues (Azure#17562)
* add the missing SensitivityLabels APIs to fix S360 issues * add example files
1 parent 413b636 commit 2159075

File tree

4 files changed

+202
-4
lines changed

4 files changed

+202
-4
lines changed

specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/ManagedDatabaseSensitivityLabels.json

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"description": "Successfully disabled the sensitivity recommendations on the given column."
336336
},
337337
"default": {
338-
"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."
338+
"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."
339339
}
340340
},
341341
"x-ms-examples": {
@@ -412,7 +412,7 @@
412412
"description": "Successfully enabled the sensitivity recommendations on the given column."
413413
},
414414
"default": {
415-
"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."
415+
"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."
416416
}
417417
},
418418
"x-ms-examples": {
@@ -422,6 +422,59 @@
422422
}
423423
}
424424
},
425+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels": {
426+
"get": {
427+
"tags": [
428+
"ManagedDatabaseSensitivityLabels"
429+
],
430+
"description": "Gets the sensitivity labels of a given database",
431+
"operationId": "ManagedDatabaseSensitivityLabels_ListByDatabase",
432+
"parameters": [
433+
{
434+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
435+
},
436+
{
437+
"$ref": "#/parameters/ManagedInstanceNameParameter"
438+
},
439+
{
440+
"$ref": "#/parameters/DatabaseNameParameter"
441+
},
442+
{
443+
"name": "$filter",
444+
"in": "query",
445+
"description": "An OData filter expression that filters elements in the collection.",
446+
"required": false,
447+
"type": "string"
448+
},
449+
{
450+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
451+
},
452+
{
453+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
454+
}
455+
],
456+
"responses": {
457+
"200": {
458+
"description": "Successfully retrieved the sensitivity labels.",
459+
"schema": {
460+
"$ref": "#/definitions/SensitivityLabelListResult"
461+
}
462+
},
463+
"default": {
464+
"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."
465+
}
466+
},
467+
"x-ms-odata": "#/definitions/SensitivityLabel",
468+
"x-ms-pageable": {
469+
"nextLinkName": "nextLink"
470+
},
471+
"x-ms-examples": {
472+
"Gets the current and recommended sensitivity labels of a given database": {
473+
"$ref": "./examples/ManagedDatabaseSensitivityLabelsListByDatabase.json"
474+
}
475+
}
476+
}
477+
},
425478
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels": {
426479
"get": {
427480
"tags": [

specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/SensitivityLabels.json

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
"description": "Successfully enabled the sensitivity recommendations on the given column."
301301
},
302302
"default": {
303-
"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."
303+
"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."
304304
}
305305
},
306306
"x-ms-examples": {
@@ -373,7 +373,7 @@
373373
"description": "Successfully disabled the sensitivity recommendation on the given column."
374374
},
375375
"default": {
376-
"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."
376+
"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."
377377
}
378378
},
379379
"x-ms-examples": {
@@ -383,6 +383,59 @@
383383
}
384384
}
385385
},
386+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels": {
387+
"get": {
388+
"tags": [
389+
"SensitivityLabels"
390+
],
391+
"description": "Gets the sensitivity labels of a given database",
392+
"operationId": "SensitivityLabels_ListByDatabase",
393+
"parameters": [
394+
{
395+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
396+
},
397+
{
398+
"$ref": "#/parameters/ServerNameParameter"
399+
},
400+
{
401+
"$ref": "#/parameters/DatabaseNameParameter"
402+
},
403+
{
404+
"name": "$filter",
405+
"in": "query",
406+
"description": "An OData filter expression that filters elements in the collection.",
407+
"required": false,
408+
"type": "string"
409+
},
410+
{
411+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
412+
},
413+
{
414+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
415+
}
416+
],
417+
"responses": {
418+
"200": {
419+
"description": "Successfully retrieved the sensitivity labels.",
420+
"schema": {
421+
"$ref": "#/definitions/SensitivityLabelListResult"
422+
}
423+
},
424+
"default": {
425+
"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."
426+
}
427+
},
428+
"x-ms-odata": "#/definitions/SensitivityLabel",
429+
"x-ms-pageable": {
430+
"nextLinkName": "nextLink"
431+
},
432+
"x-ms-examples": {
433+
"Gets the current and recommended sensitivity labels of a given database": {
434+
"$ref": "./examples/SensitivityLabelsListByDatabase.json"
435+
}
436+
}
437+
}
438+
},
386439
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}": {
387440
"get": {
388441
"tags": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "myRG",
5+
"managedInstanceName": "myManagedInstanceName",
6+
"databaseName": "myDatabase",
7+
"api-version": "2021-08-01-preview"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"value": [
13+
{
14+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current",
15+
"name": "current",
16+
"type": "Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels",
17+
"properties": {
18+
"schemaName": "dbo",
19+
"tableName": "myTable",
20+
"columnName": "myColumn",
21+
"informationType": "Financial",
22+
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
23+
"labelId": "05e6eaa1-075a-4fb4-a732-a92215a2444a",
24+
"labelName": "Sensitive",
25+
"rank": "Critical"
26+
}
27+
},
28+
{
29+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/managedInstances/myManagedInstanceName/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn2/sensitivityLabels/recommended",
30+
"name": "recommended",
31+
"type": "Microsoft.Sql/managedInstances/databases/schemas/tables/columns/sensitivityLabels",
32+
"properties": {
33+
"schemaName": "dbo",
34+
"tableName": "myTable",
35+
"columnName": "myColumn2",
36+
"informationType": "Email",
37+
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
38+
"labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
39+
"labelName": "PII",
40+
"rank": "Medium"
41+
}
42+
}
43+
]
44+
}
45+
}
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "myRG",
5+
"serverName": "myServer",
6+
"databaseName": "myDatabase",
7+
"api-version": "2021-08-01-preview"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"value": [
13+
{
14+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current",
15+
"name": "current",
16+
"type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels",
17+
"properties": {
18+
"schemaName": "dbo",
19+
"tableName": "myTable",
20+
"columnName": "myColumn",
21+
"informationType": "Financial",
22+
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
23+
"labelId": "05e6eaa1-075a-4fb4-a732-a92215a2444a",
24+
"labelName": "Sensitive"
25+
}
26+
},
27+
{
28+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn2/sensitivityLabels/recommended",
29+
"name": "recommended",
30+
"type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels",
31+
"properties": {
32+
"schemaName": "dbo",
33+
"tableName": "myTable",
34+
"columnName": "myColumn2",
35+
"informationType": "Email",
36+
"informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
37+
"labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
38+
"labelName": "PII"
39+
}
40+
}
41+
]
42+
}
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)