From 41af7ad98e7c8c331504ae10a2cd05afb5fb82bc Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Mon, 25 Mar 2019 17:11:49 -0700 Subject: [PATCH 01/13] Add Database and Collection API --- .../stable/2015-04-08/cosmos-db.json | 833 +++++++++++++++++- .../examples/CosmosDBCollectionCreate.json | 104 +++ .../examples/CosmosDBCollectionDelete.json | 14 + .../examples/CosmosDBCollectionGet.json | 59 ++ .../examples/CosmosDBCollectionList.json | 62 ++ .../examples/CosmosDBCollectionReplace.json | 105 +++ .../examples/CosmosDBDatabaseCreate.json | 36 + .../examples/CosmosDBDatabaseDelete.json | 13 + .../examples/CosmosDBDatabaseGet.json | 27 + .../examples/CosmosDBDatabaseList.json | 30 + .../examples/CosmosDBDatabaseReplace.json | 37 + .../cosmos-db/resource-manager/readme.md | 70 +- 12 files changed, 1386 insertions(+), 4 deletions(-) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index b0d4c3b3298e..eb86e3d8916a 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1368,6 +1368,385 @@ "nextLinkName": null } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases": { + "get": { + "operationId": "DatabaseAccounts_ListDatabases", + "x-ms-examples": { + "CosmosDBDatabaseList": { "$ref": "./examples/CosmosDBDatabaseList.json" } + }, + "description": "Lists the databases under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The database properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/DatabaseListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateDatabase", + "x-ms-examples": { + "CosmosDBDatabaseCreate": { "$ref": "./examples/CosmosDBDatabaseCreate.json" } + }, + "description": "Creates an Azure Cosmos DB database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DatabaseCreateUpdateParameters" + }, + "description": "The parameters to provide for the current database." + } + ], + "responses": { + "200": { + "description": "The database create operation will complete asynchronously.", + "schema": { + "$ref": "#/definitions/DatabaseResource" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}": { + "get": { + "operationId": "DatabaseAccounts_GetDatabase", + "x-ms-examples": { + "CosmosDBDatabaseGet": { "$ref": "./examples/CosmosDBDatabaseGet.json" } + }, + "description": "Gets the databases under an existing Azure Cosmos DB database account with the provided id.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The database properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/DatabaseResource" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateDatabase", + "x-ms-examples": { + "CosmosDBDatabaseReplace": { "$ref": "./examples/CosmosDBDatabaseReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DatabaseCreateUpdateParameters" + }, + "description": "The parameters to provide for the current database." + } + ], + "responses": { + "200": { + "description": "The database create operation will complete asynchronously.", + "schema": { + "$ref": "#/definitions/DatabaseResource" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteDatabase", + "x-ms-examples": { + "CosmosDBDatabaseDelete": { "$ref": "./examples/CosmosDBDatabaseDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB database.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The database delete operation will complete asynchronously." + }, + "204": { + "description": "The specified database does not exist in the subscription." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/containers": { + "get": { + "operationId": "DatabaseAccounts_ListCollections", + "x-ms-examples": { + "CosmosDBCollectionList": { "$ref": "./examples/CosmosDBCollectionList.json" } + }, + "description": "Lists the collections under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The collection properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/CollectionListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateCollection", + "x-ms-examples": { + "CosmosDBCollectionCreate": { "$ref": "./examples/CosmosDBCollectionCreate.json" } + }, + "description": "Creates an Azure Cosmos DB collection", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createCollectionParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CollectionCreateUpdateParameters" + }, + "description": "The parameters to provide for the current collection." + } + ], + "responses": { + "201": { + "description": "The collection create operation was successful", + "schema": { + "$ref": "#/definitions/CollectionResource" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/containers/{collectionRid}": { + "get": { + "operationId": "DatabaseAccounts_GetCollection", + "x-ms-examples": { + "CosmosDBCollectionGet": { "$ref": "./examples/CosmosDBCollectionGet.json" } + }, + "description": "Gets the collection under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The collection properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/CollectionResource" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateCollection", + "x-ms-examples": { + "CosmosDBCollectionReplace": { "$ref": "./examples/CosmosDBCollectionReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB collection", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateCollectionParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CollectionCreateUpdateParameters" + }, + "description": "The parameters to provide for the current collection." + } + ], + "responses": { + "200": { + "description": "The collection create operation will complete asynchronously.", + "schema": { + "$ref": "#/definitions/CollectionResource" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteCollection", + "x-ms-examples": { + "CosmosDBCollectionDelete": { "$ref": "./examples/CosmosDBCollectionDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB collection.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The collection delete operation will complete asynchronously." + }, + "204": { + "description": "The specified collection does not exist in the subscription." + } + } + } } }, "definitions": { @@ -1377,12 +1756,38 @@ "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/DatabaseAccount" + "$ref": "#/definitions/DatabaseAccount" + }, + "description": "List of database account and their properties." + } + }, + "description": "The List operation response, that contains the database accounts and their properties." + }, + "DatabaseListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseResource" + }, + "description": "List of databases and their properties." + } + }, + "description": "The List operation response, that contains the databases and their properties." + }, + "CollectionListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/CollectionResource" }, - "description": "List of database account and their properties." + "description": "List of collections and their properties." } }, - "description": "The List operation response, that contains the database accounts and their properties." + "description": "The List operation response, that contains the collections and their properties." }, "ErrorResponse": { "properties": { @@ -1535,6 +1940,140 @@ } ] }, + "GeneralResourceProperties": { + "description": "The general system generated resource properties associated with Databases and Collections.", + "type": "object", + "properties": { + "_rid": { + "type": "string", + "description": "A system generated property. A unique identifier." + }, + "_ts": { + "description": "A system generated property that denotes the last updated timestamp of the resource." + }, + "_self": { + "type": "string", + "description": "A system generated property. It is the unique addressable URI for the resource." + }, + "_etag": { + "type": "string", + "description": "A system generated property representing the resource etag required for optimistic concurrency control." + } + } + }, + "AccountResource": { + "type": "object", + "description": "A database or collection resource.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The unique resource identifier of the database account." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the database account." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of Azure resource." + } + }, + "required": [ + "location" + ], + "x-ms-azure-resource": true + }, + "DatabaseResource":{ + "description": "An Azure Cosmos DB database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB database", + "$ref": "#/definitions/DatabaseProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/AccountResource" + } + ] + }, + "DatabaseProperties": { + "description": "The properties of an Azure Cosmos DB database", + "type": "object", + "properties": { + "_colls": { + "type": "string", + "description": "A system generated property that specified the addressable path of the collections resource." + }, + "_users": { + "type": "string", + "description": "A system generated property that specifies the addressable path of the users resource." + } + }, + "allOf": [ + { + "$ref": "#/definitions/DatabaseCreateUpdateResource" + }, + { + "$ref": "#/definitions/GeneralResourceProperties" + } + ] + }, + "CollectionResource":{ + "description": "An Azure Cosmos DB collection.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB collection", + "$ref": "#/definitions/CollectionProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/AccountResource" + } + ] + }, + "CollectionProperties": { + "description": "The properties of an Azure Cosmos DB collection", + "type": "object", + "properties": { + "_doc": { + "type": "string", + "description": "A system generated property that specifies the addressable path of the documents resource." + }, + "_sprocs": { + "type": "string", + "description": "A system generated property that specifies the addressable path of the stored procedures (sprocs) resource." + }, + "_triggers": { + "type": "string", + "description": "A system generated property that specifies the addressable path of the triggers resource." + }, + "_udfs": { + "type": "string", + "description": "A system generated property that specifies the addressable path of the user-defined functions (udfs) resource." + }, + "_conflicts": { + "type": "string", + "description": "A system generated property that specifies the addressable path of the conflicts resource." + } + }, + "allOf": [ + { + "$ref": "#/definitions/CollectionCreateUpdateResource" + }, + { + "$ref": "#/definitions/GeneralResourceProperties" + } + ] + }, "ConsistencyPolicy": { "type": "object", "description": "The consistency policy for the Cosmos DB database account.", @@ -1679,6 +2218,7 @@ } }, "databaseAccountOfferType": { + "description": "The offer type for the database", "$ref": "#/definitions/DatabaseAccountOfferType" }, "ipRangeFilter": { @@ -1857,6 +2397,293 @@ "modelAsString": false } }, + "DatabaseCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB database.", + "type": "object", + "properties": { + "id": { + "description": "The name of the database", + "type": "string" + }, + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB database.", + "$ref": "#/definitions/DatabaseCreateUpdateProperties" + } + }, + "required": [ + "id", + "properties" + ] + }, + "DatabaseCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB database.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a database", + "$ref": "#/definitions/DatabaseCreateUpdateResource" + }, + "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" + ] + }, + "CollectionCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB collection.", + "type": "object", + "properties": { + "id": { + "description": "The name of the collection", + "type": "string" + }, + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB collection.", + "$ref": "#/definitions/CollectionCreateUpdateProperties" + } + }, + "required": [ + "id", + "properties" + ] + }, + "CollectionCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB collection.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a collection", + "$ref": "#/definitions/CollectionCreateUpdateResource" + }, + "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" + ] + }, + "DatabaseCreateUpdateResource": { + "type": "object", + "description": "Cosmos DB database id object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB database" + } + }, + "required": [ + "id" + ] + }, + "CollectionCreateUpdateResource": { + "type": "object", + "description": "Cosmos DB collection resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB collection" + }, + "indexingPolicy": { + "$ref": "#/definitions/IndexingPolicy", + "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the collection" + }, + "partitionKey": { + "$ref": "#/definitions/PartitionKey", + "description": "The configuration of the partition key to be used for partitioning data into multiple partitions" + }, + "conflictResolutionPolicy": { + "$ref": "#/definitions/ConflictResolutionPolicy", + "description": "The conflict resolution policy for the collection." + } + }, + "required": [ + "id" + ] + }, + "IndexingPolicy": { + "type": "object", + "description": "Cosmos DB indexing policy", + "properties": { + "automatic": { + "type": "boolean", + "description": "Indicates if the indexing policy is automatic" + }, + "indexingMode": { + "description": "Indicates the indexing mode.", + "type": "string", + "default": "Consistent", + "enum": [ + "Consistent", + "Lazy", + "None" + ], + "x-ms-enum": { + "name": "IndexingMode", + "modelAsString": true + } + }, + "includedPaths": { + "description": "List of paths to include in the indexing", + "type": "array", + "items": { + "$ref": "#/definitions/IncludedPaths" + } + }, + "excludedPaths": { + "description": "List of paths to exclude from indexing", + "type": "array", + "items": { + "$ref": "#/definitions/Path" + } + } + } + }, + "Path": { + "type": "string", + "description": "A path. These typically start with root (/path)" + }, + "IncludedPaths": { + "type": "object", + "description": "The paths that are included in indexing", + "properties": { + "path": { + "type": "string", + "description": "The path for which the indexing behavior applies to. Index paths typically start with root and end with windcard (/path/*)" + }, + "indexes": { + "description": "List of indexes for this path", + "type": "array", + "items": { + "$ref": "#/definitions/Indexes" + } + } + } + }, + "Indexes": { + "type": "object", + "description": "The indexes for the path.", + "properties": { + "dataType": { + "description": "The datatype for which the indexing behavior is applied to.", + "type": "string", + "default": "String", + "enum": [ + "String", + "Number", + "Point", + "Polygon", + "LineString", + "MultiPolygon" + ], + "x-ms-enum": { + "name": "DataType", + "modelAsString": true + } + }, + "precision": { + "description": "The precision of the index. -1 is maximum precision.", + "type": "integer" + }, + "kind": { + "description": "Indicates the type of index.", + "type": "string", + "default": "Hash", + "enum": [ + "Hash", + "Range", + "Spatial" + ], + "x-ms-enum": { + "name": "IndexKind", + "modelAsString": true + } + } + } + }, + "PartitionKey": { + "type": "object", + "description": "The configuration of the partition key to be used for partitioning data into multiple partitions", + "properties": { + "paths": { + "description": "List of paths using which data within the collection can be parititoned", + "type": "array", + "items": { + "$ref": "#/definitions/Path" + } + }, + "kind": { + "description": "Indicates the kind of algorithm used for partitioning", + "type": "string", + "default": "Hash", + "enum": [ + "Hash", + "Range" + ], + "x-ms-enum": { + "name": "PartitionKind", + "modelAsString": true + } + } + } + }, + "ConflictResolutionPolicy": { + "type": "object", + "description": "The conflict resolution policy for the collection.", + "properties": { + "mode": { + "description": "Indicates the conflict resolution mode.", + "type": "string", + "default": "LastWriterWins", + "enum": [ + "LastWriterWins", + "Custom" + ], + "x-ms-enum": { + "name": "ConflictResolutionMode", + "modelAsString": true + } + }, + "conflictResolutionPath": { + "type": "string", + "description": "The conflict resolution path in the case of LastWriterWins mode." + }, + "conflictResolutionProcedure": { + "type": "string", + "description": "The procedure to resolve conflicts in the case of custom mode." + } + } + }, + "CreateUpdateOptions": { + "type": "object", + "description": "Cosmos DB create database options", + "properties": { + "If-Match": { + "type": "string", + "description": "The If-Match header for the request" + }, + "If-None-Match": { + "type": "string", + "description": "The If-Non-Match header for the request" + }, + "Session-Token": { + "type": "string", + "description": "The x-ms-session-token header for the request" + }, + "Throughput": { + "type": "string", + "description": "The x-ms-offer-throughput header for the request" + } + } + }, "Capability": { "type": "object", "description": "Cosmos DB capability object", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json new file mode 100644 index 000000000000..5e97859ae4ee --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json @@ -0,0 +1,104 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "createCollectionParameters": { + "id": "testcoll", + "properties": { + "resource": { + "id": "testcoll", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + } + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "testcoll", + "name": "testcoll", + "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "properties": { + "id": "testcoll", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", + "_docs": "docs/", + "_sprocs": "sprocs/", + "_triggers": "triggers/", + "_udfs": "udfs/", + "_conflicts": "conflicts/" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json new file mode 100644 index 000000000000..2fd3befbb9aa --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "collectionRid": "collectionName" + }, + "responses": { + "202": { }, + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json new file mode 100644 index 000000000000..3fda4116751e --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseRid": "databaseName", + "collectionRid": "collectionName" + }, + "responses": { + "200": { + "body": { + "id": "collectionName", + "name": "collectionName", + "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "properties": { + "id": "collectionName", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", + "_docs": "docs/", + "_sprocs": "sprocs/", + "_triggers": "triggers/", + "_udfs": "udfs/", + "_conflicts": "conflicts/" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json new file mode 100644 index 000000000000..2f9186f8c848 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseRid": "databaseName" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "testcoll", + "name": "testcoll", + "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "properties": { + "id": "collectionName", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", + "_docs": "docs/", + "_sprocs": "sprocs/", + "_triggers": "triggers/", + "_udfs": "udfs/", + "_conflicts": "conflicts/" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json new file mode 100644 index 000000000000..680a6256a76c --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json @@ -0,0 +1,105 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "collectionRid": "testcoll", + "updateCollectionParameters": { + "id": "testcoll", + "properties": { + "resource": { + "id": "testcoll", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + } + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "testcoll", + "name": "testcoll", + "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "properties": { + "id": "testcoll", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", + "_docs": "docs/", + "_sprocs": "sprocs/", + "_triggers": "triggers/", + "_udfs": "udfs/", + "_conflicts": "conflicts/" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json new file mode 100644 index 000000000000..8a758bdd70f8 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "createDatabaseParameters": { + "id": "databaseName", + "properties": { + "resource": { + "id": "databaseName" + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "properties": { + "id": "databaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_self": "dbs\/CqNBAA==\/", + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", + "_colls": "colls\/", + "_users": "users\/" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json new file mode 100644 index 000000000000..0b770a10a0ad --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName" + }, + "responses": { + "202": { }, + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json new file mode 100644 index 000000000000..d3ba3616d3c5 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName" + }, + "responses": { + "200": { + "body": { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "properties": { + "id": "databaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_self": "dbs\/CqNBAA==\/", + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", + "_colls": "colls\/", + "_users": "users\/" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json new file mode 100644 index 000000000000..3dde98587dac --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "properties": { + "id": "databaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_self": "dbs\/CqNBAA==\/", + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", + "_colls": "colls\/", + "_users": "users\/" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json new file mode 100644 index 000000000000..1674af370a7d --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "updateDatabaseParameters": { + "id": "updatedDatabaseName", + "properties": { + "resource": { + "id": "updatedDatabaseName" + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "updatedDatabaseName", + "name": "updatedDatabaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "properties": { + "id": "updatedDatabaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_self": "dbs\/CqNBAA==\/", + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", + "_colls": "colls\/", + "_users": "users\/" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index 740a2d0c111c..4191697ae1c2 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -50,10 +50,78 @@ directive: from: cosmos-db.json where: $.definitions.DatabaseAccountCreateUpdateParameters reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.DatabaseResource + reason: The DatabaseResource doesn't support Path operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.CollectionResource + reason: The CollectionResource doesn't support Path operation - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json where: $.definitions.MetricValue.properties._count - reason: The Metrics API has has a property name with a leading underscore character + reason: The Metrics API has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GeneralResourceProperties.properties._rid + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GeneralResourceProperties.properties._ts + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GeneralResourceProperties.properties._self + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GeneralResourceProperties.properties._etag + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.DatabaseProperties.properties._colls + reason: The database has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.DatabaseProperties.properties._users + reason: The database has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CollectionProperties.properties._doc + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CollectionProperties.properties._sprocs + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CollectionProperties.properties._triggers + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CollectionProperties.properties._udfs + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CollectionProperties.properties._conflicts + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CreateUpdateOptions.properties.If-Match + reason: The option has a property name with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CreateUpdateOptions.properties.If-None-Match + reason: The option has a property name with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CreateUpdateOptions.properties.Session-Token + reason: The option has a property name with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.CreateUpdateOptions.properties.Throughput + reason: The option has a property name with leading capital letters - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json where: $.definitions.PercentileMetricValue.properties.P10 From d596bac71b2b2ada41c02c94d1af7ccd871b7daf Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Tue, 26 Mar 2019 15:57:18 -0700 Subject: [PATCH 02/13] Add SQL Database and Container API --- .../stable/2015-04-08/cosmos-db.json | 276 +++++++++--------- ...e.json => CosmosDBSqlContainerCreate.json} | 16 +- ...e.json => CosmosDBSqlContainerDelete.json} | 5 +- ...nGet.json => CosmosDBSqlContainerGet.json} | 10 +- ...ist.json => CosmosDBSqlContainerList.json} | 8 +- ....json => CosmosDBSqlContainerReplace.json} | 16 +- ...te.json => CosmosDBSqlDatabaseCreate.json} | 6 +- ...te.json => CosmosDBSqlDatabaseDelete.json} | 3 +- ...seGet.json => CosmosDBSqlDatabaseGet.json} | 2 +- ...List.json => CosmosDBSqlDatabaseList.json} | 2 +- ...e.json => CosmosDBSqlDatabaseReplace.json} | 4 +- .../cosmos-db/resource-manager/readme.md | 30 +- 12 files changed, 184 insertions(+), 194 deletions(-) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCollectionCreate.json => CosmosDBSqlContainerCreate.json} (90%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCollectionDelete.json => CosmosDBSqlContainerDelete.json} (74%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCollectionGet.json => CosmosDBSqlContainerGet.json} (86%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCollectionList.json => CosmosDBSqlContainerList.json} (89%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCollectionReplace.json => CosmosDBSqlContainerReplace.json} (90%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBDatabaseCreate.json => CosmosDBSqlDatabaseCreate.json} (85%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBDatabaseDelete.json => CosmosDBSqlDatabaseDelete.json} (86%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBDatabaseGet.json => CosmosDBSqlDatabaseGet.json} (89%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBDatabaseList.json => CosmosDBSqlDatabaseList.json} (89%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBDatabaseReplace.json => CosmosDBSqlDatabaseReplace.json} (88%) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index eb86e3d8916a..986e6a3ec97c 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1369,13 +1369,13 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases": { "get": { - "operationId": "DatabaseAccounts_ListDatabases", + "operationId": "DatabaseAccounts_ListSqlDatabases", "x-ms-examples": { - "CosmosDBDatabaseList": { "$ref": "./examples/CosmosDBDatabaseList.json" } + "CosmosDBSqlDatabaseList": { "$ref": "./examples/CosmosDBSqlDatabaseList.json" } }, - "description": "Lists the databases under an existing Azure Cosmos DB database account.", + "description": "Lists the SQL databases under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -1392,9 +1392,9 @@ ], "responses": { "200": { - "description": "The database properties were retrieved successfully.", + "description": "The SQL database properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/DatabaseListResult" + "$ref": "#/definitions/SqlDatabaseListResult" } } }, @@ -1403,11 +1403,11 @@ } }, "put": { - "operationId": "DatabaseAccounts_CreateDatabase", + "operationId": "DatabaseAccounts_CreateSqlDatabase", "x-ms-examples": { - "CosmosDBDatabaseCreate": { "$ref": "./examples/CosmosDBDatabaseCreate.json" } + "CosmosDBSqlDatabaseCreate": { "$ref": "./examples/CosmosDBSqlDatabaseCreate.json" } }, - "description": "Creates an Azure Cosmos DB database", + "description": "Creates an Azure Cosmos DB SQL database", "x-ms-long-running-operation": true, "parameters": [ { @@ -1423,32 +1423,32 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "createDatabaseParameters", + "name": "createSqlDatabaseParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DatabaseCreateUpdateParameters" + "$ref": "#/definitions/SqlDatabaseCreateUpdateParameters" }, - "description": "The parameters to provide for the current database." + "description": "The parameters to provide for the current SQL database." } ], "responses": { - "200": { - "description": "The database create operation will complete asynchronously.", + "201": { + "description": "The SQL database create operation was succesful.", "schema": { - "$ref": "#/definitions/DatabaseResource" + "$ref": "#/definitions/SqlDatabaseResource" } } } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseRid}": { "get": { - "operationId": "DatabaseAccounts_GetDatabase", + "operationId": "DatabaseAccounts_GetSqlDatabase", "x-ms-examples": { - "CosmosDBDatabaseGet": { "$ref": "./examples/CosmosDBDatabaseGet.json" } + "CosmosDBSqlDatabaseGet": { "$ref": "./examples/CosmosDBSqlDatabaseGet.json" } }, - "description": "Gets the databases under an existing Azure Cosmos DB database account with the provided id.", + "description": "Gets the SQL databases under an existing Azure Cosmos DB database account with the provided id.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -1468,19 +1468,19 @@ ], "responses": { "200": { - "description": "The database properties were retrieved successfully.", + "description": "The SQL database property was retrieved successfully.", "schema": { - "$ref": "#/definitions/DatabaseResource" + "$ref": "#/definitions/SqlDatabaseResource" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateDatabase", + "operationId": "DatabaseAccounts_UpdateSqlDatabase", "x-ms-examples": { - "CosmosDBDatabaseReplace": { "$ref": "./examples/CosmosDBDatabaseReplace.json" } + "CosmosDBSqlDatabaseReplace": { "$ref": "./examples/CosmosDBSqlDatabaseReplace.json" } }, - "description": "Updates an existing Azure Cosmos DB database", + "description": "Updates an existing Azure Cosmos DB SQL database", "x-ms-long-running-operation": true, "parameters": [ { @@ -1499,30 +1499,30 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateDatabaseParameters", + "name": "updateSqlDatabaseParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DatabaseCreateUpdateParameters" + "$ref": "#/definitions/SqlDatabaseCreateUpdateParameters" }, - "description": "The parameters to provide for the current database." + "description": "The parameters to provide for the current SQL database." } ], "responses": { "200": { - "description": "The database create operation will complete asynchronously.", + "description": "The SQL database update operation was successful.", "schema": { - "$ref": "#/definitions/DatabaseResource" + "$ref": "#/definitions/SqlDatabaseResource" } } } }, "delete": { - "operationId": "DatabaseAccounts_DeleteDatabase", + "operationId": "DatabaseAccounts_DeleteSqlDatabase", "x-ms-examples": { - "CosmosDBDatabaseDelete": { "$ref": "./examples/CosmosDBDatabaseDelete.json" } + "CosmosDBSqlDatabaseDelete": { "$ref": "./examples/CosmosDBSqlDatabaseDelete.json" } }, - "description": "Deletes an existing Azure Cosmos DB database.", + "description": "Deletes an existing Azure Cosmos DB SQL database.", "x-ms-long-running-operation": true, "parameters": [ { @@ -1542,22 +1542,19 @@ } ], "responses": { - "202": { - "description": "The database delete operation will complete asynchronously." - }, - "204": { - "description": "The specified database does not exist in the subscription." + "200": { + "description": "The SQL database delete operation was successful." } } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/containers": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseRid}/containers": { "get": { - "operationId": "DatabaseAccounts_ListCollections", + "operationId": "DatabaseAccounts_ListSqlContainers", "x-ms-examples": { - "CosmosDBCollectionList": { "$ref": "./examples/CosmosDBCollectionList.json" } + "CosmosDBSqlContainerList": { "$ref": "./examples/CosmosDBSqlContainerList.json" } }, - "description": "Lists the collections under an existing Azure Cosmos DB database account.", + "description": "Lists the SQL container under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -1577,9 +1574,9 @@ ], "responses": { "200": { - "description": "The collection properties were retrieved successfully.", + "description": "The SQL container properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/CollectionListResult" + "$ref": "#/definitions/SqlContainerListResult" } } }, @@ -1588,11 +1585,11 @@ } }, "put": { - "operationId": "DatabaseAccounts_CreateCollection", + "operationId": "DatabaseAccounts_CreateSqlContainer", "x-ms-examples": { - "CosmosDBCollectionCreate": { "$ref": "./examples/CosmosDBCollectionCreate.json" } + "CosmosDBSqlContainerCreate": { "$ref": "./examples/CosmosDBSqlContainerCreate.json" } }, - "description": "Creates an Azure Cosmos DB collection", + "description": "Creates an Azure Cosmos DB SQL container", "x-ms-long-running-operation": true, "parameters": [ { @@ -1611,32 +1608,32 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "createCollectionParameters", + "name": "createSqlContainerParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CollectionCreateUpdateParameters" + "$ref": "#/definitions/SqlContainerCreateUpdateParameters" }, - "description": "The parameters to provide for the current collection." + "description": "The parameters to provide for the current SQL container." } ], "responses": { "201": { - "description": "The collection create operation was successful", + "description": "The SQL container create operation was successful", "schema": { - "$ref": "#/definitions/CollectionResource" + "$ref": "#/definitions/SqlContainerResource" } } } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/containers/{collectionRid}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseRid}/containers/{containerRid}": { "get": { - "operationId": "DatabaseAccounts_GetCollection", + "operationId": "DatabaseAccounts_GetSqlContainer", "x-ms-examples": { - "CosmosDBCollectionGet": { "$ref": "./examples/CosmosDBCollectionGet.json" } + "CosmosDBSqlContainerGet": { "$ref": "./examples/CosmosDBSqlContainerGet.json" } }, - "description": "Gets the collection under an existing Azure Cosmos DB database account.", + "description": "Gets the SQL container under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -1651,7 +1648,7 @@ "$ref": "#/parameters/databaseRidParameter" }, { - "$ref": "#/parameters/collectionRidParameter" + "$ref": "#/parameters/containerRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" @@ -1659,19 +1656,19 @@ ], "responses": { "200": { - "description": "The collection properties were retrieved successfully.", + "description": "The SQL container property was retrieved successfully.", "schema": { - "$ref": "#/definitions/CollectionResource" + "$ref": "#/definitions/SqlContainerResource" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateCollection", + "operationId": "DatabaseAccounts_UpdateSqlContainer", "x-ms-examples": { - "CosmosDBCollectionReplace": { "$ref": "./examples/CosmosDBCollectionReplace.json" } + "CosmosDBSqlContainerReplace": { "$ref": "./examples/CosmosDBSqlContainerReplace.json" } }, - "description": "Updates an existing Azure Cosmos DB collection", + "description": "Updates an existing Azure Cosmos DB SQL container", "x-ms-long-running-operation": true, "parameters": [ { @@ -1687,36 +1684,36 @@ "$ref": "#/parameters/databaseRidParameter" }, { - "$ref": "#/parameters/collectionRidParameter" + "$ref": "#/parameters/containerRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateCollectionParameters", + "name": "updateSqlContainerParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CollectionCreateUpdateParameters" + "$ref": "#/definitions/SqlContainerCreateUpdateParameters" }, - "description": "The parameters to provide for the current collection." + "description": "The parameters to provide for the current SQL container." } ], "responses": { "200": { - "description": "The collection create operation will complete asynchronously.", + "description": "The SQL container update operation was successful.", "schema": { - "$ref": "#/definitions/CollectionResource" + "$ref": "#/definitions/SqlContainerResource" } } } }, "delete": { - "operationId": "DatabaseAccounts_DeleteCollection", + "operationId": "DatabaseAccounts_DeleteSqlContainer", "x-ms-examples": { - "CosmosDBCollectionDelete": { "$ref": "./examples/CosmosDBCollectionDelete.json" } + "CosmosDBSqlContainerDelete": { "$ref": "./examples/CosmosDBSqlContainerDelete.json" } }, - "description": "Deletes an existing Azure Cosmos DB collection.", + "description": "Deletes an existing Azure Cosmos DB SQL container.", "x-ms-long-running-operation": true, "parameters": [ { @@ -1732,18 +1729,15 @@ "$ref": "#/parameters/databaseRidParameter" }, { - "$ref": "#/parameters/collectionRidParameter" + "$ref": "#/parameters/containerRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" } ], "responses": { - "202": { - "description": "The collection delete operation will complete asynchronously." - }, - "204": { - "description": "The specified collection does not exist in the subscription." + "200": { + "description": "The SQL container delete operation was successful." } } } @@ -1763,31 +1757,31 @@ }, "description": "The List operation response, that contains the database accounts and their properties." }, - "DatabaseListResult": { + "SqlDatabaseListResult": { "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/DatabaseResource" + "$ref": "#/definitions/SqlDatabaseResource" }, - "description": "List of databases and their properties." + "description": "List of SQL databases and their properties." } }, - "description": "The List operation response, that contains the databases and their properties." + "description": "The List operation response, that contains the SQL databases and their properties." }, - "CollectionListResult": { + "SqlContainerListResult": { "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/CollectionResource" + "$ref": "#/definitions/SqlContainerResource" }, - "description": "List of collections and their properties." + "description": "List of SQL containers and their properties." } }, - "description": "The List operation response, that contains the collections and their properties." + "description": "The List operation response, that contains the SQL containers and their properties." }, "ErrorResponse": { "properties": { @@ -1940,8 +1934,8 @@ } ] }, - "GeneralResourceProperties": { - "description": "The general system generated resource properties associated with Databases and Collections.", + "ExtenedResourceProperties": { + "description": "The system generated resource properties associated with SQL databases and SQL containers.", "type": "object", "properties": { "_rid": { @@ -1961,9 +1955,9 @@ } } }, - "AccountResource": { + "GenericResourceProperties": { "type": "object", - "description": "A database or collection resource.", + "description": "The general properties associated with all API resource.", "properties": { "id": { "readOnly": true, @@ -1986,24 +1980,24 @@ ], "x-ms-azure-resource": true }, - "DatabaseResource":{ - "description": "An Azure Cosmos DB database.", + "SqlDatabaseResource":{ + "description": "An Azure Cosmos DB SQL database.", "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, - "description": "The properties of an Azure Cosmos DB database", - "$ref": "#/definitions/DatabaseProperties" + "description": "The properties of an Azure Cosmos DB SQL database", + "$ref": "#/definitions/SqlDatabaseResourceProperties" } }, "allOf": [ { - "$ref": "#/definitions/AccountResource" + "$ref": "#/definitions/GenericResourceProperties" } ] }, - "DatabaseProperties": { - "description": "The properties of an Azure Cosmos DB database", + "SqlDatabaseResourceProperties": { + "description": "The properties of an Azure Cosmos DB SQL database", "type": "object", "properties": { "_colls": { @@ -2017,31 +2011,31 @@ }, "allOf": [ { - "$ref": "#/definitions/DatabaseCreateUpdateResource" + "$ref": "#/definitions/SqlDatabaseCreateUpdateResource" }, { - "$ref": "#/definitions/GeneralResourceProperties" + "$ref": "#/definitions/ExtenedResourceProperties" } ] }, - "CollectionResource":{ - "description": "An Azure Cosmos DB collection.", + "SqlContainerResource":{ + "description": "An Azure Cosmos DB SQL container.", "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, - "description": "The properties of an Azure Cosmos DB collection", - "$ref": "#/definitions/CollectionProperties" + "description": "The properties of an Azure Cosmos DB SQL container", + "$ref": "#/definitions/SqlContainerResourceProperties" } }, "allOf": [ { - "$ref": "#/definitions/AccountResource" + "$ref": "#/definitions/GenericResourceProperties" } ] }, - "CollectionProperties": { - "description": "The properties of an Azure Cosmos DB collection", + "SqlContainerResourceProperties": { + "description": "The properties of an Azure Cosmos DB SQL container", "type": "object", "properties": { "_doc": { @@ -2067,10 +2061,10 @@ }, "allOf": [ { - "$ref": "#/definitions/CollectionCreateUpdateResource" + "$ref": "#/definitions/SqlContainerCreateUpdateResource" }, { - "$ref": "#/definitions/GeneralResourceProperties" + "$ref": "#/definitions/ExtenedResourceProperties" } ] }, @@ -2397,32 +2391,27 @@ "modelAsString": false } }, - "DatabaseCreateUpdateParameters": { - "description": "Parameters to create and update Cosmos DB database.", + "SqlDatabaseCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB SQL database.", "type": "object", "properties": { - "id": { - "description": "The name of the database", - "type": "string" - }, "properties": { "x-ms-client-flatten": true, - "description": "Properties to create and update Azure Cosmos DB database.", - "$ref": "#/definitions/DatabaseCreateUpdateProperties" + "description": "Properties to create and update Azure Cosmos DB SQL database.", + "$ref": "#/definitions/SqlDatabaseCreateUpdateProperties" } }, "required": [ - "id", "properties" ] }, - "DatabaseCreateUpdateProperties": { - "description": "Properties to create and update Azure Cosmos DB database.", + "SqlDatabaseCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB SQL database.", "type": "object", "properties": { "resource": { - "description": "The standard JSON format of a database", - "$ref": "#/definitions/DatabaseCreateUpdateResource" + "description": "The standard JSON format of a SQL database", + "$ref": "#/definitions/SqlDatabaseCreateUpdateResource" }, "options": { "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", @@ -2434,32 +2423,27 @@ "options" ] }, - "CollectionCreateUpdateParameters": { - "description": "Parameters to create and update Cosmos DB collection.", + "SqlContainerCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB SQL container.", "type": "object", "properties": { - "id": { - "description": "The name of the collection", - "type": "string" - }, "properties": { "x-ms-client-flatten": true, - "description": "Properties to create and update Azure Cosmos DB collection.", - "$ref": "#/definitions/CollectionCreateUpdateProperties" + "description": "Properties to create and update Azure Cosmos DB SQL container.", + "$ref": "#/definitions/SqlContainerCreateUpdateProperties" } }, "required": [ - "id", "properties" ] }, - "CollectionCreateUpdateProperties": { - "description": "Properties to create and update Azure Cosmos DB collection.", + "SqlContainerCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB SQL container.", "type": "object", "properties": { "resource": { - "description": "The standard JSON format of a collection", - "$ref": "#/definitions/CollectionCreateUpdateResource" + "description": "The standard JSON format of a SQL container", + "$ref": "#/definitions/SqlContainerCreateUpdateResource" }, "options": { "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", @@ -2471,30 +2455,30 @@ "options" ] }, - "DatabaseCreateUpdateResource": { + "SqlDatabaseCreateUpdateResource": { "type": "object", - "description": "Cosmos DB database id object", + "description": "Cosmos DB SQL database id object", "properties": { "id": { "type": "string", - "description": "Name of the Cosmos DB database" + "description": "Name of the Cosmos DB SQL database" } }, "required": [ "id" ] }, - "CollectionCreateUpdateResource": { + "SqlContainerCreateUpdateResource": { "type": "object", - "description": "Cosmos DB collection resource object", + "description": "Cosmos DB SQL container resource object", "properties": { "id": { "type": "string", - "description": "Name of the Cosmos DB collection" + "description": "Name of the Cosmos DB SQL container" }, "indexingPolicy": { "$ref": "#/definitions/IndexingPolicy", - "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the collection" + "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the SQL container" }, "partitionKey": { "$ref": "#/definitions/PartitionKey", @@ -2502,7 +2486,7 @@ }, "conflictResolutionPolicy": { "$ref": "#/definitions/ConflictResolutionPolicy", - "description": "The conflict resolution policy for the collection." + "description": "The conflict resolution policy for the SQL container." } }, "required": [ @@ -2614,7 +2598,7 @@ "description": "The configuration of the partition key to be used for partitioning data into multiple partitions", "properties": { "paths": { - "description": "List of paths using which data within the collection can be parititoned", + "description": "List of paths using which data within the SQL container can be parititoned", "type": "array", "items": { "$ref": "#/definitions/Path" @@ -2637,7 +2621,7 @@ }, "ConflictResolutionPolicy": { "type": "object", - "description": "The conflict resolution policy for the collection.", + "description": "The conflict resolution policy for the SQL container.", "properties": { "mode": { "description": "Indicates the conflict resolution mode.", @@ -3250,6 +3234,14 @@ "x-ms-parameter-location": "method", "description": "Cosmos DB collection rid." }, + "containerRidParameter": { + "name": "containerRid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB container rid." + }, "regionParameter": { "name": "region", "in": "path", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json similarity index 90% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json index 5e97859ae4ee..2b69600c302e 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionCreate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json @@ -5,11 +5,11 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "createCollectionParameters": { - "id": "testcoll", + "createSqlContainerParameters": { + "id": "testctn", "properties": { "resource": { - "id": "testcoll", + "id": "testctn", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, @@ -49,13 +49,13 @@ } }, "responses": { - "200": { + "201": { "body": { - "id": "testcoll", - "name": "testcoll", - "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "id": "testctn", + "name": "testctn", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", "properties": { - "id": "testcoll", + "id": "testctn", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json similarity index 74% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json index 2fd3befbb9aa..f3382b636cba 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json @@ -5,10 +5,9 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "collectionRid": "collectionName" + "containerRid": "containerName" }, "responses": { - "202": { }, - "204": { } + "200": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json similarity index 86% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json index 3fda4116751e..961c27c68571 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json @@ -5,16 +5,16 @@ "resourceGroupName": "rgName", "accountName": "ddb1", "databaseRid": "databaseName", - "collectionRid": "collectionName" + "containerRid": "containerName" }, "responses": { "200": { "body": { - "id": "collectionName", - "name": "collectionName", - "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "id": "containerName", + "name": "containerName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", "properties": { - "id": "collectionName", + "id": "containerName", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json similarity index 89% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json index 2f9186f8c848..e8188d655443 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json @@ -11,11 +11,11 @@ "body": { "value": [ { - "id": "testcoll", - "name": "testcoll", - "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "id": "testctn", + "name": "testctn", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", "properties": { - "id": "collectionName", + "id": "testctn", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json similarity index 90% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json index 680a6256a76c..5e59724d379c 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCollectionReplace.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json @@ -5,12 +5,12 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "collectionRid": "testcoll", - "updateCollectionParameters": { - "id": "testcoll", + "containerRid": "testctn", + "updateSqlContainerParameters": { + "id": "testctn", "properties": { "resource": { - "id": "testcoll", + "id": "testctn", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, @@ -52,11 +52,11 @@ "responses": { "200": { "body": { - "id": "testcoll", - "name": "testcoll", - "type": "Microsoft.DocumentDB/databaseAccounts/databases/containers", + "id": "testctn", + "name": "testctn", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", "properties": { - "id": "testcoll", + "id": "testctn", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreate.json similarity index 85% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreate.json index 8a758bdd70f8..5c74b5691843 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseCreate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreate.json @@ -4,7 +4,7 @@ "resourceGroupName": "rg1", "api-version": "2015-04-08", "subscriptionId": "subid", - "createDatabaseParameters": { + "createSqlDatabaseParameters": { "id": "databaseName", "properties": { "resource": { @@ -16,11 +16,11 @@ } }, "responses": { - "200": { + "201": { "body": { "id": "databaseName", "name": "databaseName", - "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", "properties": { "id": "databaseName", "_rid": "CqNBAA==", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json similarity index 86% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json index 0b770a10a0ad..c7448e3f981c 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json @@ -7,7 +7,6 @@ "databaseRid": "databaseName" }, "responses": { - "202": { }, - "204": { } + "200": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json similarity index 89% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json index d3ba3616d3c5..7570ec937f68 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json @@ -11,7 +11,7 @@ "body": { "id": "databaseName", "name": "databaseName", - "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", "properties": { "id": "databaseName", "_rid": "CqNBAA==", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json similarity index 89% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json index 3dde98587dac..fbbdb14738ea 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json @@ -12,7 +12,7 @@ { "id": "databaseName", "name": "databaseName", - "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", "properties": { "id": "databaseName", "_rid": "CqNBAA==", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json similarity index 88% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json index 1674af370a7d..90f019cc3adc 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseReplace.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json @@ -5,7 +5,7 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "updateDatabaseParameters": { + "updateSqlDatabaseParameters": { "id": "updatedDatabaseName", "properties": { "resource": { @@ -21,7 +21,7 @@ "body": { "id": "updatedDatabaseName", "name": "updatedDatabaseName", - "type": "Microsoft.DocumentDB/databaseAccounts/databases", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", "properties": { "id": "updatedDatabaseName", "_rid": "CqNBAA==", diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index 4191697ae1c2..6c03ea392882 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -52,59 +52,59 @@ directive: reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation - suppress: TrackedResourcePatchOperation from: cosmos-db.json - where: $.definitions.DatabaseResource - reason: The DatabaseResource doesn't support Path operation + where: $.definitions.SqlDatabaseResource + reason: The SqlDatabaseResource doesn't support Patch operation - suppress: TrackedResourcePatchOperation from: cosmos-db.json - where: $.definitions.CollectionResource - reason: The CollectionResource doesn't support Path operation + where: $.definitions.SqlContainerResource + reason: The SqlContainerResource doesn't support Patch operation - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json where: $.definitions.MetricValue.properties._count reason: The Metrics API has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.GeneralResourceProperties.properties._rid + where: $.definitions.ExtenedResourceProperties.properties._rid reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.GeneralResourceProperties.properties._ts + where: $.definitions.ExtenedResourceProperties.properties._ts reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.GeneralResourceProperties.properties._self + where: $.definitions.ExtenedResourceProperties.properties._self reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.GeneralResourceProperties.properties._etag + where: $.definitions.ExtenedResourceProperties.properties._etag reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.DatabaseProperties.properties._colls + where: $.definitions.SqlDatabaseResourceProperties.properties._colls reason: The database has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.DatabaseProperties.properties._users + where: $.definitions.SqlDatabaseResourceProperties.properties._users reason: The database has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.CollectionProperties.properties._doc + where: $.definitions.SqlContainerResourceProperties.properties._doc reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.CollectionProperties.properties._sprocs + where: $.definitions.SqlContainerResourceProperties.properties._sprocs reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.CollectionProperties.properties._triggers + where: $.definitions.SqlContainerResourceProperties.properties._triggers reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.CollectionProperties.properties._udfs + where: $.definitions.SqlContainerResourceProperties.properties._udfs reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.CollectionProperties.properties._conflicts + where: $.definitions.SqlContainerResourceProperties.properties._conflicts reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json From c53c6c4c57d4d5283baa90370a42859c2c321d66 Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Wed, 27 Mar 2019 13:43:41 -0700 Subject: [PATCH 03/13] Remove properties in CreateUpdateOptions --- .../stable/2015-04-08/cosmos-db.json | 38 +-- .../CosmosDBDatabaseAccountCreateMulti.json | 109 --------- .../cosmos-db/resource-manager/readme.md | 227 ++++++++++++++++++ 3 files changed, 237 insertions(+), 137 deletions(-) delete mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseAccountCreateMulti.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index 986e6a3ec97c..f35cee0cb223 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1434,7 +1434,7 @@ ], "responses": { "201": { - "description": "The SQL database create operation was succesful.", + "description": "The SQL database create operation was successful.", "schema": { "$ref": "#/definitions/SqlDatabaseResource" } @@ -1934,7 +1934,7 @@ } ] }, - "ExtenedResourceProperties": { + "ExtendedResourceProperties": { "description": "The system generated resource properties associated with SQL databases and SQL containers.", "type": "object", "properties": { @@ -1975,9 +1975,6 @@ "description": "The type of Azure resource." } }, - "required": [ - "location" - ], "x-ms-azure-resource": true }, "SqlDatabaseResource":{ @@ -2014,7 +2011,7 @@ "$ref": "#/definitions/SqlDatabaseCreateUpdateResource" }, { - "$ref": "#/definitions/ExtenedResourceProperties" + "$ref": "#/definitions/ExtendedResourceProperties" } ] }, @@ -2064,7 +2061,7 @@ "$ref": "#/definitions/SqlContainerCreateUpdateResource" }, { - "$ref": "#/definitions/ExtenedResourceProperties" + "$ref": "#/definitions/ExtendedResourceProperties" } ] }, @@ -2541,7 +2538,7 @@ "properties": { "path": { "type": "string", - "description": "The path for which the indexing behavior applies to. Index paths typically start with root and end with windcard (/path/*)" + "description": "The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)" }, "indexes": { "description": "List of indexes for this path", @@ -2598,7 +2595,7 @@ "description": "The configuration of the partition key to be used for partitioning data into multiple partitions", "properties": { "paths": { - "description": "List of paths using which data within the SQL container can be parititoned", + "description": "List of paths using which data within the SQL container can be partitioned", "type": "array", "items": { "$ref": "#/definitions/Path" @@ -2648,25 +2645,10 @@ }, "CreateUpdateOptions": { "type": "object", - "description": "Cosmos DB create database options", - "properties": { - "If-Match": { - "type": "string", - "description": "The If-Match header for the request" - }, - "If-None-Match": { - "type": "string", - "description": "The If-Non-Match header for the request" - }, - "Session-Token": { - "type": "string", - "description": "The x-ms-session-token header for the request" - }, - "Throughput": { - "type": "string", - "description": "The x-ms-offer-throughput header for the request" - } - } + "additionalProperties": { + "type": "string" + }, + "description": "CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are \"If-Match\", \"If-None-Match\", \"Session-Token\" and \"Throughput\"" }, "Capability": { "type": "object", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseAccountCreateMulti.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseAccountCreateMulti.json deleted file mode 100644 index 65db2f69123f..000000000000 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBDatabaseAccountCreateMulti.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "parameters": { - "accountName": "ddb1", - "resourceGroupName": "rg1", - "api-version": "2015-04-08", - "subscriptionId": "subid", - "createUpdateParameters": { - "location": "westus", - "tags": {}, - "kind": "GlobalDocumentDB", - "properties": { - "databaseAccountOfferType": "Standard", - "ipRangeFilter": "10.10.10.10", - "isVirtualNetworkFilterEnabled": true, - "enableMultipleWriteLocations": true, - "virtualNetworkRules": [ - { - "id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", - "ignoreMissingVNetServiceEndpoint": false - } - ], - "locations": [ - { - "failoverPriority": 0, - "locationName": "southcentralus" - }, - { - "failoverPriority": 1, - "locationName": "eastus" - } - ], - "consistencyPolicy": { - "defaultConsistencyLevel": "BoundedStaleness", - "maxIntervalInSeconds": 10, - "maxStalenessPrefix": 200 - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1", - "name": "ddb1", - "location": "West US", - "type": "Microsoft.DocumentDB/databaseAccounts", - "kind": "GlobalDocumentDB", - "tags": {}, - "properties": { - "provisioningState": "Initializing", - "ipRangeFilter": "10.10.10.10", - "isVirtualNetworkFilterEnabled": true, - "enableMultipleWriteLocations": true, - "databaseAccountOfferType": "Standard", - "consistencyPolicy": { - "defaultConsistencyLevel": "BoundedStaleness", - "maxIntervalInSeconds": 10, - "maxStalenessPrefix": 200 - }, - "writeLocations": [ - { - "id": "ddb1-southcentralus", - "locationName": "South Central US", - "provisioningState": "Initializing", - "failoverPriority": 0 - }, - { - "id": "ddb1-eastus", - "locationName": "East US", - "provisioningState": "Initializing", - "failoverPriority": 1 - } - ], - "readLocations": [ - { - "id": "ddb1-southcentralus", - "locationName": "South Central US", - "provisioningState": "Initializing", - "failoverPriority": 0 - }, - { - "id": "ddb1-eastus", - "locationName": "East US", - "provisioningState": "Initializing", - "failoverPriority": 1 - } - ], - "failoverPolicies": [ - { - "id": "ddb1-southcentralus", - "locationName": "South Central US", - "failoverPriority": 0 - }, - { - "id": "ddb1-eastus", - "locationName": "East US", - "failoverPriority": 1 - } - ], - "virtualNetworkRules": [ - { - "id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1" - } - ] - } - } - } - } -} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index 6c03ea392882..d1bde693dde6 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -1,3 +1,4 @@ +<<<<<<< HEAD # Cosmos-DB > see https://aka.ms/autorest @@ -238,3 +239,229 @@ generate-interface: true ``` +======= +# Cosmos-DB + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Cosmos-DB. + + + +--- +## Getting Started +To build the SDK for Cosmos-DB, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + + + +### Basic Information +These are the global settings for the Cosmos-DB API. + +``` yaml +openapi-type: arm +tag: package-2015-04 +``` + + +### Tag: package-2015-04 + +These settings apply only when `--tag=package-2015-04` is specified on the command line. + +``` yaml $(tag) == 'package-2015-04' +input-file: +- Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +``` + +## Suppression +``` yaml +directive: + - suppress: TrackedResourceGetOperation + from: cosmos-db.json + where: $.definitions.DatabaseAccountCreateUpdateParameters + reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.DatabaseAccountCreateUpdateParameters + reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.SqlDatabaseResource + reason: The SqlDatabaseResource doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.SqlContainerResource + reason: The SqlContainerResource doesn't support Patch operation + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.MetricValue.properties._count + reason: The Metrics API has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._rid + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._ts + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._self + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._etag + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlDatabaseResourceProperties.properties._colls + reason: The database has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlDatabaseResourceProperties.properties._users + reason: The database has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlContainerResourceProperties.properties._doc + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlContainerResourceProperties.properties._sprocs + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlContainerResourceProperties.properties._triggers + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlContainerResourceProperties.properties._udfs + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlContainerResourceProperties.properties._conflicts + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P10 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P25 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P50 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P75 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P90 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P95 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P99 + reason: The Metrics API has percentile metrics property names with leading capital letters +``` + +--- +# Code Generation + + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-js + - repo: azure-sdk-for-node +``` + + +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: azure.mgmt.cosmosdb + package-name: azure-mgmt-cosmosdb + package-version: 0.3.0 + clear-output-folder: true +``` +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb +``` +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb +``` + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +azure-arm: true +fluent: true +namespace: com.microsoft.azure.management.cosmosdb +license-header: MICROSOFT_MIT_NO_CODEGEN +payload-flattening-threshold: 1 +output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-cosmosdb +``` + +### Java multi-api + +``` yaml $(java) && $(multiapi) +batch: + - tag: package-2015-04 +``` + +### Tag: package-2015-04 and java + +These settings apply only when `--tag=package-2015-04 --java` is specified on the command line. +Please also specify `--azure-libraries-for-java=`. + +``` yaml $(tag) == 'package-2015-04' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.cosmosdb.v2015_04_08 + output-folder: $(azure-libraries-for-java-folder)/cosmosdb/resource-manager/v2015_04_08 +regenerate-manager: true +generate-interface: true +``` + + +>>>>>>> Remove properties in CreateUpdateOptions From 57ab189a40392688433f471b841cf222c75721a9 Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Thu, 28 Mar 2019 14:29:47 -0700 Subject: [PATCH 04/13] Update delete response code --- .../stable/2015-04-08/cosmos-db.json | 10 +++++----- .../examples/CosmosDBSqlContainerDelete.json | 2 +- .../2015-04-08/examples/CosmosDBSqlDatabaseDelete.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index f35cee0cb223..694afe3db2e9 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1542,7 +1542,7 @@ } ], "responses": { - "200": { + "204": { "description": "The SQL database delete operation was successful." } } @@ -1736,7 +1736,7 @@ } ], "responses": { - "200": { + "204": { "description": "The SQL container delete operation was successful." } } @@ -1955,7 +1955,7 @@ } } }, - "GenericResourceProperties": { + "ProxyResource": { "type": "object", "description": "The general properties associated with all API resource.", "properties": { @@ -1989,7 +1989,7 @@ }, "allOf": [ { - "$ref": "#/definitions/GenericResourceProperties" + "$ref": "#/definitions/ProxyResource" } ] }, @@ -2027,7 +2027,7 @@ }, "allOf": [ { - "$ref": "#/definitions/GenericResourceProperties" + "$ref": "#/definitions/ProxyResource" } ] }, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json index f3382b636cba..977162053318 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json @@ -8,6 +8,6 @@ "containerRid": "containerName" }, "responses": { - "200": { } + "204": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json index c7448e3f981c..29dd4f3160bd 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json @@ -7,6 +7,6 @@ "databaseRid": "databaseName" }, "responses": { - "200": { } + "204": { } } } \ No newline at end of file From 244d19c868ab614315f7ea4e86b2387843533a8a Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Thu, 28 Mar 2019 18:06:58 -0700 Subject: [PATCH 05/13] Add properties in SQL Container and simplify names --- .../stable/2015-04-08/cosmos-db.json | 102 ++++---- .../cosmos-db/resource-manager/readme.md | 243 ------------------ 2 files changed, 57 insertions(+), 288 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index 694afe3db2e9..2b43ee9a58ac 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1436,7 +1436,7 @@ "201": { "description": "The SQL database create operation was successful.", "schema": { - "$ref": "#/definitions/SqlDatabaseResource" + "$ref": "#/definitions/SqlDatabase" } } } @@ -1470,7 +1470,7 @@ "200": { "description": "The SQL database property was retrieved successfully.", "schema": { - "$ref": "#/definitions/SqlDatabaseResource" + "$ref": "#/definitions/SqlDatabase" } } } @@ -1512,7 +1512,7 @@ "200": { "description": "The SQL database update operation was successful.", "schema": { - "$ref": "#/definitions/SqlDatabaseResource" + "$ref": "#/definitions/SqlDatabase" } } } @@ -1621,7 +1621,7 @@ "201": { "description": "The SQL container create operation was successful", "schema": { - "$ref": "#/definitions/SqlContainerResource" + "$ref": "#/definitions/SqlContainer" } } } @@ -1658,7 +1658,7 @@ "200": { "description": "The SQL container property was retrieved successfully.", "schema": { - "$ref": "#/definitions/SqlContainerResource" + "$ref": "#/definitions/SqlContainer" } } } @@ -1703,7 +1703,7 @@ "200": { "description": "The SQL container update operation was successful.", "schema": { - "$ref": "#/definitions/SqlContainerResource" + "$ref": "#/definitions/SqlContainer" } } } @@ -1763,7 +1763,7 @@ "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/SqlDatabaseResource" + "$ref": "#/definitions/SqlDatabase" }, "description": "List of SQL databases and their properties." } @@ -1776,7 +1776,7 @@ "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/SqlContainerResource" + "$ref": "#/definitions/SqlContainer" }, "description": "List of SQL containers and their properties." } @@ -1875,7 +1875,7 @@ }, "Resource": { "type": "object", - "description": "A database account resource.", + "description": "The core properties of ARM resources.", "properties": { "id": { "readOnly": true, @@ -1955,45 +1955,23 @@ } } }, - "ProxyResource": { - "type": "object", - "description": "The general properties associated with all API resource.", - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "The unique resource identifier of the database account." - }, - "name": { - "readOnly": true, - "type": "string", - "description": "The name of the database account." - }, - "type": { - "readOnly": true, - "type": "string", - "description": "The type of Azure resource." - } - }, - "x-ms-azure-resource": true - }, - "SqlDatabaseResource":{ + "SqlDatabase":{ "description": "An Azure Cosmos DB SQL database.", "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, "description": "The properties of an Azure Cosmos DB SQL database", - "$ref": "#/definitions/SqlDatabaseResourceProperties" + "$ref": "#/definitions/SqlDatabaseProperties" } }, "allOf": [ { - "$ref": "#/definitions/ProxyResource" + "$ref": "#/definitions/Resource" } ] }, - "SqlDatabaseResourceProperties": { + "SqlDatabaseProperties": { "description": "The properties of an Azure Cosmos DB SQL database", "type": "object", "properties": { @@ -2008,30 +1986,30 @@ }, "allOf": [ { - "$ref": "#/definitions/SqlDatabaseCreateUpdateResource" + "$ref": "#/definitions/SqlDatabaseResource" }, { "$ref": "#/definitions/ExtendedResourceProperties" } ] }, - "SqlContainerResource":{ + "SqlContainer":{ "description": "An Azure Cosmos DB SQL container.", "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, "description": "The properties of an Azure Cosmos DB SQL container", - "$ref": "#/definitions/SqlContainerResourceProperties" + "$ref": "#/definitions/SqlContainerProperties" } }, "allOf": [ { - "$ref": "#/definitions/ProxyResource" + "$ref": "#/definitions/Resource" } ] }, - "SqlContainerResourceProperties": { + "SqlContainerProperties": { "description": "The properties of an Azure Cosmos DB SQL container", "type": "object", "properties": { @@ -2058,7 +2036,7 @@ }, "allOf": [ { - "$ref": "#/definitions/SqlContainerCreateUpdateResource" + "$ref": "#/definitions/SqlContainerResource" }, { "$ref": "#/definitions/ExtendedResourceProperties" @@ -2408,7 +2386,7 @@ "properties": { "resource": { "description": "The standard JSON format of a SQL database", - "$ref": "#/definitions/SqlDatabaseCreateUpdateResource" + "$ref": "#/definitions/SqlDatabaseResource" }, "options": { "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", @@ -2440,7 +2418,7 @@ "properties": { "resource": { "description": "The standard JSON format of a SQL container", - "$ref": "#/definitions/SqlContainerCreateUpdateResource" + "$ref": "#/definitions/SqlContainerResource" }, "options": { "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", @@ -2452,7 +2430,7 @@ "options" ] }, - "SqlDatabaseCreateUpdateResource": { + "SqlDatabaseResource": { "type": "object", "description": "Cosmos DB SQL database id object", "properties": { @@ -2465,7 +2443,7 @@ "id" ] }, - "SqlContainerCreateUpdateResource": { + "SqlContainerResource": { "type": "object", "description": "Cosmos DB SQL container resource object", "properties": { @@ -2481,6 +2459,14 @@ "$ref": "#/definitions/PartitionKey", "description": "The configuration of the partition key to be used for partitioning data into multiple partitions" }, + "defaultTtl": { + "type": "integer", + "description": "Default time to live" + }, + "uniqueKeyPolicy": { + "$ref": "#/definitions/UniqueKeyPolicy", + "description": "The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service." + }, "conflictResolutionPolicy": { "$ref": "#/definitions/ConflictResolutionPolicy", "description": "The conflict resolution policy for the SQL container." @@ -2616,6 +2602,32 @@ } } }, + "UniqueKeyPolicy": { + "type": "object", + "description": "The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.", + "properties": { + "uniqueKeys": { + "description": "List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.", + "type": "array", + "items": { + "$ref": "#/definitions/UniqueKey" + } + } + } + }, + "UniqueKey": { + "type": "object", + "description": "The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.", + "properties": { + "paths": { + "description": "List of paths must be unique for each document in the Azure Cosmos DB service", + "type": "array", + "items": { + "$ref": "#/definitions/Path" + } + } + } + }, "ConflictResolutionPolicy": { "type": "object", "description": "The conflict resolution policy for the SQL container.", diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index d1bde693dde6..d6e09367651f 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -1,245 +1,3 @@ -<<<<<<< HEAD -# Cosmos-DB - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Cosmos-DB. - - - ---- -## Getting Started -To build the SDK for Cosmos-DB, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` ---- - -## Configuration - - - -### Basic Information -These are the global settings for the Cosmos-DB API. - -``` yaml -openapi-type: arm -tag: package-2015-04 -``` - - -### Tag: package-2015-04 - -These settings apply only when `--tag=package-2015-04` is specified on the command line. - -``` yaml $(tag) == 'package-2015-04' -input-file: -- Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json -``` - -## Suppression -``` yaml -directive: - - suppress: TrackedResourceGetOperation - from: cosmos-db.json - where: $.definitions.DatabaseAccountCreateUpdateParameters - reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.DatabaseAccountCreateUpdateParameters - reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.SqlDatabaseResource - reason: The SqlDatabaseResource doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.SqlContainerResource - reason: The SqlContainerResource doesn't support Patch operation - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.MetricValue.properties._count - reason: The Metrics API has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtenedResourceProperties.properties._rid - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtenedResourceProperties.properties._ts - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtenedResourceProperties.properties._self - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtenedResourceProperties.properties._etag - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlDatabaseResourceProperties.properties._colls - reason: The database has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlDatabaseResourceProperties.properties._users - reason: The database has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._doc - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._sprocs - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._triggers - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._udfs - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._conflicts - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.CreateUpdateOptions.properties.If-Match - reason: The option has a property name with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.CreateUpdateOptions.properties.If-None-Match - reason: The option has a property name with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.CreateUpdateOptions.properties.Session-Token - reason: The option has a property name with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.CreateUpdateOptions.properties.Throughput - reason: The option has a property name with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P10 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P25 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P50 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P75 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P90 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P95 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P99 - reason: The Metrics API has percentile metrics property names with leading capital letters -``` - ---- -# Code Generation - - -## Swagger to SDK - -This section describes what SDK should be generated by the automatic system. -This is not used by Autorest itself. - -``` yaml $(swagger-to-sdk) -swagger-to-sdk: - - repo: azure-sdk-for-python - - repo: azure-sdk-for-java - - repo: azure-sdk-for-go - - repo: azure-sdk-for-js - - repo: azure-sdk-for-node -``` - - -## Python - -These settings apply only when `--python` is specified on the command line. -Please also specify `--python-sdks-folder=`. -Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. - -``` yaml $(python) -python-mode: create -python: - azure-arm: true - license-header: MICROSOFT_MIT_NO_VERSION - payload-flattening-threshold: 2 - namespace: azure.mgmt.cosmosdb - package-name: azure-mgmt-cosmosdb - package-version: 0.3.0 - clear-output-folder: true -``` -``` yaml $(python) && $(python-mode) == 'update' -python: - no-namespace-folders: true - output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb -``` -``` yaml $(python) && $(python-mode) == 'create' -python: - basic-setup-py: true - output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb -``` - -## Go - -See configuration in [readme.go.md](./readme.go.md) - -## Java - -These settings apply only when `--java` is specified on the command line. -Please also specify `--azure-libraries-for-java-folder=`. - -``` yaml $(java) -azure-arm: true -fluent: true -namespace: com.microsoft.azure.management.cosmosdb -license-header: MICROSOFT_MIT_NO_CODEGEN -payload-flattening-threshold: 1 -output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-cosmosdb -``` - -### Java multi-api - -``` yaml $(java) && $(multiapi) -batch: - - tag: package-2015-04 -``` - -### Tag: package-2015-04 and java - -These settings apply only when `--tag=package-2015-04 --java` is specified on the command line. -Please also specify `--azure-libraries-for-java=`. - -``` yaml $(tag) == 'package-2015-04' && $(java) && $(multiapi) -java: - namespace: com.microsoft.azure.management.cosmosdb.v2015_04_08 - output-folder: $(azure-libraries-for-java-folder)/cosmosdb/resource-manager/v2015_04_08 -regenerate-manager: true -generate-interface: true -``` - - -======= # Cosmos-DB > see https://aka.ms/autorest @@ -464,4 +222,3 @@ generate-interface: true ``` ->>>>>>> Remove properties in CreateUpdateOptions From 007a537027653dc15ee0aff4fdeb133e2e25ad52 Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Sun, 31 Mar 2019 21:29:51 -0700 Subject: [PATCH 06/13] Add Mongo Database and Collection API --- .../stable/2015-04-08/cosmos-db.json | 602 ++++++++++++++++++ .../CosmosDBMongoCollectionCreate.json | 62 ++ .../CosmosDBMongoCollectionDelete.json | 13 + .../examples/CosmosDBMongoCollectionGet.json | 38 ++ .../examples/CosmosDBMongoCollectionList.json | 41 ++ .../CosmosDBMongoCollectionReplace.json | 63 ++ .../examples/CosmosDBMongoDatabaseCreate.json | 30 + .../examples/CosmosDBMongoDatabaseDelete.json | 12 + .../examples/CosmosDBMongoDatabaseGet.json | 21 + .../examples/CosmosDBMongoDatabaseList.json | 24 + .../CosmosDBMongoDatabaseReplace.json | 31 + .../cosmos-db/resource-manager/readme.md | 30 +- 12 files changed, 956 insertions(+), 11 deletions(-) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionReplace.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseReplace.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index 2b43ee9a58ac..bda3e999ccad 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1741,6 +1741,379 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases": { + "get": { + "operationId": "DatabaseAccounts_ListMongoDatabases", + "x-ms-examples": { + "CosmosDBMongoDatabaseList": { "$ref": "./examples/CosmosDBMongoDatabaseList.json" } + }, + "description": "Lists the Mongo databases under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Mongo database properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoDatabaseListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateMongoDatabase", + "x-ms-examples": { + "CosmosDBMongoDatabaseCreate": { "$ref": "./examples/CosmosDBMongoDatabaseCreate.json" } + }, + "description": "Creates an Azure Cosmos DB Mongo database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createMongoDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MongoDatabaseCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Mongo database." + } + ], + "responses": { + "201": { + "description": "The Mongo database create operation was successful.", + "schema": { + "$ref": "#/definitions/MongoDatabase" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases/{databaseRid}": { + "get": { + "operationId": "DatabaseAccounts_GetMongoDatabase", + "x-ms-examples": { + "CosmosDBMongoDatabaseGet": { "$ref": "./examples/CosmosDBMongoDatabaseGet.json" } + }, + "description": "Gets the Mongo databases under an existing Azure Cosmos DB database account with the provided id.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Mongo database property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoDatabase" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateMongoDatabase", + "x-ms-examples": { + "CosmosDBMongoDatabaseReplace": { "$ref": "./examples/CosmosDBMongoDatabaseReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB Mongo database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateMongoDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MongoDatabaseCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Mongo database." + } + ], + "responses": { + "200": { + "description": "The Mongo database update operation was successful.", + "schema": { + "$ref": "#/definitions/MongoDatabase" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteMongoDatabase", + "x-ms-examples": { + "CosmosDBMongoDatabaseDelete": { "$ref": "./examples/CosmosDBMongoDatabaseDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Mongo database.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The Mongo database delete operation was successful." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases/{databaseRid}/collections": { + "get": { + "operationId": "DatabaseAccounts_ListMongoCollections", + "x-ms-examples": { + "CosmosDBMongoCollectionList": { "$ref": "./examples/CosmosDBMongoCollectionList.json" } + }, + "description": "Lists the Mongo collection under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Mongo collection properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoCollectionListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateMongoCollection", + "x-ms-examples": { + "CosmosDBMongoCollectionCreate": { "$ref": "./examples/CosmosDBMongoCollectionCreate.json" } + }, + "description": "Creates an Azure Cosmos DB Mongo collection", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createMongoCollectionParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MongoCollectionCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Mongo Collection." + } + ], + "responses": { + "201": { + "description": "The Mongo Collection create operation was successful", + "schema": { + "$ref": "#/definitions/MongoCollection" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases/{databaseRid}/collections/{collectionRid}": { + "get": { + "operationId": "DatabaseAccounts_GetMongoCollection", + "x-ms-examples": { + "CosmosDBMongoCollectionGet": { "$ref": "./examples/CosmosDBMongoCollectionGet.json" } + }, + "description": "Gets the Mongo collection under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Mongo collection property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoCollection" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateMongoCollection", + "x-ms-examples": { + "CosmosDBMongoCollectionReplace": { "$ref": "./examples/CosmosDBMongoCollectionReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB Mongo Collection", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateMongoCollectionParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MongoCollectionCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Mongo Collection." + } + ], + "responses": { + "200": { + "description": "The Mongo Collection update operation was successful.", + "schema": { + "$ref": "#/definitions/MongoCollection" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteMongoCollection", + "x-ms-examples": { + "CosmosDBMongoCollectionDelete": { "$ref": "./examples/CosmosDBMongoCollectionDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Mongo Collection.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The Mongo Collection delete operation was successful." + } + } + } } }, "definitions": { @@ -1783,6 +2156,32 @@ }, "description": "The List operation response, that contains the SQL containers and their properties." }, + "MongoDatabaseListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/MongoDatabase" + }, + "description": "List of Mongo databases and their properties." + } + }, + "description": "The List operation response, that contains the Mongo databases and their properties." + }, + "MongoCollectionListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/MongoCollection" + }, + "description": "List of Mongo collections and their properties." + } + }, + "description": "The List operation response, that contains the Mongo collections and their properties." + }, "ErrorResponse": { "properties": { "code": { @@ -2043,6 +2442,56 @@ } ] }, + "MongoDatabase": { + "description": "An Azure Cosmos DB Mongo database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB Mongo database", + "$ref": "#/definitions/MongoDatabaseProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "MongoDatabaseProperties": { + "description": "The properties of an Azure Cosmos DB Mongo database", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MongoDatabaseResource" + } + ] + }, + "MongoCollection": { + "description": "An Azure Cosmos DB Mongo collection.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB Mongo collection", + "$ref": "#/definitions/MongoCollectionProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "MongoCollectionProperties": { + "description": "The properties of an Azure Cosmos DB Mongo collection", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MongoCollectionResource" + } + ] + }, "ConsistencyPolicy": { "type": "object", "description": "The consistency policy for the Cosmos DB database account.", @@ -2430,6 +2879,70 @@ "options" ] }, + "MongoDatabaseCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Mongo database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Mongo database.", + "$ref": "#/definitions/MongoDatabaseCreateUpdateProperties" + } + }, + "required": [ + "properties" + ] + }, + "MongoDatabaseCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Mongo database.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Mongo database", + "$ref": "#/definitions/MongoDatabaseResource" + }, + "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" + ] + }, + "MongoCollectionCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Mongo collection.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Mongo collection.", + "$ref": "#/definitions/MongoCollectionCreateUpdateProperties" + } + }, + "required": [ + "properties" + ] + }, + "MongoCollectionCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Mongo collection.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Mongo collection", + "$ref": "#/definitions/MongoCollectionResource" + }, + "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" + ] + }, "SqlDatabaseResource": { "type": "object", "description": "Cosmos DB SQL database id object", @@ -2655,6 +3168,95 @@ } } }, + "MongoDatabaseResource": { + "type": "object", + "description": "Cosmos DB Mongo database id object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Mongo database" + } + }, + "required": [ + "id" + ] + }, + "MongoCollectionResource": { + "type": "object", + "description": "Cosmos DB Mongo collection resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Mongo collection" + }, + "shardKey": { + "description": "A key-value pair of shard keys to be applied for the request.", + "$ref": "#/definitions/ShardKeys" + }, + "indexes": { + "description": "List of index keys", + "type": "array", + "items": { + "$ref": "#/definitions/MongoIndex" + } + } + }, + "required": [ + "id" + ] + }, + "ShardKeys": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "The shard key and partition kind pair, only support \"Hash\" partition kind" + }, + "MongoIndex": { + "type": "object", + "description": "Cosmos DB Mongo collection index key", + "properties": { + "key": { + "description": "Cosmos DB Mongo collection index keys", + "$ref": "#/definitions/MongoIndexKeys" + }, + "options": { + "description": "Cosmos DB Mongo collection index key options", + "$ref": "#/definitions/MongoIndexOptions" + } + } + }, + "MongoIndexKeys": { + "type": "object", + "description": "Cosmos DB Mongo collection resource object", + "properties": { + "keys": { + "description": "List of keys for each Mongo collection in the Azure Cosmos DB service", + "type": "array", + "items": { + "$ref": "#/definitions/Key" + } + } + } + }, + "Key": { + "type": "string", + "description": "A Key." + }, + "MongoIndexOptions": { + "type": "object", + "description": "Cosmos DB Mongo collection index options", + "properties": { + "expireAfterSeconds": { + "description": "Expire after seconds", + "type": "integer" + }, + "unique": { + "description": "Is unique or not", + "type": "boolean" + } + } + }, "CreateUpdateOptions": { "type": "object", "additionalProperties": { diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json new file mode 100644 index 000000000000..84d9f868a404 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "createMongoCollectionParameters": { + "id": "testcoll", + "properties": { + "resource": { + "id": "testcoll", + "indexes": [ + { + "key": { + "keys": [ + "testKey" + ] + }, + "options": { + "expireAfterSeconds": 100, + "unique": true + } + } + ], + "shardKey": { + "testKey": "Hash" + } + }, + "options": { + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "testcoll", + "name": "testcoll", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/collections", + "properties": { + "id": "testcoll", + "indexes": [ + { + "key": { + "keys": [ + "testKey" + ] + }, + "options": { + "expireAfterSeconds": 100, + "unique": true + } + } + ], + "shardKey": { + "testKey": "Hash" + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json new file mode 100644 index 000000000000..46038de42a99 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "collectionRid": "collectionName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionGet.json new file mode 100644 index 000000000000..81a3dac0feed --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionGet.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseRid": "databaseName", + "collectionRid": "collectionName" + }, + "responses": { + "200": { + "body": { + "id": "collectionName", + "name": "collectionName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/collections", + "properties": { + "id": "testcoll", + "indexes": [ + { + "key": { + "keys": [ + "testKey" + ] + }, + "options": { + "expireAfterSeconds": 100, + "unique": true + } + } + ], + "shardKey": { + "testKey": "Hash" + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionList.json new file mode 100644 index 000000000000..bd9e6501001c --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionList.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseRid": "databaseName" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "testcoll", + "name": "testcoll", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/collections", + "properties": { + "id": "testcoll", + "indexes": [ + { + "key": { + "keys": [ + "testKey" + ] + }, + "options": { + "expireAfterSeconds": 100, + "unique": true + } + } + ], + "shardKey": { + "testKey": "Hash" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionReplace.json new file mode 100644 index 000000000000..e04636ba6ee0 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionReplace.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "updateMongoCollectionParameters": { + "id": "collectionName", + "properties": { + "resource": { + "id": "testcoll", + "indexes": [ + { + "key": { + "keys": [ + "testKey" + ] + }, + "options": { + "expireAfterSeconds": 100, + "unique": true + } + } + ], + "shardKey": { + "testKey": "Hash" + } + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "collectionName", + "name": "collectionName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/collection", + "properties": { + "id": "testcoll", + "indexes": [ + { + "key": { + "keys": [ + "testKey" + ] + }, + "options": { + "expireAfterSeconds": 100, + "unique": true + } + } + ], + "shardKey": { + "testKey": "Hash" + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json new file mode 100644 index 000000000000..8bb0138e7377 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "createMongoDatabaseParameters": { + "id": "databaseName", + "properties": { + "resource": { + "id": "databaseName" + }, + "options": { + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "properties": { + "id": "databaseName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json new file mode 100644 index 000000000000..29dd4f3160bd --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseGet.json new file mode 100644 index 000000000000..08e48da41cab --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseGet.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName" + }, + "responses": { + "200": { + "body": { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "properties": { + "id": "databaseName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseList.json new file mode 100644 index 000000000000..e90d781caa34 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseList.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "properties": { + "id": "databaseName" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseReplace.json new file mode 100644 index 000000000000..374da405ee04 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseReplace.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "updateMongoDatabaseParameters": { + "id": "updatedDatabaseName", + "properties": { + "resource": { + "id": "updatedDatabaseName" + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "updatedDatabaseName", + "name": "updatedDatabaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "properties": { + "id": "updatedDatabaseName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index d6e09367651f..7447fabe6a2a 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -52,12 +52,20 @@ directive: reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation - suppress: TrackedResourcePatchOperation from: cosmos-db.json - where: $.definitions.SqlDatabaseResource - reason: The SqlDatabaseResource doesn't support Patch operation + where: $.definitions.SqlDatabase + reason: The SqlDatabase doesn't support Patch operation - suppress: TrackedResourcePatchOperation from: cosmos-db.json - where: $.definitions.SqlContainerResource - reason: The SqlContainerResource doesn't support Patch operation + where: $.definitions.SqlContainer + reason: The SqlContainer doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.MongoDatabase + reason: The MongoDatabase doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.MongoCollection + reason: The MongoCollection doesn't support Patch operation - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json where: $.definitions.MetricValue.properties._count @@ -80,31 +88,31 @@ directive: reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlDatabaseResourceProperties.properties._colls + where: $.definitions.SqlDatabaseProperties.properties._colls reason: The database has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlDatabaseResourceProperties.properties._users + where: $.definitions.SqlDatabaseProperties.properties._users reason: The database has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._doc + where: $.definitions.SqlContainerProperties.properties._doc reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._sprocs + where: $.definitions.SqlContainerProperties.properties._sprocs reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._triggers + where: $.definitions.SqlContainerProperties.properties._triggers reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._udfs + where: $.definitions.SqlContainerProperties.properties._udfs reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json - where: $.definitions.SqlContainerResourceProperties.properties._conflicts + where: $.definitions.SqlContainerProperties.properties._conflicts reason: The resource has a property name with a leading underscore character - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json From 5d351e01c3accead348c3e47ca06b7223303333d Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Sun, 31 Mar 2019 22:53:10 -0700 Subject: [PATCH 07/13] Add Table API --- .../stable/2015-04-08/cosmos-db.json | 270 ++++++++++++++++++ .../examples/CosmosDBTableCreate.json | 30 ++ .../examples/CosmosDBTableDelete.json | 12 + .../2015-04-08/examples/CosmosDBTableGet.json | 21 ++ .../examples/CosmosDBTableList.json | 24 ++ .../examples/CosmosDBTableReplace.json | 31 ++ .../cosmos-db/resource-manager/readme.md | 4 + 7 files changed, 392 insertions(+) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableReplace.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index bda3e999ccad..ade7e52705f2 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -2114,6 +2114,185 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables": { + "get": { + "operationId": "DatabaseAccounts_ListTables", + "x-ms-examples": { + "CosmosDBTableList": { "$ref": "./examples/CosmosDBTableList.json" } + }, + "description": "Lists the Tables under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Table properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/TableListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateTable", + "x-ms-examples": { + "CosmosDBTableCreate": { "$ref": "./examples/CosmosDBTableCreate.json" } + }, + "description": "Creates an Azure Cosmos DB Table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createTableParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TableCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Table." + } + ], + "responses": { + "201": { + "description": "The Table create operation was successful.", + "schema": { + "$ref": "#/definitions/Table" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableRid}": { + "get": { + "operationId": "DatabaseAccounts_GetTable", + "x-ms-examples": { + "CosmosDBTableGet": { "$ref": "./examples/CosmosDBTableGet.json" } + }, + "description": "Gets the Tables under an existing Azure Cosmos DB database account with the provided id.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Table property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/Table" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateTable", + "x-ms-examples": { + "CosmosDBTableReplace": { "$ref": "./examples/CosmosDBTableReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB Table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateTableParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TableCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Table." + } + ], + "responses": { + "200": { + "description": "The Table update operation was successful.", + "schema": { + "$ref": "#/definitions/Table" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteTable", + "x-ms-examples": { + "CosmosDBTableDelete": { "$ref": "./examples/CosmosDBTableDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Table.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The Table delete operation was successful." + } + } + } } }, "definitions": { @@ -2182,6 +2361,19 @@ }, "description": "The List operation response, that contains the Mongo collections and their properties." }, + "TableListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/Table" + }, + "description": "List of Table and their properties." + } + }, + "description": "The List operation response, that contains the Table and their properties." + }, "ErrorResponse": { "properties": { "code": { @@ -2492,6 +2684,31 @@ } ] }, + "Table": { + "description": "An Azure Cosmos DB Table.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB Table", + "$ref": "#/definitions/TableProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "TableProperties": { + "description": "The properties of an Azure Cosmos Table", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/TableResource" + } + ] + }, "ConsistencyPolicy": { "type": "object", "description": "The consistency policy for the Cosmos DB database account.", @@ -2943,6 +3160,38 @@ "options" ] }, + "TableCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Table.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Table.", + "$ref": "#/definitions/TableCreateUpdateProperties" + } + }, + "required": [ + "properties" + ] + }, + "TableCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Table.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Table", + "$ref": "#/definitions/TableResource" + }, + "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" + ] + }, "SqlDatabaseResource": { "type": "object", "description": "Cosmos DB SQL database id object", @@ -3257,6 +3506,19 @@ } } }, + "TableResource": { + "type": "object", + "description": "Cosmos DB table id object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB table" + } + }, + "required": [ + "id" + ] + }, "CreateUpdateOptions": { "type": "object", "additionalProperties": { @@ -3838,6 +4100,14 @@ "x-ms-parameter-location": "method", "description": "Cosmos DB container rid." }, + "tableRidParameter": { + "name": "tableRid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB table rid." + }, "regionParameter": { "name": "region", "in": "path", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json new file mode 100644 index 000000000000..f543117e1841 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "createTableParameters": { + "id": "tableName", + "properties": { + "resource": { + "id": "tableName" + }, + "options": { + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/tables", + "properties": { + "id": "tableName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json new file mode 100644 index 000000000000..3167a8cd2e26 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "tableRid": "tableName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableGet.json new file mode 100644 index 000000000000..c9e5897cb265 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableGet.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "tableRid": "tableName" + }, + "responses": { + "200": { + "body": { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/tables", + "properties": { + "id": "tableName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableList.json new file mode 100644 index 000000000000..48eea57b0684 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableList.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/tables", + "properties": { + "id": "tableName" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableReplace.json new file mode 100644 index 000000000000..84decb47e7fe --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableReplace.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "tableRid": "tableName", + "updateTableParameters": { + "id": "tableName", + "properties": { + "resource": { + "id": "tableName" + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/tables", + "properties": { + "id": "tableName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index 7447fabe6a2a..ac29a0a47628 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -66,6 +66,10 @@ directive: from: cosmos-db.json where: $.definitions.MongoCollection reason: The MongoCollection doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.Table + reason: The Table doesn't support Patch operation - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json where: $.definitions.MetricValue.properties._count From 7a98cd13c9301a5405824990bfbd51de512c3f14 Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Mon, 1 Apr 2019 14:08:57 -0700 Subject: [PATCH 08/13] Add Cassandra keyspace and table API --- .../stable/2015-04-08/cosmos-db.json | 624 +++++++++++++++++- .../CosmosDBCassandraKeyspaceCreate.json | 30 + .../CosmosDBCassandraKeyspaceDelete.json | 12 + .../CosmosDBCassandraKeyspaceGet.json | 21 + .../CosmosDBCassandraKeyspaceList.json | 24 + .../CosmosDBCassandraKeyspaceReplace.json | 31 + .../CosmosDBCassandraTableCreate.json | 70 ++ .../CosmosDBCassandraTableDelete.json | 12 + .../examples/CosmosDBCassandraTableGet.json | 41 ++ .../examples/CosmosDBCassandraTableList.json | 44 ++ .../CosmosDBCassandraTableReplace.json | 71 ++ .../examples/CosmosDBSqlContainerCreate.json | 20 + .../examples/CosmosDBSqlContainerGet.json | 14 + .../examples/CosmosDBSqlContainerList.json | 14 + .../examples/CosmosDBSqlContainerReplace.json | 20 + .../examples/CosmosDBSqlDatabaseReplace.json | 10 +- .../cosmos-db/resource-manager/readme.md | 8 + 17 files changed, 1059 insertions(+), 7 deletions(-) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceReplace.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableReplace.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index ade7e52705f2..b1a8c3950f63 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -2293,6 +2293,379 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces": { + "get": { + "operationId": "DatabaseAccounts_ListCassandraKeyspaces", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceList": { "$ref": "./examples/CosmosDBCassandraKeyspaceList.json" } + }, + "description": "Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra keyspace properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraKeyspaceListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceCreate": { "$ref": "./examples/CosmosDBCassandraKeyspaceCreate.json" } + }, + "description": "Creates an Azure Cosmos DB Cassandra keyspace", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createCassandraKeyspaceParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CassandraKeyspaceCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Cassandra keyspace." + } + ], + "responses": { + "201": { + "description": "The Cassandra keyspace create operation was successful.", + "schema": { + "$ref": "#/definitions/CassandraKeyspace" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}": { + "get": { + "operationId": "DatabaseAccounts_GetCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceGet": { "$ref": "./examples/CosmosDBCassandraKeyspaceGet.json" } + }, + "description": "Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided id.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra keyspace property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraKeyspace" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceReplace": { "$ref": "./examples/CosmosDBCassandraKeyspaceReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB Cassandra keyspace", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateCassandraKeyspaceParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CassandraKeyspaceCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Cassandra keyspace." + } + ], + "responses": { + "200": { + "description": "The Cassandra keyspace update operation was successful.", + "schema": { + "$ref": "#/definitions/CassandraKeyspace" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceDelete": { "$ref": "./examples/CosmosDBCassandraKeyspaceDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Cassandra keyspace.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The Cassandra keyspace delete operation was successful." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}/tables": { + "get": { + "operationId": "DatabaseAccounts_ListCassandraTables", + "x-ms-examples": { + "CosmosDBCassandraTableList": { "$ref": "./examples/CosmosDBCassandraTableList.json" } + }, + "description": "Lists the Cassandra table under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra table properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraTableListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateCassandraTable", + "x-ms-examples": { + "CosmosDBCassandraTableCreate": { "$ref": "./examples/CosmosDBCassandraTableCreate.json" } + }, + "description": "Creates an Azure Cosmos DB Cassandra table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "createCassandraTableParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CassandraTableCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Cassandra table." + } + ], + "responses": { + "201": { + "description": "The Cassandra table create operation was successful", + "schema": { + "$ref": "#/definitions/CassandraTable" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}/tables/{tableRid}": { + "get": { + "operationId": "DatabaseAccounts_GetCassandraTable", + "x-ms-examples": { + "CosmosDBCassandraTableGet": { "$ref": "./examples/CosmosDBCassandraTableGet.json" } + }, + "description": "Gets the Cassandra table under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra table property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraTable" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_UpdateCassandraTable", + "x-ms-examples": { + "CosmosDBCassandraTableReplace": { "$ref": "./examples/CosmosDBCassandraTableReplace.json" } + }, + "description": "Updates an existing Azure Cosmos DB Cassandra Table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "updateCassandraTableParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CassandraTableCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Cassandra Table." + } + ], + "responses": { + "200": { + "description": "The Cassandra Table update operation was successful.", + "schema": { + "$ref": "#/definitions/CassandraTable" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteCassandraTable", + "x-ms-examples": { + "CosmosDBCassandraTableDelete": { "$ref": "./examples/CosmosDBCassandraTableDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Cassandra table.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The Cassandra table delete operation was successful." + } + } + } } }, "definitions": { @@ -2374,6 +2747,32 @@ }, "description": "The List operation response, that contains the Table and their properties." }, + "CassandraKeyspaceListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/CassandraKeyspace" + }, + "description": "List of Cassandra keyspaces and their properties." + } + }, + "description": "The List operation response, that contains the Cassandra keyspaces and their properties." + }, + "CassandraTableListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/CassandraTable" + }, + "description": "List of Cassandra tables and their properties." + } + }, + "description": "The List operation response, that contains the Cassandra tables and their properties." + }, "ErrorResponse": { "properties": { "code": { @@ -2709,6 +3108,56 @@ } ] }, + "CassandraKeyspace": { + "description": "An Azure Cosmos DB Cassandra keyspace.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB Cassandra keyspace", + "$ref": "#/definitions/CassandraKeyspaceProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "CassandraKeyspaceProperties": { + "description": "The properties of an Azure Cosmos DB Cassandra keyspace", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CassandraKeyspaceResource" + } + ] + }, + "CassandraTable": { + "description": "An Azure Cosmos DB Cassandra table.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB Cassandra table", + "$ref": "#/definitions/CassandraTableProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "CassandraTableProperties": { + "description": "The properties of an Azure Cosmos DB Cassandra table", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/CassandraTableResource" + } + ] + }, "ConsistencyPolicy": { "type": "object", "description": "The consistency policy for the Cosmos DB database account.", @@ -3192,6 +3641,70 @@ "options" ] }, + "CassandraKeyspaceCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Cassandra keyspace.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Cassandra keyspace.", + "$ref": "#/definitions/CassandraKeyspaceCreateUpdateProperties" + } + }, + "required": [ + "properties" + ] + }, + "CassandraKeyspaceCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Cassandra keyspace.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Cassandra keyspace", + "$ref": "#/definitions/CassandraKeyspaceResource" + }, + "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" + ] + }, + "CassandraTableCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Cassandra table.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Cassandra table.", + "$ref": "#/definitions/CassandraTableCreateUpdateProperties" + } + }, + "required": [ + "properties" + ] + }, + "CassandraTableCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Cassandra table.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Cassandra table", + "$ref": "#/definitions/CassandraTableResource" + }, + "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" + ] + }, "SqlDatabaseResource": { "type": "object", "description": "Cosmos DB SQL database id object", @@ -3218,7 +3731,7 @@ "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the SQL container" }, "partitionKey": { - "$ref": "#/definitions/PartitionKey", + "$ref": "#/definitions/SqlPartitionKey", "description": "The configuration of the partition key to be used for partitioning data into multiple partitions" }, "defaultTtl": { @@ -3338,7 +3851,7 @@ } } }, - "PartitionKey": { + "SqlPartitionKey": { "type": "object", "description": "The configuration of the partition key to be used for partitioning data into multiple partitions", "properties": { @@ -3519,6 +4032,105 @@ "id" ] }, + "CassandraKeyspaceResource": { + "type": "object", + "description": "Cosmos DB Cassandra keyspace id object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Cassandra keyspace" + } + }, + "required": [ + "id" + ] + }, + "CassandraTableResource": { + "type": "object", + "description": "Cosmos DB Cassandra table id object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Cassandra table" + }, + "defaultTtl": { + "type": "integer", + "description": "Time to live of the Cosmos DB Cassandra table" + }, + "schema": { + "description": "Schema of the Cosmos DB Cassandra table", + "$ref": "#/definitions/CassandraSchema" + } + }, + "required": [ + "id" + ] + }, + "CassandraSchema": { + "type": "object", + "description": "Cosmos DB Cassandra table schema", + "properties": { + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/Column" + }, + "description": "List of Cassandra table columns." + }, + "partitionKeys": { + "type": "array", + "items": { + "$ref": "#/definitions/CassandraPartitionKey" + }, + "description": "List of partition key." + }, + "clusterKeys": { + "type": "array", + "items": { + "$ref": "#/definitions/ClusterKey" + }, + "description": "List of cluster key." + } + } + }, + "Column": { + "type": "object", + "description": "Cosmos DB Cassandra table column", + "properties": { + "name": { + "type": "string", + "description": "Name of the Cosmos DB Cassandra table column" + }, + "type": { + "type": "string", + "description": "Type of the Cosmos DB Cassandra table column" + } + } + }, + "CassandraPartitionKey": { + "type": "object", + "description": "Cosmos DB Cassandra table partition key", + "properties": { + "name": { + "type": "string", + "description": "Name of the Cosmos DB Cassandra table partition key" + } + } + }, + "ClusterKey": { + "type": "object", + "description": "Cosmos DB Cassandra table cluster key", + "properties": { + "name": { + "type": "string", + "description": "Name of the Cosmos DB Cassandra table cluster key" + }, + "orderBy": { + "type": "string", + "description": "Order of the Cosmos DB Cassandra table cluster key, only support \"Asc\" and \"Desc\"" + } + } + }, "CreateUpdateOptions": { "type": "object", "additionalProperties": { @@ -4108,6 +4720,14 @@ "x-ms-parameter-location": "method", "description": "Cosmos DB table rid." }, + "keyspaceRidParameter": { + "name": "keyspaceRid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB keyspace rid." + }, "regionParameter": { "name": "region", "in": "path", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json new file mode 100644 index 000000000000..af2305b28a8b --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "createCassandraKeyspaceParameters": { + "id": "keyspaceName", + "properties": { + "resource": { + "id": "keyspaceName" + }, + "options": { + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "keyspaceName", + "name": "keyspaceName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces", + "properties": { + "id": "keyspaceName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json new file mode 100644 index 000000000000..0a9a7bced311 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "keyspaceRid": "keyspaceName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceGet.json new file mode 100644 index 000000000000..f0c76334d583 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceGet.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "keyspaceRid": "keyspaceName" + }, + "responses": { + "200": { + "body": { + "id": "keyspaceName", + "name": "keyspaceName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces", + "properties": { + "id": "keyspaceName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceList.json new file mode 100644 index 000000000000..cdbf3a8d9edb --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceList.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "keyspaceName", + "name": "keyspaceName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces", + "properties": { + "id": "keyspaceName" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceReplace.json new file mode 100644 index 000000000000..22f63ec552f0 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceReplace.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "keyspaceRid": "keyspaceName", + "updateCassandraKeyspaceParameters": { + "id": "keyspaceName", + "properties": { + "resource": { + "id": "keyspaceName" + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "keyspaceName", + "name": "keyspaceName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces", + "properties": { + "id": "keyspaceName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json new file mode 100644 index 000000000000..1fbe861f2c1b --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "createCassandraTableParameters": { + "id": "tableName", + "properties": { + "resource": { + "id": "tableName", + "defaultTtl": 100, + "schema": { + "columns": [ + { + "name": "columnA", + "type": "Ascii" + } + ], + "partitionKeys": [ + { + "name": "columnA" + } + ], + "clusterKeys": [ + { + "name": "columnA", + "orderBy": "Asc" + } + ] + } + }, + "options": { + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces/tables", + "properties": { + "id": "tableName", + "defaultTtl": 100, + "schema": { + "columns": [ + { + "name": "columnA", + "type": "Ascii" + } + ], + "partitionKeys": [ + { + "name": "columnA" + } + ], + "clusterKeys": [ + { + "name": "columnA", + "orderBy": "Asc" + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json new file mode 100644 index 000000000000..3167a8cd2e26 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "tableRid": "tableName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json new file mode 100644 index 000000000000..03607cf06808 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "tableRid": "tableName" + }, + "responses": { + "200": { + "body": { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces/tables", + "properties": { + "id": "tableName", + "defaultTtl": 100, + "schema": { + "columns": [ + { + "name": "columnA", + "type": "Ascii" + } + ], + "partitionKeys": [ + { + "name": "columnA" + } + ], + "clusterKeys": [ + { + "name": "columnA", + "orderBy": "Asc" + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json new file mode 100644 index 000000000000..2c8a13520af0 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces/tables", + "properties": { + "id": "tableName", + "defaultTtl": 100, + "schema": { + "columns": [ + { + "name": "columnA", + "type": "Ascii" + } + ], + "partitionKeys": [ + { + "name": "columnA" + } + ], + "clusterKeys": [ + { + "name": "columnA", + "orderBy": "Asc" + } + ] + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableReplace.json new file mode 100644 index 000000000000..d74c466e6c16 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableReplace.json @@ -0,0 +1,71 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "keyspaceRid": "tableName", + "updateCassandraTableParameters": { + "id": "tableName", + "properties": { + "resource": { + "id": "tableName", + "defaultTtl": 100, + "schema": { + "columns": [ + { + "name": "columnA", + "type": "Ascii" + } + ], + "partitionKeys": [ + { + "name": "columnA" + } + ], + "clusterKeys": [ + { + "name": "columnA", + "orderBy": "Asc" + } + ] + } + }, + "options": { + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "tableName", + "name": "tableName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces/tables", + "properties": { + "id": "tableName", + "defaultTtl": 100, + "schema": { + "columns": [ + { + "name": "columnA", + "type": "Ascii" + } + ], + "partitionKeys": [ + { + "name": "columnA" + } + ], + "clusterKeys": [ + { + "name": "columnA", + "orderBy": "Asc" + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json index 2b69600c302e..b6718973a5eb 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json @@ -38,6 +38,16 @@ ], "kind": "Hash" }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, "conflictReoslutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" @@ -84,6 +94,16 @@ ], "kind": "Hash" }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, "conflictReoslutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json index 961c27c68571..a9122d74315f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json @@ -43,6 +43,20 @@ ], "kind": "Hash" }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, "_rid": "PD5DALigDgw=", "_ts": 1459200611, "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json index e8188d655443..a7d59ae358a8 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json @@ -44,6 +44,20 @@ ], "kind": "Hash" }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, "_rid": "PD5DALigDgw=", "_ts": 1459200611, "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json index 5e59724d379c..6ec311038027 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json @@ -39,6 +39,16 @@ ], "kind": "Hash" }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, "conflictReoslutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" @@ -85,6 +95,16 @@ ], "kind": "Hash" }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, "conflictReoslutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json index 90f019cc3adc..915445d06f50 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json @@ -6,10 +6,10 @@ "subscriptionId": "subid", "databaseRid": "databaseName", "updateSqlDatabaseParameters": { - "id": "updatedDatabaseName", + "id": "databaseName", "properties": { "resource": { - "id": "updatedDatabaseName" + "id": "databaseName" }, "options": { } @@ -19,11 +19,11 @@ "responses": { "200": { "body": { - "id": "updatedDatabaseName", - "name": "updatedDatabaseName", + "id": "databaseName", + "name": "databaseName", "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", "properties": { - "id": "updatedDatabaseName", + "id": "databaseName", "_rid": "CqNBAA==", "_ts": 1449602962, "_self": "dbs\/CqNBAA==\/", diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index ac29a0a47628..9d9471e285f8 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -70,6 +70,14 @@ directive: from: cosmos-db.json where: $.definitions.Table reason: The Table doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.CassandraKeyspace + reason: The CassandraKeyspace doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.CassandraTable + reason: The CassandraTable doesn't support Patch operation - suppress: DefinitionsPropertiesNamesCamelCase from: cosmos-db.json where: $.definitions.MetricValue.properties._count From 132550e4349115a871f0d9be15f19b4cf5e9165d Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Thu, 4 Apr 2019 14:54:13 -0700 Subject: [PATCH 09/13] Add Gremlin API --- .../stable/2015-04-08/cosmos-db.json | 922 ++++++++++-------- .../CosmosDBCassandraKeyspaceCreate.json | 30 - ...osmosDBCassandraKeyspaceCreateUpdate.json} | 0 .../CosmosDBCassandraTableCreate.json | 70 -- ...> CosmosDBCassandraTableCreateUpdate.json} | 0 ...CosmosDBGremlinContainerCreateUpdate.json} | 0 .../CosmosDBGremlinContainerDelete.json | 13 + .../examples/CosmosDBGremlinContainerGet.json | 67 ++ .../CosmosDBGremlinContainerList.json | 70 ++ ... CosmosDBGremlinDatabaseCreateUpdate.json} | 10 +- .../CosmosDBGremlinDatabaseDelete.json | 12 + .../examples/CosmosDBGremlinDatabaseGet.json | 24 + .../examples/CosmosDBGremlinDatabaseList.json | 27 + .../CosmosDBMongoCollectionCreate.json | 62 -- ... CosmosDBMongoCollectionCreateUpdate.json} | 0 ...=> CosmosDBMongoDatabaseCreateUpdate.json} | 0 .../examples/CosmosDBSqlContainerCreate.json | 124 --- ... => CosmosDBSqlContainerCreateUpdate.json} | 0 .../examples/CosmosDBSqlContainerGet.json | 8 +- .../examples/CosmosDBSqlContainerList.json | 8 +- ...n => CosmosDBSqlDatabaseCreateUpdate.json} | 10 +- .../examples/CosmosDBTableCreate.json | 30 - ...ce.json => CosmosDBTableCreateUpdate.json} | 0 .../cosmos-db/resource-manager/readme.md | 243 +++++ 24 files changed, 999 insertions(+), 731 deletions(-) delete mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCassandraKeyspaceReplace.json => CosmosDBCassandraKeyspaceCreateUpdate.json} (100%) delete mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBCassandraTableReplace.json => CosmosDBCassandraTableCreateUpdate.json} (100%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBSqlDatabaseReplace.json => CosmosDBGremlinContainerCreateUpdate.json} (100%) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBSqlDatabaseCreate.json => CosmosDBGremlinDatabaseCreateUpdate.json} (74%) create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseGet.json create mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseList.json delete mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBMongoCollectionReplace.json => CosmosDBMongoCollectionCreateUpdate.json} (100%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBMongoDatabaseReplace.json => CosmosDBMongoDatabaseCreateUpdate.json} (100%) delete mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBSqlContainerReplace.json => CosmosDBSqlContainerCreateUpdate.json} (100%) rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBMongoDatabaseCreate.json => CosmosDBSqlDatabaseCreateUpdate.json} (69%) delete mode 100644 specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json rename specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/{CosmosDBTableReplace.json => CosmosDBTableCreateUpdate.json} (100%) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index b1a8c3950f63..5dc1b0508a6b 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -1401,45 +1401,6 @@ "x-ms-pageable": { "nextLinkName": null } - }, - "put": { - "operationId": "DatabaseAccounts_CreateSqlDatabase", - "x-ms-examples": { - "CosmosDBSqlDatabaseCreate": { "$ref": "./examples/CosmosDBSqlDatabaseCreate.json" } - }, - "description": "Creates an Azure Cosmos DB SQL database", - "x-ms-long-running-operation": true, - "parameters": [ - { - "$ref": "#/parameters/subscriptionIdParameter" - }, - { - "$ref": "#/parameters/resourceGroupNameParameter" - }, - { - "$ref": "#/parameters/accountNameParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "createSqlDatabaseParameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SqlDatabaseCreateUpdateParameters" - }, - "description": "The parameters to provide for the current SQL database." - } - ], - "responses": { - "201": { - "description": "The SQL database create operation was successful.", - "schema": { - "$ref": "#/definitions/SqlDatabase" - } - } - } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseRid}": { @@ -1476,11 +1437,11 @@ } }, "put": { - "operationId": "DatabaseAccounts_UpdateSqlDatabase", + "operationId": "DatabaseAccounts_CreateUpdateSqlDatabase", "x-ms-examples": { - "CosmosDBSqlDatabaseReplace": { "$ref": "./examples/CosmosDBSqlDatabaseReplace.json" } + "CosmosDBSqlDatabaseCreateUpdate": { "$ref": "./examples/CosmosDBSqlDatabaseCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB SQL database", + "description": "Create or update an Azure Cosmos DB SQL database", "x-ms-long-running-operation": true, "parameters": [ { @@ -1499,7 +1460,7 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateSqlDatabaseParameters", + "name": "createUpdateSqlDatabaseParameters", "in": "body", "required": true, "schema": { @@ -1509,8 +1470,11 @@ } ], "responses": { + "202": { + "description": "The SQL database create or update operation will complete asynchronously." + }, "200": { - "description": "The SQL database update operation was successful.", + "description": "The SQL database create or update operation was completed successfully.", "schema": { "$ref": "#/definitions/SqlDatabase" } @@ -1542,8 +1506,11 @@ } ], "responses": { + "202": { + "description": "The SQL database delete operation will complete asynchronously." + }, "204": { - "description": "The SQL database delete operation was successful." + "description": "The SQL database delete operation was completed successfully." } } } @@ -1576,55 +1543,13 @@ "200": { "description": "The SQL container properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/SqlContainerListResult" + "$ref": "#/definitions/ContainerListResult" } } }, "x-ms-pageable": { "nextLinkName": null } - }, - "put": { - "operationId": "DatabaseAccounts_CreateSqlContainer", - "x-ms-examples": { - "CosmosDBSqlContainerCreate": { "$ref": "./examples/CosmosDBSqlContainerCreate.json" } - }, - "description": "Creates an Azure Cosmos DB SQL container", - "x-ms-long-running-operation": true, - "parameters": [ - { - "$ref": "#/parameters/subscriptionIdParameter" - }, - { - "$ref": "#/parameters/resourceGroupNameParameter" - }, - { - "$ref": "#/parameters/accountNameParameter" - }, - { - "$ref": "#/parameters/databaseRidParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "createSqlContainerParameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SqlContainerCreateUpdateParameters" - }, - "description": "The parameters to provide for the current SQL container." - } - ], - "responses": { - "201": { - "description": "The SQL container create operation was successful", - "schema": { - "$ref": "#/definitions/SqlContainer" - } - } - } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseRid}/containers/{containerRid}": { @@ -1658,17 +1583,17 @@ "200": { "description": "The SQL container property was retrieved successfully.", "schema": { - "$ref": "#/definitions/SqlContainer" + "$ref": "#/definitions/Container" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateSqlContainer", + "operationId": "DatabaseAccounts_CreateUpdateSqlContainer", "x-ms-examples": { - "CosmosDBSqlContainerReplace": { "$ref": "./examples/CosmosDBSqlContainerReplace.json" } + "CosmosDBSqlContainerCreateUpdate": { "$ref": "./examples/CosmosDBSqlContainerCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB SQL container", + "description": "Create or update an Azure Cosmos DB SQL container", "x-ms-long-running-operation": true, "parameters": [ { @@ -1690,20 +1615,23 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateSqlContainerParameters", + "name": "createUpdateSqlContainerParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/SqlContainerCreateUpdateParameters" + "$ref": "#/definitions/ContainerCreateUpdateParameters" }, "description": "The parameters to provide for the current SQL container." } ], "responses": { + "202": { + "description": "The SQL container create or update operation will complete asynchronously." + }, "200": { - "description": "The SQL container update operation was successful.", + "description": "The SQL container create or update operation was completed successfully.", "schema": { - "$ref": "#/definitions/SqlContainer" + "$ref": "#/definitions/Container" } } } @@ -1736,8 +1664,11 @@ } ], "responses": { + "202": { + "description": "The SQL contianer delete operation will complete asynchronously." + }, "204": { - "description": "The SQL container delete operation was successful." + "description": "The SQL contianer delete operation was completed successfully." } } } @@ -1774,45 +1705,6 @@ "x-ms-pageable": { "nextLinkName": null } - }, - "put": { - "operationId": "DatabaseAccounts_CreateMongoDatabase", - "x-ms-examples": { - "CosmosDBMongoDatabaseCreate": { "$ref": "./examples/CosmosDBMongoDatabaseCreate.json" } - }, - "description": "Creates an Azure Cosmos DB Mongo database", - "x-ms-long-running-operation": true, - "parameters": [ - { - "$ref": "#/parameters/subscriptionIdParameter" - }, - { - "$ref": "#/parameters/resourceGroupNameParameter" - }, - { - "$ref": "#/parameters/accountNameParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "createMongoDatabaseParameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MongoDatabaseCreateUpdateParameters" - }, - "description": "The parameters to provide for the current Mongo database." - } - ], - "responses": { - "201": { - "description": "The Mongo database create operation was successful.", - "schema": { - "$ref": "#/definitions/MongoDatabase" - } - } - } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases/{databaseRid}": { @@ -1849,11 +1741,11 @@ } }, "put": { - "operationId": "DatabaseAccounts_UpdateMongoDatabase", + "operationId": "DatabaseAccounts_CreateUpdateMongoDatabase", "x-ms-examples": { - "CosmosDBMongoDatabaseReplace": { "$ref": "./examples/CosmosDBMongoDatabaseReplace.json" } + "CosmosDBMongoDatabaseCreateUpdate": { "$ref": "./examples/CosmosDBMongoDatabaseCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB Mongo database", + "description": "Create or updates Azure Cosmos DB Mongo database", "x-ms-long-running-operation": true, "parameters": [ { @@ -1872,7 +1764,7 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateMongoDatabaseParameters", + "name": "createUpdateMongoDatabaseParameters", "in": "body", "required": true, "schema": { @@ -1882,8 +1774,11 @@ } ], "responses": { + "202": { + "description": "The Mongo database create or update operation will complete asynchronously." + }, "200": { - "description": "The Mongo database update operation was successful.", + "description": "The Mongo database create or update operation was completed successfully.", "schema": { "$ref": "#/definitions/MongoDatabase" } @@ -1915,8 +1810,11 @@ } ], "responses": { + "202": { + "description": "The Mongo database delete operation will complete asynchronously." + }, "204": { - "description": "The Mongo database delete operation was successful." + "description": "The Mongo database delete operation was completed successfully." } } } @@ -1956,13 +1854,50 @@ "x-ms-pageable": { "nextLinkName": null } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases/{databaseRid}/collections/{collectionRid}": { + "get": { + "operationId": "DatabaseAccounts_GetMongoCollection", + "x-ms-examples": { + "CosmosDBMongoCollectionGet": { "$ref": "./examples/CosmosDBMongoCollectionGet.json" } + }, + "description": "Gets the Mongo collection under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Mongo collection property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoCollection" + } + } + } }, "put": { - "operationId": "DatabaseAccounts_CreateMongoCollection", + "operationId": "DatabaseAccounts_CreateUpdateMongoCollection", "x-ms-examples": { - "CosmosDBMongoCollectionCreate": { "$ref": "./examples/CosmosDBMongoCollectionCreate.json" } + "CosmosDBMongoCollectionCreateUpdate": { "$ref": "./examples/CosmosDBMongoCollectionCreateUpdate.json" } }, - "description": "Creates an Azure Cosmos DB Mongo collection", + "description": "Create or update an Azure Cosmos DB Mongo Collection", "x-ms-long-running-operation": true, "parameters": [ { @@ -1977,11 +1912,14 @@ { "$ref": "#/parameters/databaseRidParameter" }, + { + "$ref": "#/parameters/collectionRidParameter" + }, { "$ref": "#/parameters/apiVersionParameter" }, { - "name": "createMongoCollectionParameters", + "name": "createUpdateMongoCollectionParameters", "in": "body", "required": true, "schema": { @@ -1991,22 +1929,61 @@ } ], "responses": { - "201": { - "description": "The Mongo Collection create operation was successful", + "202": { + "description": "The Mongo Collection create or update operation will complete asynchronously." + }, + "200": { + "description": "The Mongo Collection create or update operation was completed successfully.", "schema": { "$ref": "#/definitions/MongoCollection" } } } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteMongoCollection", + "x-ms-examples": { + "CosmosDBMongoCollectionDelete": { "$ref": "./examples/CosmosDBMongoCollectionDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Mongo Collection.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The Mongo collection delete operation will complete asynchronously." + }, + "204": { + "description": "The Mongo collection delete operation was completed successfully." + } + } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongo/databases/{databaseRid}/collections/{collectionRid}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables": { "get": { - "operationId": "DatabaseAccounts_GetMongoCollection", + "operationId": "DatabaseAccounts_ListTables", "x-ms-examples": { - "CosmosDBMongoCollectionGet": { "$ref": "./examples/CosmosDBMongoCollectionGet.json" } + "CosmosDBTableList": { "$ref": "./examples/CosmosDBTableList.json" } }, - "description": "Gets the Mongo collection under an existing Azure Cosmos DB database account.", + "description": "Lists the Tables under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2018,10 +1995,41 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/databaseRidParameter" + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Table properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/TableListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableRid}": { + "get": { + "operationId": "DatabaseAccounts_GetTable", + "x-ms-examples": { + "CosmosDBTableGet": { "$ref": "./examples/CosmosDBTableGet.json" } + }, + "description": "Gets the Tables under an existing Azure Cosmos DB database account with the provided id.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" }, { - "$ref": "#/parameters/collectionRidParameter" + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" @@ -2029,19 +2037,19 @@ ], "responses": { "200": { - "description": "The Mongo collection property was retrieved successfully.", + "description": "The Table property was retrieved successfully.", "schema": { - "$ref": "#/definitions/MongoCollection" + "$ref": "#/definitions/Table" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateMongoCollection", + "operationId": "DatabaseAccounts_CreateUpdateTable", "x-ms-examples": { - "CosmosDBMongoCollectionReplace": { "$ref": "./examples/CosmosDBMongoCollectionReplace.json" } + "CosmosDBTableReplace": { "$ref": "./examples/CosmosDBTableCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB Mongo Collection", + "description": "Create or update an Azure Cosmos DB Table", "x-ms-long-running-operation": true, "parameters": [ { @@ -2054,39 +2062,39 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/databaseRidParameter" - }, - { - "$ref": "#/parameters/collectionRidParameter" + "$ref": "#/parameters/tableRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateMongoCollectionParameters", + "name": "createUpdateTableParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/MongoCollectionCreateUpdateParameters" + "$ref": "#/definitions/TableCreateUpdateParameters" }, - "description": "The parameters to provide for the current Mongo Collection." + "description": "The parameters to provide for the current Table." } ], "responses": { + "202": { + "description": "The Table create or update operation will complete asynchronously." + }, "200": { - "description": "The Mongo Collection update operation was successful.", + "description": "The Table create or update operation was completed successfully.", "schema": { - "$ref": "#/definitions/MongoCollection" + "$ref": "#/definitions/Table" } } } }, "delete": { - "operationId": "DatabaseAccounts_DeleteMongoCollection", + "operationId": "DatabaseAccounts_DeleteTable", "x-ms-examples": { - "CosmosDBMongoCollectionDelete": { "$ref": "./examples/CosmosDBMongoCollectionDelete.json" } + "CosmosDBTableDelete": { "$ref": "./examples/CosmosDBTableDelete.json" } }, - "description": "Deletes an existing Azure Cosmos DB Mongo Collection.", + "description": "Deletes an existing Azure Cosmos DB Table.", "x-ms-long-running-operation": true, "parameters": [ { @@ -2099,29 +2107,29 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/databaseRidParameter" - }, - { - "$ref": "#/parameters/collectionRidParameter" + "$ref": "#/parameters/tableRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" } ], "responses": { + "202": { + "description": "The Table delete operation will complete asynchronously." + }, "204": { - "description": "The Mongo Collection delete operation was successful." + "description": "The Table delete operation was completed successfully." } } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces": { "get": { - "operationId": "DatabaseAccounts_ListTables", + "operationId": "DatabaseAccounts_ListCassandraKeyspaces", "x-ms-examples": { - "CosmosDBTableList": { "$ref": "./examples/CosmosDBTableList.json" } + "CosmosDBCassandraKeyspaceList": { "$ref": "./examples/CosmosDBCassandraKeyspaceList.json" } }, - "description": "Lists the Tables under an existing Azure Cosmos DB database account.", + "description": "Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2138,22 +2146,56 @@ ], "responses": { "200": { - "description": "The Table properties were retrieved successfully.", + "description": "The Cassandra keyspace properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/TableListResult" + "$ref": "#/definitions/CassandraKeyspaceListResult" } } }, "x-ms-pageable": { "nextLinkName": null } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}": { + "get": { + "operationId": "DatabaseAccounts_GetCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceGet": { "$ref": "./examples/CosmosDBCassandraKeyspaceGet.json" } + }, + "description": "Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided id.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra keyspace property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraKeyspace" + } + } + } }, "put": { - "operationId": "DatabaseAccounts_CreateTable", + "operationId": "DatabaseAccounts_CreateUpdateCassandraKeyspace", "x-ms-examples": { - "CosmosDBTableCreate": { "$ref": "./examples/CosmosDBTableCreate.json" } + "CosmosDBCassandraKeyspaceCreateUpdate": { "$ref": "./examples/CosmosDBCassandraKeyspaceCreateUpdate.json" } }, - "description": "Creates an Azure Cosmos DB Table", + "description": "Create or update an Azure Cosmos DB Cassandra keyspace", "x-ms-long-running-operation": true, "parameters": [ { @@ -2165,36 +2207,112 @@ { "$ref": "#/parameters/accountNameParameter" }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, { "$ref": "#/parameters/apiVersionParameter" }, { - "name": "createTableParameters", + "name": "createUpdateCassandraKeyspaceParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/TableCreateUpdateParameters" + "$ref": "#/definitions/CassandraKeyspaceCreateUpdateParameters" }, - "description": "The parameters to provide for the current Table." + "description": "The parameters to provide for the current Cassandra keyspace." + } + ], + "responses": { + "202": { + "description": "The Cassandra keyspace create or update operation will complete asynchronously." + }, + "200": { + "description": "The Cassandra keyspace create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/CassandraKeyspace" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_DeleteCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceDelete": { "$ref": "./examples/CosmosDBCassandraKeyspaceDelete.json" } + }, + "description": "Deletes an existing Azure Cosmos DB Cassandra keyspace.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The Cassandra keyspace delete operation will complete asynchronously." + }, + "204": { + "description": "The Cassandra keyspace delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}/tables": { + "get": { + "operationId": "DatabaseAccounts_ListCassandraTables", + "x-ms-examples": { + "CosmosDBCassandraTableList": { "$ref": "./examples/CosmosDBCassandraTableList.json" } + }, + "description": "Lists the Cassandra table under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" } ], "responses": { - "201": { - "description": "The Table create operation was successful.", + "200": { + "description": "The Cassandra table properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/Table" + "$ref": "#/definitions/CassandraTableListResult" } } + }, + "x-ms-pageable": { + "nextLinkName": null } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableRid}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}/tables/{tableRid}": { "get": { - "operationId": "DatabaseAccounts_GetTable", + "operationId": "DatabaseAccounts_GetCassandraTable", "x-ms-examples": { - "CosmosDBTableGet": { "$ref": "./examples/CosmosDBTableGet.json" } + "CosmosDBCassandraTableGet": { "$ref": "./examples/CosmosDBCassandraTableGet.json" } }, - "description": "Gets the Tables under an existing Azure Cosmos DB database account with the provided id.", + "description": "Gets the Cassandra table under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2205,6 +2323,9 @@ { "$ref": "#/parameters/accountNameParameter" }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, { "$ref": "#/parameters/tableRidParameter" }, @@ -2214,19 +2335,19 @@ ], "responses": { "200": { - "description": "The Table property was retrieved successfully.", + "description": "The Cassandra table property was retrieved successfully.", "schema": { - "$ref": "#/definitions/Table" + "$ref": "#/definitions/CassandraTable" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateTable", + "operationId": "DatabaseAccounts_CreateUpdateCassandraTable", "x-ms-examples": { - "CosmosDBTableReplace": { "$ref": "./examples/CosmosDBTableReplace.json" } + "CosmosDBCassandraTableCreateUpdate": { "$ref": "./examples/CosmosDBCassandraTableCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB Table", + "description": "Create or update an Azure Cosmos DB Cassandra Table", "x-ms-long-running-operation": true, "parameters": [ { @@ -2238,6 +2359,9 @@ { "$ref": "#/parameters/accountNameParameter" }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, { "$ref": "#/parameters/tableRidParameter" }, @@ -2245,30 +2369,33 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateTableParameters", + "name": "createUpdateCassandraTableParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/TableCreateUpdateParameters" + "$ref": "#/definitions/CassandraTableCreateUpdateParameters" }, - "description": "The parameters to provide for the current Table." + "description": "The parameters to provide for the current Cassandra Table." } ], "responses": { + "202": { + "description": "The Cassandra Table create or update operation will complete asynchronously." + }, "200": { - "description": "The Table update operation was successful.", + "description": "The Cassandra Table create or update operation was completed successfully.", "schema": { - "$ref": "#/definitions/Table" + "$ref": "#/definitions/CassandraTable" } } } }, "delete": { - "operationId": "DatabaseAccounts_DeleteTable", + "operationId": "DatabaseAccounts_DeleteCassandraTable", "x-ms-examples": { - "CosmosDBTableDelete": { "$ref": "./examples/CosmosDBTableDelete.json" } + "CosmosDBCassandraTableDelete": { "$ref": "./examples/CosmosDBCassandraTableDelete.json" } }, - "description": "Deletes an existing Azure Cosmos DB Table.", + "description": "Deletes an existing Azure Cosmos DB Cassandra table.", "x-ms-long-running-operation": true, "parameters": [ { @@ -2280,6 +2407,9 @@ { "$ref": "#/parameters/accountNameParameter" }, + { + "$ref": "#/parameters/keyspaceRidParameter" + }, { "$ref": "#/parameters/tableRidParameter" }, @@ -2288,19 +2418,22 @@ } ], "responses": { + "202": { + "description": "The Cassandra table delete operation will complete asynchronously." + }, "204": { - "description": "The Table delete operation was successful." + "description": "The Cassandra table delete operation was completed successfully." } } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases": { "get": { - "operationId": "DatabaseAccounts_ListCassandraKeyspaces", + "operationId": "DatabaseAccounts_ListGremlinDatabases", "x-ms-examples": { - "CosmosDBCassandraKeyspaceList": { "$ref": "./examples/CosmosDBCassandraKeyspaceList.json" } + "CosmosDBGremlinDatabaseList": { "$ref": "./examples/CosmosDBGremlinDatabaseList.json" } }, - "description": "Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.", + "description": "Lists the Gremlin databases under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2317,63 +2450,24 @@ ], "responses": { "200": { - "description": "The Cassandra keyspace properties were retrieved successfully.", + "description": "The Gremlin database properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/CassandraKeyspaceListResult" + "$ref": "#/definitions/GremlinDatabaseListResult" } } }, "x-ms-pageable": { "nextLinkName": null } - }, - "put": { - "operationId": "DatabaseAccounts_CreateCassandraKeyspace", - "x-ms-examples": { - "CosmosDBCassandraKeyspaceCreate": { "$ref": "./examples/CosmosDBCassandraKeyspaceCreate.json" } - }, - "description": "Creates an Azure Cosmos DB Cassandra keyspace", - "x-ms-long-running-operation": true, - "parameters": [ - { - "$ref": "#/parameters/subscriptionIdParameter" - }, - { - "$ref": "#/parameters/resourceGroupNameParameter" - }, - { - "$ref": "#/parameters/accountNameParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "createCassandraKeyspaceParameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CassandraKeyspaceCreateUpdateParameters" - }, - "description": "The parameters to provide for the current Cassandra keyspace." - } - ], - "responses": { - "201": { - "description": "The Cassandra keyspace create operation was successful.", - "schema": { - "$ref": "#/definitions/CassandraKeyspace" - } - } - } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}": { "get": { - "operationId": "DatabaseAccounts_GetCassandraKeyspace", + "operationId": "DatabaseAccounts_GetGremlinDatabase", "x-ms-examples": { - "CosmosDBCassandraKeyspaceGet": { "$ref": "./examples/CosmosDBCassandraKeyspaceGet.json" } + "CosmosDBGremlinDatabaseGet": { "$ref": "./examples/CosmosDBGremlinDatabaseGet.json" } }, - "description": "Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided id.", + "description": "Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided id.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2385,7 +2479,7 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" @@ -2393,19 +2487,19 @@ ], "responses": { "200": { - "description": "The Cassandra keyspace property was retrieved successfully.", + "description": "The Gremlin database property was retrieved successfully.", "schema": { - "$ref": "#/definitions/CassandraKeyspace" + "$ref": "#/definitions/GremlinDatabase" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateCassandraKeyspace", + "operationId": "DatabaseAccounts_CreateUpdateGremlinDatabase", "x-ms-examples": { - "CosmosDBCassandraKeyspaceReplace": { "$ref": "./examples/CosmosDBCassandraKeyspaceReplace.json" } + "CosmosDBGremlinDatabaseCreateUpdate": { "$ref": "./examples/CosmosDBGremlinDatabaseCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB Cassandra keyspace", + "description": "Create or update an Azure Cosmos DB Gremlin database", "x-ms-long-running-operation": true, "parameters": [ { @@ -2418,36 +2512,39 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateCassandraKeyspaceParameters", + "name": "createUpdateGremlinDatabaseParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CassandraKeyspaceCreateUpdateParameters" + "$ref": "#/definitions/GremlinDatabaseCreateUpdateParameters" }, - "description": "The parameters to provide for the current Cassandra keyspace." + "description": "The parameters to provide for the current Gremlin database." } ], "responses": { + "202": { + "description": "The Gremlin database create or update operation will complete asynchronously." + }, "200": { - "description": "The Cassandra keyspace update operation was successful.", + "description": "The Gremlin database create or update operation was completed successfully.", "schema": { - "$ref": "#/definitions/CassandraKeyspace" + "$ref": "#/definitions/GremlinDatabase" } } } }, "delete": { - "operationId": "DatabaseAccounts_DeleteCassandraKeyspace", + "operationId": "DatabaseAccounts_DeleteGremlinDatabase", "x-ms-examples": { - "CosmosDBCassandraKeyspaceDelete": { "$ref": "./examples/CosmosDBCassandraKeyspaceDelete.json" } + "CosmosDBGremlinDatabaseDelete": { "$ref": "./examples/CosmosDBGremlinDatabaseDelete.json" } }, - "description": "Deletes an existing Azure Cosmos DB Cassandra keyspace.", + "description": "Deletes an existing Azure Cosmos DB Gremlin database.", "x-ms-long-running-operation": true, "parameters": [ { @@ -2460,26 +2557,29 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" } ], "responses": { + "202": { + "description": "The Gremlin database delete operation will complete asynchronously." + }, "204": { - "description": "The Cassandra keyspace delete operation was successful." + "description": "The Gremlin database delete operation was completed successfully." } } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}/tables": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/containers": { "get": { - "operationId": "DatabaseAccounts_ListCassandraTables", + "operationId": "DatabaseAccounts_ListGremlinContainers", "x-ms-examples": { - "CosmosDBCassandraTableList": { "$ref": "./examples/CosmosDBCassandraTableList.json" } + "CosmosDBGremlinContainerList": { "$ref": "./examples/CosmosDBGremlinContainerList.json" } }, - "description": "Lists the Cassandra table under an existing Azure Cosmos DB database account.", + "description": "Lists the Gremlin container under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2491,7 +2591,7 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" @@ -2499,66 +2599,24 @@ ], "responses": { "200": { - "description": "The Cassandra table properties were retrieved successfully.", + "description": "The Gremlin container properties were retrieved successfully.", "schema": { - "$ref": "#/definitions/CassandraTableListResult" + "$ref": "#/definitions/ContainerListResult" } } }, "x-ms-pageable": { "nextLinkName": null } - }, - "put": { - "operationId": "DatabaseAccounts_CreateCassandraTable", - "x-ms-examples": { - "CosmosDBCassandraTableCreate": { "$ref": "./examples/CosmosDBCassandraTableCreate.json" } - }, - "description": "Creates an Azure Cosmos DB Cassandra table", - "x-ms-long-running-operation": true, - "parameters": [ - { - "$ref": "#/parameters/subscriptionIdParameter" - }, - { - "$ref": "#/parameters/resourceGroupNameParameter" - }, - { - "$ref": "#/parameters/accountNameParameter" - }, - { - "$ref": "#/parameters/keyspaceRidParameter" - }, - { - "$ref": "#/parameters/apiVersionParameter" - }, - { - "name": "createCassandraTableParameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CassandraTableCreateUpdateParameters" - }, - "description": "The parameters to provide for the current Cassandra table." - } - ], - "responses": { - "201": { - "description": "The Cassandra table create operation was successful", - "schema": { - "$ref": "#/definitions/CassandraTable" - } - } - } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceRid}/tables/{tableRid}": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseRid}/containers/{containerRid}": { "get": { - "operationId": "DatabaseAccounts_GetCassandraTable", + "operationId": "DatabaseAccounts_GetGremlinContainer", "x-ms-examples": { - "CosmosDBCassandraTableGet": { "$ref": "./examples/CosmosDBCassandraTableGet.json" } + "CosmosDBGremlinContainerGet": { "$ref": "./examples/CosmosDBGremlinContainerGet.json" } }, - "description": "Gets the Cassandra table under an existing Azure Cosmos DB database account.", + "description": "Gets the Gremlin container under an existing Azure Cosmos DB database account.", "parameters": [ { "$ref": "#/parameters/subscriptionIdParameter" @@ -2570,10 +2628,10 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { - "$ref": "#/parameters/tableRidParameter" + "$ref": "#/parameters/containerRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" @@ -2581,19 +2639,19 @@ ], "responses": { "200": { - "description": "The Cassandra table property was retrieved successfully.", + "description": "The Gremlin container property was retrieved successfully.", "schema": { - "$ref": "#/definitions/CassandraTable" + "$ref": "#/definitions/Container" } } } }, "put": { - "operationId": "DatabaseAccounts_UpdateCassandraTable", + "operationId": "DatabaseAccounts_CreateUpdateGremlinContainer", "x-ms-examples": { - "CosmosDBCassandraTableReplace": { "$ref": "./examples/CosmosDBCassandraTableReplace.json" } + "CosmosDBGremlinContainerCreateUpdate": { "$ref": "./examples/CosmosDBGremlinContainerCreateUpdate.json" } }, - "description": "Updates an existing Azure Cosmos DB Cassandra Table", + "description": "Create or update an Azure Cosmos DB Gremlin container", "x-ms-long-running-operation": true, "parameters": [ { @@ -2606,39 +2664,42 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { - "$ref": "#/parameters/tableRidParameter" + "$ref": "#/parameters/containerRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" }, { - "name": "updateCassandraTableParameters", + "name": "createUpdateGremlinContainerParameters", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/CassandraTableCreateUpdateParameters" + "$ref": "#/definitions/ContainerCreateUpdateParameters" }, - "description": "The parameters to provide for the current Cassandra Table." + "description": "The parameters to provide for the current Gremlin container." } ], "responses": { + "202": { + "description": "The Gremlin container create or update operation will complete asynchronously." + }, "200": { - "description": "The Cassandra Table update operation was successful.", + "description": "The Gremlin container create or update operation was completed successfully.", "schema": { - "$ref": "#/definitions/CassandraTable" + "$ref": "#/definitions/Container" } } } }, "delete": { - "operationId": "DatabaseAccounts_DeleteCassandraTable", + "operationId": "DatabaseAccounts_DeleteGremlinContainer", "x-ms-examples": { - "CosmosDBCassandraTableDelete": { "$ref": "./examples/CosmosDBCassandraTableDelete.json" } + "CosmosDBGremlinContainerDelete": { "$ref": "./examples/CosmosDBGremlinContainerDelete.json" } }, - "description": "Deletes an existing Azure Cosmos DB Cassandra table.", + "description": "Deletes an existing Azure Cosmos DB Gremlin container.", "x-ms-long-running-operation": true, "parameters": [ { @@ -2651,18 +2712,21 @@ "$ref": "#/parameters/accountNameParameter" }, { - "$ref": "#/parameters/keyspaceRidParameter" + "$ref": "#/parameters/databaseRidParameter" }, { - "$ref": "#/parameters/tableRidParameter" + "$ref": "#/parameters/containerRidParameter" }, { "$ref": "#/parameters/apiVersionParameter" } ], "responses": { + "202": { + "description": "The Gremlin contianer delete operation will complete asynchronously." + }, "204": { - "description": "The Cassandra table delete operation was successful." + "description": "The Gremlin contianer delete operation was completed successfully." } } } @@ -2695,18 +2759,18 @@ }, "description": "The List operation response, that contains the SQL databases and their properties." }, - "SqlContainerListResult": { + "ContainerListResult": { "properties": { "value": { "readOnly": true, "type": "array", "items": { - "$ref": "#/definitions/SqlContainer" + "$ref": "#/definitions/Container" }, - "description": "List of SQL containers and their properties." + "description": "List of containers and their properties." } }, - "description": "The List operation response, that contains the SQL containers and their properties." + "description": "The List operation response, that contains the containers and their properties." }, "MongoDatabaseListResult": { "properties": { @@ -2773,6 +2837,19 @@ }, "description": "The List operation response, that contains the Cassandra tables and their properties." }, + "GremlinDatabaseListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/GremlinDatabase" + }, + "description": "List of Gremlin databases and their properties." + } + }, + "description": "The List operation response, that contains the Gremlin databases and their properties." + }, "ErrorResponse": { "properties": { "code": { @@ -2983,15 +3060,15 @@ } ] }, - "SqlContainer":{ - "description": "An Azure Cosmos DB SQL container.", + "GremlinDatabase": { + "description": "An Azure Cosmos DB Gremlin database.", "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, - "description": "The properties of an Azure Cosmos DB SQL container", - "$ref": "#/definitions/SqlContainerProperties" - } + "description": "The properties of an Azure Cosmos DB SQL database", + "$ref": "#/definitions/GremlinDatabaseProperties" + } }, "allOf": [ { @@ -2999,34 +3076,50 @@ } ] }, - "SqlContainerProperties": { - "description": "The properties of an Azure Cosmos DB SQL container", + "GremlinDatabaseProperties": { + "description": "The properties of an Azure Cosmos DB SQL database", "type": "object", "properties": { - "_doc": { - "type": "string", - "description": "A system generated property that specifies the addressable path of the documents resource." - }, - "_sprocs": { - "type": "string", - "description": "A system generated property that specifies the addressable path of the stored procedures (sprocs) resource." - }, - "_triggers": { + "_rid": { "type": "string", - "description": "A system generated property that specifies the addressable path of the triggers resource." + "description": "A system generated property. A unique identifier." }, - "_udfs": { - "type": "string", - "description": "A system generated property that specifies the addressable path of the user-defined functions (udfs) resource." + "_ts": { + "description": "A system generated property that denotes the last updated timestamp of the resource." }, - "_conflicts": { + "_etag": { "type": "string", - "description": "A system generated property that specifies the addressable path of the conflicts resource." + "description": "A system generated property representing the resource etag required for optimistic concurrency control." + } + }, + "allOf": [ + { + "$ref": "#/definitions/GremlinDatabaseResource" } + ] + }, + "Container":{ + "description": "An Azure Cosmos DB container.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB container", + "$ref": "#/definitions/ContainerProperties" + } }, "allOf": [ { - "$ref": "#/definitions/SqlContainerResource" + "$ref": "#/definitions/Resource" + } + ] + }, + "ContainerProperties": { + "description": "The properties of an Azure Cosmos DB container", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ContainerResource" }, { "$ref": "#/definitions/ExtendedResourceProperties" @@ -3513,27 +3606,27 @@ "options" ] }, - "SqlContainerCreateUpdateParameters": { - "description": "Parameters to create and update Cosmos DB SQL container.", + "ContainerCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB container.", "type": "object", "properties": { "properties": { "x-ms-client-flatten": true, - "description": "Properties to create and update Azure Cosmos DB SQL container.", - "$ref": "#/definitions/SqlContainerCreateUpdateProperties" + "description": "Properties to create and update Azure Cosmos DB container.", + "$ref": "#/definitions/ContainerCreateUpdateProperties" } }, "required": [ "properties" ] }, - "SqlContainerCreateUpdateProperties": { - "description": "Properties to create and update Azure Cosmos DB SQL container.", + "ContainerCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB container.", "type": "object", "properties": { "resource": { - "description": "The standard JSON format of a SQL container", - "$ref": "#/definitions/SqlContainerResource" + "description": "The standard JSON format of a container", + "$ref": "#/definitions/ContainerResource" }, "options": { "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", @@ -3705,6 +3798,38 @@ "options" ] }, + "GremlinDatabaseCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Gremlin database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Gremlin database.", + "$ref": "#/definitions/GremlinDatabaseCreateUpdateProperties" + } + }, + "required": [ + "properties" + ] + }, + "GremlinDatabaseCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Gremlin database.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Gremlin database", + "$ref": "#/definitions/GremlinDatabaseResource" + }, + "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" + ] + }, "SqlDatabaseResource": { "type": "object", "description": "Cosmos DB SQL database id object", @@ -3718,20 +3843,20 @@ "id" ] }, - "SqlContainerResource": { + "ContainerResource": { "type": "object", - "description": "Cosmos DB SQL container resource object", + "description": "Cosmos DB container resource object", "properties": { "id": { "type": "string", - "description": "Name of the Cosmos DB SQL container" + "description": "Name of the Cosmos DB container" }, "indexingPolicy": { "$ref": "#/definitions/IndexingPolicy", - "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the SQL container" + "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container" }, "partitionKey": { - "$ref": "#/definitions/SqlPartitionKey", + "$ref": "#/definitions/ContainerPartitionKey", "description": "The configuration of the partition key to be used for partitioning data into multiple partitions" }, "defaultTtl": { @@ -3744,7 +3869,7 @@ }, "conflictResolutionPolicy": { "$ref": "#/definitions/ConflictResolutionPolicy", - "description": "The conflict resolution policy for the SQL container." + "description": "The conflict resolution policy for the container." } }, "required": [ @@ -3851,12 +3976,12 @@ } } }, - "SqlPartitionKey": { + "ContainerPartitionKey": { "type": "object", "description": "The configuration of the partition key to be used for partitioning data into multiple partitions", "properties": { "paths": { - "description": "List of paths using which data within the SQL container can be partitioned", + "description": "List of paths using which data within the container can be partitioned", "type": "array", "items": { "$ref": "#/definitions/Path" @@ -3905,7 +4030,7 @@ }, "ConflictResolutionPolicy": { "type": "object", - "description": "The conflict resolution policy for the SQL container.", + "description": "The conflict resolution policy for the container.", "properties": { "mode": { "description": "Indicates the conflict resolution mode.", @@ -4131,6 +4256,19 @@ } } }, + "GremlinDatabaseResource": { + "type": "object", + "description": "Cosmos DB Gremlin database id object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Gremlin database" + } + }, + "required": [ + "id" + ] + }, "CreateUpdateOptions": { "type": "object", "additionalProperties": { diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json deleted file mode 100644 index af2305b28a8b..000000000000 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreate.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "accountName": "ddb1", - "resourceGroupName": "rg1", - "api-version": "2015-04-08", - "subscriptionId": "subid", - "createCassandraKeyspaceParameters": { - "id": "keyspaceName", - "properties": { - "resource": { - "id": "keyspaceName" - }, - "options": { - } - } - } - }, - "responses": { - "201": { - "body": { - "id": "keyspaceName", - "name": "keyspaceName", - "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces", - "properties": { - "id": "keyspaceName" - } - } - } - } -} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json deleted file mode 100644 index 1fbe861f2c1b..000000000000 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreate.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "parameters": { - "accountName": "ddb1", - "resourceGroupName": "rg1", - "api-version": "2015-04-08", - "subscriptionId": "subid", - "createCassandraTableParameters": { - "id": "tableName", - "properties": { - "resource": { - "id": "tableName", - "defaultTtl": 100, - "schema": { - "columns": [ - { - "name": "columnA", - "type": "Ascii" - } - ], - "partitionKeys": [ - { - "name": "columnA" - } - ], - "clusterKeys": [ - { - "name": "columnA", - "orderBy": "Asc" - } - ] - } - }, - "options": { - } - } - } - }, - "responses": { - "201": { - "body": { - "id": "tableName", - "name": "tableName", - "type": "Microsoft.DocumentDB/databaseAccounts/apis/keyspaces/tables", - "properties": { - "id": "tableName", - "defaultTtl": 100, - "schema": { - "columns": [ - { - "name": "columnA", - "type": "Ascii" - } - ], - "partitionKeys": [ - { - "name": "columnA" - } - ], - "clusterKeys": [ - { - "name": "columnA", - "orderBy": "Asc" - } - ] - } - } - } - } - } -} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json new file mode 100644 index 000000000000..977162053318 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName", + "containerRid": "containerName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json new file mode 100644 index 000000000000..bc505a78be56 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json @@ -0,0 +1,67 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseRid": "databaseName", + "containerRid": "containerName" + }, + "responses": { + "200": { + "body": { + "id": "containerName", + "name": "containerName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", + "properties": { + "id": "containerName", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json new file mode 100644 index 000000000000..796d6a86eee9 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1", + "databaseRid": "databaseName" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "testctn", + "name": "testctn", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", + "properties": { + "id": "testctn", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json similarity index 74% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreate.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json index 5c74b5691843..75589ff104e4 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json @@ -4,7 +4,8 @@ "resourceGroupName": "rg1", "api-version": "2015-04-08", "subscriptionId": "subid", - "createSqlDatabaseParameters": { + "databaseRid": "databaseName", + "updateGremlinDatabaseParameters": { "id": "databaseName", "properties": { "resource": { @@ -16,7 +17,7 @@ } }, "responses": { - "201": { + "200": { "body": { "id": "databaseName", "name": "databaseName", @@ -25,10 +26,7 @@ "id": "databaseName", "_rid": "CqNBAA==", "_ts": 1449602962, - "_self": "dbs\/CqNBAA==\/", - "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", - "_colls": "colls\/", - "_users": "users\/" + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"" } } } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json new file mode 100644 index 000000000000..29dd4f3160bd --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName" + }, + "responses": { + "204": { } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseGet.json new file mode 100644 index 000000000000..bd7010af0f21 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseGet.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2015-04-08", + "subscriptionId": "subid", + "databaseRid": "databaseName" + }, + "responses": { + "200": { + "body": { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "properties": { + "id": "databaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseList.json new file mode 100644 index 000000000000..95776f31a04f --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseList.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2015-04-08", + "subscriptionId": "subid", + "resourceGroupName": "rgName", + "accountName": "ddb1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "databaseName", + "name": "databaseName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "properties": { + "id": "databaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json deleted file mode 100644 index 84d9f868a404..000000000000 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreate.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "parameters": { - "accountName": "ddb1", - "resourceGroupName": "rg1", - "api-version": "2015-04-08", - "subscriptionId": "subid", - "createMongoCollectionParameters": { - "id": "testcoll", - "properties": { - "resource": { - "id": "testcoll", - "indexes": [ - { - "key": { - "keys": [ - "testKey" - ] - }, - "options": { - "expireAfterSeconds": 100, - "unique": true - } - } - ], - "shardKey": { - "testKey": "Hash" - } - }, - "options": { - } - } - } - }, - "responses": { - "201": { - "body": { - "id": "testcoll", - "name": "testcoll", - "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/collections", - "properties": { - "id": "testcoll", - "indexes": [ - { - "key": { - "keys": [ - "testKey" - ] - }, - "options": { - "expireAfterSeconds": 100, - "unique": true - } - } - ], - "shardKey": { - "testKey": "Hash" - } - } - } - } - } -} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json deleted file mode 100644 index b6718973a5eb..000000000000 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreate.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "parameters": { - "accountName": "ddb1", - "resourceGroupName": "rg1", - "api-version": "2015-04-08", - "subscriptionId": "subid", - "databaseRid": "databaseName", - "createSqlContainerParameters": { - "id": "testctn", - "properties": { - "resource": { - "id": "testctn", - "indexingPolicy": { - "indexingMode": "consistent", - "automatic": true, - "includedPaths": [ - { - "path": "/*", - "indexes": [ - { - "kind": "Range", - "dataType": "String", - "precision": -1 - }, - { - "kind": "Range", - "dataType": "Number", - "precision": -1 - } - ] - } - ], - "excludedPaths": [] - }, - "partitionKey": { - "paths": [ - "/AccountNumber" - ], - "kind": "Hash" - }, - "defaultTtl": 100, - "uniqueKeyPolicy": { - "uniqueKeys": [ - { - "paths": [ - "/testPath" - ] - } - ] - }, - "conflictReoslutionPolicy": { - "mode": "LastWriterWins", - "conflictResolutionPath": "/path" - } - }, - "options": { - } - } - } - }, - "responses": { - "201": { - "body": { - "id": "testctn", - "name": "testctn", - "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", - "properties": { - "id": "testctn", - "indexingPolicy": { - "indexingMode": "consistent", - "automatic": true, - "includedPaths": [ - { - "path": "/*", - "indexes": [ - { - "kind": "Range", - "dataType": "String", - "precision": -1 - }, - { - "kind": "Range", - "dataType": "Number", - "precision": -1 - } - ] - } - ], - "excludedPaths": [] - }, - "partitionKey": { - "paths": [ - "/AccountNumber" - ], - "kind": "Hash" - }, - "defaultTtl": 100, - "uniqueKeyPolicy": { - "uniqueKeys": [ - { - "paths": [ - "/testPath" - ] - } - ] - }, - "conflictReoslutionPolicy": { - "mode": "LastWriterWins", - "conflictResolutionPath": "/path" - }, - "_rid": "PD5DALigDgw=", - "_ts": 1459200611, - "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", - "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", - "_docs": "docs/", - "_sprocs": "sprocs/", - "_triggers": "triggers/", - "_udfs": "udfs/", - "_conflicts": "conflicts/" - } - } - } - } -} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json index a9122d74315f..bc505a78be56 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json @@ -59,13 +59,7 @@ }, "_rid": "PD5DALigDgw=", "_ts": 1459200611, - "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", - "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", - "_docs": "docs/", - "_sprocs": "sprocs/", - "_triggers": "triggers/", - "_udfs": "udfs/", - "_conflicts": "conflicts/" + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"" } } } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json index a7d59ae358a8..796d6a86eee9 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json @@ -60,13 +60,7 @@ }, "_rid": "PD5DALigDgw=", "_ts": 1459200611, - "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", - "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", - "_docs": "docs/", - "_sprocs": "sprocs/", - "_triggers": "triggers/", - "_udfs": "udfs/", - "_conflicts": "conflicts/" + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"" } } ] diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json similarity index 69% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json index 8bb0138e7377..7c291cb141ed 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json @@ -4,7 +4,8 @@ "resourceGroupName": "rg1", "api-version": "2015-04-08", "subscriptionId": "subid", - "createMongoDatabaseParameters": { + "databaseRid": "databaseName", + "updateSqlDatabaseParameters": { "id": "databaseName", "properties": { "resource": { @@ -16,13 +17,16 @@ } }, "responses": { - "201": { + "200": { "body": { "id": "databaseName", "name": "databaseName", "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", "properties": { - "id": "databaseName" + "id": "databaseName", + "_rid": "CqNBAA==", + "_ts": 1449602962, + "_etag": "\"00000a00-0000-0000-0000-56672f920000\"" } } } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json deleted file mode 100644 index f543117e1841..000000000000 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreate.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "accountName": "ddb1", - "resourceGroupName": "rg1", - "api-version": "2015-04-08", - "subscriptionId": "subid", - "createTableParameters": { - "id": "tableName", - "properties": { - "resource": { - "id": "tableName" - }, - "options": { - } - } - } - }, - "responses": { - "201": { - "body": { - "id": "tableName", - "name": "tableName", - "type": "Microsoft.DocumentDB/databaseAccounts/apis/tables", - "properties": { - "id": "tableName" - } - } - } - } -} \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableReplace.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json similarity index 100% rename from specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableReplace.json rename to specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index 9d9471e285f8..8468f3d16536 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -1,3 +1,4 @@ +<<<<<<< HEAD # Cosmos-DB > see https://aka.ms/autorest @@ -242,3 +243,245 @@ generate-interface: true ``` +======= +# Cosmos-DB + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Cosmos-DB. + + + +--- +## Getting Started +To build the SDK for Cosmos-DB, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + + + +### Basic Information +These are the global settings for the Cosmos-DB API. + +``` yaml +openapi-type: arm +tag: package-2015-04 +``` + + +### Tag: package-2015-04 + +These settings apply only when `--tag=package-2015-04` is specified on the command line. + +``` yaml $(tag) == 'package-2015-04' +input-file: +- Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +``` + +## Suppression +``` yaml +directive: + - suppress: TrackedResourceGetOperation + from: cosmos-db.json + where: $.definitions.DatabaseAccountCreateUpdateParameters + reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.DatabaseAccountCreateUpdateParameters + reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.SqlDatabase + reason: The SqlDatabase doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.Container + reason: The Container doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.MongoDatabase + reason: The MongoDatabase doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.MongoCollection + reason: The MongoCollection doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.Table + reason: The Table doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.CassandraKeyspace + reason: The CassandraKeyspace doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.CassandraTable + reason: The CassandraTable doesn't support Patch operation + - suppress: TrackedResourcePatchOperation + from: cosmos-db.json + where: $.definitions.GremlinDatabase + reason: The GremlinDatabase doesn't support Patch operation + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.MetricValue.properties._count + reason: The Metrics API has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._rid + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._ts + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._self + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.ExtendedResourceProperties.properties._etag + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlDatabaseProperties.properties._colls + reason: The database has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.SqlDatabaseProperties.properties._users + reason: The database has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GremlinDatabaseProperties.properties._rid + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GremlinDatabaseProperties.properties._ts + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.GremlinDatabaseProperties.properties._etag + reason: The resource has a property name with a leading underscore character + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P10 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P25 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P50 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P75 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P90 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P95 + reason: The Metrics API has percentile metrics property names with leading capital letters + - suppress: DefinitionsPropertiesNamesCamelCase + from: cosmos-db.json + where: $.definitions.PercentileMetricValue.properties.P99 + reason: The Metrics API has percentile metrics property names with leading capital letters +``` + +--- +# Code Generation + + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-js + - repo: azure-sdk-for-node +``` + + +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: azure.mgmt.cosmosdb + package-name: azure-mgmt-cosmosdb + package-version: 0.3.0 + clear-output-folder: true +``` +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb +``` +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb +``` + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +azure-arm: true +fluent: true +namespace: com.microsoft.azure.management.cosmosdb +license-header: MICROSOFT_MIT_NO_CODEGEN +payload-flattening-threshold: 1 +output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-cosmosdb +``` + +### Java multi-api + +``` yaml $(java) && $(multiapi) +batch: + - tag: package-2015-04 +``` + +### Tag: package-2015-04 and java + +These settings apply only when `--tag=package-2015-04 --java` is specified on the command line. +Please also specify `--azure-libraries-for-java=`. + +``` yaml $(tag) == 'package-2015-04' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.cosmosdb.v2015_04_08 + output-folder: $(azure-libraries-for-java-folder)/cosmosdb/resource-manager/v2015_04_08 +regenerate-manager: true +generate-interface: true +``` + + +>>>>>>> Add Gremlin API From 2083bb7fac97b078dcd30fd616dd0315e0f241fc Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Wed, 17 Apr 2019 18:27:00 -0700 Subject: [PATCH 10/13] Fix excluded key path --- .../stable/2015-04-08/cosmos-db.json | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index 5dc1b0508a6b..c8b18d5ae5a9 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -3902,23 +3902,28 @@ "description": "List of paths to include in the indexing", "type": "array", "items": { - "$ref": "#/definitions/IncludedPaths" + "$ref": "#/definitions/IncludedPath" } }, "excludedPaths": { "description": "List of paths to exclude from indexing", "type": "array", "items": { - "$ref": "#/definitions/Path" + "$ref": "#/definitions/ExcludedPath" } } } }, - "Path": { - "type": "string", - "description": "A path. These typically start with root (/path)" + "ExcludedPath": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)" + } + } }, - "IncludedPaths": { + "IncludedPath": { "type": "object", "description": "The paths that are included in indexing", "properties": { @@ -4002,6 +4007,10 @@ } } }, + "Path": { + "type": "string", + "description": "A path. These typically start with root (/path)" + }, "UniqueKeyPolicy": { "type": "object", "description": "The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service.", From 3aa809a16233b7a65d328018312d23316a213b06 Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Thu, 18 Apr 2019 11:38:34 -0700 Subject: [PATCH 11/13] Fix examples model validation --- .../stable/2015-04-08/cosmos-db.json | 7 - ...CosmosDBCassandraKeyspaceCreateUpdate.json | 5 +- .../CosmosDBCassandraKeyspaceDelete.json | 3 +- .../CosmosDBCassandraTableCreateUpdate.json | 6 +- .../CosmosDBCassandraTableDelete.json | 4 +- .../examples/CosmosDBCassandraTableGet.json | 1 + .../examples/CosmosDBCassandraTableList.json | 3 +- .../CosmosDBGremlinContainerCreateUpdate.json | 111 +++++++- .../CosmosDBGremlinContainerDelete.json | 3 +- .../examples/CosmosDBGremlinContainerGet.json | 4 +- .../CosmosDBGremlinContainerList.json | 4 +- .../CosmosDBGremlinDatabaseCreateUpdate.json | 5 +- .../CosmosDBGremlinDatabaseDelete.json | 3 +- .../CosmosDBMongoCollectionCreateUpdate.json | 6 +- .../CosmosDBMongoCollectionDelete.json | 3 +- .../CosmosDBMongoDatabaseCreateUpdate.json | 5 +- .../examples/CosmosDBMongoDatabaseDelete.json | 3 +- .../CosmosDBSqlContainerCreateUpdate.json | 29 +- .../examples/CosmosDBSqlContainerDelete.json | 3 +- .../examples/CosmosDBSqlContainerGet.json | 4 +- .../examples/CosmosDBSqlContainerList.json | 4 +- .../CosmosDBSqlDatabaseCreateUpdate.json | 4 +- .../examples/CosmosDBSqlDatabaseDelete.json | 3 +- .../examples/CosmosDBTableCreateUpdate.json | 5 +- .../examples/CosmosDBTableDelete.json | 3 +- .../cosmos-db/resource-manager/readme.md | 247 ------------------ 26 files changed, 170 insertions(+), 308 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json index c8b18d5ae5a9..0c50a1b0640f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json @@ -2967,9 +2967,6 @@ "$ref": "#/definitions/Tags" } }, - "required": [ - "location" - ], "x-ms-azure-resource": true }, "DatabaseAccount": { @@ -3012,10 +3009,6 @@ "_ts": { "description": "A system generated property that denotes the last updated timestamp of the resource." }, - "_self": { - "type": "string", - "description": "A system generated property. It is the unique addressable URI for the resource." - }, "_etag": { "type": "string", "description": "A system generated property representing the resource etag required for optimistic concurrency control." diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json index 22f63ec552f0..90959dae47e8 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json @@ -5,7 +5,7 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "keyspaceRid": "keyspaceName", - "updateCassandraKeyspaceParameters": { + "createUpdateCassandraKeyspaceParameters": { "id": "keyspaceName", "properties": { "resource": { @@ -26,6 +26,9 @@ "id": "keyspaceName" } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json index 0a9a7bced311..32bf55b8f6a0 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceDelete.json @@ -7,6 +7,7 @@ "keyspaceRid": "keyspaceName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json index d74c466e6c16..1cfff56b58eb 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json @@ -5,7 +5,8 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "keyspaceRid": "tableName", - "updateCassandraTableParameters": { + "tableRid": "tableName", + "createUpdateCassandraTableParameters": { "id": "tableName", "properties": { "resource": { @@ -66,6 +67,9 @@ } } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json index 3167a8cd2e26..0a87600d5a10 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableDelete.json @@ -4,9 +4,11 @@ "resourceGroupName": "rg1", "api-version": "2015-04-08", "subscriptionId": "subid", + "keyspaceRid": "keyspaceName", "tableRid": "tableName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json index 03607cf06808..ad4831a11493 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableGet.json @@ -4,6 +4,7 @@ "resourceGroupName": "rg1", "api-version": "2015-04-08", "subscriptionId": "subid", + "keyspaceRid": "keyspaceName", "tableRid": "tableName" }, "responses": { diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json index 2c8a13520af0..4d3c694d1835 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableList.json @@ -3,7 +3,8 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "resourceGroupName": "rgName", - "accountName": "ddb1" + "accountName": "ddb1", + "keyspaceRid": "keyspaceName" }, "responses": { "200": { diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json index 915445d06f50..6735903bb665 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json @@ -5,11 +5,54 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "updateSqlDatabaseParameters": { - "id": "databaseName", + "containerRid": "containerName", + "createUpdateGremlinContainerParameters": { + "id": "containerName", "properties": { "resource": { - "id": "databaseName" + "id": "containerName", + "indexingPolicy": { + "indexingMode": "consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, + "conflictReoslutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + } }, "options": { } @@ -19,19 +62,61 @@ "responses": { "200": { "body": { - "id": "databaseName", - "name": "databaseName", - "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases", + "id": "containerName", + "name": "containerName", + "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", "properties": { - "id": "databaseName", - "_rid": "CqNBAA==", - "_ts": 1449602962, - "_self": "dbs\/CqNBAA==\/", - "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", - "_colls": "colls\/", - "_users": "users\/" + "id": "containerName", + "indexingPolicy": { + "indexingMode": "Consistent", + "automatic": true, + "includedPaths": [ + { + "path": "/*", + "indexes": [ + { + "kind": "Range", + "dataType": "String", + "precision": -1 + }, + { + "kind": "Range", + "dataType": "Number", + "precision": -1 + } + ] + } + ], + "excludedPaths": [] + }, + "partitionKey": { + "paths": [ + "/AccountNumber" + ], + "kind": "Hash" + }, + "defaultTtl": 100, + "uniqueKeyPolicy": { + "uniqueKeys": [ + { + "paths": [ + "/testPath" + ] + } + ] + }, + "conflictResolutionPolicy": { + "mode": "LastWriterWins", + "conflictResolutionPath": "/path" + }, + "_rid": "PD5DALigDgw=", + "_ts": 1459200611, + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"" } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json index 977162053318..9ca049136749 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerDelete.json @@ -8,6 +8,7 @@ "containerRid": "containerName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json index bc505a78be56..c17ffa2b63d4 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerGet.json @@ -16,7 +16,7 @@ "properties": { "id": "containerName", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ { @@ -53,7 +53,7 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" }, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json index 796d6a86eee9..f57256ae9e3f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerList.json @@ -17,7 +17,7 @@ "properties": { "id": "testctn", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ { @@ -54,7 +54,7 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" }, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json index 75589ff104e4..d3192a806909 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json @@ -5,7 +5,7 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "updateGremlinDatabaseParameters": { + "createUpdateGremlinDatabaseParameters": { "id": "databaseName", "properties": { "resource": { @@ -29,6 +29,9 @@ "_etag": "\"00000a00-0000-0000-0000-56672f920000\"" } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json index 29dd4f3160bd..3e9271928252 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseDelete.json @@ -7,6 +7,7 @@ "databaseRid": "databaseName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json index e04636ba6ee0..d6303051d46b 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json @@ -5,7 +5,8 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "updateMongoCollectionParameters": { + "collectionRid": "collectionName", + "createUpdateMongoCollectionParameters": { "id": "collectionName", "properties": { "resource": { @@ -58,6 +59,9 @@ } } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json index 46038de42a99..46aa520680e2 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionDelete.json @@ -8,6 +8,7 @@ "collectionRid": "collectionName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json index 374da405ee04..5285987782fa 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json @@ -5,7 +5,7 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "updateMongoDatabaseParameters": { + "createUpdateMongoDatabaseParameters": { "id": "updatedDatabaseName", "properties": { "resource": { @@ -26,6 +26,9 @@ "id": "updatedDatabaseName" } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json index 29dd4f3160bd..3e9271928252 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseDelete.json @@ -7,6 +7,7 @@ "databaseRid": "databaseName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json index 6ec311038027..a078a8fe1929 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json @@ -5,12 +5,12 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "containerRid": "testctn", - "updateSqlContainerParameters": { - "id": "testctn", + "containerRid": "containerName", + "createUpdateSqlContainerParameters": { + "id": "containerName", "properties": { "resource": { - "id": "testctn", + "id": "containerName", "indexingPolicy": { "indexingMode": "consistent", "automatic": true, @@ -62,13 +62,13 @@ "responses": { "200": { "body": { - "id": "testctn", - "name": "testctn", + "id": "containerName", + "name": "containerName", "type": "Microsoft.DocumentDB/databaseAccounts/apis/databases/containers", "properties": { - "id": "testctn", + "id": "containerName", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ { @@ -105,21 +105,18 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" }, "_rid": "PD5DALigDgw=", "_ts": 1459200611, - "_self": "dbs/PD5DAA==/colls/PD5DALigDgw=/", - "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"", - "_docs": "docs/", - "_sprocs": "sprocs/", - "_triggers": "triggers/", - "_udfs": "udfs/", - "_conflicts": "conflicts/" + "_etag": "\"00005900-0000-0000-0000-56f9a2630000\"" } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json index 977162053318..9ca049136749 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerDelete.json @@ -8,6 +8,7 @@ "containerRid": "containerName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json index bc505a78be56..c17ffa2b63d4 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerGet.json @@ -16,7 +16,7 @@ "properties": { "id": "containerName", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ { @@ -53,7 +53,7 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" }, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json index 796d6a86eee9..f57256ae9e3f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerList.json @@ -17,7 +17,7 @@ "properties": { "id": "testctn", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ { @@ -54,7 +54,7 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" }, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json index 7c291cb141ed..77dd98118c0b 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json @@ -5,7 +5,7 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "databaseRid": "databaseName", - "updateSqlDatabaseParameters": { + "createUpdateSqlDatabaseParameters": { "id": "databaseName", "properties": { "resource": { @@ -29,6 +29,8 @@ "_etag": "\"00000a00-0000-0000-0000-56672f920000\"" } } + }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json index 29dd4f3160bd..3e9271928252 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseDelete.json @@ -7,6 +7,7 @@ "databaseRid": "databaseName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json index 84decb47e7fe..d1ff5e61ac34 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json @@ -5,7 +5,7 @@ "api-version": "2015-04-08", "subscriptionId": "subid", "tableRid": "tableName", - "updateTableParameters": { + "createUpdateTableParameters": { "id": "tableName", "properties": { "resource": { @@ -26,6 +26,9 @@ "id": "tableName" } } + }, + "202": { + } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json index 3167a8cd2e26..cbd616705886 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableDelete.json @@ -7,6 +7,7 @@ "tableRid": "tableName" }, "responses": { - "204": { } + "204": { }, + "202": { } } } \ No newline at end of file diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index 8468f3d16536..efdd18c114bf 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -1,249 +1,3 @@ -<<<<<<< HEAD -# Cosmos-DB - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Cosmos-DB. - - - ---- -## Getting Started -To build the SDK for Cosmos-DB, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` ---- - -## Configuration - - - -### Basic Information -These are the global settings for the Cosmos-DB API. - -``` yaml -openapi-type: arm -tag: package-2015-04 -``` - - -### Tag: package-2015-04 - -These settings apply only when `--tag=package-2015-04` is specified on the command line. - -``` yaml $(tag) == 'package-2015-04' -input-file: -- Microsoft.DocumentDB/stable/2015-04-08/cosmos-db.json -``` - -## Suppression -``` yaml -directive: - - suppress: TrackedResourceGetOperation - from: cosmos-db.json - where: $.definitions.DatabaseAccountCreateUpdateParameters - reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.DatabaseAccountCreateUpdateParameters - reason: The DatabaseAccount request and response resources differ so the DatabaseAccountCreateUpdateParameters must only have a PUT operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.SqlDatabase - reason: The SqlDatabase doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.SqlContainer - reason: The SqlContainer doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.MongoDatabase - reason: The MongoDatabase doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.MongoCollection - reason: The MongoCollection doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.Table - reason: The Table doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.CassandraKeyspace - reason: The CassandraKeyspace doesn't support Patch operation - - suppress: TrackedResourcePatchOperation - from: cosmos-db.json - where: $.definitions.CassandraTable - reason: The CassandraTable doesn't support Patch operation - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.MetricValue.properties._count - reason: The Metrics API has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtendedResourceProperties.properties._rid - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtendedResourceProperties.properties._ts - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtendedResourceProperties.properties._self - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.ExtendedResourceProperties.properties._etag - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlDatabaseProperties.properties._colls - reason: The database has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlDatabaseProperties.properties._users - reason: The database has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerProperties.properties._doc - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerProperties.properties._sprocs - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerProperties.properties._triggers - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerProperties.properties._udfs - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.SqlContainerProperties.properties._conflicts - reason: The resource has a property name with a leading underscore character - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P10 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P25 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P50 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P75 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P90 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P95 - reason: The Metrics API has percentile metrics property names with leading capital letters - - suppress: DefinitionsPropertiesNamesCamelCase - from: cosmos-db.json - where: $.definitions.PercentileMetricValue.properties.P99 - reason: The Metrics API has percentile metrics property names with leading capital letters -``` - ---- -# Code Generation - - -## Swagger to SDK - -This section describes what SDK should be generated by the automatic system. -This is not used by Autorest itself. - -``` yaml $(swagger-to-sdk) -swagger-to-sdk: - - repo: azure-sdk-for-python - - repo: azure-sdk-for-java - - repo: azure-sdk-for-go - - repo: azure-sdk-for-js - - repo: azure-sdk-for-node -``` - - -## Python - -These settings apply only when `--python` is specified on the command line. -Please also specify `--python-sdks-folder=`. -Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. - -``` yaml $(python) -python-mode: create -python: - azure-arm: true - license-header: MICROSOFT_MIT_NO_VERSION - payload-flattening-threshold: 2 - namespace: azure.mgmt.cosmosdb - package-name: azure-mgmt-cosmosdb - package-version: 0.3.0 - clear-output-folder: true -``` -``` yaml $(python) && $(python-mode) == 'update' -python: - no-namespace-folders: true - output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb -``` -``` yaml $(python) && $(python-mode) == 'create' -python: - basic-setup-py: true - output-folder: $(python-sdks-folder)/azure-mgmt-cosmosdb -``` - -## Go - -See configuration in [readme.go.md](./readme.go.md) - -## Java - -These settings apply only when `--java` is specified on the command line. -Please also specify `--azure-libraries-for-java-folder=`. - -``` yaml $(java) -azure-arm: true -fluent: true -namespace: com.microsoft.azure.management.cosmosdb -license-header: MICROSOFT_MIT_NO_CODEGEN -payload-flattening-threshold: 1 -output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-cosmosdb -``` - -### Java multi-api - -``` yaml $(java) && $(multiapi) -batch: - - tag: package-2015-04 -``` - -### Tag: package-2015-04 and java - -These settings apply only when `--tag=package-2015-04 --java` is specified on the command line. -Please also specify `--azure-libraries-for-java=`. - -``` yaml $(tag) == 'package-2015-04' && $(java) && $(multiapi) -java: - namespace: com.microsoft.azure.management.cosmosdb.v2015_04_08 - output-folder: $(azure-libraries-for-java-folder)/cosmosdb/resource-manager/v2015_04_08 -regenerate-manager: true -generate-interface: true -``` - - -======= # Cosmos-DB > see https://aka.ms/autorest @@ -484,4 +238,3 @@ generate-interface: true ``` ->>>>>>> Add Gremlin API From 4facac3fcbd45d2c8e60711142234c7da757539c Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Thu, 18 Apr 2019 11:53:15 -0700 Subject: [PATCH 12/13] Remove duplicated id from example --- .../examples/CosmosDBCassandraKeyspaceCreateUpdate.json | 1 - .../examples/CosmosDBCassandraTableCreateUpdate.json | 1 - .../examples/CosmosDBGremlinContainerCreateUpdate.json | 3 +-- .../examples/CosmosDBGremlinDatabaseCreateUpdate.json | 1 - .../examples/CosmosDBMongoCollectionCreateUpdate.json | 1 - .../examples/CosmosDBMongoDatabaseCreateUpdate.json | 1 - .../examples/CosmosDBSqlContainerCreateUpdate.json | 5 ++--- .../2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json | 1 - .../stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json | 1 - .../stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json | 1 - .../2015-04-08/examples/CosmosDBTableCreateUpdate.json | 1 - 11 files changed, 3 insertions(+), 14 deletions(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json index 90959dae47e8..5bd25a5c9bed 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraKeyspaceCreateUpdate.json @@ -6,7 +6,6 @@ "subscriptionId": "subid", "keyspaceRid": "keyspaceName", "createUpdateCassandraKeyspaceParameters": { - "id": "keyspaceName", "properties": { "resource": { "id": "keyspaceName" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json index 1cfff56b58eb..7e7549711ee5 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBCassandraTableCreateUpdate.json @@ -7,7 +7,6 @@ "keyspaceRid": "tableName", "tableRid": "tableName", "createUpdateCassandraTableParameters": { - "id": "tableName", "properties": { "resource": { "id": "tableName", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json index 6735903bb665..1c85db334fe8 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json @@ -7,7 +7,6 @@ "databaseRid": "databaseName", "containerRid": "containerName", "createUpdateGremlinContainerParameters": { - "id": "containerName", "properties": { "resource": { "id": "containerName", @@ -49,7 +48,7 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json index d3192a806909..0dc7db32490e 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinDatabaseCreateUpdate.json @@ -6,7 +6,6 @@ "subscriptionId": "subid", "databaseRid": "databaseName", "createUpdateGremlinDatabaseParameters": { - "id": "databaseName", "properties": { "resource": { "id": "databaseName" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json index d6303051d46b..ab92d5ac6c16 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoCollectionCreateUpdate.json @@ -7,7 +7,6 @@ "databaseRid": "databaseName", "collectionRid": "collectionName", "createUpdateMongoCollectionParameters": { - "id": "collectionName", "properties": { "resource": { "id": "testcoll", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json index 5285987782fa..9befb63ef43b 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBMongoDatabaseCreateUpdate.json @@ -6,7 +6,6 @@ "subscriptionId": "subid", "databaseRid": "databaseName", "createUpdateMongoDatabaseParameters": { - "id": "updatedDatabaseName", "properties": { "resource": { "id": "updatedDatabaseName" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json index a078a8fe1929..38a140e3cb65 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlContainerCreateUpdate.json @@ -7,12 +7,11 @@ "databaseRid": "databaseName", "containerRid": "containerName", "createUpdateSqlContainerParameters": { - "id": "containerName", "properties": { "resource": { "id": "containerName", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ { @@ -49,7 +48,7 @@ } ] }, - "conflictReoslutionPolicy": { + "conflictResolutionPolicy": { "mode": "LastWriterWins", "conflictResolutionPath": "/path" } diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json index 77dd98118c0b..416117cc5286 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseCreateUpdate.json @@ -6,7 +6,6 @@ "subscriptionId": "subid", "databaseRid": "databaseName", "createUpdateSqlDatabaseParameters": { - "id": "databaseName", "properties": { "resource": { "id": "databaseName" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json index 7570ec937f68..147f66f113d6 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseGet.json @@ -16,7 +16,6 @@ "id": "databaseName", "_rid": "CqNBAA==", "_ts": 1449602962, - "_self": "dbs\/CqNBAA==\/", "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", "_colls": "colls\/", "_users": "users\/" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json index fbbdb14738ea..37d38967d63f 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBSqlDatabaseList.json @@ -17,7 +17,6 @@ "id": "databaseName", "_rid": "CqNBAA==", "_ts": 1449602962, - "_self": "dbs\/CqNBAA==\/", "_etag": "\"00000a00-0000-0000-0000-56672f920000\"", "_colls": "colls\/", "_users": "users\/" diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json index d1ff5e61ac34..ab9bcdadca52 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBTableCreateUpdate.json @@ -6,7 +6,6 @@ "subscriptionId": "subid", "tableRid": "tableName", "createUpdateTableParameters": { - "id": "tableName", "properties": { "resource": { "id": "tableName" From d60b5ade2334dac17f0a96676495d0549550953d Mon Sep 17 00:00:00 2001 From: Chunyu Yu Date: Thu, 18 Apr 2019 12:01:15 -0700 Subject: [PATCH 13/13] Fix example CosmosDBGremlinContainerCreateUpdate --- .../examples/CosmosDBGremlinContainerCreateUpdate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json index 1c85db334fe8..163c2fdb0e2c 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2015-04-08/examples/CosmosDBGremlinContainerCreateUpdate.json @@ -11,7 +11,7 @@ "resource": { "id": "containerName", "indexingPolicy": { - "indexingMode": "consistent", + "indexingMode": "Consistent", "automatic": true, "includedPaths": [ {