-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Added Sql Stored Procedure for CosmosDB #6659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7198c7d
adding stored procedures in cosmos-db.json
331b75e
fixed a typo
a0d488e
example files for stored procedures
42a3078
changes in readme
82ff450
fixed a typo
488a195
renamed Body to body in example json files
21a3e47
renamed storedprocedures to storedProcedures in example files
41d23b9
renamed storedprocedures to storedProcedures in cosmos-db.json
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
adding stored procedures in cosmos-db.json
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1935,6 +1935,184 @@ | |
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/storedProcedures": { | ||
| "get": { | ||
| "operationId": "DatabaseAccounts_ListSqlStoredProcedures", | ||
| "x-ms-examples": { | ||
| "CosmosDBSqlStoredProcedureList": { | ||
| "$ref": "./examples/CosmosDBSqlStoredProcedureList.json" | ||
| } | ||
| }, | ||
| "description": "Lists the SQL stored procedures under an existing Azure Cosmos DB database account.", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/subscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/resourceGroupNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/accountNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/databaseNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/containerNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "The SQL stored procedure properties were retrieved successfully.", | ||
| "schema": { | ||
| "$ref": "#/definitions/SqlStoredProcedureListResult" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": null | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/storedprocedures/{storedProcedureName}": { | ||
| "get": { | ||
| "operationId": "DatabaseAccounts_GetSqlStoredProcedure", | ||
| "x-ms-examples": { | ||
| "CosmosDBSqlStoredProcedureGet": { | ||
| "$ref": "./examples/CosmosDBSqlStoredProcedureGet.json" | ||
| } | ||
| }, | ||
| "description": "Gets the SQL StoredProcedure under an existing Azure Cosmos DB database account.", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/subscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/resourceGroupNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/accountNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/databaseNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/containerNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/storedProcedureNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "The SQL StoredProcedure property was retrieved successfully.", | ||
| "schema": { | ||
| "$ref": "#/definitions/SqlStoredProcedure" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "put": { | ||
| "operationId": "DatabaseAccounts_CreateUpdateSqlStoredProcedure", | ||
| "x-ms-examples": { | ||
| "CosmosDBSqlStoredProcedureCreateUpdate": { | ||
| "$ref": "./examples/CosmosDBSqlStoredProcedureCreateUpdate.json" | ||
| } | ||
| }, | ||
| "description": "Create or update an Azure Cosmos DB SQL StoredProcedure", | ||
| "x-ms-long-running-operation": true, | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/subscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/resourceGroupNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/accountNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/databaseNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/containerNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/storedProcedureNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| }, | ||
| { | ||
| "name": "createUpdateSqlStoredProcedureParameters", | ||
| "in": "body", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/SqlStoredProcedureCreateUpdateParameters" | ||
| }, | ||
| "description": "The parameters to provide for the current SQL StoredProcedure." | ||
| } | ||
| ], | ||
| "responses": { | ||
| "202": { | ||
| "description": "The SQL StoredProcedure create or update operation will complete asynchronously." | ||
| }, | ||
| "200": { | ||
| "description": "The SQL StoredProcedure create or update operation was completed successfully.", | ||
| "schema": { | ||
| "$ref": "#/definitions/SqlStoredProcedure" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "delete": { | ||
| "operationId": "DatabaseAccounts_DeleteSqlStoredProcedure", | ||
| "x-ms-examples": { | ||
| "CosmosDBSqlStoredProcedureDelete": { | ||
| "$ref": "./examples/CosmosDBSqlStoredProcedureDelete.json" | ||
| } | ||
| }, | ||
| "description": "Deletes an existing Azure Cosmos DB SQL StoredProcedure.", | ||
| "x-ms-long-running-operation": true, | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/subscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/resourceGroupNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/accountNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/databaseNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/containerNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/storedProcedureNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/apiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "202": { | ||
| "description": "The SQL stored procedure delete operation will complete asynchronously." | ||
| }, | ||
| "204": { | ||
| "description": "The SQL stored procedure delete operation was completed successfully." | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases": { | ||
| "get": { | ||
| "operationId": "DatabaseAccounts_ListMongoDBDatabases", | ||
|
|
@@ -3689,6 +3867,19 @@ | |
| }, | ||
| "description": "The List operation response, that contains the containers and their properties." | ||
| }, | ||
| "SqlStoredProcedureListResult": { | ||
| "properties": { | ||
| "value": { | ||
| "readOnly": true, | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/SqlStoredProcedure" | ||
| }, | ||
| "description": "List of stored procedures and their properties." | ||
| } | ||
| }, | ||
| "description": "The List operation response, that contains the stored procedures and their properties." | ||
| }, | ||
| "MongoDBDatabaseListResult": { | ||
| "properties": { | ||
| "value": { | ||
|
|
@@ -4040,6 +4231,34 @@ | |
| } | ||
| ] | ||
| }, | ||
| "SqlStoredProcedure": { | ||
| "description": "An Azure Cosmos DB stored procedure.", | ||
| "type": "object", | ||
| "properties": { | ||
| "properties": { | ||
| "x-ms-client-flatten": true, | ||
| "description": "The properties of an Azure Cosmos DB stored procedure", | ||
| "$ref": "#/definitions/SqlStoredProcedureProperties" | ||
| } | ||
| }, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/Resource" | ||
| } | ||
| ] | ||
| }, | ||
| "SqlStoredProcedureProperties": { | ||
| "description": "The properties of an Azure Cosmos DB stored procedure", | ||
| "type": "object", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/SqlStoredProcedureResource" | ||
| }, | ||
| { | ||
| "$ref": "#/definitions/ExtendedResourceProperties" | ||
| } | ||
| ] | ||
| }, | ||
| "MongoDBDatabase": { | ||
| "description": "An Azure Cosmos DB MongoDB database.", | ||
| "type": "object", | ||
|
|
@@ -4661,6 +4880,38 @@ | |
| "options" | ||
| ] | ||
| }, | ||
| "SqlStoredProcedureCreateUpdateParameters": { | ||
| "description": "Parameters to create and update Cosmos DB stored procedure.", | ||
| "type": "object", | ||
| "properties": { | ||
| "properties": { | ||
| "x-ms-client-flatten": true, | ||
| "description": "Properties to create and update Azure Cosmos DB stored procedure.", | ||
| "$ref": "#/definitions/SqlStoredProcedureCreateUpdateProperties" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "properties" | ||
| ] | ||
| }, | ||
| "SqlStoredProcedureCreateUpdateProperties": { | ||
| "description": "Properties to create and update Azure Cosmos DB stored procedure.", | ||
| "type": "object", | ||
| "properties": { | ||
| "resource": { | ||
| "description": "The standard JSON format of a stored procedure", | ||
| "$ref": "#/definitions/SqlStoredProcedureResource" | ||
| }, | ||
| "options": { | ||
| "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", | ||
| "$ref": "#/definitions/CreateUpdateOptions" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "resource", | ||
| "options" | ||
| ] | ||
| }, | ||
| "MongoDBDatabaseCreateUpdateParameters": { | ||
| "description": "Parameters to create and update Cosmos DB MongoDB database.", | ||
| "type": "object", | ||
|
|
@@ -4944,6 +5195,20 @@ | |
| "id" | ||
| ] | ||
| }, | ||
| "SqlStoredProcedureResource": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Calling this a "resource" with an "id" property could make things confusing, as this isn't an Azure resource. Please could you update the naming to avoid confusion? |
||
| "type": "object", | ||
| "description": "Cosmos DB Gremlin graph resource object", | ||
| "properties": { | ||
| "id":{ | ||
| "type":"string", | ||
| "description":"Name of the Sql Stored Procedure" | ||
| }, | ||
| "body":{ | ||
| "type": "string", | ||
| "description": "Body of the Stored Procedure" | ||
| } | ||
| } | ||
| }, | ||
| "GremlinGraphResource": { | ||
| "type": "object", | ||
| "description": "Cosmos DB Gremlin graph resource object", | ||
|
|
@@ -5982,6 +6247,14 @@ | |
| "x-ms-parameter-location": "method", | ||
| "description": "Cosmos DB container name." | ||
| }, | ||
| "storedProcedureNameParameter":{ | ||
| "name": "storedProcedureName", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "x-ms-parameter-location": "method", | ||
| "description": "Cosmos DB SQL StoredProcedure name" | ||
| }, | ||
| "tableNameParameter": { | ||
| "name": "tableName", | ||
| "in": "path", | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're not supporting paging, do you have any limits on the number of stored procedures that can be created? How big can this response get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We support paging internally in CosmosDB. Hence, paging is not required here.