Skip to content

Commit bc6dad5

Browse files
author
Chandrasekhar Gunturi
committed
materializedview swagger changes
1 parent ac929f8 commit bc6dad5

File tree

2 files changed

+136
-0
lines changed

2 files changed

+136
-0
lines changed

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2023-03-15-preview/cosmos-db.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,9 @@
22782278
},
22792279
"CosmosDBSqlContainerRestore": {
22802280
"$ref": "./examples/CosmosDBSqlContainerRestore.json"
2281+
},
2282+
"CosmosDBSqlMaterializedViewCreateUpdate": {
2283+
"$ref": "./examples/CosmosDBSqlMaterializedViewCreateUpdate.json"
22812284
}
22822285
},
22832286
"description": "Create or update an Azure Cosmos DB SQL container",
@@ -9848,6 +9851,10 @@
98489851
"createMode": {
98499852
"description": "Enum to indicate the mode of resource creation.",
98509853
"$ref": "#/definitions/CreateMode"
9854+
},
9855+
"materializedViewDefinition": {
9856+
"$ref": "#/definitions/MaterializedViewDefinition",
9857+
"description": "The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container."
98519858
}
98529859
},
98539860
"required": [
@@ -10180,6 +10187,29 @@
1018010187
"encryptionAlgorithm"
1018110188
]
1018210189
},
10190+
"MaterializedViewDefinition": {
10191+
"type": "object",
10192+
"description": "Materialized View definition for the container.",
10193+
"properties": {
10194+
"sourceCollectionRid": {
10195+
"description": "An unique identifier for the source collection. This is a system generated property.",
10196+
"type": "string",
10197+
"readOnly": true
10198+
},
10199+
"sourceCollectionId": {
10200+
"description": "The name of the source container on which the Materialized View will be created.",
10201+
"type": "string"
10202+
},
10203+
"definition": {
10204+
"description": "The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container.",
10205+
"type": "string"
10206+
}
10207+
},
10208+
"required": [
10209+
"sourceCollectionId",
10210+
"definition"
10211+
]
10212+
},
1018310213
"SqlStoredProcedureResource": {
1018410214
"type": "object",
1018510215
"description": "Cosmos DB SQL storedProcedure resource object",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"parameters": {
3+
"accountName": "ddb1",
4+
"resourceGroupName": "rg1",
5+
"api-version": "2022-11-15-preview",
6+
"subscriptionId": "subid",
7+
"databaseName": "databaseName",
8+
"containerName": "mvContainerName",
9+
"createUpdateSqlContainerParameters": {
10+
"location": "West US",
11+
"tags": {},
12+
"properties": {
13+
"resource": {
14+
"id": "mvContainerName",
15+
"indexingPolicy": {
16+
"indexingMode": "consistent",
17+
"automatic": true,
18+
"includedPaths": [
19+
{
20+
"path": "/*",
21+
"indexes": [
22+
{
23+
"kind": "Range",
24+
"dataType": "String",
25+
"precision": -1
26+
},
27+
{
28+
"kind": "Range",
29+
"dataType": "Number",
30+
"precision": -1
31+
}
32+
]
33+
}
34+
],
35+
"excludedPaths": []
36+
},
37+
"partitionKey": {
38+
"paths": [
39+
"/mvpk"
40+
],
41+
"kind": "Hash"
42+
},
43+
"materializedViewDefinition": {
44+
"sourceCollectionId": "sourceContainerName",
45+
"definition": "select * from ROOT"
46+
}
47+
},
48+
"options": {}
49+
}
50+
}
51+
},
52+
"responses": {
53+
"200": {
54+
"body": {
55+
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/sqlDatabases/databaseName/containers/mvContainerName",
56+
"name": "mvContainerName",
57+
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/sqlContainers",
58+
"location": "West US",
59+
"tags": {},
60+
"properties": {
61+
"resource": {
62+
"id": "mvContainerName",
63+
"indexingPolicy": {
64+
"indexingMode": "consistent",
65+
"automatic": true,
66+
"includedPaths": [
67+
{
68+
"path": "/*"
69+
}
70+
],
71+
"excludedPaths": [
72+
{
73+
"path": "/\"_etag\"/?"
74+
}
75+
]
76+
},
77+
"partitionKey": {
78+
"paths": [
79+
"/mvpk"
80+
],
81+
"kind": "Hash"
82+
},
83+
"defaultTtl": -1,
84+
"uniqueKeyPolicy": {
85+
"uniqueKeys": []
86+
},
87+
"conflictResolutionPolicy": {
88+
"mode": "LastWriterWins",
89+
"conflictResolutionPath": "/_ts",
90+
"conflictResolutionProcedure": ""
91+
},
92+
"materializedViewDefinition": {
93+
"sourceCollectionRid": "vb0sn6nEu9A=",
94+
"sourceCollectionId": "sourceContainerName",
95+
"definition": "select * from ROOT"
96+
},
97+
"_rid": "vb0sn8MDxLw=",
98+
"_ts": 1671427656,
99+
"_etag": "\"00000800-0000-0200-0000-639ff6480000\""
100+
}
101+
}
102+
}
103+
},
104+
"202": {}
105+
}
106+
}

0 commit comments

Comments
 (0)