From f3c7201d35c75b8eb8b14ad813bf0e38dcf36dc2 Mon Sep 17 00:00:00 2001 From: Deepak S Date: Wed, 10 Feb 2021 21:07:40 -0800 Subject: [PATCH 1/4] Fixing s360 violations related to recommendedactions APIs --- .../PerformanceRecommendations.json | 563 ++++++++++++++++++ .../2018-06-01/examples/AdvisorsGet.json | 19 + .../examples/AdvisorsListByServer.json | 22 + .../RecommendedActionSessionCreate.json | 14 + ...commendedActionSessionOperationStatus.json | 17 + .../RecommendedActionSessionResult.json | 122 ++++ .../examples/RecommendedActionsGet.json | 39 ++ .../RecommendedActionsListByServer.json | 67 +++ 8 files changed, 863 insertions(+) create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsGet.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsListByServer.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionCreate.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionResult.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsGet.json create mode 100644 specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsListByServer.json diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json new file mode 100644 index 000000000000..75b713effc3e --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json @@ -0,0 +1,563 @@ +{ + "swagger": "2.0", + "info": { + "version": "2018-06-01", + "title": "PostgreSQLManagementClient", + "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/advisors/{advisorName}": { + "get": { + "tags": [ + "Advisors" + ], + "operationId": "Advisors_Get", + "x-ms-examples": { + "AdvisorsGet": { + "$ref": "./examples/AdvisorsGet.json" + } + }, + "description": "Get a recommendation action advisor.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdvisorNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Advisor" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/advisors": { + "get": { + "tags": [ + "Advisors" + ], + "operationId": "Advisors_ListByServer", + "x-ms-examples": { + "AdvisorsListByServer": { + "$ref": "./examples/AdvisorsListByServer.json" + } + }, + "description": "List recommendation action advisors.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AdvisorsResultList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/advisors/{advisorName}/createRecommendedActionSession": { + "post": { + "tags": [ + "RecommendedActionSessions" + ], + "operationId": "CreateRecommendedActionSession", + "x-ms-examples": { + "RecommendedActionSessionCreate": { + "$ref": "./examples/RecommendedActionSessionCreate.json" + } + }, + "description": "Create recommendation action session for the advisor.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdvisorNameParameter" + }, + { + "name": "databaseName", + "in": "query", + "required": true, + "type": "string", + "description": "The name of the database." + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}": { + "get": { + "tags": [ + "RecommendedActions" + ], + "operationId": "RecommendedActions_Get", + "x-ms-examples": { + "RecommendedActionsGet": { + "$ref": "./examples/RecommendedActionsGet.json" + } + }, + "description": "Retrieve recommended actions from the advisor.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdvisorNameParameter" + }, + { + "$ref": "#/parameters/RecommendedActionNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/RecommendationAction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/advisors/{advisorName}/recommendedActions": { + "get": { + "tags": [ + "RecommendedActions" + ], + "operationId": "RecommendedActions_ListByServer", + "x-ms-examples": { + "RecommendedActionsListByServer": { + "$ref": "./examples/RecommendedActionsListByServer.json" + } + }, + "description": "Retrieve recommended actions from the advisor.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdvisorNameParameter" + }, + { + "name": "sessionId", + "in": "query", + "required": false, + "type": "string", + "description": "The recommendation action session identifier." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/RecommendationActionsResultList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/recommendedActionSessionsAzureAsyncOperation/{operationId}": { + "get": { + "tags": [ + "LocationBasedRecommendedActionSessionsOperationStatus" + ], + "operationId": "LocationBasedRecommendedActionSessionsOperationStatus_Get", + "x-ms-examples": { + "RecommendedActionSessionOperationStatus": { + "$ref": "./examples/RecommendedActionSessionOperationStatus.json" + } + }, + "description": "Recommendation action session operation status.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/LocationNameParameter" + }, + { + "$ref": "#/parameters/OperationIdParameter" + } + ], + "responses": { + "200": { + "description": "OK.", + "schema": { + "$ref": "#/definitions/RecommendedActionSessionsOperationStatus" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/recommendedActionSessionsOperationResults/{operationId}": { + "get": { + "tags": [ + "LocationBasedRecommendedActionSessionsResult" + ], + "operationId": "LocationBasedRecommendedActionSessionsResult_List", + "x-ms-examples": { + "RecommendedActionSessionResult": { + "$ref": "./examples/RecommendedActionSessionResult.json" + } + }, + "description": "Recommendation action session operation result.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/LocationNameParameter" + }, + { + "$ref": "#/parameters/OperationIdParameter" + } + ], + "responses": { + "200": { + "description": "Created", + "schema": { + "$ref": "#/definitions/RecommendationActionsResultList" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/RecommendationActionsResultList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "AdvisorProperties": { + "properties": {}, + "description": "The properties of a recommendation action advisor." + }, + "Advisor": { + "properties": { + "properties": { + "$ref": "#/definitions/AdvisorProperties", + "x-ms-client-flatten": true, + "description": "The properties of a recommendation action advisor." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a recommendation action advisor." + }, + "AdvisorsResultList": { + "description": "A list of query statistics.", + "type": "object", + "properties": { + "value": { + "description": "The list of recommendation action advisors.", + "type": "array", + "items": { + "$ref": "#/definitions/Advisor" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "RecommendationActionProperties": { + "properties": { + "advisorName": { + "type": "string", + "description": "Advisor name." + }, + "sessionId": { + "type": "string", + "description": "Recommendation action session identifier." + }, + "actionId": { + "type": "integer", + "format": "int32", + "description": "Recommendation action identifier." + }, + "createdTime": { + "type": "string", + "format": "date-time", + "description": "Recommendation action creation time." + }, + "expirationTime": { + "type": "string", + "format": "date-time", + "description": "Recommendation action expiration time." + }, + "reason": { + "type": "string", + "description": "Recommendation action reason." + }, + "recommendationType": { + "type": "string", + "description": "Recommendation action type." + }, + "details": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Recommendation action details." + } + }, + "description": "The properties of a recommendation action." + }, + "RecommendationAction": { + "properties": { + "properties": { + "$ref": "#/definitions/RecommendationActionProperties", + "x-ms-client-flatten": true, + "description": "The properties of a recommendation action." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Recommendation Action." + }, + "RecommendationActionsResultList": { + "description": "A list of recommendation actions.", + "type": "object", + "properties": { + "value": { + "description": "The list of recommendation action advisors.", + "type": "array", + "items": { + "$ref": "#/definitions/RecommendationAction" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "RecommendedActionSessionsOperationStatus": { + "properties": { + "name": { + "type": "string", + "description": "Operation identifier." + }, + "startTime": { + "type": "string", + "format": "date-time", + "description": "Operation start time." + }, + "status": { + "type": "string", + "description": "Operation status." + } + }, + "description": "Recommendation action session operation status." + }, + "CloudError": { + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + }, + "description": "An error response from the Batch service." + } + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "description": "The name of the server.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "LocationNameParameter": { + "name": "locationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the location.", + "x-ms-parameter-location": "method" + }, + "AdvisorNameParameter": { + "name": "advisorName", + "in": "path", + "required": true, + "type": "string", + "description": "The advisor name for recommendation action.", + "x-ms-parameter-location": "method" + }, + "RecommendedActionNameParameter": { + "name": "recommendedActionName", + "in": "path", + "required": true, + "type": "string", + "description": "The recommended action name.", + "x-ms-parameter-location": "method" + }, + "OperationIdParameter": { + "name": "operationId", + "in": "path", + "required": true, + "type": "string", + "description": "The operation identifier.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsGet.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsGet.json new file mode 100644 index 000000000000..014bfae5265a --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsGet.json @@ -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": {} + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsListByServer.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsListByServer.json new file mode 100644 index 000000000000..a079a807e743 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/AdvisorsListByServer.json @@ -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": {} + } + ] + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionCreate.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionCreate.json new file mode 100644 index 000000000000..7496a76cac2a --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionCreate.json @@ -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": {} + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json new file mode 100644 index 000000000000..61bd9a019661 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionOperationStatus.json @@ -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" + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionResult.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionResult.json new file mode 100644 index 000000000000..984a2901e36a --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionSessionResult.json @@ -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" + } + } + } + ] + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsGet.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsGet.json new file mode 100644 index 000000000000..67221a058051 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsGet.json @@ -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" + } + } + } + } + } +} diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsListByServer.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsListByServer.json new file mode 100644 index 000000000000..7f948cc98ca3 --- /dev/null +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/RecommendedActionsListByServer.json @@ -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" + } + } + } + ] + } + } + } +} From d3832fadddfce111018dc656d7e1da1f416b6708 Mon Sep 17 00:00:00 2001 From: Deepak S Date: Wed, 10 Feb 2021 22:46:50 -0800 Subject: [PATCH 2/4] update the md file --- specification/postgresql/resource-manager/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/postgresql/resource-manager/readme.md b/specification/postgresql/resource-manager/readme.md index 91b29e7740fa..5f0842e07c79 100644 --- a/specification/postgresql/resource-manager/readme.md +++ b/specification/postgresql/resource-manager/readme.md @@ -98,6 +98,8 @@ These settings apply only when `--tag=package-2018-06-01-privatepreview` is spec input-file: - Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateEndpointConnections.json - Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateLinkResources.json +- Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PerformanceRecommendations.json +- Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/QueryPerformanceInsights.json ``` ### Tag: package-2018-06-01 From d01da656cb839dec070b6f4351d8c942b6b5b837 Mon Sep 17 00:00:00 2001 From: Deepak S Date: Mon, 22 Feb 2021 07:31:09 -0800 Subject: [PATCH 3/4] fixing operation id --- .../stable/2018-06-01/PerformanceRecommendations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json index 75b713effc3e..cdf50e380c06 100644 --- a/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json +++ b/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/PerformanceRecommendations.json @@ -129,7 +129,7 @@ "tags": [ "RecommendedActionSessions" ], - "operationId": "CreateRecommendedActionSession", + "operationId": "Advisors_CreateRecommendedActionSession", "x-ms-examples": { "RecommendedActionSessionCreate": { "$ref": "./examples/RecommendedActionSessionCreate.json" From 6cfa1ee7d16c0391ba776a05b241edd536aa0519 Mon Sep 17 00:00:00 2001 From: Deepak S Date: Wed, 24 Feb 2021 06:41:30 -0800 Subject: [PATCH 4/4] addressing pr comments --- specification/postgresql/resource-manager/readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specification/postgresql/resource-manager/readme.md b/specification/postgresql/resource-manager/readme.md index 5f0842e07c79..763d593c1081 100644 --- a/specification/postgresql/resource-manager/readme.md +++ b/specification/postgresql/resource-manager/readme.md @@ -98,8 +98,6 @@ These settings apply only when `--tag=package-2018-06-01-privatepreview` is spec input-file: - Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateEndpointConnections.json - Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PrivateLinkResources.json -- Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/PerformanceRecommendations.json -- Microsoft.DBforPostgreSQL/preview/2018-06-01-privatepreview/QueryPerformanceInsights.json ``` ### Tag: package-2018-06-01 @@ -114,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 + ``` @@ -219,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