diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/advisors.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/advisors.json index 76aaa12b7119..bfafbf330fa4 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/advisors.json +++ b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/advisors.json @@ -16,6 +16,144 @@ "application/json" ], "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors": { + "get": { + "tags": [ + "ServerAdvisors" + ], + "description": "Gets a list of server advisors.", + "operationId": "ServerAdvisors_ListByServer", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of server advisors.", + "schema": { + "$ref": "#/definitions/AdvisorListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 AdvisorNotFound - The requested advisor was not found.\n\n * 503 ServiceTemporarilyUnavailable - Feature temporarily unavailable." + } + }, + "x-ms-examples": { + "List of server advisors": { + "$ref": "./examples/ServerAdvisorList.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}": { + "get": { + "tags": [ + "ServerAdvisors" + ], + "description": "Gets a server advisor.", + "operationId": "ServerAdvisors_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "advisorName", + "in": "path", + "description": "The name of the Server Advisor.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved details of specified server advisor.", + "schema": { + "$ref": "#/definitions/Advisor" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 AdvisorNotFound - The requested advisor was not found.\n\n * 405 NotSupported - This functionality is not supported.\n\n * 409 Conflict - Request could not be processed because of conflict in the request.\n\n * 503 ServiceTemporarilyUnavailable - Feature temporarily unavailable." + } + }, + "x-ms-examples": { + "Get server advisor": { + "$ref": "./examples/ServerAdvisorGet.json" + } + } + }, + "patch": { + "tags": [ + "ServerAdvisors" + ], + "description": "Updates a server advisor.", + "operationId": "ServerAdvisors_Update", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "advisorName", + "in": "path", + "description": "The name of the Server Advisor.", + "required": true, + "type": "string" + }, + { + "name": "parameters", + "in": "body", + "description": "The requested advisor resource state.", + "required": true, + "schema": { + "$ref": "#/definitions/Advisor" + } + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully updated the specified server advisor.", + "schema": { + "$ref": "#/definitions/Advisor" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 AdvisorNotFound - The requested advisor was not found.\n\n * 405 NotSupported - This functionality is not supported.\n\n * 409 Conflict - Request could not be processed because of conflict in the request.\n\n * 503 ServiceTemporarilyUnavailable - Feature temporarily unavailable." + } + }, + "x-ms-examples": { + "Update server advisor": { + "$ref": "./examples/ServerAdvisorUpdate.json" + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors": { "get": { "tags": [ diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorGet.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorGet.json new file mode 100644 index 000000000000..26644a541240 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorGet.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "workloadinsight-demos", + "serverName": "misosisvr", + "advisorName": "CreateIndex", + "api-version": "2014-04-01" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex", + "name": "CreateIndex", + "type": "Microsoft.Sql/servers/advisors", + "properties": { + "advisorStatus": "GA", + "autoExecuteValue": "Disabled" + } + } + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorList.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorList.json new file mode 100644 index 000000000000..4a43205a0512 --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorList.json @@ -0,0 +1,50 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "workloadinsight-demos", + "serverName": "misosisvr", + "api-version": "2014-04-01" + }, + "responses": { + "200": { + "body": [ + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex", + "name": "CreateIndex", + "type": "Microsoft.Sql/servers/advisors", + "properties": { + "advisorStatus": "GA", + "autoExecuteValue": "Disabled" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DropIndex", + "name": "DropIndex", + "type": "Microsoft.Sql/servers/advisors", + "properties": { + "advisorStatus": "GA", + "autoExecuteValue": "Disabled" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/DbParameterization", + "name": "DbParameterization", + "type": "Microsoft.Sql/servers/advisors", + "properties": { + "advisorStatus": "GA", + "autoExecuteValue": "Disabled" + } + }, + { + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/ForceLastGoodPlan", + "name": "ForceLastGoodPlan", + "type": "Microsoft.Sql/servers/advisors", + "properties": { + "advisorStatus": "PrivatePreview", + "autoExecuteValue": "Disabled" + } + } + ] + } + } +} \ No newline at end of file diff --git a/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorUpdate.json b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorUpdate.json new file mode 100644 index 000000000000..b7f33d9f1f3a --- /dev/null +++ b/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerAdvisorUpdate.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "subscriptionId": "00000000-1111-2222-3333-444444444444", + "resourceGroupName": "workloadinsight-demos", + "serverName": "misosisvr", + "advisorName": "CreateIndex", + "api-version": "2014-04-01", + "parameters": { + "properties": { + "autoExecuteValue": "Disabled" + } + } + }, + "responses": { + "200": { + "body": { + "properties": { + "advisorStatus": "GA", + "autoExecuteValue": "Disabled" + }, + "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workloadinsight-demos/providers/Microsoft.Sql/servers/misosisvr/advisors/CreateIndex", + "name": "CreateIndex", + "type": "Microsoft.Sql/servers/advisors" + } + } + } +}