Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"swagger": "2.0",
"info": {
"version": "2019-06-01-preview",
"title": "SqlManagementClient",
"description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover": {
"post": {
"tags": [
"ManagedInstances"
],
"description": "Failovers a managed instance.",
"operationId": "ManagedInstances_Failover",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
Comment thread
milanbrkic-ms marked this conversation as resolved.
Outdated
},
{
"name": "managedInstanceName",
"in": "path",
"description": "The name of the managed instance to failover.",
"required": true,
"type": "string"
},
{
"name": "replicaType",
"in": "query",
"description": "The type of replica to be failed over.",
"required": false,
"type": "string",
"enum": [
"Primary",
"ReadableSecondary"
],
"x-ms-enum": {
"name": "ReplicaType",
"modelAsString": true
}
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
Comment thread
milanbrkic-ms marked this conversation as resolved.
Outdated
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully completed managed instance failover."
},
"202": {
"description": "Managed instance failover is in progress."
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 ManagementServiceFeatureDisabled - User attempted to use a feature which is disabled.\n\n * 400 ManagedInstanceFailoverThrottled - There was a recent failover on the managed instance.\n\n * 400 ManagedInstanceFailoverNotSupportedOnSKU - This type of customer initiated failover is not supported on the given SKU.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 409 ManagedInstanceNotInStateToFailover - The managed instance is currently in a state such that failover cannot be issued."
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Failover a managed instance.": {
"$ref": "./examples/FailoverManagedInstance.json"
}
}
}
}
},
"definitions": {},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"description": "The subscription ID that identifies an Azure subscription.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "The API version to use for the request.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
},
"ResourceGroupParameter": {
"name": "resourceGroupName",
"in": "path",
"description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"ServerNameParameter": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many unused and duplicate definitions here. They should be removed. I looked over other json in SQL, seems there are copy and paste since they exhibit same pattern. This creates problems in our codegen(autorest) and producing duplicate class schemas.

I opened an issue on our side to work with you to clean up these swaggers in the future.

"name": "serverName",
"in": "path",
"description": "The name of the server.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"ManagedInstanceNameParameter": {
"name": "managedInstanceName",
"in": "path",
"description": "The name of the managed instance.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"DatabaseNameParameter": {
"name": "databaseName",
"in": "path",
"description": "The name of the database.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"BlobAuditingPolicyNameParameter": {
"name": "blobAuditingPolicyName",
"in": "path",
"description": "The name of the blob auditing policy.",
"required": true,
"type": "string",
"enum": [
"default"
],
"x-ms-parameter-location": "method"
},
"SqlVirtualMachineInstanceNameParameter": {
"name": "sqlVirtualMachineInstanceName",
"in": "path",
"description": "The name of the SqlVirtualMachineInstance.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlVirtualMachineContainerNameParameter": {
"name": "sqlVirtualMachineContainerName",
"in": "path",
"description": "The name of the SqlVirtualMachineContainer.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"VirtualClusterNameParameter": {
"name": "virtualClusterName",
"in": "path",
"description": "The name of the virtual cluster.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
}
},
"securityDefinitions": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We would like to standardize security and securityDefinitions at beginning of the file to create consistency layout and ease of review.

"azure_auth": {
"type": "oauth2",
"description": "Azure Active Directory OAuth2 Flow",
"flow": "implicit",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"responses": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "testrg",
"managedInstanceName": "testinstance",
"replicaType": "Primary",
"api-version": "2019-06-01-preview"
},
"responses": {
"200": {},
"202": {}
}
}
4 changes: 4 additions & 0 deletions specification/sql/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ input-file:
- Microsoft.Sql/preview/2019-06-01-preview/managedInstanceOperations.json
- Microsoft.Sql/preview/2019-06-01-preview/syncGroups.json
- Microsoft.Sql/preview/2019-06-01-preview/syncMembers.json
- Microsoft.Sql/preview/2019-06-01-preview/FailoverManagedInstance.json

# Needed when there is more than one input file
override-info:
Expand Down Expand Up @@ -241,6 +242,7 @@ input-file:
- Microsoft.Sql/preview/2019-06-01-preview/ServerAzureADAdministrators.json
- Microsoft.Sql/preview/2019-06-01-preview/syncGroups.json
- Microsoft.Sql/preview/2019-06-01-preview/syncMembers.json
- Microsoft.Sql/preview/2019-06-01-preview/FailoverManagedInstance.json

# Needed when there is more than one input file
override-info:
Expand Down Expand Up @@ -333,6 +335,7 @@ input-file:
- Microsoft.Sql/preview/2019-06-01-preview/ServerAzureADAdministrators.json
- Microsoft.Sql/preview/2019-06-01-preview/syncGroups.json
- Microsoft.Sql/preview/2019-06-01-preview/syncMembers.json
- Microsoft.Sql/preview/2019-06-01-preview/FailoverManagedInstance.json

# Needed when there is more than one input file
override-info:
Expand Down Expand Up @@ -503,6 +506,7 @@ input-file:
- ./Microsoft.Sql/preview/2019-06-01-preview/ServerAzureADAdministrators.json
- ./Microsoft.Sql/preview/2019-06-01-preview/syncGroups.json
- ./Microsoft.Sql/preview/2019-06-01-preview/syncMembers.json
- ./Microsoft.Sql/preview/2019-06-01-preview/FailoverManagedInstance.json

# Needed when there is more than one input file
override-info:
Expand Down