diff --git a/src/Common/CosmosClient.ts b/src/Common/CosmosClient.ts index 2779e1ba1..da84e0c07 100644 --- a/src/Common/CosmosClient.ts +++ b/src/Common/CosmosClient.ts @@ -203,8 +203,10 @@ export function client(): Cosmos.CosmosClient { } let _defaultHeaders: Cosmos.CosmosHeaders = {}; + _defaultHeaders["x-ms-cosmos-sdk-supportedcapabilities"] = SDKSupportedCapabilities.None | SDKSupportedCapabilities.PartitionMerge; + _defaultHeaders["x-ms-cosmos-throughput-bucket"] = 1; if ( userContext.authType === AuthType.ConnectionString || diff --git a/src/Common/dataAccess/readCollectionOffer.ts b/src/Common/dataAccess/readCollectionOffer.ts index e52df1f60..6fb6e9e4b 100644 --- a/src/Common/dataAccess/readCollectionOffer.ts +++ b/src/Common/dataAccess/readCollectionOffer.ts @@ -105,6 +105,8 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri ? parseInt(resource.softAllowedMaximumThroughput) : resource.softAllowedMaximumThroughput; + const throughputBuckets = resource?.throughputBuckets; + if (autoscaleSettings) { return { id: offerId, @@ -114,6 +116,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri offerReplacePending: resource.offerReplacePending === "true", instantMaximumThroughput, softAllowedMaximumThroughput, + throughputBuckets, }; } @@ -125,6 +128,7 @@ const readCollectionOfferWithARM = async (databaseId: string, collectionId: stri offerReplacePending: resource.offerReplacePending === "true", instantMaximumThroughput, softAllowedMaximumThroughput, + throughputBuckets, }; } diff --git a/src/Common/dataAccess/updateOffer.ts b/src/Common/dataAccess/updateOffer.ts index 0e507ce37..4d26ca68d 100644 --- a/src/Common/dataAccess/updateOffer.ts +++ b/src/Common/dataAccess/updateOffer.ts @@ -1,6 +1,6 @@ import { OfferDefinition, RequestOptions } from "@azure/cosmos"; import { AuthType } from "../../AuthType"; -import { Offer, SDKOfferDefinition, UpdateOfferParams } from "../../Contracts/DataModels"; +import { Offer, SDKOfferDefinition, ThroughputBucket, UpdateOfferParams } from "../../Contracts/DataModels"; import { userContext } from "../../UserContext"; import { migrateCassandraKeyspaceToAutoscale, @@ -359,6 +359,13 @@ const createUpdateOfferBody = (params: UpdateOfferParams): ThroughputSettingsUpd body.properties.resource.throughput = params.manualThroughput; } + if (params.throughputBuckets) { + const throughputBuckets = params.throughputBuckets.filter( + (bucket: ThroughputBucket) => bucket.maxThroughputPercentage !== 100, + ); + body.properties.resource.throughputBuckets = throughputBuckets; + } + return body; }; diff --git a/src/Contracts/DataModels.ts b/src/Contracts/DataModels.ts index 47533fee3..3b3ab5027 100644 --- a/src/Contracts/DataModels.ts +++ b/src/Contracts/DataModels.ts @@ -275,6 +275,12 @@ export interface Offer { offerReplacePending: boolean; instantMaximumThroughput?: number; softAllowedMaximumThroughput?: number; + throughputBuckets?: ThroughputBucket[]; +} + +export interface ThroughputBucket { + id: number; + maxThroughputPercentage: number; } export interface SDKOfferDefinition extends Resource { @@ -397,6 +403,7 @@ export interface UpdateOfferParams { collectionId?: string; migrateToAutoPilot?: boolean; migrateToManual?: boolean; + throughputBuckets?: ThroughputBucket[]; } export interface Notification { diff --git a/src/Explorer/Controls/Settings/SettingsComponent.test.tsx b/src/Explorer/Controls/Settings/SettingsComponent.test.tsx index a97ee8f45..5a7a47def 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.test.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.test.tsx @@ -1,5 +1,7 @@ +import { AuthType } from "AuthType"; import { shallow } from "enzyme"; import ko from "knockout"; +import { Features } from "Platform/Hosted/extractFeatures"; import React from "react"; import { updateCollection } from "../../../Common/dataAccess/updateCollection"; import { updateOffer } from "../../../Common/dataAccess/updateOffer"; @@ -247,4 +249,42 @@ describe("SettingsComponent", () => { expect(conflictResolutionPolicy.mode).toEqual(DataModels.ConflictResolutionMode.Custom); expect(conflictResolutionPolicy.conflictResolutionProcedure).toEqual(expectSprocPath); }); + + it("should save throughput bucket changes when Save button is clicked", async () => { + updateUserContext({ + apiType: "SQL", + features: { enableThroughputBuckets: true } as Features, + authType: AuthType.AAD, + }); + + const wrapper = shallow(); + + const settingsComponentInstance = wrapper.instance() as SettingsComponent; + const isEnabled = settingsComponentInstance["throughputBucketsEnabled"]; + expect(isEnabled).toBe(true); + + wrapper.setState({ + isThroughputBucketsSaveable: true, + throughputBuckets: [ + { id: 1, maxThroughputPercentage: 70 }, + { id: 2, maxThroughputPercentage: 60 }, + ], + }); + + await settingsComponentInstance.onSaveClick(); + + expect(updateOffer).toHaveBeenCalledWith({ + databaseId: collection.databaseId, + collectionId: collection.id(), + currentOffer: expect.any(Object), + autopilotThroughput: collection.offer().autoscaleMaxThroughput, + manualThroughput: collection.offer().manualThroughput, + throughputBuckets: [ + { id: 1, maxThroughputPercentage: 70 }, + { id: 2, maxThroughputPercentage: 60 }, + ], + }); + + expect(wrapper.state("isThroughputBucketsSaveable")).toBe(false); + }); }); diff --git a/src/Explorer/Controls/Settings/SettingsComponent.tsx b/src/Explorer/Controls/Settings/SettingsComponent.tsx index 57bf5b13e..720bef874 100644 --- a/src/Explorer/Controls/Settings/SettingsComponent.tsx +++ b/src/Explorer/Controls/Settings/SettingsComponent.tsx @@ -7,6 +7,10 @@ import { ContainerPolicyComponent, ContainerPolicyComponentProps, } from "Explorer/Controls/Settings/SettingsSubComponents/ContainerPolicyComponent"; +import { + ThroughputBucketsComponent, + ThroughputBucketsComponentProps, +} from "Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent"; import { useDatabases } from "Explorer/useDatabases"; import { isFullTextSearchEnabled, isVectorSearchEnabled } from "Utils/CapabilityUtils"; import { isRunningOnPublicCloud } from "Utils/CloudUtils"; @@ -86,6 +90,8 @@ export interface SettingsComponentState { wasAutopilotOriginallySet: boolean; isScaleSaveable: boolean; isScaleDiscardable: boolean; + throughputBuckets: DataModels.ThroughputBucket[]; + throughputBucketsBaseline: DataModels.ThroughputBucket[]; throughputError: string; timeToLive: TtlType; @@ -104,6 +110,7 @@ export interface SettingsComponentState { changeFeedPolicyBaseline: ChangeFeedPolicyState; isSubSettingsSaveable: boolean; isSubSettingsDiscardable: boolean; + isThroughputBucketsSaveable: boolean; vectorEmbeddingPolicy: DataModels.VectorEmbeddingPolicy; vectorEmbeddingPolicyBaseline: DataModels.VectorEmbeddingPolicy; @@ -158,6 +165,7 @@ export class SettingsComponent extends React.Component this.setState({ indexingPolicyContent: newIndexingPolicy }); + private onThroughputBucketsSaveableChange = (isSaveable: boolean): void => { + this.setState({ isThroughputBucketsSaveable: isSaveable }); + }; + private resetShouldDiscardContainerPolicies = (): void => this.setState({ shouldDiscardContainerPolicies: false }); private resetShouldDiscardIndexingPolicy = (): void => this.setState({ shouldDiscardIndexingPolicy: false }); @@ -749,9 +773,13 @@ export class SettingsComponent extends React.Component { + this.setState({ throughputBuckets }); + }; + private onAutoPilotSelected = (isAutoPilotSelected: boolean): void => this.setState({ isAutoPilotSelected: isAutoPilotSelected }); @@ -1029,6 +1061,24 @@ export class SettingsComponent extends React.Component, + }); + } + const pivotProps: IPivotProps = { onLinkClick: this.onPivotChange, selectedKey: SettingsV2TabTypes[this.state.selectedTab], diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent.test.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent.test.tsx new file mode 100644 index 000000000..460dfa252 --- /dev/null +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent.test.tsx @@ -0,0 +1,177 @@ +import "@testing-library/jest-dom"; +import { fireEvent, render, screen } from "@testing-library/react"; +import React from "react"; +import { ThroughputBucketsComponent } from "./ThroughputBucketsComponent"; + +describe("ThroughputBucketsComponent", () => { + const mockOnBucketsChange = jest.fn(); + const mockOnSaveableChange = jest.fn(); + + const defaultProps = { + currentBuckets: [ + { id: 1, maxThroughputPercentage: 50 }, + { id: 2, maxThroughputPercentage: 60 }, + ], + throughputBucketsBaseline: [ + { id: 1, maxThroughputPercentage: 40 }, + { id: 2, maxThroughputPercentage: 50 }, + ], + onBucketsChange: mockOnBucketsChange, + onSaveableChange: mockOnSaveableChange, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("renders the correct number of buckets", () => { + render(); + expect(screen.getAllByText(/Group \d+/)).toHaveLength(5); + }); + + it("renders buckets in the correct order even if input is unordered", () => { + const unorderedBuckets = [ + { id: 2, maxThroughputPercentage: 60 }, + { id: 1, maxThroughputPercentage: 50 }, + ]; + render(); + + const bucketLabels = screen.getAllByText(/Group \d+/).map((el) => el.textContent); + expect(bucketLabels).toEqual(["Group 1 (Data Explorer Query Bucket)", "Group 2", "Group 3", "Group 4", "Group 5"]); + }); + + it("renders all provided buckets even if they exceed the max default bucket count", () => { + const oversizedBuckets = [ + { id: 1, maxThroughputPercentage: 50 }, + { id: 2, maxThroughputPercentage: 60 }, + { id: 3, maxThroughputPercentage: 70 }, + { id: 4, maxThroughputPercentage: 80 }, + { id: 5, maxThroughputPercentage: 90 }, + { id: 6, maxThroughputPercentage: 100 }, + { id: 7, maxThroughputPercentage: 40 }, + ]; + + render(); + + expect(screen.getAllByText(/Group \d+/)).toHaveLength(7); + + expect(screen.getByDisplayValue("50")).toBeInTheDocument(); + expect(screen.getByDisplayValue("60")).toBeInTheDocument(); + expect(screen.getByDisplayValue("70")).toBeInTheDocument(); + expect(screen.getByDisplayValue("80")).toBeInTheDocument(); + expect(screen.getByDisplayValue("90")).toBeInTheDocument(); + expect(screen.getByDisplayValue("100")).toBeInTheDocument(); + expect(screen.getByDisplayValue("40")).toBeInTheDocument(); + }); + + it("calls onBucketsChange when a bucket value changes", () => { + render(); + const input = screen.getByDisplayValue("50"); + fireEvent.change(input, { target: { value: "70" } }); + + expect(mockOnBucketsChange).toHaveBeenCalledWith([ + { id: 1, maxThroughputPercentage: 70 }, + { id: 2, maxThroughputPercentage: 60 }, + { id: 3, maxThroughputPercentage: 100 }, + { id: 4, maxThroughputPercentage: 100 }, + { id: 5, maxThroughputPercentage: 100 }, + ]); + }); + + it("triggers onSaveableChange when values change", () => { + render(); + const input = screen.getByDisplayValue("50"); + fireEvent.change(input, { target: { value: "80" } }); + + expect(mockOnSaveableChange).toHaveBeenCalledWith(true); + }); + + it("updates state consistently after multiple changes to different buckets", () => { + render(); + + const input1 = screen.getByDisplayValue("50"); + fireEvent.change(input1, { target: { value: "70" } }); + + const input2 = screen.getByDisplayValue("60"); + fireEvent.change(input2, { target: { value: "80" } }); + + expect(mockOnBucketsChange).toHaveBeenCalledWith([ + { id: 1, maxThroughputPercentage: 70 }, + { id: 2, maxThroughputPercentage: 80 }, + { id: 3, maxThroughputPercentage: 100 }, + { id: 4, maxThroughputPercentage: 100 }, + { id: 5, maxThroughputPercentage: 100 }, + ]); + }); + + it("resets to baseline when currentBuckets are reset", () => { + const { rerender } = render(); + const input1 = screen.getByDisplayValue("50"); + fireEvent.change(input1, { target: { value: "70" } }); + + rerender(); + + expect(screen.getByDisplayValue("40")).toBeInTheDocument(); + expect(screen.getByDisplayValue("50")).toBeInTheDocument(); + }); + + it("does not call onBucketsChange when value remains unchanged", () => { + render(); + const input = screen.getByDisplayValue("50"); + fireEvent.change(input, { target: { value: "50" } }); + + expect(mockOnBucketsChange).not.toHaveBeenCalled(); + }); + + it("disables input and slider when maxThroughputPercentage is 100", () => { + render( + , + ); + + const disabledInputs = screen.getAllByDisplayValue("100"); + expect(disabledInputs.length).toBeGreaterThan(0); + expect(disabledInputs[0]).toBeDisabled(); + + const sliders = screen.getAllByRole("slider"); + expect(sliders.length).toBeGreaterThan(0); + expect(sliders[0]).toHaveAttribute("aria-disabled", "true"); + expect(sliders[1]).toHaveAttribute("aria-disabled", "false"); + }); + + it("toggles bucket value between 50 and 100 with switch", () => { + render(); + const toggles = screen.getAllByRole("switch"); + + fireEvent.click(toggles[0]); + + expect(mockOnBucketsChange).toHaveBeenCalledWith([ + { id: 1, maxThroughputPercentage: 100 }, + { id: 2, maxThroughputPercentage: 60 }, + { id: 3, maxThroughputPercentage: 100 }, + { id: 4, maxThroughputPercentage: 100 }, + { id: 5, maxThroughputPercentage: 100 }, + ]); + + fireEvent.click(toggles[0]); + + expect(mockOnBucketsChange).toHaveBeenCalledWith([ + { id: 1, maxThroughputPercentage: 50 }, + { id: 2, maxThroughputPercentage: 60 }, + { id: 3, maxThroughputPercentage: 100 }, + { id: 4, maxThroughputPercentage: 100 }, + { id: 5, maxThroughputPercentage: 100 }, + ]); + }); + + it("ensures default buckets are used when no buckets are provided", () => { + render(); + expect(screen.getAllByText(/Group \d+/)).toHaveLength(5); + expect(screen.getAllByDisplayValue("100")).toHaveLength(5); + }); +}); diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent.tsx new file mode 100644 index 000000000..a9408b1e4 --- /dev/null +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/ThroughputInputComponents/ThroughputBucketsComponent.tsx @@ -0,0 +1,105 @@ +import { Label, Slider, Stack, TextField, Toggle } from "@fluentui/react"; +import { ThroughputBucket } from "Contracts/DataModels"; +import React, { FC, useEffect, useState } from "react"; +import { isDirty } from "../../SettingsUtils"; + +const MAX_BUCKET_SIZES = 5; + +const DEFAULT_BUCKETS = Array.from({ length: MAX_BUCKET_SIZES }, (_, i) => ({ + id: i + 1, + maxThroughputPercentage: 100, +})); + +export interface ThroughputBucketsComponentProps { + currentBuckets: ThroughputBucket[]; + throughputBucketsBaseline: ThroughputBucket[]; + onBucketsChange: (updatedBuckets: ThroughputBucket[]) => void; + onSaveableChange: (isSaveable: boolean) => void; +} + +export const ThroughputBucketsComponent: FC = ({ + currentBuckets, + throughputBucketsBaseline, + onBucketsChange, + onSaveableChange, +}) => { + const getThroughputBuckets = (buckets: ThroughputBucket[]): ThroughputBucket[] => { + if (!buckets || buckets.length === 0) { + return DEFAULT_BUCKETS; + } + const maxBuckets = Math.max(DEFAULT_BUCKETS.length, buckets.length); + const adjustedDefaultBuckets = Array.from({ length: maxBuckets }, (_, i) => ({ + id: i + 1, + maxThroughputPercentage: 100, + })); + + return adjustedDefaultBuckets.map( + (defaultBucket) => buckets?.find((bucket) => bucket.id === defaultBucket.id) || defaultBucket, + ); + }; + + const [throughputBuckets, setThroughputBuckets] = useState(getThroughputBuckets(currentBuckets)); + + useEffect(() => { + setThroughputBuckets(getThroughputBuckets(currentBuckets)); + onSaveableChange(false); + }, [currentBuckets]); + + useEffect(() => { + const isChanged = isDirty(throughputBuckets, getThroughputBuckets(throughputBucketsBaseline)); + onSaveableChange(isChanged); + }, [throughputBuckets]); + + const handleBucketChange = (id: number, newValue: number) => { + const updatedBuckets = throughputBuckets.map((bucket) => + bucket.id === id ? { ...bucket, maxThroughputPercentage: newValue } : bucket, + ); + setThroughputBuckets(updatedBuckets); + const settingsChanged = isDirty(updatedBuckets, throughputBuckets); + settingsChanged && onBucketsChange(updatedBuckets); + }; + + const onToggle = (id: number, checked: boolean) => { + handleBucketChange(id, checked ? 50 : 100); + }; + + return ( + + + + {throughputBuckets?.map((bucket) => ( + + handleBucketChange(bucket.id, newValue)} + showValue={false} + label={`Group ${bucket.id}${bucket.id === 1 ? " (Data Explorer Query Bucket)" : ""}`} + styles={{ root: { flex: 2, maxWidth: 400 } }} + disabled={bucket.maxThroughputPercentage === 100} + /> + handleBucketChange(bucket.id, parseInt(newValue || "0", 10))} + type="number" + suffix="%" + styles={{ + fieldGroup: { width: 80 }, + }} + disabled={bucket.maxThroughputPercentage === 100} + /> + onToggle(bucket.id, checked)} + styles={{ root: { marginBottom: 0 }, text: { fontSize: 12 } }} + > + + ))} + + + ); +}; diff --git a/src/Explorer/Controls/Settings/SettingsUtils.tsx b/src/Explorer/Controls/Settings/SettingsUtils.tsx index fa8360b9b..900ad6ab0 100644 --- a/src/Explorer/Controls/Settings/SettingsUtils.tsx +++ b/src/Explorer/Controls/Settings/SettingsUtils.tsx @@ -11,7 +11,8 @@ export type isDirtyTypes = | DataModels.IndexingPolicy | DataModels.ComputedProperties | DataModels.VectorEmbedding[] - | DataModels.FullTextPolicy; + | DataModels.FullTextPolicy + | DataModels.ThroughputBucket[]; export const TtlOff = "off"; export const TtlOn = "on"; export const TtlOnNoDefault = "on-nodefault"; @@ -55,6 +56,7 @@ export enum SettingsV2TabTypes { PartitionKeyTab, ComputedPropertiesTab, ContainerVectorPolicyTab, + ThroughputBucketsTab, } export enum ContainerPolicyTabTypes { @@ -167,6 +169,8 @@ export const getTabTitle = (tab: SettingsV2TabTypes): string => { return "Computed Properties"; case SettingsV2TabTypes.ContainerVectorPolicyTab: return "Container Policies"; + case SettingsV2TabTypes.ThroughputBucketsTab: + return "Throughput Buckets"; default: throw new Error(`Unknown tab ${tab}`); } diff --git a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx index 2347e0822..821aebfe5 100644 --- a/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx +++ b/src/Explorer/Tabs/QueryTab/QueryTabComponent.tsx @@ -375,6 +375,7 @@ class QueryTabComponentImpl extends React.Component await queryDocumentsPage( this.props.collection && this.props.collection.id(), diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 5bd84516e..175c4bcff 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -16,6 +16,7 @@ export type Features = { readonly enableAadDataPlane: boolean; readonly enableResourceGraph: boolean; readonly enableKoResourceTree: boolean; + readonly enableThroughputBuckets: boolean; readonly hostedDataExplorer: boolean; readonly junoEndpoint?: string; readonly phoenixEndpoint?: string; @@ -81,6 +82,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear enableSpark: "true" === get("enablespark"), enableTtl: "true" === get("enablettl"), enableKoResourceTree: "true" === get("enablekoresourcetree"), + enableThroughputBuckets: "true" === get("enablethroughputbuckets"), executeSproc: "true" === get("dataexplorerexecutesproc"), hostedDataExplorer: "true" === get("hosteddataexplorerenabled"), mongoProxyEndpoint: get("mongoproxyendpoint"), diff --git a/src/Utils/arm/generatedClients/cosmos/cassandraResources.ts b/src/Utils/arm/generatedClients/cosmos/cassandraResources.ts index 461e516bf..9c573b9ad 100644 --- a/src/Utils/arm/generatedClients/cosmos/cassandraResources.ts +++ b/src/Utils/arm/generatedClients/cosmos/cassandraResources.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */ export async function listCassandraKeyspaces( diff --git a/src/Utils/arm/generatedClients/cosmos/collection.ts b/src/Utils/arm/generatedClients/cosmos/collection.ts index 4a9a9c198..da781b9f4 100644 --- a/src/Utils/arm/generatedClients/cosmos/collection.ts +++ b/src/Utils/arm/generatedClients/cosmos/collection.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given database account and collection. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/collectionPartition.ts b/src/Utils/arm/generatedClients/cosmos/collectionPartition.ts index 6fed487b6..7996d9f15 100644 --- a/src/Utils/arm/generatedClients/cosmos/collectionPartition.ts +++ b/src/Utils/arm/generatedClients/cosmos/collectionPartition.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given collection, split by partition. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/collectionPartitionRegion.ts b/src/Utils/arm/generatedClients/cosmos/collectionPartitionRegion.ts index b33c904d9..5e6f65265 100644 --- a/src/Utils/arm/generatedClients/cosmos/collectionPartitionRegion.ts +++ b/src/Utils/arm/generatedClients/cosmos/collectionPartitionRegion.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given collection and region, split by partition. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/collectionRegion.ts b/src/Utils/arm/generatedClients/cosmos/collectionRegion.ts index 984cb146a..03da69029 100644 --- a/src/Utils/arm/generatedClients/cosmos/collectionRegion.ts +++ b/src/Utils/arm/generatedClients/cosmos/collectionRegion.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given database account, collection and region. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/database.ts b/src/Utils/arm/generatedClients/cosmos/database.ts index 7b286c4ec..4cf7df0ef 100644 --- a/src/Utils/arm/generatedClients/cosmos/database.ts +++ b/src/Utils/arm/generatedClients/cosmos/database.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given database account and database. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/databaseAccountRegion.ts b/src/Utils/arm/generatedClients/cosmos/databaseAccountRegion.ts index 09f17c35b..bc9a611b8 100644 --- a/src/Utils/arm/generatedClients/cosmos/databaseAccountRegion.ts +++ b/src/Utils/arm/generatedClients/cosmos/databaseAccountRegion.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given database account and region. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/databaseAccounts.ts b/src/Utils/arm/generatedClients/cosmos/databaseAccounts.ts index 4b52b631b..f4b35a0a2 100644 --- a/src/Utils/arm/generatedClients/cosmos/databaseAccounts.ts +++ b/src/Utils/arm/generatedClients/cosmos/databaseAccounts.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the properties of an existing Azure Cosmos DB database account. */ export async function get( diff --git a/src/Utils/arm/generatedClients/cosmos/graphResources.ts b/src/Utils/arm/generatedClients/cosmos/graphResources.ts index d51d44d77..b304ff3e1 100644 --- a/src/Utils/arm/generatedClients/cosmos/graphResources.ts +++ b/src/Utils/arm/generatedClients/cosmos/graphResources.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists the graphs under an existing Azure Cosmos DB database account. */ export async function listGraphs( diff --git a/src/Utils/arm/generatedClients/cosmos/gremlinResources.ts b/src/Utils/arm/generatedClients/cosmos/gremlinResources.ts index 6e8656400..821faa6ad 100644 --- a/src/Utils/arm/generatedClients/cosmos/gremlinResources.ts +++ b/src/Utils/arm/generatedClients/cosmos/gremlinResources.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists the Gremlin databases under an existing Azure Cosmos DB database account. */ export async function listGremlinDatabases( diff --git a/src/Utils/arm/generatedClients/cosmos/locations.ts b/src/Utils/arm/generatedClients/cosmos/locations.ts index 6ec4cdc62..00cc27092 100644 --- a/src/Utils/arm/generatedClients/cosmos/locations.ts +++ b/src/Utils/arm/generatedClients/cosmos/locations.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* List Cosmos DB locations and their properties */ export async function list(subscriptionId: string): Promise { diff --git a/src/Utils/arm/generatedClients/cosmos/mongoDBResources.ts b/src/Utils/arm/generatedClients/cosmos/mongoDBResources.ts index 22b316904..24fbae936 100644 --- a/src/Utils/arm/generatedClients/cosmos/mongoDBResources.ts +++ b/src/Utils/arm/generatedClients/cosmos/mongoDBResources.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists the MongoDB databases under an existing Azure Cosmos DB database account. */ export async function listMongoDBDatabases( diff --git a/src/Utils/arm/generatedClients/cosmos/operations.ts b/src/Utils/arm/generatedClients/cosmos/operations.ts index ae87fbb48..e2dd9589f 100644 --- a/src/Utils/arm/generatedClients/cosmos/operations.ts +++ b/src/Utils/arm/generatedClients/cosmos/operations.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists all of the available Cosmos DB Resource Provider operations. */ export async function list(): Promise { diff --git a/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeId.ts b/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeId.ts index d9b5d6dfa..c977f0905 100644 --- a/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeId.ts +++ b/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeId.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given partition key range id. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeIdRegion.ts b/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeIdRegion.ts index 6ec2ba50a..557dfde06 100644 --- a/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeIdRegion.ts +++ b/src/Utils/arm/generatedClients/cosmos/partitionKeyRangeIdRegion.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Retrieves the metrics determined by the given filter for the given partition key range id and region. */ export async function listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/percentile.ts b/src/Utils/arm/generatedClients/cosmos/percentile.ts index cbbc751dc..03f0b3ea3 100644 --- a/src/Utils/arm/generatedClients/cosmos/percentile.ts +++ b/src/Utils/arm/generatedClients/cosmos/percentile.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* 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 listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/percentileSourceTarget.ts b/src/Utils/arm/generatedClients/cosmos/percentileSourceTarget.ts index 88c05dd11..fc1e39013 100644 --- a/src/Utils/arm/generatedClients/cosmos/percentileSourceTarget.ts +++ b/src/Utils/arm/generatedClients/cosmos/percentileSourceTarget.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* 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 listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/percentileTarget.ts b/src/Utils/arm/generatedClients/cosmos/percentileTarget.ts index 87359e9f0..eaf1f3947 100644 --- a/src/Utils/arm/generatedClients/cosmos/percentileTarget.ts +++ b/src/Utils/arm/generatedClients/cosmos/percentileTarget.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* 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 listMetrics( diff --git a/src/Utils/arm/generatedClients/cosmos/sqlResources.ts b/src/Utils/arm/generatedClients/cosmos/sqlResources.ts index 049e265e9..bcf7c6bac 100644 --- a/src/Utils/arm/generatedClients/cosmos/sqlResources.ts +++ b/src/Utils/arm/generatedClients/cosmos/sqlResources.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-05-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists the SQL databases under an existing Azure Cosmos DB database account. */ export async function listSqlDatabases( diff --git a/src/Utils/arm/generatedClients/cosmos/tableResources.ts b/src/Utils/arm/generatedClients/cosmos/tableResources.ts index 0da78793e..e0771c5d3 100644 --- a/src/Utils/arm/generatedClients/cosmos/tableResources.ts +++ b/src/Utils/arm/generatedClients/cosmos/tableResources.ts @@ -3,13 +3,13 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ import { configContext } from "../../../../ConfigContext"; import { armRequest } from "../../request"; import * as Types from "./types"; -const apiVersion = "2024-02-15-preview"; +const apiVersion = "2024-12-01-preview"; /* Lists the Tables under an existing Azure Cosmos DB database account. */ export async function listTables( diff --git a/src/Utils/arm/generatedClients/cosmos/types.ts b/src/Utils/arm/generatedClients/cosmos/types.ts index 1871884e0..6f64ebd7a 100644 --- a/src/Utils/arm/generatedClients/cosmos/types.ts +++ b/src/Utils/arm/generatedClients/cosmos/types.ts @@ -3,7 +3,7 @@ Run "npm run generateARMClients" to regenerate Edting this file directly should be done with extreme caution as not to diverge from ARM REST specs - Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-02-15-preview/cosmos-db.json + Generated from: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-12-01-preview/cosmos-db.json */ /* The List operation response, that contains the client encryption keys and their properties. */ @@ -553,6 +553,12 @@ export interface DatabaseAccountGetProperties { /* The object that represents all properties related to capacity enforcement on an account. */ capacity?: Capacity; + /* Indicates the capacityMode of the Cosmos DB account. */ + capacityMode?: CapacityMode; + + /* The object that represents the migration state for the CapacityMode of the Cosmos DB account. */ + capacityModeChangeTransitionState?: CapacityModeChangeTransitionState; + /* Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ enableMaterializedViews?: boolean; /* The object that represents the metadata for the Account Keys of the Cosmos DB account. */ @@ -652,6 +658,9 @@ export interface DatabaseAccountCreateUpdateProperties { /* The object that represents all properties related to capacity enforcement on an account. */ capacity?: Capacity; + /* Indicates the capacityMode of the Cosmos DB account. */ + capacityMode?: CapacityMode; + /* Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ enableMaterializedViews?: boolean; /* This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */ @@ -754,6 +763,9 @@ export interface DatabaseAccountUpdateProperties { /* The object that represents all properties related to capacity enforcement on an account. */ capacity?: Capacity; + /* Indicates the capacityMode of the Cosmos DB account. */ + capacityMode?: CapacityMode; + /* Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ enableMaterializedViews?: boolean; /* This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */ @@ -1087,6 +1099,8 @@ export interface ThroughputSettingsResource { readonly instantMaximumThroughput?: string; /* The maximum throughput value or the maximum maxThroughput value (for autoscale) that can be specified */ readonly softAllowedMaximumThroughput?: string; + /* Array of Throughput Bucket limits to be applied to the Cosmos DB container */ + throughputBuckets?: ThroughputBucketResource[]; } /* Cosmos DB provisioned throughput settings object */ @@ -1114,6 +1128,14 @@ export interface ThroughputPolicyResource { incrementPercent?: number; } +/* Cosmos DB throughput bucket object */ +export interface ThroughputBucketResource { + /* Represents the throughput bucket id */ + id: number; + /* Represents maximum percentage throughput that can be used by the bucket */ + maxThroughputPercentage: number; +} + /* Cosmos DB options resource object */ export interface OptionsResource { /* Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. */ @@ -1235,10 +1257,6 @@ export interface SqlDatabaseResource { export interface SqlContainerResource { /* Name of the Cosmos DB SQL container */ id: string; - - vectorEmbeddingPolicy?: VectorEmbeddingPolicy; - fullTextPolicy?: FullTextPolicy; - /* The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container */ indexingPolicy?: IndexingPolicy; @@ -1269,39 +1287,11 @@ export interface SqlContainerResource { /* List of computed properties */ computedProperties?: ComputedProperty[]; -} -export interface VectorEmbeddingPolicy { - vectorEmbeddings: VectorEmbedding[]; -} + /* The vector embedding policy for the container. */ + vectorEmbeddingPolicy?: VectorEmbeddingPolicy; -export interface VectorEmbedding { - path?: string; - dataType?: string; - dimensions?: number; - distanceFunction?: string; -} - -export interface FullTextPolicy { - /** - * The default language for the full text . - */ - defaultLanguage: string; - /** - * The paths to be indexed for full text search. - */ - fullTextPaths: FullTextPath[]; -} - -export interface FullTextPath { - /** - * The path to be indexed for full text search. - */ - path: string; - /** - * The language for the full text path. - */ - language: string; + fullTextPolicy?: FullTextPolicy; } /* Cosmos DB indexing policy */ @@ -1323,19 +1313,14 @@ export interface IndexingPolicy { /* List of spatial specifics */ spatialIndexes?: SpatialSpec[]; + /* List of paths to include in the vector indexing */ vectorIndexes?: VectorIndex[]; - - fullTextIndexes?: FullTextIndex[]; } -export interface VectorIndex { - path?: string; - type?: string; -} - -export interface FullTextIndex { - /** The path in the JSON document to index. */ - path: string; +/* Cosmos DB Vector Embedding Policy */ +export interface VectorEmbeddingPolicy { + /* List of vector embeddings */ + vectorEmbeddings?: VectorEmbedding[]; } /* undocumented */ @@ -1363,6 +1348,50 @@ export interface Indexes { kind?: "Hash" | "Range" | "Spatial"; } +/* undocumented */ +export interface VectorIndex { + /* The path to the vector field in the document. */ + path: string; + /* The index type of the vector. Currently, flat, diskANN, and quantizedFlat are supported. */ + type: "flat" | "diskANN" | "quantizedFlat"; +} + +/* Represents a vector embedding. A vector embedding is used to define a vector field in the documents. */ +export interface VectorEmbedding { + /* The path to the vector field in the document. */ + path: string; + /* Indicates the data type of vector. */ + dataType: "float16" | "float32" | "uint8" | "int8"; + + /* The distance function to use for distance calculation in between vectors. */ + distanceFunction: "euclidean" | "cosine" | "dotproduct"; + + /* The number of dimensions in the vector. */ + dimensions: number; +} + +export interface FullTextPolicy { + /** + * The default language for the full text . + */ + defaultLanguage: string; + /** + * The paths to be indexed for full text search. + */ + fullTextPaths: FullTextPath[]; +} + +export interface FullTextPath { + /** + * The path to be indexed for full text search. + */ + path: string; + /** + * The language for the full text path. + */ + language: string; +} + /* List of composite path */ export type CompositePathList = CompositePath[]; @@ -1688,6 +1717,28 @@ export interface Capacity { totalThroughputLimit?: number; } +/* Indicates the capacity mode of the account. */ +export type CapacityMode = "None" | "Provisioned" | "Serverless"; + +/* The transition state information related capacity mode change with update request. */ +export interface CapacityModeChangeTransitionState { + /* The transition status of capacity mode. */ + capacityModeTransitionStatus?: "Invalid" | "Initialized" | "InProgress" | "Completed" | "Failed"; + + /* Indicates the current capacity mode of the account. */ + currentCapacityMode?: "None" | "Provisioned" | "Serverless"; + + /* Indicates the previous capacity mode of the account before successful transition. */ + previousCapacityMode?: "None" | "Provisioned" | "Serverless"; + + /* Begin time in UTC of the capacity mode change. */ + readonly capacityModeTransitionBeginTimestamp?: string; + /* End time in UTC of the capacity mode change. */ + readonly capacityModeTransitionEndTimestamp?: string; + /* End time in UTC of the last successful capacity mode change. */ + readonly capacityModeLastSuccessfulTransitionEndTimestamp?: 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". */ export type Tags = { [key: string]: string }; @@ -1953,8 +2004,8 @@ export type PublicNetworkAccess = "Enabled" | "Disabled" | "SecuredByPerimeter"; /* undocumented */ export interface ApiProperties { - /* Describes the ServerVersion of an a MongoDB account. */ - serverVersion?: "3.2" | "3.6" | "4.0" | "4.2"; + /* Describes the version of the MongoDB account. */ + serverVersion?: "3.2" | "3.6" | "4.0" | "4.2" | "5.0" | "6.0" | "7.0"; } /* Analytical storage specific properties. */ diff --git a/utils/armClientGenerator/generator.ts b/utils/armClientGenerator/generator.ts index 1a50e9082..69c86c41a 100644 --- a/utils/armClientGenerator/generator.ts +++ b/utils/armClientGenerator/generator.ts @@ -16,13 +16,13 @@ Results of this file should be checked into the repo. */ // CHANGE THESE VALUES TO GENERATE NEW CLIENTS -const version = "2024-02-15-preview"; -/* The following are legal options for resourceName but you generally will only use cosmos-db: -"cosmos-db" | "managedCassandra" | "mongorbac" | "notebook" | "privateEndpointConnection" | "privateLinkResources" | +const version = "2024-12-01-preview"; +/* The following are legal options for resourceName but you generally will only use cosmos: +"cosmos" | "managedCassandra" | "mongorbac" | "notebook" | "privateEndpointConnection" | "privateLinkResources" | "rbac" | "restorable" | "services" | "dataTransferService" */ const githubResourceName = "cosmos-db"; -const deResourceName = "cosmos-db"; +const deResourceName = "cosmos"; const schemaURL = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/${version}/${githubResourceName}.json`; const outputDir = path.join(__dirname, `../../src/Utils/arm/generatedClients/${deResourceName}`);