From df544f88b2062b39fc97ad683d64978164eaa87b Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Wed, 22 Jul 2020 21:37:13 -0500 Subject: [PATCH] First pass at a generated ARM client --- models.ts | 2903 ++++++++++ package.json | 1 + utils/armClientGenerator/generator.ts | 155 + utils/armClientGenerator/schema.json | 7731 +++++++++++++++++++++++++ 4 files changed, 10790 insertions(+) create mode 100644 models.ts create mode 100644 utils/armClientGenerator/generator.ts create mode 100644 utils/armClientGenerator/schema.json diff --git a/models.ts b/models.ts new file mode 100644 index 000000000..6807ae05a --- /dev/null +++ b/models.ts @@ -0,0 +1,2903 @@ +export interface DatabaseAccountsListResult { + /* List of database account and their properties. */ + readonly value: DatabaseAccountGetResults[]; +} + +export interface SqlDatabaseListResult { + /* List of SQL databases and their properties. */ + readonly value: SqlDatabaseGetResults[]; +} + +export interface SqlContainerListResult { + /* List of containers and their properties. */ + readonly value: SqlContainerGetResults[]; +} + +export interface SqlStoredProcedureListResult { + /* List of storedProcedures and their properties. */ + readonly value: SqlStoredProcedureGetResults[]; +} + +export interface SqlUserDefinedFunctionListResult { + /* List of userDefinedFunctions and their properties. */ + readonly value: SqlUserDefinedFunctionGetResults[]; +} + +export interface SqlTriggerListResult { + /* List of triggers and their properties. */ + readonly value: SqlTriggerGetResults[]; +} + +export interface MongoDBDatabaseListResult { + /* List of MongoDB databases and their properties. */ + readonly value: MongoDBDatabaseGetResults[]; +} + +export interface MongoDBCollectionListResult { + /* List of MongoDB collections and their properties. */ + readonly value: MongoDBCollectionGetResults[]; +} + +export interface TableListResult { + /* List of Table and their properties. */ + readonly value: TableGetResults[]; +} + +export interface CassandraKeyspaceListResult { + /* List of Cassandra keyspaces and their properties. */ + readonly value: CassandraKeyspaceGetResults[]; +} + +export interface CassandraTableListResult { + /* List of Cassandra tables and their properties. */ + readonly value: CassandraTableGetResults[]; +} + +export interface GremlinDatabaseListResult { + /* List of Gremlin databases and their properties. */ + readonly value: GremlinDatabaseGetResults[]; +} + +export interface GremlinGraphListResult { + /* List of graphs and their properties. */ + readonly value: GremlinGraphGetResults[]; +} + +export interface ErrorResponse { + /* Error code. */ + code: string; + /* Error message indicating why the operation failed. */ + message: string; +} + +export interface ErrorResponseUpdatedFormat { + /* undefined */ + error: unknown; +} + +export interface FailoverPolicies { + /* List of failover policies. */ + failoverPolicies: FailoverPolicy[]; +} + +export interface FailoverPolicy { + /* The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. */ + readonly id: string; + /* The name of the region in which the database account exists. */ + locationName: string; + /* The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. */ + failoverPriority: number; +} + +export interface RegionForOnlineOffline { + /* Cosmos DB region, with spaces between words and each word capitalized. */ + region: string; +} + +export interface Location { + /* The unique identifier of the region within the database account. Example: <accountName>-<locationName>. */ + readonly id: string; + /* The name of the region. */ + locationName: string; + /* The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ */ + readonly documentEndpoint: string; + /* undefined */ + provisioningState: ProvisioningState; + + /* The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. */ + failoverPriority: number; + /* Flag to indicate whether or not this region is an AvailabilityZone region */ + isZoneRedundant: boolean; +} + +export interface ARMResourceProperties { + /* The unique resource identifier of the ARM resource. */ + readonly id: string; + /* The name of the ARM resource. */ + readonly name: string; + /* The type of Azure resource. */ + readonly type: string; + /* The location of the resource group to which the resource belongs. */ + location: string; + /* undefined */ + tags: Tags; + + /* undefined */ + identity: ManagedServiceIdentity; +} + +export interface ARMProxyResource { + /* The unique resource identifier of the database account. */ + readonly id: string; + /* The name of the database account. */ + readonly name: string; + /* The type of Azure resource. */ + readonly type: string; +} + +export type DatabaseAccountGetResults = ARMResourceProperties & { + /* Indicates the type of database account. This can only be set at database account creation. */ + kind: string; + /* undefined */ + properties: DatabaseAccountGetProperties; + + /* The system meta data relating to this resource. */ + readonly systemData: unknown; +}; + +export interface ExtendedResourceProperties { + /* A system generated property. A unique identifier. */ + readonly _rid: string; + /* A system generated property that denotes the last updated timestamp of the resource. */ + readonly _ts: undefined; + /* A system generated property representing the resource etag required for optimistic concurrency control. */ + readonly _etag: string; +} + +export type ThroughputSettingsGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB resource throughput */ + properties: ThroughputSettingsGetProperties; +}; + +export interface ThroughputSettingsGetProperties { + /* undefined */ + resource: undefined; +} + +export type SqlDatabaseGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB SQL database */ + properties: SqlDatabaseGetProperties; +}; + +export interface SqlDatabaseGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type SqlContainerGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB container */ + properties: SqlContainerGetProperties; +}; + +export interface SqlContainerGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type SqlStoredProcedureGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB storedProcedure */ + properties: SqlStoredProcedureGetProperties; +}; + +export interface SqlStoredProcedureGetProperties { + /* undefined */ + resource: undefined; +} + +export type SqlUserDefinedFunctionGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB userDefinedFunction */ + properties: SqlUserDefinedFunctionGetProperties; +}; + +export interface SqlUserDefinedFunctionGetProperties { + /* undefined */ + resource: undefined; +} + +export type SqlTriggerGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB trigger */ + properties: SqlTriggerGetProperties; +}; + +export interface SqlTriggerGetProperties { + /* undefined */ + resource: undefined; +} + +export type MongoDBDatabaseGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB MongoDB database */ + properties: MongoDBDatabaseGetProperties; +}; + +export interface MongoDBDatabaseGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type MongoDBCollectionGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB MongoDB collection */ + properties: MongoDBCollectionGetProperties; +}; + +export interface MongoDBCollectionGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type TableGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB Table */ + properties: TableGetProperties; +}; + +export interface TableGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type CassandraKeyspaceGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB Cassandra keyspace */ + properties: CassandraKeyspaceGetProperties; +}; + +export interface CassandraKeyspaceGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type CassandraTableGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB Cassandra table */ + properties: CassandraTableGetProperties; +}; + +export interface CassandraTableGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type GremlinDatabaseGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB SQL database */ + properties: GremlinDatabaseGetProperties; +}; + +export interface GremlinDatabaseGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export type GremlinGraphGetResults = ARMResourceProperties & { + /* The properties of an Azure Cosmos DB Gremlin graph */ + properties: GremlinGraphGetProperties; +}; + +export interface GremlinGraphGetProperties { + /* undefined */ + resource: undefined; + /* undefined */ + options: undefined; +} + +export interface ConsistencyPolicy { + /* The default consistency level and configuration settings of the Cosmos DB account. */ + defaultConsistencyLevel: string; + /* When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. */ + maxStalenessPrefix: number; + /* When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. */ + maxIntervalInSeconds: number; +} + +export interface DatabaseAccountGetProperties { + /* undefined */ + provisioningState: ProvisioningState; + + /* The connection endpoint for the Cosmos DB database account. */ + readonly documentEndpoint: string; + /* The offer type for the Cosmos DB database account. Default value: Standard. */ + readonly databaseAccountOfferType: DatabaseAccountOfferType; + + /* List of IpRules. */ + ipRules: IPRules; + + /* Flag to indicate whether to enable/disable Virtual Network ACL rules. */ + isVirtualNetworkFilterEnabled: boolean; + /* Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. */ + enableAutomaticFailover: boolean; + /* The consistency policy for the Cosmos DB database account. */ + consistencyPolicy: ConsistencyPolicy; + + /* List of Cosmos DB capabilities for the account */ + capabilities: Capability[]; + + /* An array that contains the write location for the Cosmos DB account. */ + readonly writeLocations: Location[]; + + /* An array that contains of the read locations enabled for the Cosmos DB account. */ + readonly readLocations: Location[]; + + /* An array that contains all of the locations enabled for the Cosmos DB account. */ + readonly locations: Location[]; + + /* An array that contains the regions ordered by their failover priorities. */ + readonly failoverPolicies: FailoverPolicy[]; + + /* List of Virtual Network ACL rules configured for the Cosmos DB account. */ + virtualNetworkRules: VirtualNetworkRule[]; + + /* List of Private Endpoint Connections configured for the Cosmos DB account. */ + readonly privateEndpointConnections: PrivateEndpointConnection[]; + + /* Enables the account to write in multiple locations */ + enableMultipleWriteLocations: boolean; + /* Enables the cassandra connector on the Cosmos DB C* account */ + enableCassandraConnector: boolean; + /* The cassandra connector offer type for the Cosmos DB database C* account. */ + connectorOffer: ConnectorOffer; + + /* Disable write operations on metadata resources (databases, containers, throughput) via account keys */ + disableKeyBasedMetadataWriteAccess: boolean; + /* The URI of the key vault */ + keyVaultKeyUri: string; + /* Whether requests from Public Network are allowed */ + publicNetworkAccess: PublicNetworkAccess; + + /* Flag to indicate whether Free Tier is enabled. */ + enableFreeTier: boolean; + /* API specific properties. */ + apiProperties: ApiProperties; + + /* Flag to indicate whether to enable storage analytics. */ + enableAnalyticalStorage: boolean; + /* A unique identifier assigned to the database account */ + readonly instanceId: string; + /* Enum to indicate the mode of account creation. */ + createMode: CreateMode; + + /* Parameters to indicate the information about the restore. */ + restoreParameters: RestoreParameters; + + /* The object representing the policy for taking backups on an account. */ + backupPolicy: BackupPolicy; +} + +export interface DatabaseAccountCreateUpdateProperties { + /* The consistency policy for the Cosmos DB account. */ + consistencyPolicy: ConsistencyPolicy; + + /* An array that contains the georeplication locations enabled for the Cosmos DB account. */ + locations: Location[]; + + /* The offer type for the database */ + databaseAccountOfferType: DatabaseAccountOfferType; + + /* List of IpRules. */ + ipRules: IPRules; + + /* Flag to indicate whether to enable/disable Virtual Network ACL rules. */ + isVirtualNetworkFilterEnabled: boolean; + /* Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. */ + enableAutomaticFailover: boolean; + /* List of Cosmos DB capabilities for the account */ + capabilities: Capability[]; + + /* List of Virtual Network ACL rules configured for the Cosmos DB account. */ + virtualNetworkRules: VirtualNetworkRule[]; + + /* Enables the account to write in multiple locations */ + enableMultipleWriteLocations: boolean; + /* Enables the cassandra connector on the Cosmos DB C* account */ + enableCassandraConnector: boolean; + /* The cassandra connector offer type for the Cosmos DB database C* account. */ + connectorOffer: ConnectorOffer; + + /* Disable write operations on metadata resources (databases, containers, throughput) via account keys */ + disableKeyBasedMetadataWriteAccess: boolean; + /* The URI of the key vault */ + keyVaultKeyUri: string; + /* Whether requests from Public Network are allowed */ + publicNetworkAccess: PublicNetworkAccess; + + /* Flag to indicate whether Free Tier is enabled. */ + enableFreeTier: boolean; + /* API specific properties. Currently, supported only for MongoDB API. */ + apiProperties: ApiProperties; + + /* Flag to indicate whether to enable storage analytics. */ + enableAnalyticalStorage: boolean; + /* Enum to indicate the mode of account creation. */ + createMode: CreateMode; + + /* The object representing the policy for taking backups on an account. */ + backupPolicy: BackupPolicy; +} + +export type RestoreReqeustDatabaseAccountCreateUpdateProperties = DatabaseAccountCreateUpdateProperties & { + /* Parameters to indicate the information about the restore. */ + restoreParameters: RestoreParameters; +}; + +export type DatabaseAccountCreateUpdateParameters = ARMResourceProperties & { + /* Indicates the type of database account. This can only be set at database account creation. */ + kind: string; + /* undefined */ + properties: DatabaseAccountCreateUpdateProperties; +}; + +export interface DatabaseAccountUpdateProperties { + /* The consistency policy for the Cosmos DB account. */ + consistencyPolicy: ConsistencyPolicy; + + /* An array that contains the georeplication locations enabled for the Cosmos DB account. */ + locations: Location[]; + + /* List of IpRules. */ + ipRules: IPRules; + + /* Flag to indicate whether to enable/disable Virtual Network ACL rules. */ + isVirtualNetworkFilterEnabled: boolean; + /* Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. */ + enableAutomaticFailover: boolean; + /* List of Cosmos DB capabilities for the account */ + capabilities: Capability[]; + + /* List of Virtual Network ACL rules configured for the Cosmos DB account. */ + virtualNetworkRules: VirtualNetworkRule[]; + + /* Enables the account to write in multiple locations */ + enableMultipleWriteLocations: boolean; + /* Enables the cassandra connector on the Cosmos DB C* account */ + enableCassandraConnector: boolean; + /* The cassandra connector offer type for the Cosmos DB database C* account. */ + connectorOffer: ConnectorOffer; + + /* Disable write operations on metadata resources (databases, containers, throughput) via account keys */ + disableKeyBasedMetadataWriteAccess: boolean; + /* The URI of the key vault */ + keyVaultKeyUri: string; + /* Whether requests from Public Network are allowed */ + publicNetworkAccess: PublicNetworkAccess; + + /* Flag to indicate whether Free Tier is enabled. */ + enableFreeTier: boolean; + /* API specific properties. Currently, supported only for MongoDB API. */ + apiProperties: ApiProperties; + + /* Flag to indicate whether to enable storage analytics. */ + enableAnalyticalStorage: boolean; + /* The object representing the policy for taking backups on an account. */ + backupPolicy: BackupPolicy; +} + +export interface DatabaseAccountUpdateParameters { + /* undefined */ + tags: Tags; + + /* The location of the resource group to which the resource belongs. */ + location: string; + /* undefined */ + properties: DatabaseAccountUpdateProperties; +} + +export interface DatabaseAccountListReadOnlyKeysResult { + /* Base 64 encoded value of the primary read-only key. */ + readonly primaryReadonlyMasterKey: string; + /* Base 64 encoded value of the secondary read-only key. */ + readonly secondaryReadonlyMasterKey: string; +} + +export type DatabaseAccountListKeysResult = DatabaseAccountListReadOnlyKeysResult & { + /* Base 64 encoded value of the primary read-write key. */ + readonly primaryMasterKey: string; + /* Base 64 encoded value of the secondary read-write key. */ + readonly secondaryMasterKey: string; +}; + +export interface DatabaseAccountConnectionString { + /* Value of the connection string */ + readonly connectionString: string; + /* Description of the connection string */ + readonly description: string; +} + +export interface DatabaseAccountListConnectionStringsResult { + /* An array that contains the connection strings for the Cosmos DB account. */ + connectionStrings: DatabaseAccountConnectionString[]; +} + +export interface DatabaseAccountRegenerateKeyParameters { + /* The access key to regenerate. */ + keyKind: string; +} + +/* The offer type for the Cosmos DB database account. */ +type DatabaseAccountOfferType = "Standard"; +export type ThroughputSettingsUpdateParameters = ARMResourceProperties & { + /* Properties to update Azure Cosmos DB resource throughput. */ + properties: ThroughputSettingsUpdateProperties; +}; + +export interface ThroughputSettingsUpdateProperties { + /* The standard JSON format of a resource throughput */ + resource: ThroughputSettingsResource; +} + +export type SqlDatabaseCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB SQL database. */ + properties: SqlDatabaseCreateUpdateProperties; +}; + +export interface SqlDatabaseCreateUpdateProperties { + /* The standard JSON format of a SQL database */ + resource: SqlDatabaseResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type SqlContainerCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB container. */ + properties: SqlContainerCreateUpdateProperties; +}; + +export interface SqlContainerCreateUpdateProperties { + /* The standard JSON format of a container */ + resource: SqlContainerResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type SqlStoredProcedureCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB storedProcedure. */ + properties: SqlStoredProcedureCreateUpdateProperties; +}; + +export interface SqlStoredProcedureCreateUpdateProperties { + /* The standard JSON format of a storedProcedure */ + resource: SqlStoredProcedureResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type SqlUserDefinedFunctionCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB userDefinedFunction. */ + properties: SqlUserDefinedFunctionCreateUpdateProperties; +}; + +export interface SqlUserDefinedFunctionCreateUpdateProperties { + /* The standard JSON format of a userDefinedFunction */ + resource: SqlUserDefinedFunctionResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type SqlTriggerCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB trigger. */ + properties: SqlTriggerCreateUpdateProperties; +}; + +export interface SqlTriggerCreateUpdateProperties { + /* The standard JSON format of a trigger */ + resource: SqlTriggerResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type MongoDBDatabaseCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB MongoDB database. */ + properties: MongoDBDatabaseCreateUpdateProperties; +}; + +export interface MongoDBDatabaseCreateUpdateProperties { + /* The standard JSON format of a MongoDB database */ + resource: MongoDBDatabaseResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type MongoDBCollectionCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB MongoDB collection. */ + properties: MongoDBCollectionCreateUpdateProperties; +}; + +export interface MongoDBCollectionCreateUpdateProperties { + /* The standard JSON format of a MongoDB collection */ + resource: MongoDBCollectionResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type TableCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB Table. */ + properties: TableCreateUpdateProperties; +}; + +export interface TableCreateUpdateProperties { + /* The standard JSON format of a Table */ + resource: TableResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type CassandraKeyspaceCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB Cassandra keyspace. */ + properties: CassandraKeyspaceCreateUpdateProperties; +}; + +export interface CassandraKeyspaceCreateUpdateProperties { + /* The standard JSON format of a Cassandra keyspace */ + resource: CassandraKeyspaceResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type CassandraTableCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB Cassandra table. */ + properties: CassandraTableCreateUpdateProperties; +}; + +export interface CassandraTableCreateUpdateProperties { + /* The standard JSON format of a Cassandra table */ + resource: CassandraTableResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type GremlinDatabaseCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB Gremlin database. */ + properties: GremlinDatabaseCreateUpdateProperties; +}; + +export interface GremlinDatabaseCreateUpdateProperties { + /* The standard JSON format of a Gremlin database */ + resource: GremlinDatabaseResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export type GremlinGraphCreateUpdateParameters = ARMResourceProperties & { + /* Properties to create and update Azure Cosmos DB Gremlin graph. */ + properties: GremlinGraphCreateUpdateProperties; +}; + +export interface GremlinGraphCreateUpdateProperties { + /* The standard JSON format of a Gremlin graph */ + resource: GremlinGraphResource; + + /* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */ + options: CreateUpdateOptions; +} + +export interface ThroughputSettingsResource { + /* Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. */ + throughput: number; + /* Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. */ + autoscaleSettings: AutoscaleSettingsResource; + + /* The minimum throughput of the resource */ + readonly minimumThroughput: string; + /* The throughput replace is pending */ + readonly offerReplacePending: string; +} + +export interface AutoscaleSettingsResource { + /* Represents maximum throughput container can scale up to. */ + maxThroughput: number; + /* Cosmos DB resource auto-upgrade policy */ + autoUpgradePolicy: AutoUpgradePolicyResource; + + /* Represents target maximum throughput container can scale up to once offer is no longer in pending state. */ + readonly targetMaxThroughput: number; +} + +export interface AutoUpgradePolicyResource { + /* Represents throughput policy which service must adhere to for auto-upgrade */ + throughputPolicy: ThroughputPolicyResource; +} + +export interface ThroughputPolicyResource { + /* Determines whether the ThroughputPolicy is active or not */ + isEnabled: boolean; + /* Represents the percentage by which throughput can increase every time throughput policy kicks in. */ + incrementPercent: number; +} + +export interface OptionsResource { + /* Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. */ + throughput: number; + /* Specifies the Autoscale settings. */ + autoscaleSettings: AutoscaleSettings; +} + +export interface SqlDatabaseResource { + /* Name of the Cosmos DB SQL database */ + id: string; +} + +export interface SqlContainerResource { + /* Name of the Cosmos DB SQL container */ + id: string; + /* The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container */ + indexingPolicy: IndexingPolicy; + + /* The configuration of the partition key to be used for partitioning data into multiple partitions */ + partitionKey: ContainerPartitionKey; + + /* Default time to live */ + defaultTtl: number; + /* The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. */ + uniqueKeyPolicy: UniqueKeyPolicy; + + /* The conflict resolution policy for the container. */ + conflictResolutionPolicy: ConflictResolutionPolicy; +} + +export interface IndexingPolicy { + /* Indicates if the indexing policy is automatic */ + automatic: boolean; + /* Indicates the indexing mode. */ + indexingMode: string; + /* List of paths to include in the indexing */ + includedPaths: IncludedPath[]; + + /* List of paths to exclude from indexing */ + excludedPaths: ExcludedPath[]; + + /* List of composite path list */ + compositeIndexes: CompositePathList[]; + + /* List of spatial specifics */ + spatialIndexes: SpatialSpec[]; +} + +export interface ExcludedPath { + /* The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) */ + path: string; +} + +export interface IncludedPath { + /* The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) */ + path: string; + /* List of indexes for this path */ + indexes: Indexes[]; +} + +export interface Indexes { + /* The datatype for which the indexing behavior is applied to. */ + dataType: string; + /* The precision of the index. -1 is maximum precision. */ + precision: number; + /* Indicates the type of index. */ + kind: string; +} + +/* List of composite path */ +type CompositePathList = CompositePath[]; +export interface CompositePath { + /* The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) */ + path: string; + /* Sort order for composite paths. */ + order: string; +} + +export interface SpatialSpec { + /* The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) */ + path: string; + /* List of path's spatial type */ + types: SpatialType[]; +} + +/* Indicates the spatial type of index. */ +type SpatialType = "Point" | "LineString" | "Polygon" | "MultiPolygon"; +export interface ContainerPartitionKey { + /* List of paths using which data within the container can be partitioned */ + paths: Path[]; + + /* Indicates the kind of algorithm used for partitioning */ + kind: string; + /* Indicates the version of the partition key definition */ + version: number; +} + +/* A path. These typically start with root (/path) */ +type Path = string; +export interface UniqueKeyPolicy { + /* List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. */ + uniqueKeys: UniqueKey[]; +} + +export interface UniqueKey { + /* List of paths must be unique for each document in the Azure Cosmos DB service */ + paths: Path[]; +} + +export interface ConflictResolutionPolicy { + /* Indicates the conflict resolution mode. */ + mode: string; + /* The conflict resolution path in the case of LastWriterWins mode. */ + conflictResolutionPath: string; + /* The procedure to resolve conflicts in the case of custom mode. */ + conflictResolutionProcedure: string; +} + +export interface SqlStoredProcedureResource { + /* Name of the Cosmos DB SQL storedProcedure */ + id: string; + /* Body of the Stored Procedure */ + body: string; +} + +export interface SqlUserDefinedFunctionResource { + /* Name of the Cosmos DB SQL userDefinedFunction */ + id: string; + /* Body of the User Defined Function */ + body: string; +} + +export interface SqlTriggerResource { + /* Name of the Cosmos DB SQL trigger */ + id: string; + /* Body of the Trigger */ + body: string; + /* Type of the Trigger */ + triggerType: string; + /* The operation the trigger is associated with */ + triggerOperation: string; +} + +export interface MongoDBDatabaseResource { + /* Name of the Cosmos DB MongoDB database */ + id: string; +} + +export interface MongoDBCollectionResource { + /* Name of the Cosmos DB MongoDB collection */ + id: string; + /* A key-value pair of shard keys to be applied for the request. */ + shardKey: ShardKeys; + + /* List of index keys */ + indexes: MongoIndex[]; + + /* Analytical TTL. */ + analyticalStorageTtl: number; +} + +/* The shard key and partition kind pair, only support "Hash" partition kind */ +type ShardKeys = { [key: string]: string }; +export interface MongoIndex { + /* Cosmos DB MongoDB collection index keys */ + key: MongoIndexKeys; + + /* Cosmos DB MongoDB collection index key options */ + options: MongoIndexOptions; +} + +export interface MongoIndexKeys { + /* List of keys for each MongoDB collection in the Azure Cosmos DB service */ + keys: Key[]; +} + +/* A Key. */ +type Key = string; +export interface MongoIndexOptions { + /* Expire after seconds */ + expireAfterSeconds: number; + /* Is unique or not */ + unique: boolean; +} + +export interface TableResource { + /* Name of the Cosmos DB table */ + id: string; +} + +export interface CassandraKeyspaceResource { + /* Name of the Cosmos DB Cassandra keyspace */ + id: string; +} + +export interface CassandraTableResource { + /* Name of the Cosmos DB Cassandra table */ + id: string; + /* Time to live of the Cosmos DB Cassandra table */ + defaultTtl: number; + /* Schema of the Cosmos DB Cassandra table */ + schema: CassandraSchema; + + /* Analytical TTL. */ + analyticalStorageTtl: number; +} + +export interface CassandraSchema { + /* List of Cassandra table columns. */ + columns: Column[]; + + /* List of partition key. */ + partitionKeys: CassandraPartitionKey[]; + + /* List of cluster key. */ + clusterKeys: ClusterKey[]; +} + +export interface Column { + /* Name of the Cosmos DB Cassandra table column */ + name: string; + /* Type of the Cosmos DB Cassandra table column */ + type: string; +} + +export interface CassandraPartitionKey { + /* Name of the Cosmos DB Cassandra table partition key */ + name: string; +} + +export interface ClusterKey { + /* Name of the Cosmos DB Cassandra table cluster key */ + name: string; + /* Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" */ + orderBy: string; +} + +export interface GremlinDatabaseResource { + /* Name of the Cosmos DB Gremlin database */ + id: string; +} + +export interface GremlinGraphResource { + /* Name of the Cosmos DB Gremlin graph */ + id: string; + /* The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph */ + indexingPolicy: IndexingPolicy; + + /* The configuration of the partition key to be used for partitioning data into multiple partitions */ + partitionKey: ContainerPartitionKey; + + /* Default time to live */ + defaultTtl: number; + /* The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. */ + uniqueKeyPolicy: UniqueKeyPolicy; + + /* The conflict resolution policy for the graph. */ + conflictResolutionPolicy: ConflictResolutionPolicy; +} + +export interface CreateUpdateOptions { + /* Request Units per second. For example, "throughput": 10000. */ + throughput: number; + /* Specifies the Autoscale settings. */ + autoscaleSettings: AutoscaleSettings; +} + +export interface AutoscaleSettings { + /* Represents maximum throughput, the resource can scale up to. */ + maxThroughput: number; +} + +export interface Capability { + /* Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". */ + name: string; +} + +/* Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". */ +type Tags = { [key: string]: string }; +export interface ManagedServiceIdentity { + /* The principal id of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly principalId: string; + /* The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId: string; + /* The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. */ + type: string; +} + +/* The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed. */ +type ProvisioningState = string; + +/* Array of IpAddressOrRange objects. */ +type IPRules = IpAddressOrRange[]; +export interface IpAddressOrRange { + /* A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”. */ + ipAddressOrRange: string; +} + +export interface VirtualNetworkRule { + /* Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. */ + id: string; + /* Create firewall rule before the virtual network has vnet service endpoint enabled. */ + ignoreMissingVNetServiceEndpoint: boolean; +} + +export type PrivateEndpointConnection = unknown & { + /* Resource properties. */ + properties: PrivateEndpointConnectionProperties; +}; + +export interface PrivateEndpointConnectionProperties { + /* Private endpoint which the connection belongs to. */ + privateEndpoint: PrivateEndpointProperty; + + /* Connection State of the Private Endpoint Connection. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionStateProperty; +} + +export interface PrivateEndpointProperty { + /* Resource id of the private endpoint. */ + id: string; +} + +export interface PrivateLinkServiceConnectionStateProperty { + /* The private link service connection status. */ + status: string; + /* Any action that is required beyond basic workflow (approve/ reject/ disconnect) */ + readonly actionsRequired: string; +} + +export interface Operation { + /* Operation name: {provider}/{resource}/{operation} */ + name: string; + /* The object that represents the operation. */ + display: undefined; +} + +export interface OperationListResult { + /* List of operations supported by the Resource Provider. */ + value: Operation[]; + + /* URL to get the next set of operation list results if there are any. */ + nextLink: string; +} + +export interface UsagesResult { + /* The list of usages for the database. A usage is a point in time metric */ + readonly value: Usage[]; +} + +export interface Usage { + /* The unit of the metric. */ + unit: UnitType; + + /* The name information for the metric. */ + readonly name: MetricName; + + /* The quota period used to summarize the usage values. */ + readonly quotaPeriod: string; + /* Maximum value for this metric */ + readonly limit: number; + /* Current value for this metric */ + readonly currentValue: number; +} + +export interface PartitionUsagesResult { + /* The list of partition-level usages for the database. A usage is a point in time metric */ + readonly value: PartitionUsage[]; +} + +export type PartitionUsage = Usage & { + /* The partition id (GUID identifier) of the usages. */ + readonly partitionId: string; + /* The partition key range id (integer identifier) of the usages. */ + readonly partitionKeyRangeId: string; +}; + +export interface MetricDefinitionsListResult { + /* The list of metric definitions for the account. */ + readonly value: MetricDefinition[]; +} + +export interface MetricDefinition { + /* The list of metric availabilities for the account. */ + readonly metricAvailabilities: MetricAvailability[]; + + /* The primary aggregation type of the metric. */ + readonly primaryAggregationType: string; + /* The unit of the metric. */ + unit: UnitType; + + /* The resource uri of the database. */ + readonly resourceUri: string; + /* The name information for the metric. */ + readonly name: MetricName; +} + +export interface MetricAvailability { + /* The time grain to be used to summarize the metric values. */ + readonly timeGrain: string; + /* The retention for the metric values. */ + readonly retention: string; +} + +export interface MetricListResult { + /* The list of metrics for the account. */ + readonly value: Metric[]; +} + +export interface Metric { + /* The start time for the metric (ISO-8601 format). */ + readonly startTime: string; + /* The end time for the metric (ISO-8601 format). */ + readonly endTime: string; + /* The time grain to be used to summarize the metric values. */ + readonly timeGrain: string; + /* The unit of the metric. */ + unit: UnitType; + + /* The name information for the metric. */ + readonly name: MetricName; + + /* The metric values for the specified time window and timestep. */ + readonly metricValues: MetricValue[]; +} + +export interface MetricName { + /* The name of the metric. */ + readonly value: string; + /* The friendly name of the metric. */ + readonly localizedValue: string; +} + +export interface MetricValue { + /* The number of values for the metric. */ + readonly _count: number; + /* The average value of the metric. */ + readonly average: number; + /* The max value of the metric. */ + readonly maximum: number; + /* The min value of the metric. */ + readonly minimum: number; + /* The metric timestamp (ISO-8601 format). */ + readonly timestamp: string; + /* The total value of the metric. */ + readonly total: number; +} + +export interface PercentileMetricListResult { + /* The list of percentile metrics for the account. */ + readonly value: PercentileMetric[]; +} + +export interface PercentileMetric { + /* The start time for the metric (ISO-8601 format). */ + readonly startTime: string; + /* The end time for the metric (ISO-8601 format). */ + readonly endTime: string; + /* The time grain to be used to summarize the metric values. */ + readonly timeGrain: string; + /* The unit of the metric. */ + unit: UnitType; + + /* The name information for the metric. */ + readonly name: MetricName; + + /* The percentile metric values for the specified time window and timestep. */ + readonly metricValues: PercentileMetricValue[]; +} + +export type PercentileMetricValue = MetricValue & { + /* The 10th percentile value for the metric. */ + readonly P10: number; + /* The 25th percentile value for the metric. */ + readonly P25: number; + /* The 50th percentile value for the metric. */ + readonly P50: number; + /* The 75th percentile value for the metric. */ + readonly P75: number; + /* The 90th percentile value for the metric. */ + readonly P90: number; + /* The 95th percentile value for the metric. */ + readonly P95: number; + /* The 99th percentile value for the metric. */ + readonly P99: number; +}; + +export interface PartitionMetricListResult { + /* The list of partition-level metrics for the account. */ + readonly value: PartitionMetric[]; +} + +export type PartitionMetric = Metric & { + /* The partition id (GUID identifier) of the metric values. */ + readonly partitionId: string; + /* The partition key range id (integer identifier) of the metric values. */ + readonly partitionKeyRangeId: string; +}; + +/* The unit of the metric. */ +type UnitType = "Count" | "Bytes" | "Seconds" | "Percent" | "CountPerSecond" | "BytesPerSecond" | "Milliseconds"; + +/* The cassandra connector offer type for the Cosmos DB C* database account. */ +type ConnectorOffer = "Small"; + +/* Whether requests from Public Network are allowed */ +type PublicNetworkAccess = "Enabled" | "Disabled"; +export interface ApiProperties { + /* Describes the ServerVersion of an a MongoDB account. */ + serverVersion: string; +} + +/* Enum to indicate the mode of account creation. */ +type CreateMode = "Default" | "Restore"; +export interface RestoreParameters { + /* Describes the mode of the restore. */ + restoreMode: string; + /* Path of the source account from which the restore has to be initiated */ + restoreSource: string; + /* Time to which the account has to be restored (ISO-8601 format). */ + restoreTimestampInUtc: string; + /* List of specific databases to restore. */ + databasesToRestore: DatabaseRestoreResource[]; +} + +export interface DatabaseRestoreResource { + /* The name of the database to restore. */ + databaseName: string; + /* The names of the collections to restore. */ + collectionNames: CollectionName[]; +} + +/* The name of the collection. */ +type CollectionName = string; +export interface BackupPolicy { + /* Describes the mode of backups. */ + type: string; +} + +export type PeriodicModeBackupPolicy = BackupPolicy & { + /* Configuration values for periodic mode backup */ + periodicModeProperties: PeriodicModeProperties; +}; + +/* The object representing continuous mode backup policy. */ +type ContinuousModeBackupPolicy = BackupPolicy; +export interface PeriodicModeProperties { + /* An integer representing the interval in minutes between two backups */ + backupIntervalInMinutes: number; + /* An integer representing the time (in hours) that each backup is retained */ + backupRetentionIntervalInHours: number; +} + +export interface RestorableDatabaseAccountsListResult { + /* List of restorable database accounts and their properties. */ + readonly value: RestorableDatabaseAccountGetResult[]; +} + +export type RestorableDatabaseAccountGetResult = ARMResourceProperties & { + /* The properties of a restorable database account. */ + properties: RestorableDatabaseAccountProperties; +}; + +export interface RestorableDatabaseAccountProperties { + /* The name of the global database account */ + accountName: string; + /* The creation time of the restorable database account (ISO-8601 format). */ + creationTime: string; + /* The time at which the restorable database account has been deleted (ISO-8601 format). */ + deletionTime: string; +} + +/* Retrieves the properties of an existing Azure Cosmos DB database account. */ +export async function DatabaseAccounts_Get( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Updates the properties of an existing Azure Cosmos DB database account. */ +export async function DatabaseAccounts_Update( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + body: DatabaseAccountUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`, + { method: "patch", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates on an account. */ +export async function DatabaseAccounts_CreateOrUpdate( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + body: DatabaseAccountCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB database account. */ +export async function DatabaseAccounts_Delete( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. */ +export async function DatabaseAccounts_FailoverPriorityChange( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + body: FailoverPolicies +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/failoverPriorityChange`, + { method: "post", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists all the Azure Cosmos DB database accounts available under the subscription. */ +export async function DatabaseAccounts_List(subscriptionId: string): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Lists all the Azure Cosmos DB database accounts available under the given resource group. */ +export async function DatabaseAccounts_ListByResourceGroup( + subscriptionId: string, + resourceGroupName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Lists the access keys for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_ListKeys( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/listKeys`, + { method: "post" } + ) + .then(response => response.json()); +} + +/* Lists the connection strings for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_ListConnectionStrings( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/listConnectionStrings`, + { method: "post" } + ) + .then(response => response.json()); +} + +/* Offline the specified region for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_OfflineRegion( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + body: RegionForOnlineOffline +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/offlineRegion`, + { method: "post", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Online the specified region for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_OnlineRegion( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + body: RegionForOnlineOffline +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/onlineRegion`, + { method: "post", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the read-only access keys for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_GetReadOnlyKeys( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/readonlykeys`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Lists the read-only access keys for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_ListReadOnlyKeys( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/readonlykeys`, + { method: "post" } + ) + .then(response => response.json()); +} + +/* Regenerates an access key for the specified Azure Cosmos DB database account. */ +export async function DatabaseAccounts_RegenerateKey( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + body: DatabaseAccountRegenerateKeyParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/regenerateKey`, + { method: "post", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. */ +export async function DatabaseAccounts_CheckNameExists(accountName: string): Promise { + return window + .fetch(`https://management.azure.com/providers/Microsoft.DocumentDB/databaseAccountNames/${accountName}`, { + method: "head" + }) + .then(response => response.json()); +} + +/* Lists all of the available Cosmos DB Resource Provider operations. */ +export async function Operations_List(): Promise { + return window + .fetch(`https://management.azure.com/providers/Microsoft.DocumentDB/operations`, { method: "get" }) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given database account. */ +export async function DatabaseAccounts_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given database account and database. */ +export async function Database_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given database account and collection. */ +export async function Collection_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given database account, collection and region. */ +export async function CollectionRegion_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + region: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/databases/${databaseRid}/collections/${collectionRid}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given database account and region. */ +export async function DatabaseAccountRegion_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + region: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data */ +export async function PercentileSourceTarget_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + sourceRegion: string, + targetRegion: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sourceRegion/${sourceRegion}/targetRegion/${targetRegion}/percentile/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data */ +export async function PercentileTarget_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + targetRegion: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/targetRegion/${targetRegion}/percentile/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data */ +export async function Percentile_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/percentile/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given collection and region, split by partition. */ +export async function CollectionPartitionRegion_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + region: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/databases/${databaseRid}/collections/${collectionRid}/partitions/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given collection, split by partition. */ +export async function CollectionPartition_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/partitions/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given partition key range id. */ +export async function PartitionKeyRangeId_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string, + collectionRid: string, + partitionKeyRangeId: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/partitionKeyRangeId/${partitionKeyRangeId}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the metrics determined by the given filter for the given partition key range id and region. */ +export async function PartitionKeyRangeIdRegion_ListMetrics( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + region: string, + databaseRid: string, + collectionRid: string, + partitionKeyRangeId: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/region/${region}/databases/${databaseRid}/collections/${collectionRid}/partitionKeyRangeId/${partitionKeyRangeId}/metrics`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the usages (most recent data) for the given database account. */ +export async function DatabaseAccounts_ListUsages( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/usages`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the usages (most recent data) for the given database. */ +export async function Database_ListUsages( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/usages`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the usages (most recent storage data) for the given collection. */ +export async function Collection_ListUsages( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/usages`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the usages (most recent storage data) for the given collection, split by partition. */ +export async function CollectionPartition_ListUsages( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/partitions/usages`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves metric definitions for the given database. */ +export async function Database_ListMetricDefinitions( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/metricDefinitions`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves metric definitions for the given collection. */ +export async function Collection_ListMetricDefinitions( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseRid: string, + collectionRid: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/databases/${databaseRid}/collections/${collectionRid}/metricDefinitions`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves metric definitions for the given database account. */ +export async function DatabaseAccounts_ListMetricDefinitions( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/metricDefinitions`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Lists the SQL databases under an existing Azure Cosmos DB database account. */ +export async function SqlResources_ListSqlDatabases( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. */ +export async function SqlResources_GetSqlDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB SQL database */ +export async function SqlResources_CreateUpdateSqlDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + body: SqlDatabaseCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB SQL database. */ +export async function SqlResources_DeleteSqlDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. */ +export async function SqlResources_GetSqlDatabaseThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB SQL database */ +export async function SqlResources_UpdateSqlDatabaseThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the SQL container under an existing Azure Cosmos DB database account. */ +export async function SqlResources_ListSqlContainers( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the SQL container under an existing Azure Cosmos DB database account. */ +export async function SqlResources_GetSqlContainer( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB SQL container */ +export async function SqlResources_CreateUpdateSqlContainer( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + body: SqlContainerCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB SQL container. */ +export async function SqlResources_DeleteSqlContainer( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. */ +export async function SqlResources_GetSqlContainerThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB SQL container */ +export async function SqlResources_UpdateSqlContainerThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. */ +export async function SqlResources_ListSqlStoredProcedures( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. */ +export async function SqlResources_GetSqlStoredProcedure( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + storedProcedureName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures/${storedProcedureName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB SQL storedProcedure */ +export async function SqlResources_CreateUpdateSqlStoredProcedure( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + storedProcedureName: string, + body: SqlStoredProcedureCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures/${storedProcedureName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB SQL storedProcedure. */ +export async function SqlResources_DeleteSqlStoredProcedure( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + storedProcedureName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/storedProcedures/${storedProcedureName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. */ +export async function SqlResources_ListSqlUserDefinedFunctions( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. */ +export async function SqlResources_GetSqlUserDefinedFunction( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + userDefinedFunctionName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions/${userDefinedFunctionName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB SQL userDefinedFunction */ +export async function SqlResources_CreateUpdateSqlUserDefinedFunction( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + userDefinedFunctionName: string, + body: SqlUserDefinedFunctionCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions/${userDefinedFunctionName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB SQL userDefinedFunction. */ +export async function SqlResources_DeleteSqlUserDefinedFunction( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + userDefinedFunctionName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/userDefinedFunctions/${userDefinedFunctionName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Lists the SQL trigger under an existing Azure Cosmos DB database account. */ +export async function SqlResources_ListSqlTriggers( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the SQL trigger under an existing Azure Cosmos DB database account. */ +export async function SqlResources_GetSqlTrigger( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + triggerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers/${triggerName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB SQL trigger */ +export async function SqlResources_CreateUpdateSqlTrigger( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + triggerName: string, + body: SqlTriggerCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers/${triggerName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB SQL trigger. */ +export async function SqlResources_DeleteSqlTrigger( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + triggerName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/triggers/${triggerName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Lists the MongoDB databases under an existing Azure Cosmos DB database account. */ +export async function MongoDBResources_ListMongoDBDatabases( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. */ +export async function MongoDBResources_GetMongoDBDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or updates Azure Cosmos DB MongoDB database */ +export async function MongoDBResources_CreateUpdateMongoDBDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + body: MongoDBDatabaseCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB MongoDB database. */ +export async function MongoDBResources_DeleteMongoDBDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. */ +export async function MongoDBResources_GetMongoDBDatabaseThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of the an Azure Cosmos DB MongoDB database */ +export async function MongoDBResources_UpdateMongoDBDatabaseThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the MongoDB collection under an existing Azure Cosmos DB database account. */ +export async function MongoDBResources_ListMongoDBCollections( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the MongoDB collection under an existing Azure Cosmos DB database account. */ +export async function MongoDBResources_GetMongoDBCollection( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB MongoDB Collection */ +export async function MongoDBResources_CreateUpdateMongoDBCollection( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + body: MongoDBCollectionCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB MongoDB Collection. */ +export async function MongoDBResources_DeleteMongoDBCollection( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. */ +export async function MongoDBResources_GetMongoDBCollectionThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update the RUs per second of an Azure Cosmos DB MongoDB collection */ +export async function MongoDBResources_UpdateMongoDBCollectionThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the Tables under an existing Azure Cosmos DB database account. */ +export async function TableResources_ListTables( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the Tables under an existing Azure Cosmos DB database account with the provided name. */ +export async function TableResources_GetTable( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + tableName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB Table */ +export async function TableResources_CreateUpdateTable( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + tableName: string, + body: TableCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB Table. */ +export async function TableResources_DeleteTable( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + tableName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. */ +export async function TableResources_GetTableThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + tableName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB Table */ +export async function TableResources_UpdateTableThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + tableName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */ +export async function CassandraResources_ListCassandraKeyspaces( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. */ +export async function CassandraResources_GetCassandraKeyspace( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB Cassandra keyspace */ +export async function CassandraResources_CreateUpdateCassandraKeyspace( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + body: CassandraKeyspaceCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB Cassandra keyspace. */ +export async function CassandraResources_DeleteCassandraKeyspace( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. */ +export async function CassandraResources_GetCassandraKeyspaceThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace */ +export async function CassandraResources_UpdateCassandraKeyspaceThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the Cassandra table under an existing Azure Cosmos DB database account. */ +export async function CassandraResources_ListCassandraTables( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the Cassandra table under an existing Azure Cosmos DB database account. */ +export async function CassandraResources_GetCassandraTable( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + tableName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB Cassandra Table */ +export async function CassandraResources_CreateUpdateCassandraTable( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + tableName: string, + body: CassandraTableCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB Cassandra table. */ +export async function CassandraResources_DeleteCassandraTable( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + tableName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. */ +export async function CassandraResources_GetCassandraTableThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + tableName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB Cassandra table */ +export async function CassandraResources_UpdateCassandraTableThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + keyspaceName: string, + tableName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the Gremlin databases under an existing Azure Cosmos DB database account. */ +export async function GremlinResources_ListGremlinDatabases( + subscriptionId: string, + resourceGroupName: string, + accountName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. */ +export async function GremlinResources_GetGremlinDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB Gremlin database */ +export async function GremlinResources_CreateUpdateGremlinDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + body: GremlinDatabaseCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB Gremlin database. */ +export async function GremlinResources_DeleteGremlinDatabase( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. */ +export async function GremlinResources_GetGremlinDatabaseThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB Gremlin database */ +export async function GremlinResources_UpdateGremlinDatabaseThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists the Gremlin graph under an existing Azure Cosmos DB database account. */ +export async function GremlinResources_ListGremlinGraphs( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Gets the Gremlin graph under an existing Azure Cosmos DB database account. */ +export async function GremlinResources_GetGremlinGraph( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + graphName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Create or update an Azure Cosmos DB Gremlin graph */ +export async function GremlinResources_CreateUpdateGremlinGraph( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + graphName: string, + body: GremlinGraphCreateUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Deletes an existing Azure Cosmos DB Gremlin graph. */ +export async function GremlinResources_DeleteGremlinGraph( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + graphName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}`, + { method: "delete" } + ) + .then(response => response.json()); +} + +/* Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. */ +export async function GremlinResources_GetGremlinGraphThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + graphName: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Update RUs per second of an Azure Cosmos DB Gremlin graph */ +export async function GremlinResources_UpdateGremlinGraphThroughput( + subscriptionId: string, + resourceGroupName: string, + accountName: string, + databaseName: string, + graphName: string, + body: ThroughputSettingsUpdateParameters +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default`, + { method: "put", body: JSON.stringify(body) } + ) + .then(response => response.json()); +} + +/* Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. */ +export async function RestorableDatabaseAccounts_ListByLocation( + subscriptionId: string, + location: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/locations/${location}/restorableDatabaseAccounts`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Lists all the restorable Azure Cosmos DB database accounts available under the subscription. */ +export async function RestorableDatabaseAccounts_List( + subscriptionId: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts`, + { method: "get" } + ) + .then(response => response.json()); +} + +/* Retrieves the properties of an existing Azure Cosmos DB restorable database account. */ +export async function RestorableDatabaseAccounts_GetByLocation( + subscriptionId: string, + location: string, + instanceId: string +): Promise { + return window + .fetch( + `https://management.azure.com/subscriptions/${subscriptionId}/providers/Microsoft.DocumentDB/locations/${location}/restorableDatabaseAccounts/${instanceId}`, + { method: "get" } + ) + .then(response => response.json()); +} diff --git a/package.json b/package.json index 2ffbc3936..f385d4679 100644 --- a/package.json +++ b/package.json @@ -147,6 +147,7 @@ "less-vars-loader": "1.1.0", "mini-css-extract-plugin": "0.4.3", "monaco-editor-webpack-plugin": "1.7.0", + "node-fetch": "2.6.0", "prettier": "1.19.1", "puppeteer": "4.0.0", "raw-loader": "0.5.1", diff --git a/utils/armClientGenerator/generator.ts b/utils/armClientGenerator/generator.ts new file mode 100644 index 000000000..39f2163df --- /dev/null +++ b/utils/armClientGenerator/generator.ts @@ -0,0 +1,155 @@ +/// +const { writeFileSync } = require("fs"); +const schema = require("./schema.json"); + +const file: string[] = [""]; + +const propertyMap: { [key: string]: string } = { + integer: "number" +}; + +function refToType(path: string | undefined) { + // Handles refs pointing to other files. We don't support that yet. + if (path && path.startsWith("#")) { + return path.split("/").pop(); + } + return "unknown"; +} + +function bodyParam(parameter: any) { + if (!parameter) { + return ""; + } + return `,body: ${refToType(parameter.schema.$ref)}`; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function parametersFromPath(path: any) { + // TODO: Remove any. String.matchAll is a real thing. + const matches = path.matchAll(/{(\w+)}/g); + return Array.from(matches) + .map((match: string[]) => `${match[1]}: string`) + .join(",\n"); +} + +function responseType(operation: any) { + if (operation.responses) { + return Object.keys(operation.responses) + .map((responseCode: any) => { + if (!operation.responses[responseCode].schema) { + return "void"; + } + return refToType(operation.responses[responseCode].schema.$ref); + }) + .join(" | "); + } + return "unknown"; +} + +async function main() { + for (const interface in schema.definitions) { + const properties = schema.definitions[interface].properties; + if (properties) { + if (schema.definitions[interface].allOf) { + const baseTypes = schema.definitions[interface].allOf + .map((allof: { $ref: string }) => refToType(allof.$ref)) + .join(" & "); + file.push(`export type ${interface} = ${baseTypes} & {`); + } else { + file.push(`export interface ${interface} {`); + } + for (const prop in schema.definitions[interface].properties) { + const property = schema.definitions[interface].properties[prop]; + if (property) { + if (property.$ref) { + const type = refToType(property.$ref); + file.push(` + /* ${property.description} */ + ${property.readOnly ? "readonly " : ""}${prop}: ${type} + `); + } else if (property.type === "array") { + const type = refToType(property.items.$ref); + file.push(` + /* ${property.description} */ + ${property.readOnly ? "readonly " : ""}${prop}: ${type}[] + `); + } else if (property.type === "object") { + const type = refToType(property.$ref); + file.push(` + /* ${property.description} */ + ${property.readOnly ? "readonly " : ""}${prop}: ${type} + `); + } else { + file.push(` + /* ${property.description} */ + ${property.readOnly ? "readonly " : ""}${prop}: ${ + propertyMap[property.type] ? propertyMap[property.type] : property.type + }`); + } + } + } + file.push(`}`); + file.push("\n\n"); + } else { + const definition = schema.definitions[interface]; + if (definition.enum) { + file.push(` + /* ${definition.description} */ + type ${interface} = ${definition.enum.map((v: string) => `"${v}"`).join(" | ")}`); + file.push("\n"); + } else if (definition.type === "string") { + file.push(` + /* ${definition.description} */ + type ${interface} = string + `); + } else if (definition.type === "array") { + const type = refToType(definition.items.$ref); + file.push(` + /* ${definition.description} */ + type ${interface} = ${type}[] + `); + } else if (definition.type === "object" && definition.additionalProperties) { + file.push(` + /* ${definition.description} */ + type ${interface} = { [key: string]: ${definition.additionalProperties.type}} + `); + } else if (definition.type === "object" && definition.allOf) { + const type = refToType(definition.allOf[0].$ref); + file.push(` + /* ${definition.description} */ + type ${interface} = ${type} + `); + } else { + console.log("UNHANDLED MODEL:", interface, schema.definitions[interface]); + } + } + } + + for (const path in schema.paths) { + for (const method in schema.paths[path]) { + const operation = schema.paths[path][method]; + const bodyParameter = operation.parameters.find( + (parameter: any) => parameter.in === "body" && parameter.required === true + ); + console.log(bodyParameter); + file.push(` + /* ${operation.description} */ + export async function ${operation.operationId} ( + ${parametersFromPath(path)} + ${bodyParam(bodyParameter)} + ) : Promise<${responseType(operation)}> { + return window.fetch(\`https://management.azure.com${path.replace(/{/g, "${")}\`, { method: "${method}", ${ + bodyParameter ? "body: JSON.stringify(body)" : "" + } }).then((response) => response.json()) + } + `); + } + } + + writeFileSync("./models.ts", file.join("")); +} + +main().catch(e => { + console.error(e); + process.exit(1); +}); diff --git a/utils/armClientGenerator/schema.json b/utils/armClientGenerator/schema.json new file mode 100644 index 000000000..7883230b0 --- /dev/null +++ b/utils/armClientGenerator/schema.json @@ -0,0 +1,7731 @@ +{ + "swagger": "2.0", + "info": { + "title": "Cosmos DB", + "description": "Azure Cosmos DB Database Service Resource Provider REST API", + "version": "2020-06-01-preview" + }, + "host": "management.azure.com", + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], + "security": [ + { + "azure_auth": ["user_impersonation"] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "Impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}": { + "get": { + "operationId": "DatabaseAccounts_Get", + "x-ms-examples": { + "CosmosDBDatabaseAccountGet": { + "$ref": "./examples/CosmosDBDatabaseAccountGet.json" + } + }, + "description": "Retrieves the properties of an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The database account properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountGetResults" + } + } + } + }, + "patch": { + "operationId": "DatabaseAccounts_Update", + "x-ms-examples": { + "CosmosDBDatabaseAccountPatch": { + "$ref": "./examples/CosmosDBDatabaseAccountPatch.json" + } + }, + "description": "Updates the properties of an existing Azure Cosmos DB database account.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DatabaseAccountUpdateParameters" + }, + "description": "The parameters to provide for the current database account." + } + ], + "responses": { + "200": { + "description": "The database account update operation will complete asynchronously.", + "schema": { + "$ref": "#/definitions/DatabaseAccountGetResults" + } + } + } + }, + "put": { + "operationId": "DatabaseAccounts_CreateOrUpdate", + "x-ms-examples": { + "CosmosDBDatabaseAccountCreateMin": { + "$ref": "./examples/CosmosDBDatabaseAccountCreateMin.json" + }, + "CosmosDBDatabaseAccountCreateMax": { + "$ref": "./examples/CosmosDBDatabaseAccountCreateMax.json" + }, + "CosmosDBRestoreDatabaseAccountCreateUpdate.json": { + "$ref": "./examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json" + } + }, + "description": "Creates or updates an Azure Cosmos DB database account. The \"Update\" method is preferred when performing updates on an account.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DatabaseAccountCreateUpdateParameters" + }, + "description": "The parameters to provide for the current database account." + } + ], + "responses": { + "200": { + "description": "The database account create or update operation will complete asynchronously.", + "schema": { + "$ref": "#/definitions/DatabaseAccountGetResults" + } + } + } + }, + "delete": { + "operationId": "DatabaseAccounts_Delete", + "x-ms-examples": { + "CosmosDBDatabaseAccountDelete": { + "$ref": "./examples/CosmosDBDatabaseAccountDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB database account.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The database account delete operation will complete asynchronously." + }, + "204": { + "description": "The specified account does not exist in the subscription." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange": { + "post": { + "operationId": "DatabaseAccounts_FailoverPriorityChange", + "x-ms-examples": { + "CosmosDBDatabaseAccountFailoverPriorityChange": { + "$ref": "./examples/CosmosDBDatabaseAccountFailoverPriorityChange.json" + } + }, + "description": "Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "failoverParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FailoverPolicies" + }, + "description": "The new failover policies for the database account." + } + ], + "responses": { + "202": { + "description": "Accepted. The failover policy change operation will complete asynchronously." + }, + "204": { + "description": "No Content" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts": { + "get": { + "operationId": "DatabaseAccounts_List", + "x-ms-examples": { + "CosmosDBDatabaseAccountList": { + "$ref": "./examples/CosmosDBDatabaseAccountList.json" + } + }, + "description": "Lists all the Azure Cosmos DB database accounts available under the subscription.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountsListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts": { + "get": { + "operationId": "DatabaseAccounts_ListByResourceGroup", + "x-ms-examples": { + "CosmosDBDatabaseAccountListByResourceGroup": { + "$ref": "./examples/CosmosDBDatabaseAccountListByResourceGroup.json" + } + }, + "description": "Lists all the Azure Cosmos DB database accounts available under the given resource group.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountsListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys": { + "post": { + "operationId": "DatabaseAccounts_ListKeys", + "x-ms-examples": { + "CosmosDBDatabaseAccountListKeys": { + "$ref": "./examples/CosmosDBDatabaseAccountListKeys.json" + } + }, + "description": "Lists the access keys for the specified Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountListKeysResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings": { + "post": { + "operationId": "DatabaseAccounts_ListConnectionStrings", + "x-ms-examples": { + "CosmosDBDatabaseAccountListConnectionStrings": { + "$ref": "./examples/CosmosDBDatabaseAccountListConnectionStrings.json" + }, + "CosmosDBDatabaseAccountListConnectionStringsMongo": { + "$ref": "./examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json" + } + }, + "description": "Lists the connection strings for the specified Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountListConnectionStringsResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion": { + "post": { + "operationId": "DatabaseAccounts_OfflineRegion", + "x-ms-examples": { + "CosmosDBDatabaseAccountOfflineRegion": { + "$ref": "./examples/CosmosDBDatabaseAccountOfflineRegion.json" + } + }, + "description": "Offline the specified region for the specified Azure Cosmos DB database account.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "regionParameterForOffline", + "in": "body", + "required": true, + "description": "Cosmos DB region to offline for the database account.", + "schema": { + "$ref": "#/definitions/RegionForOnlineOffline" + } + } + ], + "responses": { + "200": { + "description": "The offline region operation is completed successfully." + }, + "202": { + "description": "Accepted. The offline region operation will complete asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion": { + "post": { + "operationId": "DatabaseAccounts_OnlineRegion", + "x-ms-examples": { + "CosmosDBDatabaseAccountOnlineRegion": { + "$ref": "./examples/CosmosDBDatabaseAccountOnlineRegion.json" + } + }, + "description": "Online the specified region for the specified Azure Cosmos DB database account.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "regionParameterForOnline", + "in": "body", + "required": true, + "description": "Cosmos DB region to online for the database account.", + "schema": { + "$ref": "#/definitions/RegionForOnlineOffline" + } + } + ], + "responses": { + "200": { + "description": "The online region operation is completed successfully." + }, + "202": { + "description": "Accepted. The online region operation will complete asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys": { + "get": { + "operationId": "DatabaseAccounts_GetReadOnlyKeys", + "x-ms-examples": { + "CosmosDBDatabaseAccountListReadOnlyKeys": { + "$ref": "./examples/CosmosDBDatabaseAccountListReadOnlyKeys.json" + } + }, + "description": "Lists the read-only access keys for the specified Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountListReadOnlyKeysResult" + } + } + } + }, + "post": { + "operationId": "DatabaseAccounts_ListReadOnlyKeys", + "x-ms-examples": { + "CosmosDBDatabaseAccountListReadOnlyKeys": { + "$ref": "./examples/CosmosDBDatabaseAccountListReadOnlyKeys.json" + } + }, + "description": "Lists the read-only access keys for the specified Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/DatabaseAccountListReadOnlyKeysResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey": { + "post": { + "operationId": "DatabaseAccounts_RegenerateKey", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegenerateKey": { + "$ref": "./examples/CosmosDBDatabaseAccountRegenerateKey.json" + } + }, + "description": "Regenerates an access key for the specified Azure Cosmos DB database account.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "keyToRegenerate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DatabaseAccountRegenerateKeyParameters" + }, + "description": "The name of the key to regenerate." + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted. The regenerate key operation will complete asynchronously." + } + } + } + }, + "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}": { + "head": { + "operationId": "DatabaseAccounts_CheckNameExists", + "x-ms-examples": { + "CosmosDBDatabaseAccountCheckNameExists": { + "$ref": "./examples/CosmosDBDatabaseAccountCheckNameExists.json" + } + }, + "description": "Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.", + "parameters": [ + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The account name is valid but is already in use." + }, + "404": { + "description": "Not Found. The account name is available and valid." + } + } + } + }, + "/providers/Microsoft.DocumentDB/operations": { + "get": { + "tags": ["Operations"], + "description": "Lists all of the available Cosmos DB Resource Provider operations.", + "operationId": "Operations_List", + "x-ms-examples": { + "CosmosDBOperationsList": { + "$ref": "./examples/CosmosDBOperationsList.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics": { + "get": { + "operationId": "DatabaseAccounts_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountGetMetrics": { + "$ref": "./examples/CosmosDBDatabaseAccountGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The metrics for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics": { + "get": { + "operationId": "Database_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseGetMetrics": { + "$ref": "./examples/CosmosDBDatabaseGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given database account and database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The metrics for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics": { + "get": { + "operationId": "Collection_ListMetrics", + "x-ms-examples": { + "CosmosDBCollectionGetMetrics": { + "$ref": "./examples/CosmosDBCollectionGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given database account and collection.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The metrics for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics": { + "get": { + "operationId": "CollectionRegion_ListMetrics", + "x-ms-examples": { + "CosmosDBRegionCollectionGetMetrics": { + "$ref": "./examples/CosmosDBRegionCollectionGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given database account, collection and region.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/regionParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The metrics for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics": { + "get": { + "operationId": "DatabaseAccountRegion_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBDatabaseAccountRegionGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given database account and region.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/regionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The metrics for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics": { + "get": { + "operationId": "PercentileSourceTarget_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBPercentileSourceTargetGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/sourceRegionParameter" + }, + { + "$ref": "#/parameters/targetRegionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The percentile metrics for the account, source and target regions were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PercentileMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics": { + "get": { + "operationId": "PercentileTarget_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBPercentileTargetGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/targetRegionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The percentile metrics for the account and target regions were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PercentileMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics": { + "get": { + "operationId": "Percentile_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBPercentileGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The percentile metrics for the account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PercentileMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics": { + "get": { + "operationId": "CollectionPartitionRegion_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBCollectionPartitionRegionGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given collection and region, split by partition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/regionParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The partition-level metrics for the collection and region were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PartitionMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics": { + "get": { + "operationId": "CollectionPartition_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBCollectionPartitionGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given collection, split by partition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The partition-level metrics for the collection were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PartitionMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics": { + "get": { + "operationId": "PartitionKeyRangeId_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBPKeyRangeIdGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given partition key range id.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/partitionKeyRangeIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The partition-level metrics for the partition key range id were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PartitionMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics": { + "get": { + "operationId": "PartitionKeyRangeIdRegion_ListMetrics", + "x-ms-examples": { + "CosmosDBDatabaseAccountRegionGetMetrics": { + "$ref": "./examples/CosmosDBPKeyRangeIdRegionGetMetrics.json" + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "description": "Retrieves the metrics determined by the given filter for the given partition key range id and region.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/regionParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "#/parameters/partitionKeyRangeIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/filterParameter" + } + ], + "responses": { + "200": { + "description": "The partition-level metrics for the partition key range id and region were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PartitionMetricListResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages": { + "get": { + "operationId": "DatabaseAccounts_ListUsages", + "x-ms-examples": { + "CosmosDBDatabaseAccountGetUsages": { + "$ref": "./examples/CosmosDBDatabaseAccountGetUsages.json" + } + }, + "description": "Retrieves the usages (most recent data) for the given database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/usageFilterParameter" + } + ], + "responses": { + "200": { + "description": "The usages for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/UsagesResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages": { + "get": { + "operationId": "Database_ListUsages", + "x-ms-examples": { + "CosmosDBDatabaseGetUsages": { + "$ref": "./examples/CosmosDBDatabaseGetUsages.json" + } + }, + "description": "Retrieves the usages (most recent data) for the given database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/usageFilterParameter" + } + ], + "responses": { + "200": { + "description": "The usages for the database were retrieved successfully.", + "schema": { + "$ref": "#/definitions/UsagesResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages": { + "get": { + "operationId": "Collection_ListUsages", + "x-ms-examples": { + "CosmosDBCollectionGetUsages": { + "$ref": "./examples/CosmosDBCollectionGetUsages.json" + } + }, + "description": "Retrieves the usages (most recent storage data) for the given collection.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/usageFilterParameter" + } + ], + "responses": { + "200": { + "description": "The usages for the collection were retrieved successfully.", + "schema": { + "$ref": "#/definitions/UsagesResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages": { + "get": { + "operationId": "CollectionPartition_ListUsages", + "x-ms-examples": { + "CosmosDBCollectionGetUsages": { + "$ref": "./examples/CosmosDBCollectionPartitionGetUsages.json" + } + }, + "description": "Retrieves the usages (most recent storage data) for the given collection, split by partition.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/usageFilterParameter" + } + ], + "responses": { + "200": { + "description": "The usages for the collection, per partition were retrieved successfully.", + "schema": { + "$ref": "#/definitions/PartitionUsagesResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions": { + "get": { + "operationId": "Database_ListMetricDefinitions", + "x-ms-examples": { + "CosmosDBDatabaseGetMetricDefinitions": { + "$ref": "./examples/CosmosDBDatabaseGetMetricDefinitions.json" + } + }, + "description": "Retrieves metric definitions for the given database.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The metric definitions for the database were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricDefinitionsListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions": { + "get": { + "operationId": "Collection_ListMetricDefinitions", + "x-ms-examples": { + "CosmosDBCollectionGetMetricDefinitions": { + "$ref": "./examples/CosmosDBCollectionGetMetricDefinitions.json" + } + }, + "description": "Retrieves metric definitions for the given collection.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseRidParameter" + }, + { + "$ref": "#/parameters/collectionRidParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The metric definitions for the collection were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricDefinitionsListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions": { + "get": { + "operationId": "DatabaseAccounts_ListMetricDefinitions", + "x-ms-examples": { + "CosmosDBDatabaseAccountGetMetricDefinitions": { + "$ref": "./examples/CosmosDBDatabaseAccountGetMetricDefinitions.json" + } + }, + "description": "Retrieves metric definitions for the given database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The metric definitions for the database account were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MetricDefinitionsListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases": { + "get": { + "operationId": "SqlResources_ListSqlDatabases", + "x-ms-examples": { + "CosmosDBSqlDatabaseList": { + "$ref": "./examples/CosmosDBSqlDatabaseList.json" + } + }, + "description": "Lists the SQL databases under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL database properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlDatabaseListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}": { + "get": { + "operationId": "SqlResources_GetSqlDatabase", + "x-ms-examples": { + "CosmosDBSqlDatabaseGet": { + "$ref": "./examples/CosmosDBSqlDatabaseGet.json" + } + }, + "description": "Gets the SQL database under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL database property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlDatabaseGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_CreateUpdateSqlDatabase", + "x-ms-examples": { + "CosmosDBSqlDatabaseCreateUpdate": { + "$ref": "./examples/CosmosDBSqlDatabaseCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB SQL database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateSqlDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SqlDatabaseCreateUpdateParameters" + }, + "description": "The parameters to provide for the current SQL database." + } + ], + "responses": { + "202": { + "description": "The SQL database create or update operation will complete asynchronously." + }, + "200": { + "description": "The SQL database create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/SqlDatabaseGetResults" + } + } + } + }, + "delete": { + "operationId": "SqlResources_DeleteSqlDatabase", + "x-ms-examples": { + "CosmosDBSqlDatabaseDelete": { + "$ref": "./examples/CosmosDBSqlDatabaseDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB SQL database.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The SQL database delete operation will complete asynchronously." + }, + "204": { + "description": "The SQL database delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default": { + "get": { + "operationId": "SqlResources_GetSqlDatabaseThroughput", + "x-ms-examples": { + "CosmosDBSqlDatabaseThroughputGet": { + "$ref": "./examples/CosmosDBSqlDatabaseThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the SQL database was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_UpdateSqlDatabaseThroughput", + "x-ms-examples": { + "CosmosDBSqlDatabaseThroughputUpdate": { + "$ref": "./examples/CosmosDBSqlDatabaseThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB SQL database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The parameters to provide for the RUs per second of the current SQL database." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the SQL database update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the SQL database update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers": { + "get": { + "operationId": "SqlResources_ListSqlContainers", + "x-ms-examples": { + "CosmosDBSqlContainerList": { + "$ref": "./examples/CosmosDBSqlContainerList.json" + } + }, + "description": "Lists the SQL container under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL container properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlContainerListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}": { + "get": { + "operationId": "SqlResources_GetSqlContainer", + "x-ms-examples": { + "CosmosDBSqlContainerGet": { + "$ref": "./examples/CosmosDBSqlContainerGet.json" + } + }, + "description": "Gets the SQL container under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL container property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlContainerGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_CreateUpdateSqlContainer", + "x-ms-examples": { + "CosmosDBSqlContainerCreateUpdate": { + "$ref": "./examples/CosmosDBSqlContainerCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB SQL container", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateSqlContainerParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SqlContainerCreateUpdateParameters" + }, + "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 create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/SqlContainerGetResults" + } + } + } + }, + "delete": { + "operationId": "SqlResources_DeleteSqlContainer", + "x-ms-examples": { + "CosmosDBSqlContainerDelete": { + "$ref": "./examples/CosmosDBSqlContainerDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB SQL container.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The SQL container delete operation will complete asynchronously." + }, + "204": { + "description": "The SQL container delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default": { + "get": { + "operationId": "SqlResources_GetSqlContainerThroughput", + "x-ms-examples": { + "CosmosDBSqlContainerThroughputGet": { + "$ref": "./examples/CosmosDBSqlContainerThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the SQL container was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_UpdateSqlContainerThroughput", + "x-ms-examples": { + "CosmosDBSqlContainerThroughputUpdate": { + "$ref": "./examples/CosmosDBSqlContainerThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB SQL container", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The parameters to provide for the RUs per second of the current SQL container." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the SQL container update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the SQL container update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures": { + "get": { + "operationId": "SqlResources_ListSqlStoredProcedures", + "x-ms-examples": { + "CosmosDBSqlStoredProcedureList": { + "$ref": "./examples/CosmosDBSqlStoredProcedureList.json" + } + }, + "description": "Lists the SQL storedProcedure under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL stored procedure properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlStoredProcedureListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}": { + "get": { + "operationId": "SqlResources_GetSqlStoredProcedure", + "x-ms-examples": { + "CosmosDBSqlStoredProcedureGet": { + "$ref": "./examples/CosmosDBSqlStoredProcedureGet.json" + } + }, + "description": "Gets the SQL storedProcedure under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/storedProcedureNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL storedProcedure property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlStoredProcedureGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_CreateUpdateSqlStoredProcedure", + "x-ms-examples": { + "CosmosDBSqlStoredProcedureCreateUpdate": { + "$ref": "./examples/CosmosDBSqlStoredProcedureCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB SQL storedProcedure", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/storedProcedureNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateSqlStoredProcedureParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SqlStoredProcedureCreateUpdateParameters" + }, + "description": "The parameters to provide for the current SQL storedProcedure." + } + ], + "responses": { + "202": { + "description": "The SQL storedProcedure create or update operation will complete asynchronously." + }, + "200": { + "description": "The SQL storedProcedure create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/SqlStoredProcedureGetResults" + } + } + } + }, + "delete": { + "operationId": "SqlResources_DeleteSqlStoredProcedure", + "x-ms-examples": { + "CosmosDBSqlStoredProcedureDelete": { + "$ref": "./examples/CosmosDBSqlStoredProcedureDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB SQL storedProcedure.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/storedProcedureNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The SQL storedProcedure delete operation will complete asynchronously." + }, + "204": { + "description": "The SQL storedProcedure delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions": { + "get": { + "operationId": "SqlResources_ListSqlUserDefinedFunctions", + "x-ms-examples": { + "CosmosDBSqlUserDefinedFunctionList": { + "$ref": "./examples/CosmosDBSqlUserDefinedFunctionList.json" + } + }, + "description": "Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL userDefinedFunction properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlUserDefinedFunctionListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}": { + "get": { + "operationId": "SqlResources_GetSqlUserDefinedFunction", + "x-ms-examples": { + "CosmosDBSqlUserDefinedFunctionGet": { + "$ref": "./examples/CosmosDBSqlUserDefinedFunctionGet.json" + } + }, + "description": "Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/userDefinedFunctionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL userDefinedFunction property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlUserDefinedFunctionGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_CreateUpdateSqlUserDefinedFunction", + "x-ms-examples": { + "CosmosDBSqlUserDefinedFunctionCreateUpdate": { + "$ref": "./examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB SQL userDefinedFunction", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/userDefinedFunctionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateSqlUserDefinedFunctionParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SqlUserDefinedFunctionCreateUpdateParameters" + }, + "description": "The parameters to provide for the current SQL userDefinedFunction." + } + ], + "responses": { + "202": { + "description": "The SQL userDefinedFunction create or update operation will complete asynchronously." + }, + "200": { + "description": "The SQL userDefinedFunction create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/SqlUserDefinedFunctionGetResults" + } + } + } + }, + "delete": { + "operationId": "SqlResources_DeleteSqlUserDefinedFunction", + "x-ms-examples": { + "CosmosDBSqlUserDefinedFunctionDelete": { + "$ref": "./examples/CosmosDBSqlUserDefinedFunctionDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB SQL userDefinedFunction.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/userDefinedFunctionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The SQL userDefinedFunction delete operation will complete asynchronously." + }, + "204": { + "description": "The SQL userDefinedFunction delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers": { + "get": { + "operationId": "SqlResources_ListSqlTriggers", + "x-ms-examples": { + "CosmosDBSqlTriggerList": { + "$ref": "./examples/CosmosDBSqlTriggerList.json" + } + }, + "description": "Lists the SQL trigger under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL trigger properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlTriggerListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}": { + "get": { + "operationId": "SqlResources_GetSqlTrigger", + "x-ms-examples": { + "CosmosDBSqlTriggerGet": { + "$ref": "./examples/CosmosDBSqlTriggerGet.json" + } + }, + "description": "Gets the SQL trigger under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/triggerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The SQL trigger property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/SqlTriggerGetResults" + } + } + } + }, + "put": { + "operationId": "SqlResources_CreateUpdateSqlTrigger", + "x-ms-examples": { + "CosmosDBSqlTriggerCreateUpdate": { + "$ref": "./examples/CosmosDBSqlTriggerCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB SQL trigger", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/triggerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateSqlTriggerParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SqlTriggerCreateUpdateParameters" + }, + "description": "The parameters to provide for the current SQL trigger." + } + ], + "responses": { + "202": { + "description": "The SQL trigger create or update operation will complete asynchronously." + }, + "200": { + "description": "The SQL trigger create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/SqlTriggerGetResults" + } + } + } + }, + "delete": { + "operationId": "SqlResources_DeleteSqlTrigger", + "x-ms-examples": { + "CosmosDBSqlTriggerDelete": { + "$ref": "./examples/CosmosDBSqlTriggerDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB SQL trigger.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/containerNameParameter" + }, + { + "$ref": "#/parameters/triggerNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The SQL trigger delete operation will complete asynchronously." + }, + "204": { + "description": "The SQL trigger delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases": { + "get": { + "operationId": "MongoDBResources_ListMongoDBDatabases", + "x-ms-examples": { + "CosmosDBMongoDBDatabaseList": { + "$ref": "./examples/CosmosDBMongoDBDatabaseList.json" + } + }, + "description": "Lists the MongoDB databases under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The MongoDB database properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoDBDatabaseListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}": { + "get": { + "operationId": "MongoDBResources_GetMongoDBDatabase", + "x-ms-examples": { + "CosmosDBMongoDBDatabaseGet": { + "$ref": "./examples/CosmosDBMongoDBDatabaseGet.json" + } + }, + "description": "Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The MongoDB database property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoDBDatabaseGetResults" + } + } + } + }, + "put": { + "operationId": "MongoDBResources_CreateUpdateMongoDBDatabase", + "x-ms-examples": { + "CosmosDBMongoDBDatabaseCreateUpdate": { + "$ref": "./examples/CosmosDBMongoDBDatabaseCreateUpdate.json" + } + }, + "description": "Create or updates Azure Cosmos DB MongoDB database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateMongoDBDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MongoDBDatabaseCreateUpdateParameters" + }, + "description": "The parameters to provide for the current MongoDB database." + } + ], + "responses": { + "202": { + "description": "The MongoDB database create or update operation will complete asynchronously." + }, + "200": { + "description": "The MongoDB database create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/MongoDBDatabaseGetResults" + } + } + } + }, + "delete": { + "operationId": "MongoDBResources_DeleteMongoDBDatabase", + "x-ms-examples": { + "CosmosDBMongoDBDatabaseDelete": { + "$ref": "./examples/CosmosDBMongoDBDatabaseDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB MongoDB database.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The MongoDB database delete operation will complete asynchronously." + }, + "204": { + "description": "The MongoDB database delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default": { + "get": { + "operationId": "MongoDBResources_GetMongoDBDatabaseThroughput", + "x-ms-examples": { + "CosmosDBMongoDBDatabaseThroughputGet": { + "$ref": "./examples/CosmosDBMongoDBDatabaseThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the MongoDB database was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "MongoDBResources_UpdateMongoDBDatabaseThroughput", + "x-ms-examples": { + "CosmosDBMongoDBDatabaseThroughputUpdate": { + "$ref": "./examples/CosmosDBMongoDBDatabaseThroughputUpdate.json" + } + }, + "description": "Update RUs per second of the an Azure Cosmos DB MongoDB database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The RUs per second of the parameters to provide for the current MongoDB database." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the MongoDB database update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the MongoDB database update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections": { + "get": { + "operationId": "MongoDBResources_ListMongoDBCollections", + "x-ms-examples": { + "CosmosDBMongoDBCollectionList": { + "$ref": "./examples/CosmosDBMongoDBCollectionList.json" + } + }, + "description": "Lists the MongoDB collection under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The MongoDB collection properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoDBCollectionListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}": { + "get": { + "operationId": "MongoDBResources_GetMongoDBCollection", + "x-ms-examples": { + "CosmosDBMongoDBCollectionGet": { + "$ref": "./examples/CosmosDBMongoDBCollectionGet.json" + } + }, + "description": "Gets the MongoDB collection under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/collectionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The MongoDB collection property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/MongoDBCollectionGetResults" + } + } + } + }, + "put": { + "operationId": "MongoDBResources_CreateUpdateMongoDBCollection", + "x-ms-examples": { + "CosmosDBMongoDBCollectionCreateUpdate": { + "$ref": "./examples/CosmosDBMongoDBCollectionCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB MongoDB Collection", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/collectionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateMongoDBCollectionParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MongoDBCollectionCreateUpdateParameters" + }, + "description": "The parameters to provide for the current MongoDB Collection." + } + ], + "responses": { + "202": { + "description": "The MongoDB Collection create or update operation will complete asynchronously." + }, + "200": { + "description": "The MongoDB Collection create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/MongoDBCollectionGetResults" + } + } + } + }, + "delete": { + "operationId": "MongoDBResources_DeleteMongoDBCollection", + "x-ms-examples": { + "CosmosDBMongoDBCollectionDelete": { + "$ref": "./examples/CosmosDBMongoDBCollectionDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB MongoDB Collection.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/collectionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The MongoDB collection delete operation will complete asynchronously." + }, + "204": { + "description": "The MongoDB collection delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default": { + "get": { + "operationId": "MongoDBResources_GetMongoDBCollectionThroughput", + "x-ms-examples": { + "CosmosDBMongoDBCollectionThroughputGet": { + "$ref": "./examples/CosmosDBMongoDBCollectionThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/collectionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the MongoDB collection was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "MongoDBResources_UpdateMongoDBCollectionThroughput", + "x-ms-examples": { + "CosmosDBMongoDBCollectionThroughputUpdate": { + "$ref": "./examples/CosmosDBMongoDBCollectionThroughputUpdate.json" + } + }, + "description": "Update the RUs per second of an Azure Cosmos DB MongoDB collection", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/collectionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The RUs per second of the parameters to provide for the current MongoDB collection." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the MongoDB collection update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the MongoDB collection update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables": { + "get": { + "operationId": "TableResources_ListTables", + "x-ms-examples": { + "CosmosDBTableList": { + "$ref": "./examples/CosmosDBTableList.json" + } + }, + "description": "Lists the Tables under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/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}/tables/{tableName}": { + "get": { + "operationId": "TableResources_GetTable", + "x-ms-examples": { + "CosmosDBTableGet": { + "$ref": "./examples/CosmosDBTableGet.json" + } + }, + "description": "Gets the Tables under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Table property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/TableGetResults" + } + } + } + }, + "put": { + "operationId": "TableResources_CreateUpdateTable", + "x-ms-examples": { + "CosmosDBTableReplace": { + "$ref": "./examples/CosmosDBTableCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB Table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateTableParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TableCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Table." + } + ], + "responses": { + "202": { + "description": "The Table create or update operation will complete asynchronously." + }, + "200": { + "description": "The Table create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/TableGetResults" + } + } + } + }, + "delete": { + "operationId": "TableResources_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": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The Table delete operation will complete asynchronously." + }, + "204": { + "description": "The Table delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default": { + "get": { + "operationId": "TableResources_GetTableThroughput", + "x-ms-examples": { + "CosmosDBTableThroughputGet": { + "$ref": "./examples/CosmosDBTableThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the Table was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "TableResources_UpdateTableThroughput", + "x-ms-examples": { + "CosmosDBTableThroughputUpdate": { + "$ref": "./examples/CosmosDBTableThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB Table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The parameters to provide for the RUs per second of the current Table." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the Table update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the Table update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces": { + "get": { + "operationId": "CassandraResources_ListCassandraKeyspaces", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceList": { + "$ref": "./examples/CosmosDBCassandraKeyspaceList.json" + } + }, + "description": "Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra keyspace properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraKeyspaceListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}": { + "get": { + "operationId": "CassandraResources_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 name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra keyspace property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraKeyspaceGetResults" + } + } + } + }, + "put": { + "operationId": "CassandraResources_CreateUpdateCassandraKeyspace", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceCreateUpdate": { + "$ref": "./examples/CosmosDBCassandraKeyspaceCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB Cassandra keyspace", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateCassandraKeyspaceParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CassandraKeyspaceCreateUpdateParameters" + }, + "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/CassandraKeyspaceGetResults" + } + } + } + }, + "delete": { + "operationId": "CassandraResources_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": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/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}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default": { + "get": { + "operationId": "CassandraResources_GetCassandraKeyspaceThroughput", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceThroughputGet": { + "$ref": "./examples/CosmosDBCassandraKeyspaceThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the Cassandra Keyspace was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "CassandraResources_UpdateCassandraKeyspaceThroughput", + "x-ms-examples": { + "CosmosDBCassandraKeyspaceThroughputUpdate": { + "$ref": "./examples/CosmosDBCassandraKeyspaceThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB Cassandra Keyspace", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The RUs per second of the parameters to provide for the current Cassandra Keyspace." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the Cassandra Keyspace update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the Cassandra Keyspace update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables": { + "get": { + "operationId": "CassandraResources_ListCassandraTables", + "x-ms-examples": { + "CosmosDBCassandraTableList": { + "$ref": "./examples/CosmosDBCassandraTableList.json" + } + }, + "description": "Lists the Cassandra table under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra table properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraTableListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}": { + "get": { + "operationId": "CassandraResources_GetCassandraTable", + "x-ms-examples": { + "CosmosDBCassandraTableGet": { + "$ref": "./examples/CosmosDBCassandraTableGet.json" + } + }, + "description": "Gets the Cassandra table under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Cassandra table property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/CassandraTableGetResults" + } + } + } + }, + "put": { + "operationId": "CassandraResources_CreateUpdateCassandraTable", + "x-ms-examples": { + "CosmosDBCassandraTableCreateUpdate": { + "$ref": "./examples/CosmosDBCassandraTableCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB Cassandra Table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateCassandraTableParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CassandraTableCreateUpdateParameters" + }, + "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 Cassandra Table create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/CassandraTableGetResults" + } + } + } + }, + "delete": { + "operationId": "CassandraResources_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": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The Cassandra table delete operation will complete asynchronously." + }, + "204": { + "description": "The Cassandra table delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default": { + "get": { + "operationId": "CassandraResources_GetCassandraTableThroughput", + "x-ms-examples": { + "CosmosDBCassandraTableThroughputGet": { + "$ref": "./examples/CosmosDBCassandraTableThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the Cassandra table was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "CassandraResources_UpdateCassandraTableThroughput", + "x-ms-examples": { + "CosmosDBCassandraTableThroughputUpdate": { + "$ref": "./examples/CosmosDBCassandraTableThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB Cassandra table", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/keyspaceNameParameter" + }, + { + "$ref": "#/parameters/tableNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The RUs per second of the parameters to provide for the current Cassandra table." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the Cassandra table update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the Cassandra table update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases": { + "get": { + "operationId": "GremlinResources_ListGremlinDatabases", + "x-ms-examples": { + "CosmosDBGremlinDatabaseList": { + "$ref": "./examples/CosmosDBGremlinDatabaseList.json" + } + }, + "description": "Lists the Gremlin databases under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Gremlin database properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/GremlinDatabaseListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}": { + "get": { + "operationId": "GremlinResources_GetGremlinDatabase", + "x-ms-examples": { + "CosmosDBGremlinDatabaseGet": { + "$ref": "./examples/CosmosDBGremlinDatabaseGet.json" + } + }, + "description": "Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Gremlin database property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/GremlinDatabaseGetResults" + } + } + } + }, + "put": { + "operationId": "GremlinResources_CreateUpdateGremlinDatabase", + "x-ms-examples": { + "CosmosDBGremlinDatabaseCreateUpdate": { + "$ref": "./examples/CosmosDBGremlinDatabaseCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB Gremlin database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateGremlinDatabaseParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GremlinDatabaseCreateUpdateParameters" + }, + "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 Gremlin database create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/GremlinDatabaseGetResults" + } + } + } + }, + "delete": { + "operationId": "GremlinResources_DeleteGremlinDatabase", + "x-ms-examples": { + "CosmosDBGremlinDatabaseDelete": { + "$ref": "./examples/CosmosDBGremlinDatabaseDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB Gremlin database.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The Gremlin database delete operation will complete asynchronously." + }, + "204": { + "description": "The Gremlin database delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default": { + "get": { + "operationId": "GremlinResources_GetGremlinDatabaseThroughput", + "x-ms-examples": { + "CosmosDBGremlinDatabaseThroughputGet": { + "$ref": "./examples/CosmosDBGremlinDatabaseThroughputGet.json" + } + }, + "description": "Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the Gremlin database was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "GremlinResources_UpdateGremlinDatabaseThroughput", + "x-ms-examples": { + "CosmosDBGremlinDatabaseThroughputUpdate": { + "$ref": "./examples/CosmosDBGremlinDatabaseThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB Gremlin database", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The RUs per second of the parameters to provide for the current Gremlin database." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the Gremlin database update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the Gremlin database update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs": { + "get": { + "operationId": "GremlinResources_ListGremlinGraphs", + "x-ms-examples": { + "CosmosDBGremlinGraphList": { + "$ref": "./examples/CosmosDBGremlinGraphList.json" + } + }, + "description": "Lists the Gremlin graph under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Gremlin graph properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/GremlinGraphListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}": { + "get": { + "operationId": "GremlinResources_GetGremlinGraph", + "x-ms-examples": { + "CosmosDBGremlinGraphGet": { + "$ref": "./examples/CosmosDBGremlinGraphGet.json" + } + }, + "description": "Gets the Gremlin graph under an existing Azure Cosmos DB database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/graphNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The Gremlin graph property was retrieved successfully.", + "schema": { + "$ref": "#/definitions/GremlinGraphGetResults" + } + } + } + }, + "put": { + "operationId": "GremlinResources_CreateUpdateGremlinGraph", + "x-ms-examples": { + "CosmosDBGremlinGraphCreateUpdate": { + "$ref": "./examples/CosmosDBGremlinGraphCreateUpdate.json" + } + }, + "description": "Create or update an Azure Cosmos DB Gremlin graph", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/graphNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "createUpdateGremlinGraphParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GremlinGraphCreateUpdateParameters" + }, + "description": "The parameters to provide for the current Gremlin graph." + } + ], + "responses": { + "202": { + "description": "The Gremlin graph create or update operation will complete asynchronously." + }, + "200": { + "description": "The Gremlin graph create or update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/GremlinGraphGetResults" + } + } + } + }, + "delete": { + "operationId": "GremlinResources_DeleteGremlinGraph", + "x-ms-examples": { + "CosmosDBGremlinGraphDelete": { + "$ref": "./examples/CosmosDBGremlinGraphDelete.json" + } + }, + "description": "Deletes an existing Azure Cosmos DB Gremlin graph.", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/graphNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "The Gremlin graph delete operation will complete asynchronously." + }, + "204": { + "description": "The Gremlin graph delete operation was completed successfully." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default": { + "get": { + "operationId": "GremlinResources_GetGremlinGraphThroughput", + "x-ms-examples": { + "CosmosDBGremlinGraphThroughputGet": { + "$ref": "./examples/CosmosDBGremlinGraphThroughputGet.json" + } + }, + "description": "Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/graphNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The RUs per second of the Gremlin graph was retrieved successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + }, + "put": { + "operationId": "GremlinResources_UpdateGremlinGraphThroughput", + "x-ms-examples": { + "CosmosDBGremlinGraphThroughputUpdate": { + "$ref": "./examples/CosmosDBGremlinGraphThroughputUpdate.json" + } + }, + "description": "Update RUs per second of an Azure Cosmos DB Gremlin graph", + "x-ms-long-running-operation": true, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "#/parameters/databaseNameParameter" + }, + { + "$ref": "#/parameters/graphNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "updateThroughputParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ThroughputSettingsUpdateParameters" + }, + "description": "The RUs per second of the parameters to provide for the current Gremlin graph." + } + ], + "responses": { + "202": { + "description": "The RUs per second of the Gremlin graph update operation will complete asynchronously." + }, + "200": { + "description": "The RUs per second of the Gremlin graph update operation was completed successfully.", + "schema": { + "$ref": "#/definitions/ThroughputSettingsGetResults" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts": { + "get": { + "operationId": "RestorableDatabaseAccounts_ListByLocation", + "x-ms-examples": { + "CosmosDBDatabaseAccountList": { + "$ref": "./examples/CosmosDBRestorableDatabaseAccountList.json" + } + }, + "description": "Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableDatabaseAccountsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseUpdatedFormat" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts": { + "get": { + "operationId": "RestorableDatabaseAccounts_List", + "x-ms-examples": { + "CosmosDBDatabaseAccountList": { + "$ref": "./examples/CosmosDBRestorableDatabaseAccountNoLocationList.json" + } + }, + "description": "Lists all the restorable Azure Cosmos DB database accounts available under the subscription.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The operation completed successfully.", + "schema": { + "$ref": "#/definitions/RestorableDatabaseAccountsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseUpdatedFormat" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}": { + "get": { + "operationId": "RestorableDatabaseAccounts_GetByLocation", + "x-ms-examples": { + "CosmosDBDatabaseAccountGet": { + "$ref": "./examples/CosmosDBRestorableDatabaseAccountGet.json" + } + }, + "description": "Retrieves the properties of an existing Azure Cosmos DB restorable database account.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/locationParameter" + }, + { + "$ref": "#/parameters/instanceIdParameter" + } + ], + "responses": { + "200": { + "description": "The restorable database account properties were retrieved successfully.", + "schema": { + "$ref": "#/definitions/RestorableDatabaseAccountGetResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseUpdatedFormat" + } + } + } + } + } + }, + "definitions": { + "DatabaseAccountsListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/DatabaseAccountGetResults" + }, + "description": "List of database account and their properties." + } + }, + "description": "The List operation response, that contains the database accounts and their properties." + }, + "SqlDatabaseListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SqlDatabaseGetResults" + }, + "description": "List of SQL databases and their properties." + } + }, + "description": "The List operation response, that contains the SQL databases and their properties." + }, + "SqlContainerListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SqlContainerGetResults" + }, + "description": "List of containers and their properties." + } + }, + "description": "The List operation response, that contains the containers and their properties." + }, + "SqlStoredProcedureListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SqlStoredProcedureGetResults" + }, + "description": "List of storedProcedures and their properties." + } + }, + "description": "The List operation response, that contains the storedProcedures and their properties." + }, + "SqlUserDefinedFunctionListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SqlUserDefinedFunctionGetResults" + }, + "description": "List of userDefinedFunctions and their properties." + } + }, + "description": "The List operation response, that contains the userDefinedFunctions and their properties." + }, + "SqlTriggerListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/SqlTriggerGetResults" + }, + "description": "List of triggers and their properties." + } + }, + "description": "The List operation response, that contains the triggers and their properties." + }, + "MongoDBDatabaseListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/MongoDBDatabaseGetResults" + }, + "description": "List of MongoDB databases and their properties." + } + }, + "description": "The List operation response, that contains the MongoDB databases and their properties." + }, + "MongoDBCollectionListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/MongoDBCollectionGetResults" + }, + "description": "List of MongoDB collections and their properties." + } + }, + "description": "The List operation response, that contains the MongoDB collections and their properties." + }, + "TableListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/TableGetResults" + }, + "description": "List of Table and their properties." + } + }, + "description": "The List operation response, that contains the Table and their properties." + }, + "CassandraKeyspaceListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/CassandraKeyspaceGetResults" + }, + "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/CassandraTableGetResults" + }, + "description": "List of Cassandra tables and their properties." + } + }, + "description": "The List operation response, that contains the Cassandra tables and their properties." + }, + "GremlinDatabaseListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/GremlinDatabaseGetResults" + }, + "description": "List of Gremlin databases and their properties." + } + }, + "description": "The List operation response, that contains the Gremlin databases and their properties." + }, + "GremlinGraphListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/GremlinGraphGetResults" + }, + "description": "List of graphs and their properties." + } + }, + "description": "The List operation response, that contains the graphs and their properties." + }, + "ErrorResponse": { + "properties": { + "code": { + "description": "Error code.", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + }, + "description": "Error Response." + }, + "ErrorResponseUpdatedFormat": { + "description": "An error response from the service.", + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + } + }, + "FailoverPolicies": { + "properties": { + "failoverPolicies": { + "type": "array", + "description": "List of failover policies.", + "items": { + "$ref": "#/definitions/FailoverPolicy" + } + } + }, + "required": ["failoverPolicies"], + "description": "The list of new failover policies for the failover priority change." + }, + "FailoverPolicy": { + "type": "object", + "description": "The failover policy for a given region of a database account.", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>." + }, + "locationName": { + "type": "string", + "description": "The name of the region in which the database account exists." + }, + "failoverPriority": { + "type": "integer", + "minimum": 0, + "format": "int32", + "description": "The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists." + } + } + }, + "RegionForOnlineOffline": { + "properties": { + "region": { + "type": "string", + "description": "Cosmos DB region, with spaces between words and each word capitalized." + } + }, + "required": ["region"], + "description": "Cosmos DB region to online or offline." + }, + "Location": { + "description": "A region in which the Azure Cosmos DB database account is deployed.", + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "The unique identifier of the region within the database account. Example: <accountName>-<locationName>." + }, + "locationName": { + "type": "string", + "description": "The name of the region." + }, + "documentEndpoint": { + "type": "string", + "readOnly": true, + "description": "The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState" + }, + "failoverPriority": { + "description": "The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists.", + "format": "int32", + "type": "integer", + "minimum": 0 + }, + "isZoneRedundant": { + "type": "boolean", + "description": "Flag to indicate whether or not this region is an AvailabilityZone region" + } + } + }, + "ARMResourceProperties": { + "type": "object", + "description": "The core properties of ARM resources.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The unique resource identifier of the ARM resource." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the ARM resource." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of Azure resource." + }, + "location": { + "type": "string", + "description": "The location of the resource group to which the resource belongs." + }, + "tags": { + "$ref": "#/definitions/Tags" + }, + "identity": { + "$ref": "#/definitions/ManagedServiceIdentity" + } + }, + "x-ms-azure-resource": true + }, + "ARMProxyResource": { + "type": "object", + "description": "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags", + "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 + }, + "DatabaseAccountGetResults": { + "description": "An Azure Cosmos DB database account.", + "type": "object", + "properties": { + "kind": { + "description": "Indicates the type of database account. This can only be set at database account creation.", + "type": "string", + "default": "GlobalDocumentDB", + "enum": ["GlobalDocumentDB", "MongoDB", "Parse"], + "x-ms-enum": { + "name": "DatabaseAccountKind", + "modelAsString": true + } + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DatabaseAccountGetProperties" + }, + "systemData": { + "readOnly": true, + "description": "The system meta data relating to this resource.", + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/systemData" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "ExtendedResourceProperties": { + "description": "The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs.", + "type": "object", + "properties": { + "_rid": { + "type": "string", + "description": "A system generated property. A unique identifier.", + "readOnly": true + }, + "_ts": { + "description": "A system generated property that denotes the last updated timestamp of the resource.", + "readOnly": true + }, + "_etag": { + "type": "string", + "description": "A system generated property representing the resource etag required for optimistic concurrency control.", + "readOnly": true + } + } + }, + "ThroughputSettingsGetResults": { + "description": "An Azure Cosmos DB resource throughput.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB resource throughput", + "$ref": "#/definitions/ThroughputSettingsGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "ThroughputSettingsGetProperties": { + "description": "The properties of an Azure Cosmos DB resource throughput", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/ThroughputSettingsResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + } + } + }, + "SqlDatabaseGetResults": { + "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/SqlDatabaseGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "SqlDatabaseGetProperties": { + "description": "The properties of an Azure Cosmos DB SQL database", + "type": "object", + "properties": { + "resource": { + "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/SqlDatabaseResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "SqlContainerGetResults": { + "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/SqlContainerGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "SqlContainerGetProperties": { + "description": "The properties of an Azure Cosmos DB container", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/SqlContainerResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "SqlStoredProcedureGetResults": { + "description": "An Azure Cosmos DB storedProcedure.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB storedProcedure", + "$ref": "#/definitions/SqlStoredProcedureGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "SqlStoredProcedureGetProperties": { + "description": "The properties of an Azure Cosmos DB StoredProcedure", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/SqlStoredProcedureResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + } + } + }, + "SqlUserDefinedFunctionGetResults": { + "description": "An Azure Cosmos DB userDefinedFunction.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB userDefinedFunction", + "$ref": "#/definitions/SqlUserDefinedFunctionGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "SqlUserDefinedFunctionGetProperties": { + "description": "The properties of an Azure Cosmos DB userDefinedFunction", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/SqlUserDefinedFunctionResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + } + } + }, + "SqlTriggerGetResults": { + "description": "An Azure Cosmos DB trigger.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB trigger", + "$ref": "#/definitions/SqlTriggerGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "SqlTriggerGetProperties": { + "description": "The properties of an Azure Cosmos DB trigger", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/SqlTriggerResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + } + } + }, + "MongoDBDatabaseGetResults": { + "description": "An Azure Cosmos DB MongoDB database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB MongoDB database", + "$ref": "#/definitions/MongoDBDatabaseGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "MongoDBDatabaseGetProperties": { + "description": "The properties of an Azure Cosmos DB MongoDB database", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/MongoDBDatabaseResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "MongoDBCollectionGetResults": { + "description": "An Azure Cosmos DB MongoDB collection.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB MongoDB collection", + "$ref": "#/definitions/MongoDBCollectionGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "MongoDBCollectionGetProperties": { + "description": "The properties of an Azure Cosmos DB MongoDB collection", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/MongoDBCollectionResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "TableGetResults": { + "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/TableGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "TableGetProperties": { + "description": "The properties of an Azure Cosmos Table", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/TableResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "CassandraKeyspaceGetResults": { + "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/CassandraKeyspaceGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "CassandraKeyspaceGetProperties": { + "description": "The properties of an Azure Cosmos DB Cassandra keyspace", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/CassandraKeyspaceResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "CassandraTableGetResults": { + "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/CassandraTableGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "CassandraTableGetProperties": { + "description": "The properties of an Azure Cosmos DB Cassandra table", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/CassandraTableResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "GremlinDatabaseGetResults": { + "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 database", + "$ref": "#/definitions/GremlinDatabaseGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "GremlinDatabaseGetProperties": { + "description": "The properties of an Azure Cosmos DB SQL database", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/GremlinDatabaseResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "GremlinGraphGetResults": { + "description": "An Azure Cosmos DB Gremlin graph.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "The properties of an Azure Cosmos DB Gremlin graph", + "$ref": "#/definitions/GremlinGraphGetProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "GremlinGraphGetProperties": { + "description": "The properties of an Azure Cosmos DB Gremlin graph", + "type": "object", + "properties": { + "resource": { + "allOf": [ + { + "$ref": "#/definitions/GremlinGraphResource" + }, + { + "$ref": "#/definitions/ExtendedResourceProperties" + } + ] + }, + "options": { + "allOf": [ + { + "$ref": "#/definitions/OptionsResource" + } + ] + } + } + }, + "ConsistencyPolicy": { + "type": "object", + "description": "The consistency policy for the Cosmos DB database account.", + "properties": { + "defaultConsistencyLevel": { + "description": "The default consistency level and configuration settings of the Cosmos DB account.", + "type": "string", + "enum": ["Eventual", "Session", "BoundedStaleness", "Strong", "ConsistentPrefix"], + "x-ms-enum": { + "name": "DefaultConsistencyLevel", + "modelAsString": false + } + }, + "maxStalenessPrefix": { + "description": "When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.", + "type": "integer", + "minimum": 1, + "maximum": 2147483647, + "format": "int64" + }, + "maxIntervalInSeconds": { + "description": "When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.", + "type": "integer", + "minimum": 5, + "maximum": 86400, + "format": "int32" + } + }, + "required": ["defaultConsistencyLevel"] + }, + "DatabaseAccountGetProperties": { + "description": "Properties for the database account.", + "type": "object", + "properties": { + "provisioningState": { + "$ref": "#/definitions/ProvisioningState" + }, + "documentEndpoint": { + "description": "The connection endpoint for the Cosmos DB database account.", + "type": "string", + "readOnly": true + }, + "databaseAccountOfferType": { + "description": "The offer type for the Cosmos DB database account. Default value: Standard.", + "readOnly": true, + "$ref": "#/definitions/DatabaseAccountOfferType" + }, + "ipRules": { + "description": "List of IpRules.", + "$ref": "#/definitions/IPRules" + }, + "isVirtualNetworkFilterEnabled": { + "description": "Flag to indicate whether to enable/disable Virtual Network ACL rules.", + "type": "boolean" + }, + "enableAutomaticFailover": { + "description": "Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.", + "type": "boolean" + }, + "consistencyPolicy": { + "description": "The consistency policy for the Cosmos DB database account.", + "$ref": "#/definitions/ConsistencyPolicy" + }, + "capabilities": { + "type": "array", + "description": "List of Cosmos DB capabilities for the account", + "items": { + "$ref": "#/definitions/Capability" + } + }, + "writeLocations": { + "type": "array", + "readOnly": true, + "description": "An array that contains the write location for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, + "readLocations": { + "type": "array", + "readOnly": true, + "description": "An array that contains of the read locations enabled for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, + "locations": { + "type": "array", + "readOnly": true, + "description": "An array that contains all of the locations enabled for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, + "failoverPolicies": { + "type": "array", + "readOnly": true, + "description": "An array that contains the regions ordered by their failover priorities.", + "items": { + "$ref": "#/definitions/FailoverPolicy" + } + }, + "virtualNetworkRules": { + "type": "array", + "description": "List of Virtual Network ACL rules configured for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/VirtualNetworkRule" + } + }, + "privateEndpointConnections": { + "type": "array", + "readOnly": true, + "description": "List of Private Endpoint Connections configured for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + }, + "enableMultipleWriteLocations": { + "description": "Enables the account to write in multiple locations", + "type": "boolean" + }, + "enableCassandraConnector": { + "description": "Enables the cassandra connector on the Cosmos DB C* account", + "type": "boolean" + }, + "connectorOffer": { + "description": "The cassandra connector offer type for the Cosmos DB database C* account.", + "$ref": "#/definitions/ConnectorOffer" + }, + "disableKeyBasedMetadataWriteAccess": { + "description": "Disable write operations on metadata resources (databases, containers, throughput) via account keys", + "type": "boolean" + }, + "keyVaultKeyUri": { + "description": "The URI of the key vault", + "type": "string" + }, + "publicNetworkAccess": { + "description": "Whether requests from Public Network are allowed", + "$ref": "#/definitions/PublicNetworkAccess" + }, + "enableFreeTier": { + "description": "Flag to indicate whether Free Tier is enabled.", + "type": "boolean" + }, + "apiProperties": { + "description": "API specific properties.", + "type": "object", + "$ref": "#/definitions/ApiProperties" + }, + "enableAnalyticalStorage": { + "description": "Flag to indicate whether to enable storage analytics.", + "type": "boolean" + }, + "instanceId": { + "description": "A unique identifier assigned to the database account", + "type": "string", + "readOnly": true + }, + "createMode": { + "description": "Enum to indicate the mode of account creation.", + "type": "string", + "default": "Default", + "$ref": "#/definitions/CreateMode" + }, + "restoreParameters": { + "description": "Parameters to indicate the information about the restore.", + "type": "object", + "$ref": "#/definitions/RestoreParameters" + }, + "backupPolicy": { + "description": "The object representing the policy for taking backups on an account.", + "type": "object", + "$ref": "#/definitions/BackupPolicy" + } + } + }, + "DatabaseAccountCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB database accounts.", + "type": "object", + "discriminator": "createMode", + "properties": { + "consistencyPolicy": { + "description": "The consistency policy for the Cosmos DB account.", + "$ref": "#/definitions/ConsistencyPolicy" + }, + "locations": { + "type": "array", + "description": "An array that contains the georeplication locations enabled for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, + "databaseAccountOfferType": { + "description": "The offer type for the database", + "$ref": "#/definitions/DatabaseAccountOfferType" + }, + "ipRules": { + "description": "List of IpRules.", + "$ref": "#/definitions/IPRules" + }, + "isVirtualNetworkFilterEnabled": { + "description": "Flag to indicate whether to enable/disable Virtual Network ACL rules.", + "type": "boolean" + }, + "enableAutomaticFailover": { + "description": "Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.", + "type": "boolean" + }, + "capabilities": { + "type": "array", + "description": "List of Cosmos DB capabilities for the account", + "items": { + "$ref": "#/definitions/Capability" + } + }, + "virtualNetworkRules": { + "type": "array", + "description": "List of Virtual Network ACL rules configured for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/VirtualNetworkRule" + } + }, + "enableMultipleWriteLocations": { + "description": "Enables the account to write in multiple locations", + "type": "boolean" + }, + "enableCassandraConnector": { + "description": "Enables the cassandra connector on the Cosmos DB C* account", + "type": "boolean" + }, + "connectorOffer": { + "description": "The cassandra connector offer type for the Cosmos DB database C* account.", + "$ref": "#/definitions/ConnectorOffer" + }, + "disableKeyBasedMetadataWriteAccess": { + "description": "Disable write operations on metadata resources (databases, containers, throughput) via account keys", + "type": "boolean" + }, + "keyVaultKeyUri": { + "description": "The URI of the key vault", + "type": "string" + }, + "publicNetworkAccess": { + "description": "Whether requests from Public Network are allowed", + "$ref": "#/definitions/PublicNetworkAccess" + }, + "enableFreeTier": { + "description": "Flag to indicate whether Free Tier is enabled.", + "type": "boolean" + }, + "apiProperties": { + "description": "API specific properties. Currently, supported only for MongoDB API.", + "type": "object", + "$ref": "#/definitions/ApiProperties" + }, + "enableAnalyticalStorage": { + "description": "Flag to indicate whether to enable storage analytics.", + "type": "boolean" + }, + "createMode": { + "description": "Enum to indicate the mode of account creation.", + "type": "string", + "default": "Default", + "$ref": "#/definitions/CreateMode" + }, + "backupPolicy": { + "description": "The object representing the policy for taking backups on an account.", + "type": "object", + "$ref": "#/definitions/BackupPolicy" + } + }, + "required": ["locations", "databaseAccountOfferType", "createMode"] + }, + "DefaultRequestDatabaseAccountCreateUpdateProperties": { + "description": "Properties for non-restore Azure Cosmos DB database account requests.", + "allOf": [ + { + "$ref": "#/definitions/DatabaseAccountCreateUpdateProperties" + } + ], + "x-ms-discriminator-value": "Default" + }, + "RestoreReqeustDatabaseAccountCreateUpdateProperties": { + "description": "Properties to restore Azure Cosmos DB database account.", + "allOf": [ + { + "$ref": "#/definitions/DatabaseAccountCreateUpdateProperties" + } + ], + "properties": { + "restoreParameters": { + "description": "Parameters to indicate the information about the restore.", + "type": "object", + "$ref": "#/definitions/RestoreParameters" + } + }, + "x-ms-discriminator-value": "Restore" + }, + "DatabaseAccountCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB database accounts.", + "type": "object", + "properties": { + "kind": { + "description": "Indicates the type of database account. This can only be set at database account creation.", + "type": "string", + "default": "GlobalDocumentDB", + "enum": ["GlobalDocumentDB", "MongoDB", "Parse"], + "x-ms-enum": { + "name": "DatabaseAccountKind", + "modelAsString": true + } + }, + "properties": { + "$ref": "#/definitions/DatabaseAccountCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "DatabaseAccountUpdateProperties": { + "description": "Properties to update Azure Cosmos DB database accounts.", + "type": "object", + "properties": { + "consistencyPolicy": { + "description": "The consistency policy for the Cosmos DB account.", + "$ref": "#/definitions/ConsistencyPolicy" + }, + "locations": { + "type": "array", + "description": "An array that contains the georeplication locations enabled for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, + "ipRules": { + "description": "List of IpRules.", + "$ref": "#/definitions/IPRules" + }, + "isVirtualNetworkFilterEnabled": { + "description": "Flag to indicate whether to enable/disable Virtual Network ACL rules.", + "type": "boolean" + }, + "enableAutomaticFailover": { + "description": "Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account.", + "type": "boolean" + }, + "capabilities": { + "type": "array", + "description": "List of Cosmos DB capabilities for the account", + "items": { + "$ref": "#/definitions/Capability" + } + }, + "virtualNetworkRules": { + "type": "array", + "description": "List of Virtual Network ACL rules configured for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/VirtualNetworkRule" + } + }, + "enableMultipleWriteLocations": { + "description": "Enables the account to write in multiple locations", + "type": "boolean" + }, + "enableCassandraConnector": { + "description": "Enables the cassandra connector on the Cosmos DB C* account", + "type": "boolean" + }, + "connectorOffer": { + "description": "The cassandra connector offer type for the Cosmos DB database C* account.", + "$ref": "#/definitions/ConnectorOffer" + }, + "disableKeyBasedMetadataWriteAccess": { + "description": "Disable write operations on metadata resources (databases, containers, throughput) via account keys", + "type": "boolean" + }, + "keyVaultKeyUri": { + "description": "The URI of the key vault", + "type": "string" + }, + "publicNetworkAccess": { + "description": "Whether requests from Public Network are allowed", + "$ref": "#/definitions/PublicNetworkAccess" + }, + "enableFreeTier": { + "description": "Flag to indicate whether Free Tier is enabled.", + "type": "boolean" + }, + "apiProperties": { + "description": "API specific properties. Currently, supported only for MongoDB API.", + "type": "object", + "$ref": "#/definitions/ApiProperties" + }, + "enableAnalyticalStorage": { + "description": "Flag to indicate whether to enable storage analytics.", + "type": "boolean" + }, + "backupPolicy": { + "description": "The object representing the policy for taking backups on an account.", + "type": "object", + "$ref": "#/definitions/BackupPolicy" + } + } + }, + "DatabaseAccountUpdateParameters": { + "description": "Parameters for patching Azure Cosmos DB database account properties.", + "type": "object", + "properties": { + "tags": { + "$ref": "#/definitions/Tags" + }, + "location": { + "type": "string", + "description": "The location of the resource group to which the resource belongs." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DatabaseAccountUpdateProperties" + } + } + }, + "DatabaseAccountListReadOnlyKeysResult": { + "description": "The read-only access keys for the given database account.", + "properties": { + "primaryReadonlyMasterKey": { + "readOnly": true, + "type": "string", + "description": "Base 64 encoded value of the primary read-only key." + }, + "secondaryReadonlyMasterKey": { + "readOnly": true, + "type": "string", + "description": "Base 64 encoded value of the secondary read-only key." + } + } + }, + "DatabaseAccountListKeysResult": { + "description": "The access keys for the given database account.", + "properties": { + "primaryMasterKey": { + "readOnly": true, + "type": "string", + "description": "Base 64 encoded value of the primary read-write key." + }, + "secondaryMasterKey": { + "readOnly": true, + "type": "string", + "description": "Base 64 encoded value of the secondary read-write key." + } + }, + "allOf": [ + { + "$ref": "#/definitions/DatabaseAccountListReadOnlyKeysResult" + } + ] + }, + "DatabaseAccountConnectionString": { + "description": "Connection string for the Cosmos DB account", + "properties": { + "connectionString": { + "readOnly": true, + "type": "string", + "description": "Value of the connection string" + }, + "description": { + "readOnly": true, + "type": "string", + "description": "Description of the connection string" + } + } + }, + "DatabaseAccountListConnectionStringsResult": { + "description": "The connection strings for the given database account.", + "properties": { + "connectionStrings": { + "type": "array", + "description": "An array that contains the connection strings for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/DatabaseAccountConnectionString" + } + } + } + }, + "DatabaseAccountRegenerateKeyParameters": { + "type": "object", + "description": "Parameters to regenerate the keys within the database account.", + "properties": { + "keyKind": { + "type": "string", + "description": "The access key to regenerate.", + "enum": ["primary", "secondary", "primaryReadonly", "secondaryReadonly"], + "x-ms-enum": { + "name": "KeyKind", + "modelAsString": true + } + } + }, + "required": ["keyKind"] + }, + "DatabaseAccountOfferType": { + "description": "The offer type for the Cosmos DB database account.", + "type": "string", + "enum": ["Standard"], + "x-ms-enum": { + "name": "DatabaseAccountOfferType", + "modelAsString": false + } + }, + "ThroughputSettingsUpdateParameters": { + "description": "Parameters to update Cosmos DB resource throughput.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to update Azure Cosmos DB resource throughput.", + "$ref": "#/definitions/ThroughputSettingsUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "ThroughputSettingsUpdateProperties": { + "description": "Properties to update Azure Cosmos DB resource throughput.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a resource throughput", + "$ref": "#/definitions/ThroughputSettingsResource" + } + }, + "required": ["resource"] + }, + "SqlDatabaseCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB SQL database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB SQL database.", + "$ref": "#/definitions/SqlDatabaseCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "SqlDatabaseCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB SQL database.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a SQL database", + "$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.", + "$ref": "#/definitions/CreateUpdateOptions" + } + }, + "required": ["resource", "options"] + }, + "SqlContainerCreateUpdateParameters": { + "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 container.", + "$ref": "#/definitions/SqlContainerCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "SqlContainerCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB container.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a container", + "$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.", + "$ref": "#/definitions/CreateUpdateOptions" + } + }, + "required": ["resource", "options"] + }, + "SqlStoredProcedureCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB storedProcedure.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB storedProcedure.", + "$ref": "#/definitions/SqlStoredProcedureCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "SqlStoredProcedureCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB storedProcedure.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a storedProcedure", + "$ref": "#/definitions/SqlStoredProcedureResource" + }, + "options": { + "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", + "$ref": "#/definitions/CreateUpdateOptions" + } + }, + "required": ["resource", "options"] + }, + "SqlUserDefinedFunctionCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB userDefinedFunction.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB userDefinedFunction.", + "$ref": "#/definitions/SqlUserDefinedFunctionCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "SqlUserDefinedFunctionCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB userDefinedFunction.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a userDefinedFunction", + "$ref": "#/definitions/SqlUserDefinedFunctionResource" + }, + "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"] + }, + "SqlTriggerCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB trigger.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB trigger.", + "$ref": "#/definitions/SqlTriggerCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "SqlTriggerCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB trigger.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a trigger", + "$ref": "#/definitions/SqlTriggerResource" + }, + "options": { + "description": "A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.", + "$ref": "#/definitions/CreateUpdateOptions" + } + }, + "required": ["resource", "options"] + }, + "MongoDBDatabaseCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB MongoDB database.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB MongoDB database.", + "$ref": "#/definitions/MongoDBDatabaseCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "MongoDBDatabaseCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB MongoDB database.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a MongoDB database", + "$ref": "#/definitions/MongoDBDatabaseResource" + }, + "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"] + }, + "MongoDBCollectionCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB MongoDB collection.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB MongoDB collection.", + "$ref": "#/definitions/MongoDBCollectionCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "MongoDBCollectionCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB MongoDB collection.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a MongoDB collection", + "$ref": "#/definitions/MongoDBCollectionResource" + }, + "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"] + }, + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "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"] + }, + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "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"] + }, + "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" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "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"] + }, + "GremlinGraphCreateUpdateParameters": { + "description": "Parameters to create and update Cosmos DB Gremlin graph.", + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Properties to create and update Azure Cosmos DB Gremlin graph.", + "$ref": "#/definitions/GremlinGraphCreateUpdateProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ], + "required": ["properties"] + }, + "GremlinGraphCreateUpdateProperties": { + "description": "Properties to create and update Azure Cosmos DB Gremlin graph.", + "type": "object", + "properties": { + "resource": { + "description": "The standard JSON format of a Gremlin graph", + "$ref": "#/definitions/GremlinGraphResource" + }, + "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"] + }, + "ThroughputSettingsResource": { + "type": "object", + "description": "Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both.", + "properties": { + "throughput": { + "type": "integer", + "description": "Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both." + }, + "autoscaleSettings": { + "description": "Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both.", + "$ref": "#/definitions/AutoscaleSettingsResource" + }, + "minimumThroughput": { + "type": "string", + "description": "The minimum throughput of the resource", + "readOnly": true + }, + "offerReplacePending": { + "type": "string", + "description": "The throughput replace is pending", + "readOnly": true + } + } + }, + "AutoscaleSettingsResource": { + "type": "object", + "description": "Cosmos DB provisioned throughput settings object", + "properties": { + "maxThroughput": { + "type": "integer", + "description": "Represents maximum throughput container can scale up to." + }, + "autoUpgradePolicy": { + "description": "Cosmos DB resource auto-upgrade policy", + "$ref": "#/definitions/AutoUpgradePolicyResource" + }, + "targetMaxThroughput": { + "type": "integer", + "description": "Represents target maximum throughput container can scale up to once offer is no longer in pending state.", + "readOnly": true + } + }, + "required": ["maxThroughput"] + }, + "AutoUpgradePolicyResource": { + "type": "object", + "description": "Cosmos DB resource auto-upgrade policy", + "properties": { + "throughputPolicy": { + "description": "Represents throughput policy which service must adhere to for auto-upgrade", + "$ref": "#/definitions/ThroughputPolicyResource" + } + } + }, + "ThroughputPolicyResource": { + "type": "object", + "description": "Cosmos DB resource throughput policy", + "properties": { + "isEnabled": { + "type": "boolean", + "description": "Determines whether the ThroughputPolicy is active or not" + }, + "incrementPercent": { + "type": "integer", + "description": "Represents the percentage by which throughput can increase every time throughput policy kicks in." + } + } + }, + "OptionsResource": { + "type": "object", + "description": "Cosmos DB options resource object", + "readOnly": true, + "properties": { + "throughput": { + "type": "integer", + "description": "Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details." + }, + "autoscaleSettings": { + "type": "object", + "$ref": "#/definitions/AutoscaleSettings", + "description": "Specifies the Autoscale settings." + } + } + }, + "SqlDatabaseResource": { + "type": "object", + "description": "Cosmos DB SQL database resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB SQL database" + } + }, + "required": ["id"] + }, + "SqlContainerResource": { + "type": "object", + "description": "Cosmos DB SQL container resource object", + "properties": { + "id": { + "type": "string", + "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 container" + }, + "partitionKey": { + "$ref": "#/definitions/ContainerPartitionKey", + "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 container." + } + }, + "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/IncludedPath" + } + }, + "excludedPaths": { + "description": "List of paths to exclude from indexing", + "type": "array", + "items": { + "$ref": "#/definitions/ExcludedPath" + } + }, + "compositeIndexes": { + "description": "List of composite path list", + "type": "array", + "items": { + "$ref": "#/definitions/CompositePathList" + } + }, + "spatialIndexes": { + "description": "List of spatial specifics", + "type": "array", + "items": { + "$ref": "#/definitions/SpatialSpec" + } + } + } + }, + "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/*)" + } + } + }, + "IncludedPath": { + "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 wildcard (/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 + } + } + } + }, + "CompositePathList": { + "description": "List of composite path", + "type": "array", + "items": { + "$ref": "#/definitions/CompositePath" + } + }, + "CompositePath": { + "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/*)" + }, + "order": { + "description": "Sort order for composite paths.", + "type": "string", + "enum": ["Ascending", "Descending"], + "x-ms-enum": { + "name": "CompositePathSortOrder", + "modelAsString": true + } + } + } + }, + "SpatialSpec": { + "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/*)" + }, + "types": { + "description": "List of path's spatial type", + "type": "array", + "items": { + "$ref": "#/definitions/SpatialType" + } + } + } + }, + "SpatialType": { + "description": "Indicates the spatial type of index.", + "type": "string", + "enum": ["Point", "LineString", "Polygon", "MultiPolygon"], + "x-ms-enum": { + "name": "SpatialType", + "modelAsString": true + } + }, + "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 container can be partitioned", + "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 + } + }, + "version": { + "description": "Indicates the version of the partition key definition", + "type": "integer", + "minimum": 1, + "maximum": 2, + "format": "int32" + } + } + }, + "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.", + "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 container.", + "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." + } + } + }, + "SqlStoredProcedureResource": { + "type": "object", + "description": "Cosmos DB SQL storedProcedure resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB SQL storedProcedure" + }, + "body": { + "type": "string", + "description": "Body of the Stored Procedure" + } + }, + "required": ["id"] + }, + "SqlUserDefinedFunctionResource": { + "type": "object", + "description": "Cosmos DB SQL userDefinedFunction resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB SQL userDefinedFunction" + }, + "body": { + "type": "string", + "description": "Body of the User Defined Function" + } + }, + "required": ["id"] + }, + "SqlTriggerResource": { + "type": "object", + "description": "Cosmos DB SQL trigger resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB SQL trigger" + }, + "body": { + "type": "string", + "description": "Body of the Trigger" + }, + "triggerType": { + "type": "string", + "enum": ["Pre", "Post"], + "description": "Type of the Trigger", + "x-ms-enum": { + "name": "triggerType", + "modelAsString": true + } + }, + "triggerOperation": { + "type": "string", + "enum": ["All", "Create", "Update", "Delete", "Replace"], + "description": "The operation the trigger is associated with", + "x-ms-enum": { + "name": "triggerOperation", + "modelAsString": true + } + } + }, + "required": ["id"] + }, + "MongoDBDatabaseResource": { + "type": "object", + "description": "Cosmos DB MongoDB database resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB MongoDB database" + } + }, + "required": ["id"] + }, + "MongoDBCollectionResource": { + "type": "object", + "description": "Cosmos DB MongoDB collection resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB MongoDB 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" + } + }, + "analyticalStorageTtl": { + "type": "integer", + "description": "Analytical TTL." + } + }, + "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 MongoDB collection index key", + "properties": { + "key": { + "description": "Cosmos DB MongoDB collection index keys", + "$ref": "#/definitions/MongoIndexKeys" + }, + "options": { + "description": "Cosmos DB MongoDB collection index key options", + "$ref": "#/definitions/MongoIndexOptions" + } + } + }, + "MongoIndexKeys": { + "type": "object", + "description": "Cosmos DB MongoDB collection resource object", + "properties": { + "keys": { + "description": "List of keys for each MongoDB 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 MongoDB collection index options", + "properties": { + "expireAfterSeconds": { + "description": "Expire after seconds", + "type": "integer" + }, + "unique": { + "description": "Is unique or not", + "type": "boolean" + } + } + }, + "TableResource": { + "type": "object", + "description": "Cosmos DB table resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB table" + } + }, + "required": ["id"] + }, + "CassandraKeyspaceResource": { + "type": "object", + "description": "Cosmos DB Cassandra keyspace resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Cassandra keyspace" + } + }, + "required": ["id"] + }, + "CassandraTableResource": { + "type": "object", + "description": "Cosmos DB Cassandra table resource 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" + }, + "analyticalStorageTtl": { + "type": "integer", + "description": "Analytical TTL." + } + }, + "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\"" + } + } + }, + "GremlinDatabaseResource": { + "type": "object", + "description": "Cosmos DB Gremlin database resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Gremlin database" + } + }, + "required": ["id"] + }, + "GremlinGraphResource": { + "type": "object", + "description": "Cosmos DB Gremlin graph resource object", + "properties": { + "id": { + "type": "string", + "description": "Name of the Cosmos DB Gremlin graph" + }, + "indexingPolicy": { + "$ref": "#/definitions/IndexingPolicy", + "description": "The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph" + }, + "partitionKey": { + "$ref": "#/definitions/ContainerPartitionKey", + "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 graph." + } + }, + "required": ["id"] + }, + "CreateUpdateOptions": { + "type": "object", + "properties": { + "throughput": { + "type": "integer", + "description": "Request Units per second. For example, \"throughput\": 10000." + }, + "autoscaleSettings": { + "$ref": "#/definitions/AutoscaleSettings", + "description": "Specifies the Autoscale settings." + } + }, + "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\"" + }, + "AutoscaleSettings": { + "type": "object", + "properties": { + "maxThroughput": { + "type": "integer", + "description": "Represents maximum throughput, the resource can scale up to." + } + } + }, + "Capability": { + "type": "object", + "description": "Cosmos DB capability object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Cosmos DB capability. For example, \"name\": \"EnableCassandra\". Current values also include \"EnableTable\" and \"EnableGremlin\"." + } + } + }, + "Tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with \"defaultExperience\": \"Cassandra\". Current \"defaultExperience\" values also include \"Table\", \"Graph\", \"DocumentDB\", and \"MongoDB\"." + }, + "ManagedServiceIdentity": { + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal id of the system assigned identity. This property will only be provided for a system assigned identity." + }, + "tenantId": { + "readOnly": true, + "type": "string", + "description": "The tenant id of the system assigned identity. This property will only be provided for a system assigned identity." + }, + "type": { + "type": "string", + "description": "The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.", + "enum": ["SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None"], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false + } + } + }, + "description": "Identity for the resource." + }, + "ProvisioningState": { + "type": "string", + "readOnly": true, + "description": "The status of the Cosmos DB account at the time the operation was called. The status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB account deletion failed." + }, + "IPRules": { + "type": "array", + "description": "Array of IpAddressOrRange objects.", + "items": { + "$ref": "#/definitions/IpAddressOrRange" + } + }, + "IpAddressOrRange": { + "type": "object", + "description": "IpAddressOrRange object", + "properties": { + "ipAddressOrRange": { + "type": "string", + "description": "A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”." + } + } + }, + "VirtualNetworkRule": { + "type": "object", + "description": "Virtual Network ACL Rule object", + "properties": { + "id": { + "type": "string", + "description": "Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}." + }, + "ignoreMissingVNetServiceEndpoint": { + "type": "boolean", + "description": "Create firewall rule before the virtual network has vnet service endpoint enabled." + } + } + }, + "PrivateEndpointConnection": { + "description": "A private endpoint connection", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/PrivateEndpointConnectionProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ] + }, + "PrivateEndpointConnectionProperties": { + "description": "Properties of a private endpoint connection.", + "type": "object", + "properties": { + "privateEndpoint": { + "$ref": "#/definitions/PrivateEndpointProperty", + "description": "Private endpoint which the connection belongs to." + }, + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/PrivateLinkServiceConnectionStateProperty", + "description": "Connection State of the Private Endpoint Connection." + } + } + }, + "PrivateEndpointProperty": { + "type": "object", + "description": "Private endpoint which the connection belongs to.", + "properties": { + "id": { + "type": "string", + "description": "Resource id of the private endpoint." + } + } + }, + "PrivateLinkServiceConnectionStateProperty": { + "type": "object", + "description": "Connection State of the Private Endpoint Connection.", + "properties": { + "status": { + "type": "string", + "description": "The private link service connection status." + }, + "actionsRequired": { + "type": "string", + "description": "Any action that is required beyond basic workflow (approve/ reject/ disconnect)", + "readOnly": true + } + } + }, + "Operation": { + "description": "REST API operation", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}", + "type": "string" + }, + "display": { + "description": "The object that represents the operation.", + "properties": { + "Provider": { + "description": "Service provider: Microsoft.ResourceProvider", + "type": "string" + }, + "Resource": { + "description": "Resource on which the operation is performed: Profile, endpoint, etc.", + "type": "string" + }, + "Operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string" + }, + "Description": { + "description": "Description of operation", + "type": "string" + } + } + } + } + }, + "OperationListResult": { + "description": "Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get the next set of results.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "description": "List of operations supported by the Resource Provider." + }, + "nextLink": { + "type": "string", + "description": "URL to get the next set of operation list results if there are any." + } + } + }, + "UsagesResult": { + "properties": { + "value": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Usage" + }, + "description": "The list of usages for the database. A usage is a point in time metric" + } + }, + "description": "The response to a list usage request." + }, + "Usage": { + "properties": { + "unit": { + "description": "The unit of the metric.", + "$ref": "#/definitions/UnitType" + }, + "name": { + "$ref": "#/definitions/MetricName", + "readOnly": true, + "description": "The name information for the metric." + }, + "quotaPeriod": { + "type": "string", + "readOnly": true, + "description": "The quota period used to summarize the usage values." + }, + "limit": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Maximum value for this metric" + }, + "currentValue": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "Current value for this metric" + } + }, + "description": "The usage data for a usage request." + }, + "PartitionUsagesResult": { + "properties": { + "value": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/PartitionUsage" + }, + "description": "The list of partition-level usages for the database. A usage is a point in time metric" + } + }, + "description": "The response to a list partition level usage request." + }, + "PartitionUsage": { + "allOf": [ + { + "$ref": "#/definitions/Usage" + } + ], + "properties": { + "partitionId": { + "readOnly": true, + "type": "string", + "description": "The partition id (GUID identifier) of the usages." + }, + "partitionKeyRangeId": { + "readOnly": true, + "type": "string", + "description": "The partition key range id (integer identifier) of the usages." + } + }, + "description": "The partition level usage data for a usage request." + }, + "MetricDefinitionsListResult": { + "properties": { + "value": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/MetricDefinition" + }, + "description": "The list of metric definitions for the account." + } + }, + "description": "The response to a list metric definitions request." + }, + "MetricDefinition": { + "properties": { + "metricAvailabilities": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/MetricAvailability" + }, + "description": "The list of metric availabilities for the account." + }, + "primaryAggregationType": { + "readOnly": true, + "type": "string", + "description": "The primary aggregation type of the metric.", + "enum": ["None", "Average", "Total", "Minimum", "Maximum", "Last"], + "x-ms-enum": { + "modelAsString": true, + "name": "PrimaryAggregationType" + } + }, + "unit": { + "description": "The unit of the metric.", + "$ref": "#/definitions/UnitType" + }, + "resourceUri": { + "readOnly": true, + "type": "string", + "description": "The resource uri of the database." + }, + "name": { + "readOnly": true, + "$ref": "#/definitions/MetricName", + "description": "The name information for the metric." + } + }, + "description": "The definition of a metric." + }, + "MetricAvailability": { + "properties": { + "timeGrain": { + "readOnly": true, + "type": "string", + "description": "The time grain to be used to summarize the metric values." + }, + "retention": { + "readOnly": true, + "type": "string", + "description": "The retention for the metric values." + } + }, + "description": "The availability of the metric." + }, + "MetricListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + }, + "description": "The list of metrics for the account." + } + }, + "description": "The response to a list metrics request." + }, + "Metric": { + "properties": { + "startTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "The start time for the metric (ISO-8601 format)." + }, + "endTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "The end time for the metric (ISO-8601 format)." + }, + "timeGrain": { + "readOnly": true, + "type": "string", + "description": "The time grain to be used to summarize the metric values." + }, + "unit": { + "$ref": "#/definitions/UnitType", + "description": "The unit of the metric." + }, + "name": { + "readOnly": true, + "$ref": "#/definitions/MetricName", + "description": "The name information for the metric." + }, + "metricValues": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/MetricValue" + }, + "description": "The metric values for the specified time window and timestep." + } + }, + "description": "Metric data" + }, + "MetricName": { + "properties": { + "value": { + "readOnly": true, + "type": "string", + "description": "The name of the metric." + }, + "localizedValue": { + "readOnly": true, + "type": "string", + "description": "The friendly name of the metric." + } + }, + "description": "A metric name." + }, + "MetricValue": { + "properties": { + "_count": { + "readOnly": true, + "type": "number", + "format": "int32", + "description": "The number of values for the metric." + }, + "average": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The average value of the metric." + }, + "maximum": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The max value of the metric." + }, + "minimum": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The min value of the metric." + }, + "timestamp": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "The metric timestamp (ISO-8601 format)." + }, + "total": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The total value of the metric." + } + }, + "description": "Represents metrics values." + }, + "PercentileMetricListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/PercentileMetric" + }, + "description": "The list of percentile metrics for the account." + } + }, + "description": "The response to a list percentile metrics request." + }, + "PercentileMetric": { + "properties": { + "startTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "The start time for the metric (ISO-8601 format)." + }, + "endTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "The end time for the metric (ISO-8601 format)." + }, + "timeGrain": { + "readOnly": true, + "type": "string", + "description": "The time grain to be used to summarize the metric values." + }, + "unit": { + "$ref": "#/definitions/UnitType", + "description": "The unit of the metric." + }, + "name": { + "readOnly": true, + "$ref": "#/definitions/MetricName", + "description": "The name information for the metric." + }, + "metricValues": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/PercentileMetricValue" + }, + "description": "The percentile metric values for the specified time window and timestep." + } + }, + "description": "Percentile Metric data" + }, + "PercentileMetricValue": { + "allOf": [ + { + "$ref": "#/definitions/MetricValue" + } + ], + "properties": { + "P10": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 10th percentile value for the metric." + }, + "P25": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 25th percentile value for the metric." + }, + "P50": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 50th percentile value for the metric." + }, + "P75": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 75th percentile value for the metric." + }, + "P90": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 90th percentile value for the metric." + }, + "P95": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 95th percentile value for the metric." + }, + "P99": { + "readOnly": true, + "type": "number", + "format": "double", + "description": "The 99th percentile value for the metric." + } + }, + "description": "Represents percentile metrics values." + }, + "PartitionMetricListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/PartitionMetric" + }, + "description": "The list of partition-level metrics for the account." + } + }, + "description": "The response to a list partition metrics request." + }, + "PartitionMetric": { + "allOf": [ + { + "$ref": "#/definitions/Metric" + } + ], + "properties": { + "partitionId": { + "readOnly": true, + "type": "string", + "description": "The partition id (GUID identifier) of the metric values." + }, + "partitionKeyRangeId": { + "readOnly": true, + "type": "string", + "description": "The partition key range id (integer identifier) of the metric values." + } + }, + "description": "The metric values for a single partition." + }, + "UnitType": { + "type": "string", + "readOnly": true, + "description": "The unit of the metric.", + "enum": ["Count", "Bytes", "Seconds", "Percent", "CountPerSecond", "BytesPerSecond", "Milliseconds"], + "x-ms-enum": { + "modelAsString": true, + "name": "UnitType" + } + }, + "ConnectorOffer": { + "description": "The cassandra connector offer type for the Cosmos DB C* database account.", + "type": "string", + "enum": ["Small"], + "x-ms-enum": { + "name": "ConnectorOffer", + "modelAsString": true + } + }, + "PublicNetworkAccess": { + "type": "string", + "readOnly": true, + "description": "Whether requests from Public Network are allowed", + "enum": ["Enabled", "Disabled"], + "x-ms-enum": { + "modelAsString": true, + "name": "PublicNetworkAccess" + } + }, + "ApiProperties": { + "type": "object", + "properties": { + "serverVersion": { + "type": "string", + "enum": ["3.2", "3.6"], + "description": "Describes the ServerVersion of an a MongoDB account.", + "x-ms-enum": { + "modelAsString": true, + "name": "ServerVersion" + } + } + } + }, + "CreateMode": { + "description": "Enum to indicate the mode of account creation.", + "type": "string", + "default": "Default", + "enum": ["Default", "Restore"], + "x-ms-enum": { + "name": "CreateMode", + "modelAsString": true + } + }, + "RestoreParameters": { + "type": "object", + "description": "Parameters to indicate the information about the restore.", + "x-ms-mutability": ["read", "create"], + "properties": { + "restoreMode": { + "type": "string", + "enum": ["PointInTime"], + "description": "Describes the mode of the restore.", + "x-ms-enum": { + "modelAsString": true, + "name": "RestoreMode" + } + }, + "restoreSource": { + "type": "string", + "description": "Path of the source account from which the restore has to be initiated" + }, + "restoreTimestampInUtc": { + "type": "string", + "format": "date-time", + "description": "Time to which the account has to be restored (ISO-8601 format)." + }, + "databasesToRestore": { + "type": "array", + "description": "List of specific databases to restore.", + "items": { + "$ref": "#/definitions/DatabaseRestoreResource" + } + } + } + }, + "DatabaseRestoreResource": { + "type": "object", + "description": "Specific Databases to restore.", + "properties": { + "databaseName": { + "type": "string", + "description": "The name of the database to restore." + }, + "collectionNames": { + "type": "array", + "description": "The names of the collections to restore.", + "items": { + "$ref": "#/definitions/CollectionName" + } + } + } + }, + "CollectionName": { + "type": "string", + "description": "The name of the collection." + }, + "BackupPolicy": { + "type": "object", + "description": "The object representing the policy for taking backups on an account.", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "enum": ["Periodic", "Continuous"], + "description": "Describes the mode of backups.", + "x-ms-enum": { + "modelAsString": true, + "name": "BackupType" + } + } + }, + "required": ["type"] + }, + "PeriodicModeBackupPolicy": { + "description": "The object representing periodic mode backup policy.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/BackupPolicy" + } + ], + "properties": { + "periodicModeProperties": { + "type": "object", + "description": "Configuration values for periodic mode backup", + "$ref": "#/definitions/PeriodicModeProperties" + } + }, + "x-ms-discriminator-value": "Periodic" + }, + "ContinuousModeBackupPolicy": { + "description": "The object representing continuous mode backup policy.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/BackupPolicy" + } + ], + "x-ms-discriminator-value": "Continuous" + }, + "PeriodicModeProperties": { + "type": "object", + "description": "Configuration values for periodic mode backup", + "properties": { + "backupIntervalInMinutes": { + "type": "integer", + "format": "int32", + "minimum": 0, + "description": "An integer representing the interval in minutes between two backups" + }, + "backupRetentionIntervalInHours": { + "type": "integer", + "format": "int32", + "minimum": 0, + "description": "An integer representing the time (in hours) that each backup is retained" + } + } + }, + "RestorableDatabaseAccountsListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/RestorableDatabaseAccountGetResult" + }, + "description": "List of restorable database accounts and their properties." + } + }, + "description": "The List operation response, that contains the restorable database accounts and their properties." + }, + "RestorableDatabaseAccountGetResult": { + "description": "A Azure Cosmos DB restorable database account.", + "type": "object", + "properties": { + "properties": { + "type": "object", + "x-ms-client-flatten": true, + "description": "The properties of a restorable database account.", + "$ref": "#/definitions/RestorableDatabaseAccountProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ARMResourceProperties" + } + ] + }, + "RestorableDatabaseAccountProperties": { + "type": "object", + "description": "The properties of a restorable database account.", + "properties": { + "accountName": { + "type": "string", + "description": "The name of the global database account" + }, + "creationTime": { + "type": "string", + "format": "date-time", + "description": "The creation time of the restorable database account (ISO-8601 format)." + }, + "deletionTime": { + "type": "string", + "format": "date-time", + "description": "The time at which the restorable database account has been deleted (ISO-8601 format)." + } + } + } + }, + "parameters": { + "resourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method", + "description": "Name of an Azure resource group." + }, + "accountNameParameter": { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB database account name.", + "minLength": 3, + "maxLength": 50, + "pattern": "^[a-z0-9]+(-[a-z0-9]+)*" + }, + "filterParameter": { + "name": "$filter", + "in": "query", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq." + }, + "usageFilterParameter": { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names)." + }, + "databaseRidParameter": { + "name": "databaseRid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB database rid." + }, + "collectionRidParameter": { + "name": "collectionRid", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB collection rid." + }, + "databaseNameParameter": { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB database name." + }, + "containerNameParameter": { + "name": "containerName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB container name." + }, + "storedProcedureNameParameter": { + "name": "storedProcedureName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB storedProcedure name." + }, + "userDefinedFunctionNameParameter": { + "name": "userDefinedFunctionName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB userDefinedFunction name." + }, + "triggerNameParameter": { + "name": "triggerName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB trigger name." + }, + "tableNameParameter": { + "name": "tableName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB table name." + }, + "collectionNameParameter": { + "name": "collectionName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB collection name." + }, + "keyspaceNameParameter": { + "name": "keyspaceName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB keyspace name." + }, + "graphNameParameter": { + "name": "graphName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB graph name." + }, + "regionParameter": { + "name": "region", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB region, with spaces between words and each word capitalized." + }, + "sourceRegionParameter": { + "name": "sourceRegion", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized." + }, + "targetRegionParameter": { + "name": "targetRegion", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized." + }, + "partitionKeyRangeIdParameter": { + "name": "partitionKeyRangeId", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Partition Key Range Id for which to get data." + }, + "locationParameter": { + "name": "location", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Cosmos DB region, with spaces between words and each word capitalized." + }, + "instanceIdParameter": { + "name": "instanceId", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The instanceId GUID of a restorable database account." + } + } +}