diff --git a/azure/table_azure_cosmosdb_account.go b/azure/table_azure_cosmosdb_account.go index e8e9877b..1821fbcf 100644 --- a/azure/table_azure_cosmosdb_account.go +++ b/azure/table_azure_cosmosdb_account.go @@ -214,6 +214,12 @@ func tableAzureCosmosDBAccount(_ context.Context) *plugin.Table { Type: proto.ColumnType_JSON, Transform: transform.FromField("DatabaseAccount.DatabaseAccountGetProperties.ReadLocations"), }, + { + Name: "restore_parameters", + Description: "Parameters to indicate the information about the restore.", + Type: proto.ColumnType_JSON, + Transform: transform.FromField("DatabaseAccount.DatabaseAccountGetProperties.RestoreParameters"), + }, { Name: "virtual_network_rules", Description: "A list of Virtual Network ACL rules configured for the Cosmos DB account.", diff --git a/docs/tables/azure_cosmosdb_account.md b/docs/tables/azure_cosmosdb_account.md index 00f79b53..221dd1c7 100644 --- a/docs/tables/azure_cosmosdb_account.md +++ b/docs/tables/azure_cosmosdb_account.md @@ -100,3 +100,18 @@ from azure_cosmosdb_account, jsonb_array_elements(private_endpoint_connections) as c; ``` + +### Get details of accounts restored from backup + +```sql +select + name, + restore_parameters ->> 'restoreMode' as restore_mode, + restore_parameters ->> 'restoreSource' as restore_source, + d ->> 'databaseName' as restored_database_name, + c as restored_collection_name +from + azure_cosmosdb_account, + jsonb_array_elements(restore_parameters -> 'databasesToRestore') d, + jsonb_array_elements_text(d -> 'collectionNames') c; +``` \ No newline at end of file