Skip to content

Commit

Permalink
Updating swagger with missing 2014-04-01 advisor server api. (#2835)
Browse files Browse the repository at this point in the history
* Updating swagger with missing 2014-04-01 advisor server api.

* Updated response to return AdvisorListResult, in order to align server advisor api response with database advisor api response.
  • Loading branch information
StefanLazic92 authored and jhendrixMSFT committed Apr 10, 2018
1 parent 0d3fc5e commit 8a4e351
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}

0 comments on commit 8a4e351

Please sign in to comment.