Skip to content

Commit

Permalink
CosmosDB Restoreable APIs for SQL and MongoDB database account (Azure…
Browse files Browse the repository at this point in the history
…#11428)

* adding new restorable apis

* fix some typos

* fix validations

* fix more validations

* prettier

* fix name and add apitype

* fix casing

* add custom word etcd

* add mongodb

* fix prameter name

* fix validations

* make read only

* remove the word snapshot and make properties readonly

* pretty

* improved some descriptions

* update description and removed mongodb content

* fix container property name

* fix documentcollection name

* make query parameter optional

* address Meha's comments

* move restorable apis to separate file

* move restorable database apis back to cosmos-db.json

* remove point read apis

* fix avocado
  • Loading branch information
vinhms authored and DeMale committed Dec 11, 2020
1 parent 444a30f commit 4bb78b6
Show file tree
Hide file tree
Showing 12 changed files with 1,161 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7695,7 +7695,7 @@
},
"databasesToRestore": {
"type": "array",
"description": "List of specific databases to restore.",
"description": "List of specific databases available for restore.",
"items": {
"$ref": "#/definitions/DatabaseRestoreResource"
}
Expand All @@ -7708,11 +7708,11 @@
"properties": {
"databaseName": {
"type": "string",
"description": "The name of the database to restore."
"description": "The name of the database available for restore."
},
"collectionNames": {
"type": "array",
"description": "The names of the collections to restore.",
"description": "The names of the collections available for restore.",
"items": {
"$ref": "#/definitions/CollectionName"
}
Expand Down Expand Up @@ -7837,6 +7837,65 @@
"type": "string",
"format": "date-time",
"description": "The time at which the restorable database account has been deleted (ISO-8601 format)."
},
"apiType": {
"type": "string",
"readOnly": true,
"description": "The API type of the restorable database account.",
"$ref": "#/definitions/ApiType"
},
"restorableLocations": {
"type": "array",
"readOnly": true,
"description": "List of regions where the of the database account can be restored from.",
"items": {
"$ref": "#/definitions/RestorableLocationResource"
}
}
}
},
"ApiType": {
"description": "Enum to indicate the API type of the restorable database account.",
"type": "string",
"readOnly": true,
"enum": [
"MongoDB",
"Gremlin",
"Cassandra",
"Table",
"Sql",
"GremlinV2"
],
"x-ms-enum": {
"name": "ApiType",
"modelAsString": true
}
},
"RestorableLocationResource": {
"type": "object",
"description": "Properties of the regional restorable account.",
"properties": {
"locationName": {
"type": "string",
"readOnly": true,
"description": "The location of the regional restorable account."
},
"regionalDatabaseAccountInstanceId": {
"type": "string",
"readOnly": true,
"description": "The instance id of the regional restorable account."
},
"creationTime": {
"type": "string",
"readOnly": true,
"format": "date-time",
"description": "The creation time of the regional restorable database account (ISO-8601 format)."
},
"deletionTime": {
"type": "string",
"readOnly": true,
"format": "date-time",
"description": "The time at which the regional restorable database account has been deleted (ISO-8601 format)."
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@
"properties": {
"accountName": "ddb1",
"creationTime": "2020-04-11T21:56:15Z",
"deletionTime": "2020-06-12T22:05:09Z"
"deletionTime": "2020-06-12T22:05:09Z",
"apiType": "Sql",
"restorableLocations": [
{
"locationName": "South Central US",
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
"creationTime": "2020-10-30T21:13:10.7486417Z",
"deletionTime": "2020-10-30T21:13:35.4466333Z"
},
{
"locationName": "West US",
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
"creationTime": "2020-10-30T21:13:10.7486417Z"
}
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,21 @@
"properties": {
"accountName": "ddb1",
"creationTime": "2020-04-11T21:56:15Z",
"deletionTime": "2020-06-12T22:05:09Z"
"deletionTime": "2020-06-12T22:05:09Z",
"apiType": "Sql",
"restorableLocations": [
{
"locationName": "South Central US",
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
"creationTime": "2020-10-30T21:13:10.7486417Z",
"deletionTime": "2020-10-30T21:13:35.4466333Z"
},
{
"locationName": "West US",
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
"creationTime": "2020-10-30T21:13:10.7486417Z"
}
]
}
},
{
Expand All @@ -26,7 +40,21 @@
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts",
"properties": {
"accountName": "ddb2",
"creationTime": "2020-05-01T08:05:18Z"
"creationTime": "2020-05-01T08:05:18Z",
"apiType": "Sql",
"restorableLocations": [
{
"locationName": "South Central US",
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
"creationTime": "2020-10-30T21:13:10.7486417Z",
"deletionTime": "2020-10-30T21:13:35.4466333Z"
},
{
"locationName": "West US",
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
"creationTime": "2020-10-30T21:13:10.7486417Z"
}
]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@
"properties": {
"accountName": "ddb1",
"creationTime": "2020-04-11T21:56:15Z",
"deletionTime": "2020-06-12T22:05:09Z"
"deletionTime": "2020-06-12T22:05:09Z",
"apiType": "Sql",
"restorableLocations": [
{
"locationName": "South Central US",
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
"creationTime": "2020-10-30T21:13:10.7486417Z",
"deletionTime": "2020-10-30T21:13:35.4466333Z"
},
{
"locationName": "West US",
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
"creationTime": "2020-10-30T21:13:10.7486417Z"
}
]
}
},
{
Expand All @@ -25,7 +39,21 @@
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts",
"properties": {
"accountName": "ddb2",
"creationTime": "2020-05-01T08:05:18Z"
"creationTime": "2020-05-01T08:05:18Z",
"apiType": "Sql",
"restorableLocations": [
{
"locationName": "South Central US",
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
"creationTime": "2020-10-30T21:13:10.7486417Z",
"deletionTime": "2020-10-30T21:13:35.4466333Z"
},
{
"locationName": "West US",
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
"creationTime": "2020-10-30T21:13:10.7486417Z"
}
]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"parameters": {
"api-version": "2020-06-01-preview",
"subscriptionId": "subid",
"location": "WestUS",
"instanceId": "98a570f2-63db-4117-91f0-366327b7b353",
"restorableMongodbDatabaseRid": "PD5DALigDgw="
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86",
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections",
"name": "79609a98-3394-41f8-911f-cfab0c075c86",
"properties": {
"resource": {
"_rid": "zAyAPQAAAA==",
"eventTimestamp": "2020-10-13T04:56:42Z",
"ownerId": "Collection1",
"ownerResourceId": "V18LoLrv-qA=",
"operationType": "Create"
}
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"parameters": {
"api-version": "2020-06-01-preview",
"subscriptionId": "2296c272-5d55-40d9-bc05-4d56dc2d7588",
"location": "WestUS",
"instanceId": "d9b26648-2f53-4541-b3d8-3044f4f9810d"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableMongodbDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc",
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases",
"name": "59c21367-b98b-4a8e-abb7-b6f46600decc",
"properties": {
"resource": {
"_rid": "DLB14gAAAA==",
"eventTimestamp": "2020-09-02T19:45:03Z",
"ownerId": "Database1",
"ownerResourceId": "PD5DALigDgw=",
"operationType": "Create"
}
}
},
{
"id": "/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableMongodbDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257",
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases",
"name": "8456cb17-cdb0-4c6a-8db8-d0ff3f886257",
"properties": {
"resource": {
"_rid": "ESXNLAAAAA==",
"eventTimestamp": "2020-09-02T19:53:42Z",
"ownerId": "Database1",
"ownerResourceId": "PD5DALigDgw=",
"operationType": "Delete"
}
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parameters": {
"api-version": "2020-06-01-preview",
"subscriptionId": "2296c272-5d55-40d9-bc05-4d56dc2d7588",
"location": "WestUS",
"instanceId": "d9b26648-2f53-4541-b3d8-3044f4f9810d",
"restoreLocation": "WestUS",
"restoreTimestampInUtc": "10/13/2020 4:56"
},
"responses": {
"200": {
"body": {
"value": [
{
"databaseName": "Database1",
"collectionNames": [
"Collection1"
]
},
{
"databaseName": "Database2",
"collectionNames": [
"Collection1",
"Collection2"
]
},
{
"databaseName": "Database3",
"collectionNames": []
}
]
}
}
}
}
Loading

0 comments on commit 4bb78b6

Please sign in to comment.