Skip to content

Commit c48fcd4

Browse files
vinhmsgiromm2ms
authored andcommitted
CosmosDB Restoreable APIs for SQL and MongoDB database account (Azure#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
1 parent 6b9a2c3 commit c48fcd4

12 files changed

+1161
-8
lines changed

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/cosmos-db.json

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7695,7 +7695,7 @@
76957695
},
76967696
"databasesToRestore": {
76977697
"type": "array",
7698-
"description": "List of specific databases to restore.",
7698+
"description": "List of specific databases available for restore.",
76997699
"items": {
77007700
"$ref": "#/definitions/DatabaseRestoreResource"
77017701
}
@@ -7708,11 +7708,11 @@
77087708
"properties": {
77097709
"databaseName": {
77107710
"type": "string",
7711-
"description": "The name of the database to restore."
7711+
"description": "The name of the database available for restore."
77127712
},
77137713
"collectionNames": {
77147714
"type": "array",
7715-
"description": "The names of the collections to restore.",
7715+
"description": "The names of the collections available for restore.",
77167716
"items": {
77177717
"$ref": "#/definitions/CollectionName"
77187718
}
@@ -7837,6 +7837,65 @@
78377837
"type": "string",
78387838
"format": "date-time",
78397839
"description": "The time at which the restorable database account has been deleted (ISO-8601 format)."
7840+
},
7841+
"apiType": {
7842+
"type": "string",
7843+
"readOnly": true,
7844+
"description": "The API type of the restorable database account.",
7845+
"$ref": "#/definitions/ApiType"
7846+
},
7847+
"restorableLocations": {
7848+
"type": "array",
7849+
"readOnly": true,
7850+
"description": "List of regions where the of the database account can be restored from.",
7851+
"items": {
7852+
"$ref": "#/definitions/RestorableLocationResource"
7853+
}
7854+
}
7855+
}
7856+
},
7857+
"ApiType": {
7858+
"description": "Enum to indicate the API type of the restorable database account.",
7859+
"type": "string",
7860+
"readOnly": true,
7861+
"enum": [
7862+
"MongoDB",
7863+
"Gremlin",
7864+
"Cassandra",
7865+
"Table",
7866+
"Sql",
7867+
"GremlinV2"
7868+
],
7869+
"x-ms-enum": {
7870+
"name": "ApiType",
7871+
"modelAsString": true
7872+
}
7873+
},
7874+
"RestorableLocationResource": {
7875+
"type": "object",
7876+
"description": "Properties of the regional restorable account.",
7877+
"properties": {
7878+
"locationName": {
7879+
"type": "string",
7880+
"readOnly": true,
7881+
"description": "The location of the regional restorable account."
7882+
},
7883+
"regionalDatabaseAccountInstanceId": {
7884+
"type": "string",
7885+
"readOnly": true,
7886+
"description": "The instance id of the regional restorable account."
7887+
},
7888+
"creationTime": {
7889+
"type": "string",
7890+
"readOnly": true,
7891+
"format": "date-time",
7892+
"description": "The creation time of the regional restorable database account (ISO-8601 format)."
7893+
},
7894+
"deletionTime": {
7895+
"type": "string",
7896+
"readOnly": true,
7897+
"format": "date-time",
7898+
"description": "The time at which the regional restorable database account has been deleted (ISO-8601 format)."
78407899
}
78417900
}
78427901
}

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@
1515
"properties": {
1616
"accountName": "ddb1",
1717
"creationTime": "2020-04-11T21:56:15Z",
18-
"deletionTime": "2020-06-12T22:05:09Z"
18+
"deletionTime": "2020-06-12T22:05:09Z",
19+
"apiType": "Sql",
20+
"restorableLocations": [
21+
{
22+
"locationName": "South Central US",
23+
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
24+
"creationTime": "2020-10-30T21:13:10.7486417Z",
25+
"deletionTime": "2020-10-30T21:13:35.4466333Z"
26+
},
27+
{
28+
"locationName": "West US",
29+
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
30+
"creationTime": "2020-10-30T21:13:10.7486417Z"
31+
}
32+
]
1933
}
2034
}
2135
}

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,21 @@
1616
"properties": {
1717
"accountName": "ddb1",
1818
"creationTime": "2020-04-11T21:56:15Z",
19-
"deletionTime": "2020-06-12T22:05:09Z"
19+
"deletionTime": "2020-06-12T22:05:09Z",
20+
"apiType": "Sql",
21+
"restorableLocations": [
22+
{
23+
"locationName": "South Central US",
24+
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
25+
"creationTime": "2020-10-30T21:13:10.7486417Z",
26+
"deletionTime": "2020-10-30T21:13:35.4466333Z"
27+
},
28+
{
29+
"locationName": "West US",
30+
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
31+
"creationTime": "2020-10-30T21:13:10.7486417Z"
32+
}
33+
]
2034
}
2135
},
2236
{
@@ -26,7 +40,21 @@
2640
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts",
2741
"properties": {
2842
"accountName": "ddb2",
29-
"creationTime": "2020-05-01T08:05:18Z"
43+
"creationTime": "2020-05-01T08:05:18Z",
44+
"apiType": "Sql",
45+
"restorableLocations": [
46+
{
47+
"locationName": "South Central US",
48+
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
49+
"creationTime": "2020-10-30T21:13:10.7486417Z",
50+
"deletionTime": "2020-10-30T21:13:35.4466333Z"
51+
},
52+
{
53+
"locationName": "West US",
54+
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
55+
"creationTime": "2020-10-30T21:13:10.7486417Z"
56+
}
57+
]
3058
}
3159
}
3260
]

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2020-06-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@
1515
"properties": {
1616
"accountName": "ddb1",
1717
"creationTime": "2020-04-11T21:56:15Z",
18-
"deletionTime": "2020-06-12T22:05:09Z"
18+
"deletionTime": "2020-06-12T22:05:09Z",
19+
"apiType": "Sql",
20+
"restorableLocations": [
21+
{
22+
"locationName": "South Central US",
23+
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
24+
"creationTime": "2020-10-30T21:13:10.7486417Z",
25+
"deletionTime": "2020-10-30T21:13:35.4466333Z"
26+
},
27+
{
28+
"locationName": "West US",
29+
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
30+
"creationTime": "2020-10-30T21:13:10.7486417Z"
31+
}
32+
]
1933
}
2034
},
2135
{
@@ -25,7 +39,21 @@
2539
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts",
2640
"properties": {
2741
"accountName": "ddb2",
28-
"creationTime": "2020-05-01T08:05:18Z"
42+
"creationTime": "2020-05-01T08:05:18Z",
43+
"apiType": "Sql",
44+
"restorableLocations": [
45+
{
46+
"locationName": "South Central US",
47+
"regionalDatabaseAccountInstanceId": "d7a01f78-606f-45c6-9dac-0df32f433bb5",
48+
"creationTime": "2020-10-30T21:13:10.7486417Z",
49+
"deletionTime": "2020-10-30T21:13:35.4466333Z"
50+
},
51+
{
52+
"locationName": "West US",
53+
"regionalDatabaseAccountInstanceId": "fdb43d84-1572-4697-b6e7-2bcda0c51b2c",
54+
"creationTime": "2020-10-30T21:13:10.7486417Z"
55+
}
56+
]
2957
}
3058
}
3159
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-06-01-preview",
4+
"subscriptionId": "subid",
5+
"location": "WestUS",
6+
"instanceId": "98a570f2-63db-4117-91f0-366327b7b353",
7+
"restorableMongodbDatabaseRid": "PD5DALigDgw="
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"value": [
13+
{
14+
"id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableMongodbCollections/79609a98-3394-41f8-911f-cfab0c075c86",
15+
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbCollections",
16+
"name": "79609a98-3394-41f8-911f-cfab0c075c86",
17+
"properties": {
18+
"resource": {
19+
"_rid": "zAyAPQAAAA==",
20+
"eventTimestamp": "2020-10-13T04:56:42Z",
21+
"ownerId": "Collection1",
22+
"ownerResourceId": "V18LoLrv-qA=",
23+
"operationType": "Create"
24+
}
25+
}
26+
}
27+
]
28+
}
29+
}
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-06-01-preview",
4+
"subscriptionId": "2296c272-5d55-40d9-bc05-4d56dc2d7588",
5+
"location": "WestUS",
6+
"instanceId": "d9b26648-2f53-4541-b3d8-3044f4f9810d"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableMongodbDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc",
14+
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases",
15+
"name": "59c21367-b98b-4a8e-abb7-b6f46600decc",
16+
"properties": {
17+
"resource": {
18+
"_rid": "DLB14gAAAA==",
19+
"eventTimestamp": "2020-09-02T19:45:03Z",
20+
"ownerId": "Database1",
21+
"ownerResourceId": "PD5DALigDgw=",
22+
"operationType": "Create"
23+
}
24+
}
25+
},
26+
{
27+
"id": "/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableMongodbDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257",
28+
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableMongodbDatabases",
29+
"name": "8456cb17-cdb0-4c6a-8db8-d0ff3f886257",
30+
"properties": {
31+
"resource": {
32+
"_rid": "ESXNLAAAAA==",
33+
"eventTimestamp": "2020-09-02T19:53:42Z",
34+
"ownerId": "Database1",
35+
"ownerResourceId": "PD5DALigDgw=",
36+
"operationType": "Delete"
37+
}
38+
}
39+
}
40+
]
41+
}
42+
}
43+
}
44+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-06-01-preview",
4+
"subscriptionId": "2296c272-5d55-40d9-bc05-4d56dc2d7588",
5+
"location": "WestUS",
6+
"instanceId": "d9b26648-2f53-4541-b3d8-3044f4f9810d",
7+
"restoreLocation": "WestUS",
8+
"restoreTimestampInUtc": "10/13/2020 4:56"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"value": [
14+
{
15+
"databaseName": "Database1",
16+
"collectionNames": [
17+
"Collection1"
18+
]
19+
},
20+
{
21+
"databaseName": "Database2",
22+
"collectionNames": [
23+
"Collection1",
24+
"Collection2"
25+
]
26+
},
27+
{
28+
"databaseName": "Database3",
29+
"collectionNames": []
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)