Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed Instance GeoRestore Cmds #4947

Merged
merged 4 commits into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all 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,51 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "Default-SQL-SouthEastAsia",
"managedInstanceName": "server1",
"databaseName": "testdb_recovered",
"api-version": "2017-03-01-preview",
"parameters": {
"location": "southeastasia",
"properties": {
"createMode": "Recovery",
"RecoverableDatabaseId": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/Default-SQL-WestEurope/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb"
}
}
},
"responses": {
"200": {
"body": {
"tags": {
"tagKey1": "TagValue1"
},
"location": "southeastasia",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/server1/recoverableDatabases/testdb_recovered",
"name": "testdb_recovered",
"properties": {
"collation": "SQL_Latin1_General_CP1_CI_AS",
"status": "Online",
"creationDate": "2018-11-07T04:41:33.937Z"
},
"type": "Microsoft.Sql/managedInstances/databases"
}
},
"201": {
"body": {
"tags": {
"tagKey1": "TagValue1"
},
"location": "southeastasia",
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb_recovered",
"name": "testdb_recovered",
"properties": {
"collation": "SQL_Latin1_General_CP1_CI_AS",
"status": "Online",
"creationDate": "2018-11-07T04:41:33.937Z"
},
"type": "Microsoft.Sql/managedInstances/databases"
}
},
"202": { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "Test1",
"managedInstanceName": "managedInstance",
"recoverableDatabaseName": "testdb",
"api-version": "2017-10-01-preview"
},
"responses": {
"200": {
"body": {
"properties": {
"lastAvailableBackupDate": "2017-05-26T01:06:29.78Z"
},
"id":
"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDatabases/testdb",
"name": "testdb",
"type": "Microsoft.Sql/managedInstances/recoverableDatabases"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "Test1",
"managedInstanceName": "managedInstance",
"api-version": "2017-10-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"properties": {
"lastAvailableBackupDate": "2017-05-26T01:06:29.78Z"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDaatabases/testdb",
"name": "testdb",
"type": "Microsoft.Sql/managedInstances/recoverableDaatabases"
},
{
"properties": {
"lastAvailableBackupDate": "2018-04-26T02:17:23.44Z"
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/managedInstances/testsvr/recoverableDaatabases/testdb2",
"name": "testdb2",
"type": "Microsoft.Sql/managedInstances/recoverableDaatabases"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
{
"swagger": "2.0",
"info": {
"version": "2017-10-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": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to delete a recoverableDatabase through an API? Or is this a valid scenario? I am assuming that databases are automatically categorized as recoverable or not by the service.

Copy link
Contributor Author

@lixiachena lixiachena Jan 11, 2019

Choose a reason for hiding this comment

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

Recoverabledatabase is a read only. Customer can't drop it

Copy link
Contributor

Choose a reason for hiding this comment

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

@ravbhatnagar their lifetime is managed by the service, so no create or delete API is possible or needed.

"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases": {
"get": {
"tags": [
"RecoverableManagedDatabases"
],
"description": "Gets a list of recoverable managed databases.",
"operationId": "RecoverableManagedDatabases_ListByInstance",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the list of recoverable managed databases.",
"schema": {
"$ref": "#/definitions/RecoverableManagedDatabaseListResult"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found."
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"List recoverable databases by managed instances": {
"$ref": "./examples/ListRecoverableManagedDatabasesByServer.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}": {
"get": {
"tags": [
"RecoverableManagedDatabases"
],
"description": "Gets a recoverable managed database.",
"operationId": "RecoverableManagedDatabases_Get",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"name": "recoverableDatabaseName",
"in": "path",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the specified recoverable managed database.",
"schema": {
"$ref": "#/definitions/RecoverableManagedDatabase"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 InvalidRecoverableDatabaseId - Invalid recoverable database identifier.\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found."
}
},
"x-ms-examples": {
"Gets a recoverable databases by managed instances": {
"$ref": "./examples/GetRecoverableManagedDatabase.json"
}
}
}
}
},
"definitions": {
"RecoverableManagedDatabaseListResult": {
"description": "A list of recoverable managed databases.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/RecoverableManagedDatabase"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
},
"RecoverableManagedDatabaseProperties": {
"description": "The recoverable managed database's properties.",
"type": "object",
"properties": {
"lastAvailableBackupDate": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be ISO 8601 compliant and so the format should be date-time

Copy link
Contributor Author

@lixiachena lixiachena Jan 11, 2019

Choose a reason for hiding this comment

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

This is actually a string format. This value will be used later by customer for restore

Copy link
Contributor

Choose a reason for hiding this comment

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

Lixia, what should this property's data type be in generated C# code? string, or datetime?

"description": "The last available backup date.",
"type": "string",
"readOnly": true
}
}
},
"Resource": {
"description": "ARM resource.",
"type": "object",
"properties": {
"id": {
"description": "Resource ID.",
"type": "string",
"readOnly": true
},
"name": {
"description": "Resource name.",
"type": "string",
"readOnly": true
},
"type": {
"description": "Resource type.",
"type": "string",
"readOnly": true
}
},
"x-ms-azure-resource": true
},
"ProxyResource": {
"description": "ARM proxy resource.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"properties": {}
},
"RecoverableManagedDatabase": {
"description": "A recoverable managed database resource.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/RecoverableManagedDatabaseProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
}
}
},
"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": {
"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": {
"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"
}
}
}
}
Loading