Update to ADO 64472154f607bb7b0820ef3d6a9f3ab6b058382d (#11)

This commit is contained in:
Steve Faulkner 2020-05-28 15:13:45 -05:00 committed by GitHub
parent 748cfc7da3
commit 9f7f7c202f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 18 deletions

View File

@ -340,7 +340,6 @@ export class HttpHeaders {
public static partitionKey: string = "x-ms-documentdb-partitionkey";
public static migrateOfferToManualThroughput: string = "x-ms-cosmos-migrate-offer-to-manual-throughput";
public static migrateOfferToAutopilot: string = "x-ms-cosmos-migrate-offer-to-autopilot";
public static mongoFixedCollectionWithSharedThroughput: string = "InsertSystemPartitionKey";
}
export class ApiType {

View File

@ -259,8 +259,7 @@ describe("MongoProxyClient", () => {
sid: "a2",
rg: "c1",
dba: "main",
is: false,
isFixedCollectionWithSharedThroughputBeingCreated: true
is: false
};
_createMongoCollectionWithARM("management.azure.com", properties, { "x-ms-cosmos-offer-autopilot-tier": "1" });
expect(resourceProviderClientPutAsyncSpy).toHaveBeenCalledWith(
@ -268,7 +267,7 @@ describe("MongoProxyClient", () => {
"2020-04-01",
{
properties: {
options: { "x-ms-cosmos-offer-autopilot-tier": "1", InsertSystemPartitionKey: "true" },
options: { "x-ms-cosmos-offer-autopilot-tier": "1" },
resource: { id: "abc-collection" }
}
}
@ -286,8 +285,7 @@ describe("MongoProxyClient", () => {
rg: "c1",
dba: "main",
is: false,
offerThroughput: 400,
isFixedCollectionWithSharedThroughputBeingCreated: true
offerThroughput: 400
};
_createMongoCollectionWithARM("management.azure.com", properties, undefined);
expect(resourceProviderClientPutAsyncSpy).toHaveBeenCalledWith(
@ -295,7 +293,7 @@ describe("MongoProxyClient", () => {
"2020-04-01",
{
properties: {
options: { throughput: "400", InsertSystemPartitionKey: "true" },
options: { throughput: "400" },
resource: { id: "abc-collection" }
}
}

View File

@ -356,7 +356,6 @@ export function createMongoCollectionWithARM(
armEndpoint: string,
databaseId: string,
analyticalStorageTtl: number,
isFixedCollectionWithSharedThroughputBeingCreated: boolean,
collectionId: string,
offerThroughput: number,
shardKey: string,
@ -380,8 +379,7 @@ export function createMongoCollectionWithARM(
sid: CosmosClient.subscriptionId(),
rg: CosmosClient.resourceGroup(),
dba: databaseAccount.name,
analyticalStorageTtl,
isFixedCollectionWithSharedThroughputBeingCreated
analyticalStorageTtl
};
if (createDatabase) {
@ -453,11 +451,6 @@ export async function _createMongoCollectionWithARM(
}
}
if (params.isFixedCollectionWithSharedThroughputBeingCreated) {
rpPayloadToCreateCollection.properties.options[Constants.HttpHeaders.mongoFixedCollectionWithSharedThroughput] =
"true";
}
if (params.analyticalStorageTtl) {
rpPayloadToCreateCollection.properties.resource.analyticalStorageTtl = params.analyticalStorageTtl;
}

View File

@ -547,7 +547,6 @@ export interface MongoParameters extends RpParameters {
autoPilotTier?: string;
autoPilotThroughput?: string;
analyticalStorageTtl?: number;
isFixedCollectionWithSharedThroughputBeingCreated?: boolean;
}
export interface GraphParameters extends RpParameters {

View File

@ -832,7 +832,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
const isAadUser = EnvironmentUtility.isAadUser();
// note: v3 autopilot not supported yet for Mongo fixed collections (only tier supported)
if (!isAadUser) {
if (!isAadUser || isFixedCollectionWithSharedThroughputBeingCreated) {
createCollectionFunc = () =>
Q(
createMongoCollectionWithProxy(
@ -853,7 +853,6 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
this.container.armEndpoint(),
databaseId,
this._getAnalyticalStorageTtl(),
isFixedCollectionWithSharedThroughputBeingCreated,
collectionId,
offerThroughput,
partitionKeyPath,