Update to ADO 64472154f607bb7b0820ef3d6a9f3ab6b058382d (#11)
This commit is contained in:
parent
748cfc7da3
commit
9f7f7c202f
|
@ -340,7 +340,6 @@ export class HttpHeaders {
|
||||||
public static partitionKey: string = "x-ms-documentdb-partitionkey";
|
public static partitionKey: string = "x-ms-documentdb-partitionkey";
|
||||||
public static migrateOfferToManualThroughput: string = "x-ms-cosmos-migrate-offer-to-manual-throughput";
|
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 migrateOfferToAutopilot: string = "x-ms-cosmos-migrate-offer-to-autopilot";
|
||||||
public static mongoFixedCollectionWithSharedThroughput: string = "InsertSystemPartitionKey";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ApiType {
|
export class ApiType {
|
||||||
|
|
|
@ -259,8 +259,7 @@ describe("MongoProxyClient", () => {
|
||||||
sid: "a2",
|
sid: "a2",
|
||||||
rg: "c1",
|
rg: "c1",
|
||||||
dba: "main",
|
dba: "main",
|
||||||
is: false,
|
is: false
|
||||||
isFixedCollectionWithSharedThroughputBeingCreated: true
|
|
||||||
};
|
};
|
||||||
_createMongoCollectionWithARM("management.azure.com", properties, { "x-ms-cosmos-offer-autopilot-tier": "1" });
|
_createMongoCollectionWithARM("management.azure.com", properties, { "x-ms-cosmos-offer-autopilot-tier": "1" });
|
||||||
expect(resourceProviderClientPutAsyncSpy).toHaveBeenCalledWith(
|
expect(resourceProviderClientPutAsyncSpy).toHaveBeenCalledWith(
|
||||||
|
@ -268,7 +267,7 @@ describe("MongoProxyClient", () => {
|
||||||
"2020-04-01",
|
"2020-04-01",
|
||||||
{
|
{
|
||||||
properties: {
|
properties: {
|
||||||
options: { "x-ms-cosmos-offer-autopilot-tier": "1", InsertSystemPartitionKey: "true" },
|
options: { "x-ms-cosmos-offer-autopilot-tier": "1" },
|
||||||
resource: { id: "abc-collection" }
|
resource: { id: "abc-collection" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,8 +285,7 @@ describe("MongoProxyClient", () => {
|
||||||
rg: "c1",
|
rg: "c1",
|
||||||
dba: "main",
|
dba: "main",
|
||||||
is: false,
|
is: false,
|
||||||
offerThroughput: 400,
|
offerThroughput: 400
|
||||||
isFixedCollectionWithSharedThroughputBeingCreated: true
|
|
||||||
};
|
};
|
||||||
_createMongoCollectionWithARM("management.azure.com", properties, undefined);
|
_createMongoCollectionWithARM("management.azure.com", properties, undefined);
|
||||||
expect(resourceProviderClientPutAsyncSpy).toHaveBeenCalledWith(
|
expect(resourceProviderClientPutAsyncSpy).toHaveBeenCalledWith(
|
||||||
|
@ -295,7 +293,7 @@ describe("MongoProxyClient", () => {
|
||||||
"2020-04-01",
|
"2020-04-01",
|
||||||
{
|
{
|
||||||
properties: {
|
properties: {
|
||||||
options: { throughput: "400", InsertSystemPartitionKey: "true" },
|
options: { throughput: "400" },
|
||||||
resource: { id: "abc-collection" }
|
resource: { id: "abc-collection" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,7 +356,6 @@ export function createMongoCollectionWithARM(
|
||||||
armEndpoint: string,
|
armEndpoint: string,
|
||||||
databaseId: string,
|
databaseId: string,
|
||||||
analyticalStorageTtl: number,
|
analyticalStorageTtl: number,
|
||||||
isFixedCollectionWithSharedThroughputBeingCreated: boolean,
|
|
||||||
collectionId: string,
|
collectionId: string,
|
||||||
offerThroughput: number,
|
offerThroughput: number,
|
||||||
shardKey: string,
|
shardKey: string,
|
||||||
|
@ -380,8 +379,7 @@ export function createMongoCollectionWithARM(
|
||||||
sid: CosmosClient.subscriptionId(),
|
sid: CosmosClient.subscriptionId(),
|
||||||
rg: CosmosClient.resourceGroup(),
|
rg: CosmosClient.resourceGroup(),
|
||||||
dba: databaseAccount.name,
|
dba: databaseAccount.name,
|
||||||
analyticalStorageTtl,
|
analyticalStorageTtl
|
||||||
isFixedCollectionWithSharedThroughputBeingCreated
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (createDatabase) {
|
if (createDatabase) {
|
||||||
|
@ -453,11 +451,6 @@ export async function _createMongoCollectionWithARM(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.isFixedCollectionWithSharedThroughputBeingCreated) {
|
|
||||||
rpPayloadToCreateCollection.properties.options[Constants.HttpHeaders.mongoFixedCollectionWithSharedThroughput] =
|
|
||||||
"true";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (params.analyticalStorageTtl) {
|
if (params.analyticalStorageTtl) {
|
||||||
rpPayloadToCreateCollection.properties.resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
rpPayloadToCreateCollection.properties.resource.analyticalStorageTtl = params.analyticalStorageTtl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -547,7 +547,6 @@ export interface MongoParameters extends RpParameters {
|
||||||
autoPilotTier?: string;
|
autoPilotTier?: string;
|
||||||
autoPilotThroughput?: string;
|
autoPilotThroughput?: string;
|
||||||
analyticalStorageTtl?: number;
|
analyticalStorageTtl?: number;
|
||||||
isFixedCollectionWithSharedThroughputBeingCreated?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GraphParameters extends RpParameters {
|
export interface GraphParameters extends RpParameters {
|
||||||
|
|
|
@ -832,7 +832,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||||
const isAadUser = EnvironmentUtility.isAadUser();
|
const isAadUser = EnvironmentUtility.isAadUser();
|
||||||
|
|
||||||
// note: v3 autopilot not supported yet for Mongo fixed collections (only tier supported)
|
// note: v3 autopilot not supported yet for Mongo fixed collections (only tier supported)
|
||||||
if (!isAadUser) {
|
if (!isAadUser || isFixedCollectionWithSharedThroughputBeingCreated) {
|
||||||
createCollectionFunc = () =>
|
createCollectionFunc = () =>
|
||||||
Q(
|
Q(
|
||||||
createMongoCollectionWithProxy(
|
createMongoCollectionWithProxy(
|
||||||
|
@ -853,7 +853,6 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||||
this.container.armEndpoint(),
|
this.container.armEndpoint(),
|
||||||
databaseId,
|
databaseId,
|
||||||
this._getAnalyticalStorageTtl(),
|
this._getAnalyticalStorageTtl(),
|
||||||
isFixedCollectionWithSharedThroughputBeingCreated,
|
|
||||||
collectionId,
|
collectionId,
|
||||||
offerThroughput,
|
offerThroughput,
|
||||||
partitionKeyPath,
|
partitionKeyPath,
|
||||||
|
|
Loading…
Reference in New Issue