From 198e7f3b8dfb2c067f7b98230e812493c1e0e513 Mon Sep 17 00:00:00 2001 From: Kshittiz Kumar Date: Wed, 12 Oct 2022 13:41:23 -0700 Subject: [PATCH] Added specs for tables and gremlin --- .../stable/2022-11-15/cosmos-db.json | 39 + ...CosmosDBGremlinGraphBackupInformation.json | 23 + ...CosmosDBRestorableGremlinDatabaseList.json | 44 + .../CosmosDBRestorableGremlinGraphList.json | 31 + ...CosmosDBRestorableGremlinResourceList.json | 35 + .../examples/CosmosDBRestorableTableList.json | 30 + .../CosmosDBRestorableTableResourceList.json | 20 + .../CosmosDBTableBackupInformation.json | 22 + .../stable/2022-11-15/restorable.json | 949 +++++++++++++++--- 9 files changed, 1068 insertions(+), 125 deletions(-) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBGremlinGraphBackupInformation.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinGraphList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinResourceList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableResourceList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBTableBackupInformation.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/cosmos-db.json index 6886b8fe79cb..37c82c582e94 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/cosmos-db.json @@ -8663,6 +8663,20 @@ "items": { "$ref": "#/definitions/DatabaseRestoreResource" } + }, + "gremlinDatabasesToRestore": { + "type": "array", + "description": "List of specific gremlin databases available for restore.", + "items": { + "$ref": "#/definitions/GremlinDatabaseRestoreResource" + } + }, + "tablesToRestore": { + "type": "array", + "description": "List of specific tables available for restore.", + "items": { + "$ref": "#/definitions/TableName" + } } } }, @@ -8683,10 +8697,35 @@ } } }, + "GremlinDatabaseRestoreResource": { + "type": "object", + "description": "Specific Gremlin Databases to restore.", + "properties": { + "databaseName": { + "type": "string", + "description": "The name of the gremlin database available for restore." + }, + "graphNames": { + "type": "array", + "description": "The names of the graphs available for restore.", + "items": { + "$ref": "#/definitions/GraphName" + } + } + } + }, "CollectionName": { "type": "string", "description": "The name of the collection." }, + "GraphName": { + "type": "string", + "description": "The name of the graph." + }, + "TableName": { + "type": "string", + "description": "The name of the table." + }, "BackupPolicy": { "type": "object", "description": "The object representing the policy for taking backups on an account.", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBGremlinGraphBackupInformation.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBGremlinGraphBackupInformation.json new file mode 100644 index 000000000000..3a50e3e73771 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBGremlinGraphBackupInformation.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseName": "databaseName", + "graphName": "graphName", + "location": { + "location": "North Europe" + } + }, + "responses": { + "200": { + "body": { + "continuousBackupInformation": { + "latestRestorableTimestamp": "2021-02-05T02:40:50Z" + } + } + }, + "202": {} + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json new file mode 100644 index 000000000000..a051e977aa09 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "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/restorableGremlinDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc", + "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases", + "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/restorableGremlinDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257", + "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases", + "name": "8456cb17-cdb0-4c6a-8db8-d0ff3f886257", + "properties": { + "resource": { + "_rid": "ESXNLAAAAA==", + "eventTimestamp": "2020-09-02T19:53:42Z", + "ownerId": "Database1", + "ownerResourceId": "PD5DALigDgw=", + "operationType": "Delete" + } + } + } + ] + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinGraphList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinGraphList.json new file mode 100644 index 000000000000..0a1f713f2851 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinGraphList.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "subscriptionId": "subid", + "location": "WestUS", + "instanceId": "98a570f2-63db-4117-91f0-366327b7b353", + "restorableGremlinDatabaseRid": "PD5DALigDgw=" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableGraphs/79609a98-3394-41f8-911f-cfab0c075c86", + "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGraphs", + "name": "79609a98-3394-41f8-911f-cfab0c075c86", + "properties": { + "resource": { + "_rid": "zAyAPQAAAA==", + "eventTimestamp": "2020-10-13T04:56:42Z", + "ownerId": "Graph1", + "ownerResourceId": "V18LoLrv-qA=", + "operationType": "Create" + } + } + } + ] + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinResourceList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinResourceList.json new file mode 100644 index 000000000000..08c2f78bdfc0 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableGremlinResourceList.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "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", + "graphNames": [ + "Graph1" + ] + }, + { + "databaseName": "Database2", + "graphNames": [ + "Graph1", + "Graph2" + ] + }, + { + "databaseName": "Database3", + "graphNames": [] + } + ] + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableList.json new file mode 100644 index 000000000000..ae923561fc2c --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableList.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "subscriptionId": "subid", + "location": "WestUS", + "instanceId": "98a570f2-63db-4117-91f0-366327b7b353" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/98a570f2-63db-4117-91f0-366327b7b353/restorableTables/79609a98-3394-41f8-911f-cfab0c075c86", + "type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableTables", + "name": "79609a98-3394-41f8-911f-cfab0c075c86", + "properties": { + "resource": { + "_rid": "zAyAPQAAAA==", + "eventTimestamp": "2020-10-13T04:56:42Z", + "ownerId": "Table1", + "ownerResourceId": "V18LoLrv-qA=", + "operationType": "Create" + } + } + } + ] + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableResourceList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableResourceList.json new file mode 100644 index 000000000000..f81deee0f2d9 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBRestorableTableResourceList.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "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": [ + "table1", + "table2" + ] + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBTableBackupInformation.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBTableBackupInformation.json new file mode 100644 index 000000000000..13da59c20987 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/examples/CosmosDBTableBackupInformation.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2022-11-15", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "tableName": "tableName1", + "location": { + "location": "North Europe" + } + }, + "responses": { + "200": { + "body": { + "continuousBackupInformation": { + "latestRestorableTimestamp": "2021-02-05T02:40:50Z" + } + } + }, + "202": {} + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/restorable.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/restorable.json index a09f137e7089..6355e6b82c8f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/restorable.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2022-11-15/restorable.json @@ -477,6 +477,12 @@ }, { "$ref": "#/parameters/restorableMongodbDatabaseRidParameter" + }, + { + "$ref": "#/parameters/restorableMongoDBCollectionsEventFeedStartTime" + }, + { + "$ref": "#/parameters/restorableMongoDBCollectionsEventFeedEndTime" } ], "responses": { @@ -500,13 +506,369 @@ }, "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources": { "get": { - "operationId": "RestorableMongodbResources_List", + "operationId": "RestorableMongodbResources_List", + "x-ms-examples": { + "CosmosDBRestorableMongodbResourceList": { + "$ref": "./examples/CosmosDBRestorableMongodbResourceList.json" + } + }, + "description": "Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + }, + { + "$ref": "#/parameters/instanceIdParameter" + }, + { + "$ref": "#/parameters/restoreLocationParameter" + }, + { + "$ref": "#/parameters/restoreTimestampInUtcParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableMongodbResourcesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation": { + "post": { + "operationId": "GremlinResources_RetrieveContinuousBackupInformation", + "x-ms-examples": { + "CosmosDBGremlinGraphBackupInformation": { + "$ref": "./examples/CosmosDBGremlinGraphBackupInformation.json" + } + }, + "description": "Retrieves continuous backup information for a gremlin graph.", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "cosmos-db.json#/parameters/accountNameParameter" + }, + { + "$ref": "cosmos-db.json#/parameters/databaseNameParameter" + }, + { + "$ref": "cosmos-db.json#/parameters/graphNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "location", + "required": true, + "description": "The name of the continuous backup restore location.", + "schema": { + "$ref": "#/definitions/ContinuousBackupRestoreLocation" + } + } + ], + "responses": { + "200": { + "description": "The Gremlin graph retrieve backup information operation completed successfully.", + "schema": { + "$ref": "#/definitions/BackupInformation" + } + }, + "202": { + "description": "The Gremlin graph retrieve backup information operation will complete asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases": { + "get": { + "operationId": "RestorableGremlinDatabases_List", + "x-ms-examples": { + "CosmosDBRestorableGremlinDatabaseList": { + "$ref": "./examples/CosmosDBRestorableGremlinDatabaseList.json" + } + }, + "description": "Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + }, + { + "$ref": "#/parameters/instanceIdParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableGremlinDatabasesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs": { + "get": { + "operationId": "RestorableGremlinGraphs_List", + "x-ms-examples": { + "CosmosDBRestorableGremlinGraphList": { + "$ref": "./examples/CosmosDBRestorableGremlinGraphList.json" + } + }, + "description": "Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. This helps in scenario where container was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + }, + { + "$ref": "#/parameters/instanceIdParameter" + }, + { + "$ref": "#/parameters/restorableGremlinDatabaseRidParameter" + }, + { + "$ref": "#/parameters/restorableGremlinGraphsEventFeedStartTime" + }, + { + "$ref": "#/parameters/restorableGremlinGraphsEventFeedEndTime" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableGremlinGraphsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources": { + "get": { + "operationId": "RestorableGremlinResources_List", + "x-ms-examples": { + "CosmosDBRestorableGremlinResourceList": { + "$ref": "./examples/CosmosDBRestorableGremlinResourceList.json" + } + }, + "description": "Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + }, + { + "$ref": "#/parameters/instanceIdParameter" + }, + { + "$ref": "#/parameters/restoreLocationParameter" + }, + { + "$ref": "#/parameters/restoreTimestampInUtcParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableGremlinResourcesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation": { + "post": { + "operationId": "TableResources_RetrieveContinuousBackupInformation", + "x-ms-examples": { + "CosmosDBTableCollectionBackupInformation": { + "$ref": "./examples/CosmosDBTableBackupInformation.json" + } + }, + "description": "Retrieves continuous backup information for a table.", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "cosmos-db.json#/parameters/accountNameParameter" + }, + { + "$ref": "cosmos-db.json#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "location", + "required": true, + "description": "The name of the continuous backup restore location.", + "schema": { + "$ref": "#/definitions/ContinuousBackupRestoreLocation" + } + } + ], + "responses": { + "200": { + "description": "The Table retrieve backup information operation completed successfully.", + "schema": { + "$ref": "#/definitions/BackupInformation" + } + }, + "202": { + "description": "The Table retrieve backup information operation will complete asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables": { + "get": { + "operationId": "RestorableTables_List", + "x-ms-examples": { + "CosmosDBRestorableTableList": { + "$ref": "./examples/CosmosDBRestorableTableList.json" + } + }, + "description": "Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where table was accidentally deleted. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + }, + { + "$ref": "#/parameters/instanceIdParameter" + }, + { + "$ref": "#/parameters/restorableTablesEventFeedStartTime" + }, + { + "$ref": "#/parameters/restorableTablesEventFeedEndTime" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableTablesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "cosmos-db.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources": { + "get": { + "operationId": "RestorableTableResources_List", "x-ms-examples": { - "CosmosDBRestorableMongodbResourceList": { - "$ref": "./examples/CosmosDBRestorableMongodbResourceList.json" + "CosmosDBRestorableTableResourceList": { + "$ref": "./examples/CosmosDBRestorableTableResourceList.json" } }, - "description": "Return a list of database and collection combo that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission.", + "description": "Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios to validate what resources exist at given timestamp and location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission.", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" @@ -531,7 +893,7 @@ "200": { "description": "The operation completed successfully.", "schema": { - "$ref": "#/definitions/RestorableMongodbResourcesListResult" + "$ref": "#/definitions/RestorableTableResourcesListResult" } }, "default": { @@ -693,8 +1055,260 @@ "properties": { "type": "object", "x-ms-client-flatten": true, - "description": "The properties of a SQL database event.", - "$ref": "#/definitions/RestorableSqlDatabaseProperties" + "description": "The properties of a SQL database event.", + "$ref": "#/definitions/RestorableSqlDatabaseProperties" + }, + "id": { + "readOnly": true, + "type": "string", + "description": "The unique resource Identifier of the ARM resource." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the ARM resource." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of Azure resource." + } + } + }, + "RestorableSqlDatabaseProperties": { + "description": "The properties of an Azure Cosmos DB SQL database event", + "type": "object", + "properties": { + "resource": { + "type": "object", + "description": "The resource of an Azure Cosmos DB SQL database event", + "properties": { + "_rid": { + "type": "string", + "readOnly": true, + "description": "A system generated property. A unique identifier." + }, + "operationType": { + "type": "string", + "readOnly": true, + "description": "The operation type of this database event.", + "$ref": "#/definitions/OperationType" + }, + "eventTimestamp": { + "type": "string", + "readOnly": true, + "description": "The time when this database event happened." + }, + "ownerId": { + "type": "string", + "readOnly": true, + "description": "The name of the SQL database." + }, + "ownerResourceId": { + "type": "string", + "readOnly": true, + "description": "The resource ID of the SQL database." + }, + "database": { + "type": "object", + "description": "Cosmos DB SQL database resource object", + "properties": { + "_colls": { + "type": "string", + "readOnly": true, + "description": "A system generated property that specified the addressable path of the collections resource." + }, + "_users": { + "type": "string", + "readOnly": true, + "description": "A system generated property that specifies the addressable path of the users resource." + }, + "_self": { + "type": "string", + "readOnly": true, + "description": "A system generated property that specifies the addressable path of the database resource." + } + }, + "allOf": [ + { + "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/SqlDatabaseResource" + }, + { + "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/ExtendedResourceProperties" + } + ] + } + } + } + } + }, + "RestorableSqlContainersListResult": { + "type": "object", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/RestorableSqlContainerGetResult" + }, + "description": "List of SQL container events and their properties." + } + }, + "description": "The List operation response, that contains the SQL container events and their properties." + }, + "RestorableSqlContainerGetResult": { + "description": "An Azure Cosmos DB SQL container event", + "type": "object", + "properties": { + "properties": { + "type": "object", + "x-ms-client-flatten": true, + "description": "The properties of a SQL container event.", + "$ref": "#/definitions/RestorableSqlContainerProperties" + }, + "id": { + "readOnly": true, + "type": "string", + "description": "The unique resource Identifier of the ARM resource." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the ARM resource." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of Azure resource." + } + } + }, + "RestorableSqlContainerProperties": { + "description": "The properties of an Azure Cosmos DB SQL container event", + "type": "object", + "properties": { + "resource": { + "description": "The resource of an Azure Cosmos DB SQL container event", + "type": "object", + "properties": { + "_rid": { + "type": "string", + "readOnly": true, + "description": "A system generated property. A unique identifier." + }, + "operationType": { + "type": "string", + "readOnly": true, + "description": "The operation type of this container event.", + "$ref": "#/definitions/OperationType" + }, + "eventTimestamp": { + "type": "string", + "readOnly": true, + "description": "The when this container event happened." + }, + "ownerId": { + "type": "string", + "readOnly": true, + "description": "The name of this SQL container." + }, + "ownerResourceId": { + "type": "string", + "readOnly": true, + "description": "The resource ID of this SQL container." + }, + "container": { + "type": "object", + "description": "Cosmos DB SQL container resource object", + "properties": { + "_self": { + "type": "string", + "readOnly": true, + "description": "A system generated property that specifies the addressable path of the container resource." + } + }, + "allOf": [ + { + "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/SqlContainerResource" + }, + { + "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/ExtendedResourceProperties" + } + ] + } + } + } + } + }, + "RestorableSqlResourcesListResult": { + "type": "object", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/RestorableSqlResourcesGetResult" + }, + "description": "List of restorable SQL resources, including the database and collection names." + } + }, + "description": "The List operation response, that contains the restorable SQL resources." + }, + "RestorableSqlResourcesGetResult": { + "type": "object", + "description": "Specific Databases to restore.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The unique resource identifier of the ARM resource." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the ARM resource." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of Azure resource." + }, + "databaseName": { + "type": "string", + "description": "The name of the database available for restore." + }, + "collectionNames": { + "type": "array", + "description": "The names of the collections available for restore.", + "items": { + "$ref": "cosmos-db.json#/definitions/CollectionName" + } + } + } + }, + "RestorableMongodbDatabasesListResult": { + "type": "object", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/RestorableMongodbDatabaseGetResult" + }, + "description": "List of MongoDB database events and their properties." + } + }, + "description": "The List operation response, that contains the MongoDB database events and their properties." + }, + "RestorableMongodbDatabaseGetResult": { + "description": "An Azure Cosmos DB MongoDB database event", + "type": "object", + "properties": { + "properties": { + "type": "object", + "x-ms-client-flatten": true, + "description": "The properties of a MongoDB database event.", + "$ref": "#/definitions/RestorableMongodbDatabaseProperties" }, "id": { "readOnly": true, @@ -713,13 +1327,13 @@ } } }, - "RestorableSqlDatabaseProperties": { - "description": "The properties of an Azure Cosmos DB SQL database event", + "RestorableMongodbDatabaseProperties": { + "description": "The properties of an Azure Cosmos DB MongoDB database event", "type": "object", "properties": { "resource": { + "description": "The resource of an Azure Cosmos DB MongoDB database event", "type": "object", - "description": "The resource of an Azure Cosmos DB SQL database event", "properties": { "_rid": { "type": "string", @@ -740,69 +1354,40 @@ "ownerId": { "type": "string", "readOnly": true, - "description": "The name of the SQL database." + "description": "The name of this MongoDB database." }, "ownerResourceId": { "type": "string", "readOnly": true, - "description": "The resource ID of the SQL database." - }, - "database": { - "type": "object", - "description": "Cosmos DB SQL database resource object", - "properties": { - "_colls": { - "type": "string", - "readOnly": true, - "description": "A system generated property that specified the addressable path of the collections resource." - }, - "_users": { - "type": "string", - "readOnly": true, - "description": "A system generated property that specifies the addressable path of the users resource." - }, - "_self": { - "type": "string", - "readOnly": true, - "description": "A system generated property that specifies the addressable path of the database resource." - } - }, - "allOf": [ - { - "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/SqlDatabaseResource" - }, - { - "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/ExtendedResourceProperties" - } - ] + "description": "The resource ID of this MongoDB database." } } } } }, - "RestorableSqlContainersListResult": { + "RestorableMongodbCollectionsListResult": { "type": "object", "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/RestorableSqlContainerGetResult" + "$ref": "#/definitions/RestorableMongodbCollectionGetResult" }, - "description": "List of SQL container events and their properties." + "description": "List of MongoDB collection events and their properties." } }, - "description": "The List operation response, that contains the SQL container events and their properties." + "description": "The List operation response, that contains the MongoDB collection events and their properties." }, - "RestorableSqlContainerGetResult": { - "description": "An Azure Cosmos DB SQL container event", + "RestorableMongodbCollectionGetResult": { + "description": "An Azure Cosmos DB MongoDB collection event", "type": "object", "properties": { "properties": { "type": "object", "x-ms-client-flatten": true, - "description": "The properties of a SQL container event.", - "$ref": "#/definitions/RestorableSqlContainerProperties" + "description": "The properties of a MongoDB collection event.", + "$ref": "#/definitions/RestorableMongodbCollectionProperties" }, "id": { "readOnly": true, @@ -821,12 +1406,12 @@ } } }, - "RestorableSqlContainerProperties": { - "description": "The properties of an Azure Cosmos DB SQL container event", + "RestorableMongodbCollectionProperties": { + "description": "The properties of an Azure Cosmos DB MongoDB collection event", "type": "object", "properties": { "resource": { - "description": "The resource of an Azure Cosmos DB SQL container event", + "description": "The resource of an Azure Cosmos DB MongoDB collection event", "type": "object", "properties": { "_rid": { @@ -837,62 +1422,43 @@ "operationType": { "type": "string", "readOnly": true, - "description": "The operation type of this container event.", + "description": "The operation type of this collection event.", "$ref": "#/definitions/OperationType" }, "eventTimestamp": { "type": "string", "readOnly": true, - "description": "The when this container event happened." + "description": "The time when this collection event happened." }, "ownerId": { "type": "string", "readOnly": true, - "description": "The name of this SQL container." + "description": "The name of this MongoDB collection." }, "ownerResourceId": { "type": "string", "readOnly": true, - "description": "The resource ID of this SQL container." - }, - "container": { - "type": "object", - "description": "Cosmos DB SQL container resource object", - "properties": { - "_self": { - "type": "string", - "readOnly": true, - "description": "A system generated property that specifies the addressable path of the container resource." - } - }, - "allOf": [ - { - "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/SqlContainerResource" - }, - { - "$ref": "../../stable/2022-11-15/cosmos-db.json#/definitions/ExtendedResourceProperties" - } - ] + "description": "The resource ID of this MongoDB collection." } } } } }, - "RestorableSqlResourcesListResult": { + "RestorableMongodbResourcesListResult": { "type": "object", "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/RestorableSqlResourcesGetResult" + "$ref": "#/definitions/RestorableMongodbResourcesGetResult" }, - "description": "List of restorable SQL resources, including the database and collection names." + "description": "List of restorable MongoDB resources, including the database and collection names." } }, - "description": "The List operation response, that contains the restorable SQL resources." + "description": "The List operation response, that contains the restorable MongoDB resources." }, - "RestorableSqlResourcesGetResult": { + "RestorableMongodbResourcesGetResult": { "type": "object", "description": "Specific Databases to restore.", "properties": { @@ -924,29 +1490,29 @@ } } }, - "RestorableMongodbDatabasesListResult": { + "RestorableGremlinDatabasesListResult": { "type": "object", "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/RestorableMongodbDatabaseGetResult" + "$ref": "#/definitions/RestorableGremlinDatabaseGetResult" }, - "description": "List of MongoDB database events and their properties." + "description": "List of Gremlin database events and their properties." } }, - "description": "The List operation response, that contains the MongoDB database events and their properties." + "description": "The List operation response, that contains the Gremlin database events and their properties." }, - "RestorableMongodbDatabaseGetResult": { - "description": "An Azure Cosmos DB MongoDB database event", + "RestorableGremlinDatabaseGetResult": { + "description": "An Azure Cosmos DB Gremlin database event", "type": "object", "properties": { "properties": { "type": "object", "x-ms-client-flatten": true, - "description": "The properties of a MongoDB database event.", - "$ref": "#/definitions/RestorableMongodbDatabaseProperties" + "description": "The properties of a Gremlin database event.", + "$ref": "#/definitions/RestorableGremlinDatabaseProperties" }, "id": { "readOnly": true, @@ -965,12 +1531,12 @@ } } }, - "RestorableMongodbDatabaseProperties": { - "description": "The properties of an Azure Cosmos DB MongoDB database event", + "RestorableGremlinDatabaseProperties": { + "description": "The properties of an Azure Cosmos DB Gremlin database event", "type": "object", "properties": { "resource": { - "description": "The resource of an Azure Cosmos DB MongoDB database event", + "description": "The resource of an Azure Cosmos DB Gremlin database event", "type": "object", "properties": { "_rid": { @@ -992,40 +1558,40 @@ "ownerId": { "type": "string", "readOnly": true, - "description": "The name of this MongoDB database." + "description": "The name of this Gremlin database." }, "ownerResourceId": { "type": "string", "readOnly": true, - "description": "The resource ID of this MongoDB database." + "description": "The resource ID of this Gremlin database." } } } } }, - "RestorableMongodbCollectionsListResult": { + "RestorableGremlinGraphsListResult": { "type": "object", "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/RestorableMongodbCollectionGetResult" + "$ref": "#/definitions/RestorableGremlinGraphGetResult" }, - "description": "List of MongoDB collection events and their properties." + "description": "List of Gremlin graph events and their properties." } }, - "description": "The List operation response, that contains the MongoDB collection events and their properties." + "description": "The List operation response, that contains the Gremlin graph events and their properties." }, - "RestorableMongodbCollectionGetResult": { - "description": "An Azure Cosmos DB MongoDB collection event", + "RestorableGremlinGraphGetResult": { + "description": "An Azure Cosmos DB Gremlin graph event", "type": "object", "properties": { "properties": { "type": "object", "x-ms-client-flatten": true, - "description": "The properties of a MongoDB collection event.", - "$ref": "#/definitions/RestorableMongodbCollectionProperties" + "description": "The properties of a Gremlin graph event.", + "$ref": "#/definitions/RestorableGremlinGraphProperties" }, "id": { "readOnly": true, @@ -1044,12 +1610,12 @@ } } }, - "RestorableMongodbCollectionProperties": { - "description": "The properties of an Azure Cosmos DB MongoDB collection event", + "RestorableGremlinGraphProperties": { + "description": "The properties of an Azure Cosmos DB Gremlin graph event", "type": "object", "properties": { "resource": { - "description": "The resource of an Azure Cosmos DB MongoDB collection event", + "description": "The resource of an Azure Cosmos DB Gremlin graph event", "type": "object", "properties": { "_rid": { @@ -1060,50 +1626,70 @@ "operationType": { "type": "string", "readOnly": true, - "description": "The operation type of this collection event.", + "description": "The operation type of this graph event.", "$ref": "#/definitions/OperationType" }, "eventTimestamp": { "type": "string", "readOnly": true, - "description": "The time when this collection event happened." + "description": "The time when this graph event happened." }, "ownerId": { "type": "string", "readOnly": true, - "description": "The name of this MongoDB collection." + "description": "The name of this Gremlin graph." }, "ownerResourceId": { "type": "string", "readOnly": true, - "description": "The resource ID of this MongoDB collection." + "description": "The resource ID of this Gremlin graph." } } } } }, - "RestorableMongodbResourcesListResult": { + "RestorableGremlinResourcesListResult": { "type": "object", "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/RestorableMongodbResourcesGetResult" + "$ref": "../../preview/2021-11-15-preview/cosmos-db.json#/definitions/GremlinDatabaseRestoreResource" }, - "description": "List of restorable MongoDB resources, including the database and collection names." + "description": "List of restorable Gremlin resources, including the gremlin database and graph names." } }, - "description": "The List operation response, that contains the restorable MongoDB resources." + "description": "The List operation response, that contains the restorable Gremlin resources." }, - "RestorableMongodbResourcesGetResult": { + "RestorableTablesListResult": { + "type": "object", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/RestorableTableGetResult" + }, + "description": "List of Table events and their properties." + } + }, + "description": "The List operation response, that contains the Table events and their properties." + }, + "RestorableTableGetResult": { + "description": "An Azure Cosmos DB Table event", "type": "object", - "description": "Specific Databases to restore.", "properties": { + "properties": { + "type": "object", + "x-ms-client-flatten": true, + "description": "The properties of a Table event.", + "$ref": "#/definitions/RestorableTableProperties" + }, "id": { "readOnly": true, "type": "string", - "description": "The unique resource identifier of the ARM resource." + "description": "The unique resource Identifier of the ARM resource." }, "name": { "readOnly": true, @@ -1114,20 +1700,61 @@ "readOnly": true, "type": "string", "description": "The type of Azure resource." - }, - "databaseName": { - "type": "string", - "description": "The name of the database available for restore." - }, - "collectionNames": { - "type": "array", - "description": "The names of the collections available for restore.", - "items": { - "$ref": "cosmos-db.json#/definitions/CollectionName" + } + } + }, + "RestorableTableProperties": { + "description": "The properties of an Azure Cosmos DB Table event", + "type": "object", + "properties": { + "resource": { + "description": "The resource of an Azure Cosmos DB Table event", + "type": "object", + "properties": { + "_rid": { + "type": "string", + "readOnly": true, + "description": "A system generated property. A unique identifier." + }, + "operationType": { + "type": "string", + "readOnly": true, + "description": "The operation type of this table event.", + "$ref": "#/definitions/OperationType" + }, + "eventTimestamp": { + "type": "string", + "readOnly": true, + "description": "The time when this table event happened." + }, + "ownerId": { + "type": "string", + "readOnly": true, + "description": "The name of this Table." + }, + "ownerResourceId": { + "type": "string", + "readOnly": true, + "description": "The resource ID of this Table." + } } } } }, + "RestorableTableResourcesListResult": { + "type": "object", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "../../preview/2021-11-15-preview/cosmos-db.json#/definitions/TableName" + }, + "description": "List of restorable table names." + } + }, + "description": "List of restorable table names." + }, "OperationType": { "description": "Enum to indicate the operation type of the event.", "type": "string", @@ -1209,6 +1836,70 @@ "x-ms-parameter-location": "method", "description": "The timestamp when the restorable resources existed." }, + "restorableSqlContainersEventFeedStartTime": { + "name": "startTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable Sql containers event feed start time." + }, + "restorableSqlContainersEventFeedEndTime": { + "name": "endTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable Sql containers event feed end time." + }, + "restorableMongoDBCollectionsEventFeedStartTime": { + "name": "startTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable MongoDB collections event feed start time." + }, + "restorableMongoDBCollectionsEventFeedEndTime": { + "name": "endTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable MongoDB collections event feed end time." + }, + "restorableGremlinGraphsEventFeedStartTime": { + "name": "startTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable Gremlin graphs event feed start time." + }, + "restorableGremlinGraphsEventFeedEndTime": { + "name": "endTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable Gremlin graphs event feed end time." + }, + "restorableTablesEventFeedStartTime": { + "name": "startTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable Tables event feed start time." + }, + "restorableTablesEventFeedEndTime": { + "name": "endTime", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Restorable Tables event feed end time." + }, "restoreStartTime": { "name": "startTime", "in": "query", @@ -1240,6 +1931,14 @@ "type": "string", "x-ms-parameter-location": "method", "description": "The instanceId GUID of a restorable database account." + }, + "restorableGremlinDatabaseRidParameter": { + "name": "restorableGremlinDatabaseRid", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The resource ID of the Gremlin database." } } }