Skip to content

Commit

Permalink
Fixing s360 violations related to recommendedactions APIs (#12951)
Browse files Browse the repository at this point in the history
* Fixing s360 violations related to recommendedactions APIs

* update the md file

* fixing operation id

* addressing pr comments
  • Loading branch information
dsgouda authored Feb 25, 2021
1 parent 761e8ce commit f8a0c3a
Show file tree
Hide file tree
Showing 9 changed files with 866 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"resourceGroupName": "testResourceGroupName",
"serverName": "testServerName",
"advisorName": "Index"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/testServerName/advisors/Index",
"name": "Index",
"type": "Microsoft.DBforPostgreSQL/servers/advisors",
"properties": {}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"resourceGroupName": "testResourceGroupName",
"serverName": "testServerName"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.DBforPostgreSQL/servers/testServerName/advisors/Index",
"name": "Index",
"type": "Microsoft.DBforPostgreSQL/servers/advisors",
"properties": {}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"resourceGroupName": "testResourceGroupName",
"serverName": "testServerName",
"advisorName": "Index",
"databaseName": "someDatabaseName"
},
"responses": {
"200": {},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"locationName": "WestUS",
"operationId": "aaaabbbb-cccc-dddd-0000-111122223333"
},
"responses": {
"200": {
"body": {
"name": "aaaabbbb-cccc-dddd-0000-111122223333",
"startTime": "2019-05-01T17:15:00Z",
"status": "succeeded"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"locationName": "WestUS",
"operationId": "aaaabbbb-cccc-dddd-0000-111122223333"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1",
"name": "Index-1",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 1,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`movie_id` appear in Join On clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)",
"queryIds": "779",
"indexName": "idx_movie_id",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`movie_id`",
"parentTableName": "movies_genres"
}
}
},
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2",
"name": "Index-2",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 2,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`genre` appear in Group By clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)",
"queryIds": "779",
"indexName": "idx_genre",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`genre`",
"parentTableName": "movies_genres"
}
}
}
]
}
},
"201": {
"body": {
"value": [
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1",
"name": "Index-1",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 1,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`movie_id` appear in Join On clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)",
"queryIds": "779",
"indexName": "idx_movie_id",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`movie_id`",
"parentTableName": "movies_genres"
}
}
},
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2",
"name": "Index-2",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 2,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`genre` appear in Group By clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)",
"queryIds": "779",
"indexName": "idx_genre",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`genre`",
"parentTableName": "movies_genres"
}
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"resourceGroupName": "testResourceGroupName",
"serverName": "testServerName",
"advisorName": "Index",
"recommendedActionName": "Index-1"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1",
"name": "Index-1",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 1,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`movie_id` appear in Join On clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)",
"queryIds": "779",
"indexName": "idx_movie_id",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`movie_id`",
"parentTableName": "movies_genres"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"parameters": {
"api-version": "2018-06-01",
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"resourceGroupName": "testResourceGroupName",
"serverName": "testServerName",
"advisorName": "Index"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-1",
"name": "Index-1",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 1,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`movie_id` appear in Join On clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_movie_id` (`movie_id`)",
"queryIds": "779",
"indexName": "idx_movie_id",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`movie_id`",
"parentTableName": "movies_genres"
}
}
},
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testResourceGroupName/providers/Microsoft.Sql/servers/testServerName/advisors/Index/recommendedActions/Index-2",
"name": "Index-2",
"type": "Microsoft.DBforPostgreSQL/servers/advisors/recommendedActions",
"properties": {
"advisorName": "Index",
"sessionId": "c63c2114-e2a4-4c7a-98c1-85577d1a5d50",
"actionId": 2,
"createdTime": "2019-05-01T23:43:24Z",
"expirationTime": "2019-05-08T23:43:24Z",
"reason": "Column `movies_genres`.`genre` appear in Group By clause(s).",
"recommendationType": "Add",
"details": {
"engine": "InnoDB",
"script": "alter table `movies`.`movies_genres` add index `idx_genre` (`genre`)",
"queryIds": "779",
"indexName": "idx_genre",
"indexType": "BTREE",
"tableName": "movies_genres",
"schemaName": "movies",
"indexColumns": "`movies_genres`.`genre`",
"parentTableName": "movies_genres"
}
}
}
]
}
}
}
}
3 changes: 3 additions & 0 deletions specification/postgresql/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ input-file:
- Microsoft.DBforPostgreSQL/stable/2018-06-01/PrivateEndpointConnections.json
- Microsoft.DBforPostgreSQL/stable/2018-06-01/PrivateLinkResources.json
- Microsoft.DBforPostgreSQL/stable/2018-06-01/QueryPerformanceInsights.json
- Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json
```


Expand Down Expand Up @@ -217,6 +219,7 @@ input-file:
- $(this-folder)/Microsoft.DBforPostgreSQL/stable/2018-06-01/PrivateEndpointConnections.json
- $(this-folder)/Microsoft.DBforPostgreSQL/stable/2018-06-01/PrivateLinkResources.json
- $(this-folder)/Microsoft.DBforPostgreSQL/stable/2018-06-01/QueryPerformanceInsights.json
- $(this-folder)/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json
- $(this-folder)/Microsoft.DBforPostgreSQL/stable/2020-01-01/DataEncryptionKeys.json
- $(this-folder)/Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateEndpointConnections.json
- $(this-folder)/Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateLinkResources.json
Expand Down

0 comments on commit f8a0c3a

Please sign in to comment.