Update generated ARM clients to latest version (#807)
This commit is contained in:
parent
e6b3f01f16
commit
f4b0ea7d69
|
@ -205,7 +205,7 @@
|
||||||
"strict:find": "node ./strict-null-checks/find.js",
|
"strict:find": "node ./strict-null-checks/find.js",
|
||||||
"strict:add": "node ./strict-null-checks/auto-add.js",
|
"strict:add": "node ./strict-null-checks/auto-add.js",
|
||||||
"compile:fullStrict": "tsc -p ./tsconfig.json --strictNullChecks",
|
"compile:fullStrict": "tsc -p ./tsconfig.json --strictNullChecks",
|
||||||
"generateARMClients": "ts-node --compiler-options '{\"module\":\"commonjs\"}' utils/armClientGenerator/generator.ts"
|
"generateARMClients": "npx ts-node --compiler-options '{\"module\":\"commonjs\"}' utils/armClientGenerator/generator.ts"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -44,7 +44,7 @@ export class ArmResourceTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BackendDefaults {
|
export class BackendDefaults {
|
||||||
public static partitionKeyKind: string = "Hash";
|
public static partitionKeyKind = "Hash";
|
||||||
public static singlePartitionStorageInGb: string = "10";
|
public static singlePartitionStorageInGb: string = "10";
|
||||||
public static multiPartitionStorageInGb: string = "100";
|
public static multiPartitionStorageInGb: string = "100";
|
||||||
public static maxChangeFeedRetentionDuration: number = 10;
|
public static maxChangeFeedRetentionDuration: number = 10;
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { handleError } from "./ErrorHandlingUtils";
|
||||||
export class QueriesClient {
|
export class QueriesClient {
|
||||||
private static readonly PartitionKey: DataModels.PartitionKey = {
|
private static readonly PartitionKey: DataModels.PartitionKey = {
|
||||||
paths: [`/${SavedQueries.PartitionKeyProperty}`],
|
paths: [`/${SavedQueries.PartitionKeyProperty}`],
|
||||||
kind: BackendDefaults.partitionKeyKind,
|
kind: "Hash",
|
||||||
version: BackendDefaults.partitionKeyVersion,
|
version: BackendDefaults.partitionKeyVersion,
|
||||||
};
|
};
|
||||||
private static readonly FetchQuery: string = "SELECT * FROM c";
|
private static readonly FetchQuery: string = "SELECT * FROM c";
|
||||||
|
|
|
@ -10,18 +10,15 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateCassandraTable,
|
createUpdateCassandraTable,
|
||||||
getCassandraTable,
|
getCassandraTable,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import {
|
import { createUpdateGremlinGraph, getGremlinGraph } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
createUpdateGremlinGraph,
|
|
||||||
getGremlinGraph,
|
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
|
||||||
import {
|
import {
|
||||||
createUpdateMongoDBCollection,
|
createUpdateMongoDBCollection,
|
||||||
getMongoDBCollection,
|
getMongoDBCollection,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/cosmos/tableResources";
|
||||||
import * as ARMTypes from "../../Utils/arm/generatedClients/2020-04-01/types";
|
import * as ARMTypes from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -6,23 +6,23 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateCassandraKeyspace,
|
createUpdateCassandraKeyspace,
|
||||||
getCassandraKeyspace,
|
getCassandraKeyspace,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import {
|
import {
|
||||||
createUpdateGremlinDatabase,
|
createUpdateGremlinDatabase,
|
||||||
getGremlinDatabase,
|
getGremlinDatabase,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
} from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import {
|
import {
|
||||||
createUpdateMongoDBDatabase,
|
createUpdateMongoDBDatabase,
|
||||||
getMongoDBDatabase,
|
getMongoDBDatabase,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { createUpdateSqlDatabase, getSqlDatabase } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlDatabase, getSqlDatabase } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import {
|
||||||
CassandraKeyspaceCreateUpdateParameters,
|
CassandraKeyspaceCreateUpdateParameters,
|
||||||
CreateUpdateOptions,
|
CreateUpdateOptions,
|
||||||
GremlinDatabaseCreateUpdateParameters,
|
GremlinDatabaseCreateUpdateParameters,
|
||||||
MongoDBDatabaseCreateUpdateParameters,
|
MongoDBDatabaseCreateUpdateParameters,
|
||||||
SqlDatabaseCreateUpdateParameters,
|
SqlDatabaseCreateUpdateParameters,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlStoredProcedure,
|
createUpdateSqlStoredProcedure,
|
||||||
getSqlStoredProcedure,
|
getSqlStoredProcedure,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import {
|
||||||
SqlStoredProcedureCreateUpdateParameters,
|
SqlStoredProcedureCreateUpdateParameters,
|
||||||
SqlStoredProcedureResource,
|
SqlStoredProcedureResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import { Resource, TriggerDefinition } from "@azure/cosmos";
|
import { TriggerDefinition } from "@azure/cosmos";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { createUpdateSqlTrigger, getSqlTrigger } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlTrigger, getSqlTrigger } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import { SqlTriggerCreateUpdateParameters, SqlTriggerResource } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
SqlTriggerCreateUpdateParameters,
|
|
||||||
SqlTriggerResource,
|
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
@ -13,8 +10,8 @@ import { handleError } from "../ErrorHandlingUtils";
|
||||||
export async function createTrigger(
|
export async function createTrigger(
|
||||||
databaseId: string,
|
databaseId: string,
|
||||||
collectionId: string,
|
collectionId: string,
|
||||||
trigger: TriggerDefinition
|
trigger: SqlTriggerResource
|
||||||
): Promise<TriggerDefinition & Resource> {
|
): Promise<TriggerDefinition | SqlTriggerResource> {
|
||||||
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
|
const clearMessage = logConsoleProgress(`Creating trigger ${trigger.id}`);
|
||||||
try {
|
try {
|
||||||
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") {
|
||||||
|
@ -38,7 +35,7 @@ export async function createTrigger(
|
||||||
|
|
||||||
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: trigger as SqlTriggerResource,
|
resource: trigger,
|
||||||
options: {},
|
options: {},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -51,10 +48,13 @@ export async function createTrigger(
|
||||||
trigger.id,
|
trigger.id,
|
||||||
createTriggerParams
|
createTriggerParams
|
||||||
);
|
);
|
||||||
return rpResponse && (rpResponse.properties?.resource as TriggerDefinition & Resource);
|
return rpResponse && rpResponse.properties?.resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await client().database(databaseId).container(collectionId).scripts.triggers.create(trigger);
|
const response = await client()
|
||||||
|
.database(databaseId)
|
||||||
|
.container(collectionId)
|
||||||
|
.scripts.triggers.create((trigger as unknown) as TriggerDefinition); // TODO: TypeScript does not like the SQL SDK trigger type
|
||||||
return response.resource;
|
return response.resource;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "CreateTrigger", `Error while creating trigger ${trigger.id}`);
|
handleError(error, "CreateTrigger", `Error while creating trigger ${trigger.id}`);
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlUserDefinedFunction,
|
createUpdateSqlUserDefinedFunction,
|
||||||
getSqlUserDefinedFunction,
|
getSqlUserDefinedFunction,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import {
|
||||||
SqlUserDefinedFunctionCreateUpdateParameters,
|
SqlUserDefinedFunctionCreateUpdateParameters,
|
||||||
SqlUserDefinedFunctionResource,
|
SqlUserDefinedFunctionResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { deleteCassandraTable } from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
import { deleteCassandraTable } from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import { deleteGremlinGraph } from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
import { deleteGremlinGraph } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import { deleteMongoDBCollection } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { deleteMongoDBCollection } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { deleteSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { deleteSqlContainer } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { deleteTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { deleteTable } from "../../Utils/arm/generatedClients/cosmos/tableResources";
|
||||||
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { deleteCassandraKeyspace } from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
import { deleteCassandraKeyspace } from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import { deleteGremlinDatabase } from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
import { deleteGremlinDatabase } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import { deleteMongoDBDatabase } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { deleteMongoDBDatabase } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { deleteSqlDatabase } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { deleteSqlDatabase } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { deleteSqlStoredProcedure } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { deleteSqlStoredProcedure } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { deleteSqlTrigger } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { deleteSqlTrigger } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { deleteSqlUserDefinedFunction } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { deleteSqlUserDefinedFunction } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { Offer, ReadCollectionOfferParams } from "../../Contracts/DataModels";
|
import { Offer, ReadCollectionOfferParams } from "../../Contracts/DataModels";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { getCassandraTableThroughput } from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
import { getCassandraTableThroughput } from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import { getGremlinGraphThroughput } from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
import { getGremlinGraphThroughput } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import { getMongoDBCollectionThroughput } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { getMongoDBCollectionThroughput } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { getSqlContainerThroughput } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { getSqlContainerThroughput } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { getTableThroughput } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { getTableThroughput } from "../../Utils/arm/generatedClients/cosmos/tableResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { readOfferWithSDK } from "./readOfferWithSDK";
|
import { readOfferWithSDK } from "./readOfferWithSDK";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import * as DataModels from "../../Contracts/DataModels";
|
import * as DataModels from "../../Contracts/DataModels";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { listCassandraTables } from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
import { listCassandraTables } from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import { listGremlinGraphs } from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
import { listGremlinGraphs } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import { listMongoDBCollections } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { listMongoDBCollections } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { listSqlContainers } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { listSqlContainers } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { listTables } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { listTables } from "../../Utils/arm/generatedClients/cosmos/tableResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { Offer, ReadDatabaseOfferParams } from "../../Contracts/DataModels";
|
import { Offer, ReadDatabaseOfferParams } from "../../Contracts/DataModels";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { getCassandraKeyspaceThroughput } from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
import { getCassandraKeyspaceThroughput } from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import { getGremlinDatabaseThroughput } from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
import { getGremlinDatabaseThroughput } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import { getMongoDBDatabaseThroughput } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { getMongoDBDatabaseThroughput } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { getSqlDatabaseThroughput } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { getSqlDatabaseThroughput } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
import { readOfferWithSDK } from "./readOfferWithSDK";
|
import { readOfferWithSDK } from "./readOfferWithSDK";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import * as DataModels from "../../Contracts/DataModels";
|
import * as DataModels from "../../Contracts/DataModels";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { listCassandraKeyspaces } from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
import { listCassandraKeyspaces } from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import { listGremlinDatabases } from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
import { listGremlinDatabases } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import { listMongoDBDatabases } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { listMongoDBDatabases } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { listSqlDatabases } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { listSqlDatabases } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { getMongoDBCollection } from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
import { getMongoDBCollection } from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { MongoDBCollectionResource } from "../../Utils/arm/generatedClients/2020-04-01/types";
|
import { MongoDBCollectionResource } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Resource, StoredProcedureDefinition } from "@azure/cosmos";
|
import { Resource, StoredProcedureDefinition } from "@azure/cosmos";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { listSqlStoredProcedures } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { listSqlStoredProcedures } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { Resource, TriggerDefinition } from "@azure/cosmos";
|
import { TriggerDefinition } from "@azure/cosmos";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { listSqlTriggers } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { listSqlTriggers } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
|
import { SqlTriggerResource } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
@ -9,7 +10,7 @@ import { handleError } from "../ErrorHandlingUtils";
|
||||||
export async function readTriggers(
|
export async function readTriggers(
|
||||||
databaseId: string,
|
databaseId: string,
|
||||||
collectionId: string
|
collectionId: string
|
||||||
): Promise<(TriggerDefinition & Resource)[]> {
|
): Promise<SqlTriggerResource[] | TriggerDefinition[]> {
|
||||||
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
|
const clearMessage = logConsoleProgress(`Querying triggers for container ${collectionId}`);
|
||||||
try {
|
try {
|
||||||
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") {
|
if (userContext.authType === AuthType.AAD && !userContext.useSDKOperations && userContext.apiType === "SQL") {
|
||||||
|
@ -20,7 +21,7 @@ export async function readTriggers(
|
||||||
databaseId,
|
databaseId,
|
||||||
collectionId
|
collectionId
|
||||||
);
|
);
|
||||||
return rpResponse?.value?.map((trigger) => trigger.properties?.resource as TriggerDefinition & Resource);
|
return rpResponse?.value?.map((trigger) => trigger.properties?.resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await client().database(databaseId).container(collectionId).scripts.triggers.readAll().fetchAll();
|
const response = await client().database(databaseId).container(collectionId).scripts.triggers.readAll().fetchAll();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
import { Resource, UserDefinedFunctionDefinition } from "@azure/cosmos";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { listSqlUserDefinedFunctions } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { listSqlUserDefinedFunctions } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -6,23 +6,20 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateCassandraTable,
|
createUpdateCassandraTable,
|
||||||
getCassandraTable,
|
getCassandraTable,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import {
|
import { createUpdateGremlinGraph, getGremlinGraph } from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
createUpdateGremlinGraph,
|
|
||||||
getGremlinGraph,
|
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
|
||||||
import {
|
import {
|
||||||
createUpdateMongoDBCollection,
|
createUpdateMongoDBCollection,
|
||||||
getMongoDBCollection,
|
getMongoDBCollection,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlContainer, getSqlContainer } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
import { createUpdateTable, getTable } from "../../Utils/arm/generatedClients/cosmos/tableResources";
|
||||||
import {
|
import {
|
||||||
ExtendedResourceProperties,
|
ExtendedResourceProperties,
|
||||||
MongoDBCollectionCreateUpdateParameters,
|
MongoDBCollectionCreateUpdateParameters,
|
||||||
SqlContainerCreateUpdateParameters,
|
SqlContainerCreateUpdateParameters,
|
||||||
SqlContainerResource,
|
SqlContainerResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
migrateCassandraTableToManualThroughput,
|
migrateCassandraTableToManualThroughput,
|
||||||
updateCassandraKeyspaceThroughput,
|
updateCassandraKeyspaceThroughput,
|
||||||
updateCassandraTableThroughput,
|
updateCassandraTableThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/cassandraResources";
|
} from "../../Utils/arm/generatedClients/cosmos/cassandraResources";
|
||||||
import {
|
import {
|
||||||
migrateGremlinDatabaseToAutoscale,
|
migrateGremlinDatabaseToAutoscale,
|
||||||
migrateGremlinDatabaseToManualThroughput,
|
migrateGremlinDatabaseToManualThroughput,
|
||||||
|
@ -18,7 +18,7 @@ import {
|
||||||
migrateGremlinGraphToManualThroughput,
|
migrateGremlinGraphToManualThroughput,
|
||||||
updateGremlinDatabaseThroughput,
|
updateGremlinDatabaseThroughput,
|
||||||
updateGremlinGraphThroughput,
|
updateGremlinGraphThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/gremlinResources";
|
} from "../../Utils/arm/generatedClients/cosmos/gremlinResources";
|
||||||
import {
|
import {
|
||||||
migrateMongoDBCollectionToAutoscale,
|
migrateMongoDBCollectionToAutoscale,
|
||||||
migrateMongoDBCollectionToManualThroughput,
|
migrateMongoDBCollectionToManualThroughput,
|
||||||
|
@ -26,7 +26,7 @@ import {
|
||||||
migrateMongoDBDatabaseToManualThroughput,
|
migrateMongoDBDatabaseToManualThroughput,
|
||||||
updateMongoDBCollectionThroughput,
|
updateMongoDBCollectionThroughput,
|
||||||
updateMongoDBDatabaseThroughput,
|
updateMongoDBDatabaseThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/mongoDBResources";
|
} from "../../Utils/arm/generatedClients/cosmos/mongoDBResources";
|
||||||
import {
|
import {
|
||||||
migrateSqlContainerToAutoscale,
|
migrateSqlContainerToAutoscale,
|
||||||
migrateSqlContainerToManualThroughput,
|
migrateSqlContainerToManualThroughput,
|
||||||
|
@ -34,13 +34,13 @@ import {
|
||||||
migrateSqlDatabaseToManualThroughput,
|
migrateSqlDatabaseToManualThroughput,
|
||||||
updateSqlContainerThroughput,
|
updateSqlContainerThroughput,
|
||||||
updateSqlDatabaseThroughput,
|
updateSqlDatabaseThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import {
|
||||||
migrateTableToAutoscale,
|
migrateTableToAutoscale,
|
||||||
migrateTableToManualThroughput,
|
migrateTableToManualThroughput,
|
||||||
updateTableThroughput,
|
updateTableThroughput,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/tableResources";
|
} from "../../Utils/arm/generatedClients/cosmos/tableResources";
|
||||||
import { ThroughputSettingsUpdateParameters } from "../../Utils/arm/generatedClients/2020-04-01/types";
|
import { ThroughputSettingsUpdateParameters } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { HttpHeaders } from "../Constants";
|
import { HttpHeaders } from "../Constants";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlStoredProcedure,
|
createUpdateSqlStoredProcedure,
|
||||||
getSqlStoredProcedure,
|
getSqlStoredProcedure,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import {
|
||||||
SqlStoredProcedureCreateUpdateParameters,
|
SqlStoredProcedureCreateUpdateParameters,
|
||||||
SqlStoredProcedureResource,
|
SqlStoredProcedureResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import { TriggerDefinition } from "@azure/cosmos";
|
import { TriggerDefinition } from "@azure/cosmos";
|
||||||
import { AuthType } from "../../AuthType";
|
import { AuthType } from "../../AuthType";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { createUpdateSqlTrigger, getSqlTrigger } from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
import { createUpdateSqlTrigger, getSqlTrigger } from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import { SqlTriggerCreateUpdateParameters, SqlTriggerResource } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
SqlTriggerCreateUpdateParameters,
|
|
||||||
SqlTriggerResource,
|
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
@ -13,8 +10,8 @@ import { handleError } from "../ErrorHandlingUtils";
|
||||||
export async function updateTrigger(
|
export async function updateTrigger(
|
||||||
databaseId: string,
|
databaseId: string,
|
||||||
collectionId: string,
|
collectionId: string,
|
||||||
trigger: TriggerDefinition
|
trigger: SqlTriggerResource
|
||||||
): Promise<TriggerDefinition> {
|
): Promise<SqlTriggerResource | TriggerDefinition> {
|
||||||
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
|
const clearMessage = logConsoleProgress(`Updating trigger ${trigger.id}`);
|
||||||
const { authType, useSDKOperations, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext;
|
const { authType, useSDKOperations, apiType, subscriptionId, resourceGroup, databaseAccount } = userContext;
|
||||||
try {
|
try {
|
||||||
|
@ -31,7 +28,7 @@ export async function updateTrigger(
|
||||||
if (getResponse?.properties?.resource) {
|
if (getResponse?.properties?.resource) {
|
||||||
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
const createTriggerParams: SqlTriggerCreateUpdateParameters = {
|
||||||
properties: {
|
properties: {
|
||||||
resource: trigger as SqlTriggerResource,
|
resource: trigger,
|
||||||
options: {},
|
options: {},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -44,7 +41,7 @@ export async function updateTrigger(
|
||||||
trigger.id,
|
trigger.id,
|
||||||
createTriggerParams
|
createTriggerParams
|
||||||
);
|
);
|
||||||
return rpResponse && (rpResponse.properties?.resource as TriggerDefinition);
|
return rpResponse && rpResponse.properties?.resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(`Failed to update trigger: ${trigger.id} does not exist.`);
|
throw new Error(`Failed to update trigger: ${trigger.id} does not exist.`);
|
||||||
|
@ -54,7 +51,7 @@ export async function updateTrigger(
|
||||||
.database(databaseId)
|
.database(databaseId)
|
||||||
.container(collectionId)
|
.container(collectionId)
|
||||||
.scripts.trigger(trigger.id)
|
.scripts.trigger(trigger.id)
|
||||||
.replace(trigger);
|
.replace((trigger as unknown) as TriggerDefinition); // TODO: TypeScript does not like the SQL SDK trigger type
|
||||||
return response?.resource;
|
return response?.resource;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, "UpdateTrigger", `Error while updating trigger ${trigger.id}`);
|
handleError(error, "UpdateTrigger", `Error while updating trigger ${trigger.id}`);
|
||||||
|
|
|
@ -4,11 +4,11 @@ import { userContext } from "../../UserContext";
|
||||||
import {
|
import {
|
||||||
createUpdateSqlUserDefinedFunction,
|
createUpdateSqlUserDefinedFunction,
|
||||||
getSqlUserDefinedFunction,
|
getSqlUserDefinedFunction,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/sqlResources";
|
} from "../../Utils/arm/generatedClients/cosmos/sqlResources";
|
||||||
import {
|
import {
|
||||||
SqlUserDefinedFunctionCreateUpdateParameters,
|
SqlUserDefinedFunctionCreateUpdateParameters,
|
||||||
SqlUserDefinedFunctionResource,
|
SqlUserDefinedFunctionResource,
|
||||||
} from "../../Utils/arm/generatedClients/2020-04-01/types";
|
} from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
|
||||||
import { client } from "../CosmosClient";
|
import { client } from "../CosmosClient";
|
||||||
import { handleError } from "../ErrorHandlingUtils";
|
import { handleError } from "../ErrorHandlingUtils";
|
||||||
|
|
|
@ -167,7 +167,7 @@ export interface KeyResource {
|
||||||
|
|
||||||
export interface IndexingPolicy {
|
export interface IndexingPolicy {
|
||||||
automatic: boolean;
|
automatic: boolean;
|
||||||
indexingMode: string;
|
indexingMode: "consistent" | "lazy" | "none";
|
||||||
includedPaths: any;
|
includedPaths: any;
|
||||||
excludedPaths: any;
|
excludedPaths: any;
|
||||||
compositeIndexes?: any;
|
compositeIndexes?: any;
|
||||||
|
@ -176,7 +176,7 @@ export interface IndexingPolicy {
|
||||||
|
|
||||||
export interface PartitionKey {
|
export interface PartitionKey {
|
||||||
paths: string[];
|
paths: string[];
|
||||||
kind: string;
|
kind: "Hash" | "Range" | "MultiHash";
|
||||||
version: number;
|
version: number;
|
||||||
systemKey?: boolean;
|
systemKey?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import StoredProcedure from "../Explorer/Tree/StoredProcedure";
|
||||||
import Trigger from "../Explorer/Tree/Trigger";
|
import Trigger from "../Explorer/Tree/Trigger";
|
||||||
import UserDefinedFunction from "../Explorer/Tree/UserDefinedFunction";
|
import UserDefinedFunction from "../Explorer/Tree/UserDefinedFunction";
|
||||||
import { SelfServeType } from "../SelfServe/SelfServeUtils";
|
import { SelfServeType } from "../SelfServe/SelfServeUtils";
|
||||||
|
import { SqlTriggerResource } from "../Utils/arm/generatedClients/cosmos/types";
|
||||||
import * as DataModels from "./DataModels";
|
import * as DataModels from "./DataModels";
|
||||||
import { SubscriptionType } from "./SubscriptionType";
|
import { SubscriptionType } from "./SubscriptionType";
|
||||||
|
|
||||||
|
@ -175,7 +176,7 @@ export interface Collection extends CollectionBase {
|
||||||
|
|
||||||
createStoredProcedureNode(data: StoredProcedureDefinition & Resource): StoredProcedure;
|
createStoredProcedureNode(data: StoredProcedureDefinition & Resource): StoredProcedure;
|
||||||
createUserDefinedFunctionNode(data: UserDefinedFunctionDefinition & Resource): UserDefinedFunction;
|
createUserDefinedFunctionNode(data: UserDefinedFunctionDefinition & Resource): UserDefinedFunction;
|
||||||
createTriggerNode(data: TriggerDefinition & Resource): Trigger;
|
createTriggerNode(data: TriggerDefinition | SqlTriggerResource): Trigger;
|
||||||
findStoredProcedureWithId(sprocRid: string): StoredProcedure;
|
findStoredProcedureWithId(sprocRid: string): StoredProcedure;
|
||||||
findTriggerWithId(triggerRid: string): Trigger;
|
findTriggerWithId(triggerRid: string): Trigger;
|
||||||
findUserDefinedFunctionWithId(udfRid: string): UserDefinedFunction;
|
findUserDefinedFunctionWithId(udfRid: string): UserDefinedFunction;
|
||||||
|
|
|
@ -14,7 +14,7 @@ import * as ViewModels from "../../../Contracts/ViewModels";
|
||||||
import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
|
import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
|
||||||
import { trace, traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetry/TelemetryProcessor";
|
import { trace, traceFailure, traceStart, traceSuccess } from "../../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { userContext } from "../../../UserContext";
|
import { userContext } from "../../../UserContext";
|
||||||
import { MongoDBCollectionResource, MongoIndex } from "../../../Utils/arm/generatedClients/2020-04-01/types";
|
import { MongoDBCollectionResource, MongoIndex } from "../../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils";
|
import * as AutoPilotUtils from "../../../Utils/AutoPilotUtils";
|
||||||
import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent";
|
import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { shallow } from "enzyme";
|
import { shallow } from "enzyme";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { IndexingPolicyComponent, IndexingPolicyComponentProps } from "./IndexingPolicyComponent";
|
|
||||||
import * as DataModels from "../../../../Contracts/DataModels";
|
import * as DataModels from "../../../../Contracts/DataModels";
|
||||||
|
import { IndexingPolicyComponent, IndexingPolicyComponentProps } from "./IndexingPolicyComponent";
|
||||||
|
|
||||||
describe("IndexingPolicyComponent", () => {
|
describe("IndexingPolicyComponent", () => {
|
||||||
const initialIndexingPolicyContent: DataModels.IndexingPolicy = {
|
const initialIndexingPolicyContent: DataModels.IndexingPolicy = {
|
||||||
automatic: false,
|
automatic: false,
|
||||||
indexingMode: "",
|
indexingMode: "consistent",
|
||||||
includedPaths: [],
|
includedPaths: [],
|
||||||
excludedPaths: [],
|
excludedPaths: [],
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
import * as React from "react";
|
|
||||||
import {
|
import {
|
||||||
DetailsList,
|
DetailsList,
|
||||||
DetailsListLayoutMode,
|
DetailsListLayoutMode,
|
||||||
Stack,
|
|
||||||
IconButton,
|
|
||||||
Text,
|
|
||||||
SelectionMode,
|
|
||||||
IColumn,
|
IColumn,
|
||||||
|
IconButton,
|
||||||
MessageBar,
|
MessageBar,
|
||||||
MessageBarType,
|
MessageBarType,
|
||||||
|
SelectionMode,
|
||||||
|
Separator,
|
||||||
Spinner,
|
Spinner,
|
||||||
SpinnerSize,
|
SpinnerSize,
|
||||||
Separator,
|
Stack,
|
||||||
|
Text,
|
||||||
} from "@fluentui/react";
|
} from "@fluentui/react";
|
||||||
|
import * as React from "react";
|
||||||
|
import { MongoIndex } from "../../../../../Utils/arm/generatedClients/cosmos/types";
|
||||||
|
import { CollapsibleSectionComponent } from "../../../CollapsiblePanel/CollapsibleSectionComponent";
|
||||||
import {
|
import {
|
||||||
addMongoIndexStackProps,
|
addMongoIndexStackProps,
|
||||||
customDetailsListStyles,
|
|
||||||
mongoIndexingPolicyDisclaimer,
|
|
||||||
mediumWidthStackStyles,
|
|
||||||
subComponentStackProps,
|
|
||||||
createAndAddMongoIndexStackProps,
|
createAndAddMongoIndexStackProps,
|
||||||
separatorStyles,
|
customDetailsListStyles,
|
||||||
indexingPolicynUnsavedWarningMessage,
|
indexingPolicynUnsavedWarningMessage,
|
||||||
infoAndToolTipTextStyle,
|
infoAndToolTipTextStyle,
|
||||||
onRenderRow,
|
mediumWidthStackStyles,
|
||||||
mongoCompoundIndexNotSupportedMessage,
|
mongoCompoundIndexNotSupportedMessage,
|
||||||
|
mongoIndexingPolicyDisclaimer,
|
||||||
|
onRenderRow,
|
||||||
|
separatorStyles,
|
||||||
|
subComponentStackProps,
|
||||||
} from "../../SettingsRenderUtils";
|
} from "../../SettingsRenderUtils";
|
||||||
import { MongoIndex } from "../../../../../Utils/arm/generatedClients/2020-04-01/types";
|
|
||||||
import {
|
import {
|
||||||
MongoIndexTypes,
|
|
||||||
AddMongoIndexProps,
|
AddMongoIndexProps,
|
||||||
MongoIndexIdField,
|
|
||||||
MongoNotificationType,
|
|
||||||
getMongoIndexType,
|
getMongoIndexType,
|
||||||
getMongoIndexTypeText,
|
getMongoIndexTypeText,
|
||||||
isIndexTransforming,
|
isIndexTransforming,
|
||||||
|
MongoIndexIdField,
|
||||||
|
MongoIndexTypes,
|
||||||
|
MongoNotificationType,
|
||||||
} from "../../SettingsUtils";
|
} from "../../SettingsUtils";
|
||||||
import { AddMongoIndexComponent } from "./AddMongoIndexComponent";
|
|
||||||
import { CollapsibleSectionComponent } from "../../../CollapsiblePanel/CollapsibleSectionComponent";
|
|
||||||
import { IndexingPolicyRefreshComponent } from "../IndexingPolicyRefresh/IndexingPolicyRefreshComponent";
|
import { IndexingPolicyRefreshComponent } from "../IndexingPolicyRefresh/IndexingPolicyRefreshComponent";
|
||||||
|
import { AddMongoIndexComponent } from "./AddMongoIndexComponent";
|
||||||
|
|
||||||
export interface MongoIndexingPolicyComponentProps {
|
export interface MongoIndexingPolicyComponentProps {
|
||||||
mongoIndexes: MongoIndex[];
|
mongoIndexes: MongoIndex[];
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as ViewModels from "../../../Contracts/ViewModels";
|
|
||||||
import * as DataModels from "../../../Contracts/DataModels";
|
|
||||||
import * as Constants from "../../../Common/Constants";
|
import * as Constants from "../../../Common/Constants";
|
||||||
import { MongoIndex } from "../../../Utils/arm/generatedClients/2020-04-01/types";
|
import * as DataModels from "../../../Contracts/DataModels";
|
||||||
|
import * as ViewModels from "../../../Contracts/ViewModels";
|
||||||
|
import { MongoIndex } from "../../../Utils/arm/generatedClients/cosmos/types";
|
||||||
|
|
||||||
const zeroValue = 0;
|
const zeroValue = 0;
|
||||||
export type isDirtyTypes = boolean | string | number | DataModels.IndexingPolicy;
|
export type isDirtyTypes = boolean | string | number | DataModels.IndexingPolicy;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
import ko from "knockout";
|
||||||
import * as DataModels from "../../../Contracts/DataModels";
|
import * as DataModels from "../../../Contracts/DataModels";
|
||||||
import * as ViewModels from "../../../Contracts/ViewModels";
|
import * as ViewModels from "../../../Contracts/ViewModels";
|
||||||
import Explorer from "../../Explorer";
|
import Explorer from "../../Explorer";
|
||||||
import ko from "knockout";
|
|
||||||
|
|
||||||
export const container = new Explorer();
|
export const container = new Explorer();
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export const collection = ({
|
||||||
analyticalStorageTtl: ko.observable<number>(undefined),
|
analyticalStorageTtl: ko.observable<number>(undefined),
|
||||||
indexingPolicy: ko.observable<DataModels.IndexingPolicy>({
|
indexingPolicy: ko.observable<DataModels.IndexingPolicy>({
|
||||||
automatic: true,
|
automatic: true,
|
||||||
indexingMode: "default",
|
indexingMode: "consistent",
|
||||||
includedPaths: [],
|
includedPaths: [],
|
||||||
excludedPaths: [],
|
excludedPaths: [],
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -3619,7 +3619,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||||
"automatic": true,
|
"automatic": true,
|
||||||
"excludedPaths": Array [],
|
"excludedPaths": Array [],
|
||||||
"includedPaths": Array [],
|
"includedPaths": Array [],
|
||||||
"indexingMode": "default",
|
"indexingMode": "consistent",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
indexingPolicyContentBaseline={
|
indexingPolicyContentBaseline={
|
||||||
|
@ -3627,7 +3627,7 @@ exports[`SettingsComponent renders 1`] = `
|
||||||
"automatic": true,
|
"automatic": true,
|
||||||
"excludedPaths": Array [],
|
"excludedPaths": Array [],
|
||||||
"includedPaths": Array [],
|
"includedPaths": Array [],
|
||||||
"indexingMode": "default",
|
"indexingMode": "consistent",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logIndexingPolicySuccessMessage={[Function]}
|
logIndexingPolicySuccessMessage={[Function]}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"
|
||||||
import { configContext, Platform } from "../../ConfigContext";
|
import { configContext, Platform } from "../../ConfigContext";
|
||||||
import * as DataModels from "../../Contracts/DataModels";
|
import * as DataModels from "../../Contracts/DataModels";
|
||||||
import { SubscriptionType } from "../../Contracts/SubscriptionType";
|
import { SubscriptionType } from "../../Contracts/SubscriptionType";
|
||||||
import { CollectionCreation, IndexingPolicies } from "../../Shared/Constants";
|
import { CollectionCreation } from "../../Shared/Constants";
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
|
@ -41,6 +41,40 @@ export interface AddCollectionPanelProps {
|
||||||
databaseId?: string;
|
databaseId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SharedDatabaseDefault: DataModels.IndexingPolicy = {
|
||||||
|
indexingMode: "consistent",
|
||||||
|
automatic: true,
|
||||||
|
includedPaths: [],
|
||||||
|
excludedPaths: [
|
||||||
|
{
|
||||||
|
path: "/*",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
const AllPropertiesIndexed: DataModels.IndexingPolicy = {
|
||||||
|
indexingMode: "consistent",
|
||||||
|
automatic: true,
|
||||||
|
includedPaths: [
|
||||||
|
{
|
||||||
|
path: "/*",
|
||||||
|
indexes: [
|
||||||
|
{
|
||||||
|
kind: "Range",
|
||||||
|
dataType: "Number",
|
||||||
|
precision: -1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
kind: "Range",
|
||||||
|
dataType: "String",
|
||||||
|
precision: -1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
excludedPaths: [],
|
||||||
|
};
|
||||||
|
|
||||||
export interface AddCollectionPanelState {
|
export interface AddCollectionPanelState {
|
||||||
createNewDatabase: boolean;
|
createNewDatabase: boolean;
|
||||||
newDatabaseId: string;
|
newDatabaseId: string;
|
||||||
|
@ -955,14 +989,14 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
||||||
const partitionKey: DataModels.PartitionKey = partitionKeyString
|
const partitionKey: DataModels.PartitionKey = partitionKeyString
|
||||||
? {
|
? {
|
||||||
paths: [partitionKeyString],
|
paths: [partitionKeyString],
|
||||||
kind: Constants.BackendDefaults.partitionKeyKind,
|
kind: "Hash",
|
||||||
version: partitionKeyVersion,
|
version: partitionKeyVersion,
|
||||||
}
|
}
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const indexingPolicy: DataModels.IndexingPolicy = this.state.enableIndexing
|
const indexingPolicy: DataModels.IndexingPolicy = this.state.enableIndexing
|
||||||
? IndexingPolicies.AllPropertiesIndexed
|
? AllPropertiesIndexed
|
||||||
: IndexingPolicies.SharedDatabaseDefault;
|
: SharedDatabaseDefault;
|
||||||
|
|
||||||
const telemetryData = {
|
const telemetryData = {
|
||||||
database: {
|
database: {
|
||||||
|
|
|
@ -193,7 +193,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract onSaveClick: () => Promise<any>;
|
public abstract onSaveClick: () => void;
|
||||||
public abstract onUpdateClick: () => Promise<any>;
|
public abstract onUpdateClick: () => Promise<any>;
|
||||||
|
|
||||||
public onDiscard = (): Q.Promise<any> => {
|
public onDiscard = (): Q.Promise<any> => {
|
||||||
|
@ -205,16 +205,6 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
||||||
return Q();
|
return Q();
|
||||||
};
|
};
|
||||||
|
|
||||||
public onSaveOrUpdateClick(): Promise<any> {
|
|
||||||
if (this.saveButton.visible()) {
|
|
||||||
return this.onSaveClick();
|
|
||||||
} else if (this.updateButton.visible()) {
|
|
||||||
return this.onUpdateClick();
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected getTabsButtons(): CommandButtonComponentProps[] {
|
protected getTabsButtons(): CommandButtonComponentProps[] {
|
||||||
const buttons: CommandButtonComponentProps[] = [];
|
const buttons: CommandButtonComponentProps[] = [];
|
||||||
const label = "Save";
|
const label = "Save";
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { Resource, TriggerDefinition, TriggerOperation, TriggerType } from "@azure/cosmos";
|
|
||||||
import * as Constants from "../../Common/Constants";
|
import * as Constants from "../../Common/Constants";
|
||||||
import { createTrigger } from "../../Common/dataAccess/createTrigger";
|
import { createTrigger } from "../../Common/dataAccess/createTrigger";
|
||||||
import { updateTrigger } from "../../Common/dataAccess/updateTrigger";
|
import { updateTrigger } from "../../Common/dataAccess/updateTrigger";
|
||||||
|
@ -7,6 +6,7 @@ import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"
|
||||||
import * as ViewModels from "../../Contracts/ViewModels";
|
import * as ViewModels from "../../Contracts/ViewModels";
|
||||||
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
import { Action } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
|
import { SqlTriggerResource } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import Trigger from "../Tree/Trigger";
|
import Trigger from "../Tree/Trigger";
|
||||||
import ScriptTabBase from "./ScriptTabBase";
|
import ScriptTabBase from "./ScriptTabBase";
|
||||||
import template from "./TriggerTab.html";
|
import template from "./TriggerTab.html";
|
||||||
|
@ -30,12 +30,12 @@ export default class TriggerTab extends ScriptTabBase {
|
||||||
super.buildCommandBarOptions();
|
super.buildCommandBarOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public onSaveClick = (): Promise<TriggerDefinition & Resource> => {
|
public onSaveClick = (): void => {
|
||||||
return this._createTrigger({
|
this._createTrigger({
|
||||||
id: this.id(),
|
id: this.id(),
|
||||||
body: this.editorContent(),
|
body: this.editorContent(),
|
||||||
triggerOperation: this.triggerOperation() as TriggerOperation,
|
triggerOperation: this.triggerOperation() as SqlTriggerResource["triggerOperation"],
|
||||||
triggerType: this.triggerType() as TriggerType,
|
triggerType: this.triggerType() as SqlTriggerResource["triggerType"],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ export default class TriggerTab extends ScriptTabBase {
|
||||||
return updateTrigger(this.collection.databaseId, this.collection.id(), {
|
return updateTrigger(this.collection.databaseId, this.collection.id(), {
|
||||||
id: this.id(),
|
id: this.id(),
|
||||||
body: this.editorContent(),
|
body: this.editorContent(),
|
||||||
triggerOperation: this.triggerOperation() as TriggerOperation,
|
triggerOperation: this.triggerOperation() as SqlTriggerResource["triggerOperation"],
|
||||||
triggerType: this.triggerType() as TriggerType,
|
triggerType: this.triggerType() as SqlTriggerResource["triggerType"],
|
||||||
})
|
})
|
||||||
.then(
|
.then(
|
||||||
(createdResource) => {
|
(createdResource) => {
|
||||||
|
@ -117,7 +117,7 @@ export default class TriggerTab extends ScriptTabBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _createTrigger(resource: TriggerDefinition): Promise<TriggerDefinition & Resource> {
|
private _createTrigger(resource: SqlTriggerResource): void {
|
||||||
this.isExecutionError(false);
|
this.isExecutionError(false);
|
||||||
this.isExecuting(true);
|
this.isExecuting(true);
|
||||||
const startKey: number = TelemetryProcessor.traceStart(Action.CreateTrigger, {
|
const startKey: number = TelemetryProcessor.traceStart(Action.CreateTrigger, {
|
||||||
|
@ -125,7 +125,8 @@ export default class TriggerTab extends ScriptTabBase {
|
||||||
tabTitle: this.tabTitle(),
|
tabTitle: this.tabTitle(),
|
||||||
});
|
});
|
||||||
|
|
||||||
return createTrigger(this.collection.databaseId, this.collection.id(), resource)
|
resource.body = String(resource.body); // Ensure trigger body is converted to string
|
||||||
|
createTrigger(this.collection.databaseId, this.collection.id(), resource)
|
||||||
.then(
|
.then(
|
||||||
(createdResource) => {
|
(createdResource) => {
|
||||||
this.tabTitle(createdResource.id);
|
this.tabTitle(createdResource.id);
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { UploadDetailsRecord } from "../../Contracts/ViewModels";
|
||||||
import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
|
import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
|
||||||
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
|
import { SqlTriggerResource } from "../../Utils/arm/generatedClients/cosmos/types";
|
||||||
import { logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
|
import { logConsoleInfo } from "../../Utils/NotificationConsoleUtils";
|
||||||
import Explorer from "../Explorer";
|
import Explorer from "../Explorer";
|
||||||
import { CassandraAPIDataClient, CassandraTableKey, CassandraTableKeys } from "../Tables/TableDataClient";
|
import { CassandraAPIDataClient, CassandraTableKey, CassandraTableKeys } from "../Tables/TableDataClient";
|
||||||
|
@ -962,7 +963,9 @@ export default class Collection implements ViewModels.Collection {
|
||||||
|
|
||||||
public loadTriggers(): Promise<any> {
|
public loadTriggers(): Promise<any> {
|
||||||
return readTriggers(this.databaseId, this.id()).then((triggers) => {
|
return readTriggers(this.databaseId, this.id()).then((triggers) => {
|
||||||
const triggerNodes: ViewModels.TreeNode[] = triggers.map((trigger) => new Trigger(this.container, this, trigger));
|
const triggerNodes: ViewModels.TreeNode[] = triggers.map(
|
||||||
|
(trigger: SqlTriggerResource | TriggerDefinition) => new Trigger(this.container, this, trigger)
|
||||||
|
);
|
||||||
const otherNodes = this.children().filter((node) => node.nodeKind !== "Trigger");
|
const otherNodes = this.children().filter((node) => node.nodeKind !== "Trigger");
|
||||||
const allNodes = otherNodes.concat(triggerNodes);
|
const allNodes = otherNodes.concat(triggerNodes);
|
||||||
this.children(allNodes);
|
this.children(allNodes);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { SessionStorageUtility } from "../../Shared/StorageUtility";
|
import { SessionStorageUtility } from "../../Shared/StorageUtility";
|
||||||
import { userContext } from "../../UserContext";
|
import { userContext } from "../../UserContext";
|
||||||
import { get } from "../../Utils/arm/generatedClients/2020-04-01/databaseAccounts";
|
import { get } from "../../Utils/arm/generatedClients/cosmos/databaseAccounts";
|
||||||
import { RefreshResult } from "../SelfServeTypes";
|
import { RefreshResult } from "../SelfServeTypes";
|
||||||
import { AccountProps, Regions } from "./SelfServeExample.types";
|
import { AccountProps, Regions } from "./SelfServeExample.types";
|
||||||
|
|
||||||
|
|
|
@ -187,42 +187,6 @@ export const CollectionCreationDefaults = {
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export class IndexingPolicies {
|
|
||||||
public static SharedDatabaseDefault = {
|
|
||||||
indexingMode: "consistent",
|
|
||||||
automatic: true,
|
|
||||||
includedPaths: <any>[],
|
|
||||||
excludedPaths: [
|
|
||||||
{
|
|
||||||
path: "/*",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
public static AllPropertiesIndexed = {
|
|
||||||
indexingMode: "consistent",
|
|
||||||
automatic: true,
|
|
||||||
includedPaths: [
|
|
||||||
{
|
|
||||||
path: "/*",
|
|
||||||
indexes: [
|
|
||||||
{
|
|
||||||
kind: "Range",
|
|
||||||
dataType: "Number",
|
|
||||||
precision: -1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
kind: "Range",
|
|
||||||
dataType: "String",
|
|
||||||
precision: -1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
excludedPaths: <any>[],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SubscriptionUtilMappings {
|
export class SubscriptionUtilMappings {
|
||||||
public static FreeTierSubscriptionIds: string[] = [
|
public static FreeTierSubscriptionIds: string[] = [
|
||||||
"b8f2ff04-0a81-4cf9-95ef-5828d16981d2",
|
"b8f2ff04-0a81-4cf9-95ef-5828d16981d2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as DataModels from "../Contracts/DataModels";
|
|
||||||
import * as Q from "q";
|
import * as Q from "q";
|
||||||
import * as sinon from "sinon";
|
import * as sinon from "sinon";
|
||||||
|
import * as DataModels from "../Contracts/DataModels";
|
||||||
import * as ViewModels from "../Contracts/ViewModels";
|
import * as ViewModels from "../Contracts/ViewModels";
|
||||||
import * as QueryUtils from "./QueryUtils";
|
import * as QueryUtils from "./QueryUtils";
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ describe("Query Utils", () => {
|
||||||
function generatePartitionKeyForPath(path: string): DataModels.PartitionKey {
|
function generatePartitionKeyForPath(path: string): DataModels.PartitionKey {
|
||||||
return {
|
return {
|
||||||
paths: [path],
|
paths: [path],
|
||||||
kind: "hash",
|
kind: "Hash",
|
||||||
version: 2,
|
version: 2,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */
|
/* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */
|
||||||
export async function listCassandraKeyspaces(
|
export async function listCassandraKeyspaces(
|
||||||
|
@ -82,7 +84,7 @@ export async function migrateCassandraKeyspaceToAutoscale(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
keyspaceName: string
|
keyspaceName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ export async function migrateCassandraKeyspaceToManualThroughput(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
keyspaceName: string
|
keyspaceName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -178,7 +180,7 @@ export async function migrateCassandraTableToAutoscale(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
keyspaceName: string,
|
keyspaceName: string,
|
||||||
tableName: string
|
tableName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -190,7 +192,7 @@ export async function migrateCassandraTableToManualThroughput(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
keyspaceName: string,
|
keyspaceName: string,
|
||||||
tableName: string
|
tableName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/cassandraKeyspaces/${keyspaceName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given database account and collection. */
|
/* Retrieves the metrics determined by the given filter for the given database account and collection. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given collection, split by partition. */
|
/* Retrieves the metrics determined by the given filter for the given collection, split by partition. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given collection and region, split by partition. */
|
/* Retrieves the metrics determined by the given filter for the given collection and region, split by partition. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given database account, collection and region. */
|
/* Retrieves the metrics determined by the given filter for the given database account, collection and region. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given database account and database. */
|
/* Retrieves the metrics determined by the given filter for the given database account and database. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given database account and region. */
|
/* Retrieves the metrics determined by the given filter for the given database account and region. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the properties of an existing Azure Cosmos DB database account. */
|
/* Retrieves the properties of an existing Azure Cosmos DB database account. */
|
||||||
export async function get(
|
export async function get(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Lists the Gremlin databases under an existing Azure Cosmos DB database account. */
|
/* Lists the Gremlin databases under an existing Azure Cosmos DB database account. */
|
||||||
export async function listGremlinDatabases(
|
export async function listGremlinDatabases(
|
||||||
|
@ -82,7 +84,7 @@ export async function migrateGremlinDatabaseToAutoscale(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string
|
databaseName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ export async function migrateGremlinDatabaseToManualThroughput(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string
|
databaseName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -178,7 +180,7 @@ export async function migrateGremlinGraphToAutoscale(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
graphName: string
|
graphName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -190,7 +192,7 @@ export async function migrateGremlinGraphToManualThroughput(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
graphName: string
|
graphName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/gremlinDatabases/${databaseName}/graphs/${graphName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Lists the MongoDB databases under an existing Azure Cosmos DB database account. */
|
/* Lists the MongoDB databases under an existing Azure Cosmos DB database account. */
|
||||||
export async function listMongoDBDatabases(
|
export async function listMongoDBDatabases(
|
||||||
|
@ -71,7 +73,7 @@ export async function updateMongoDBDatabaseThroughput(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
body: Types.ThroughputSettingsUpdateParameters
|
body: Types.ThroughputSettingsUpdateParameters
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
}
|
}
|
||||||
|
@ -82,7 +84,7 @@ export async function migrateMongoDBDatabaseToAutoscale(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string
|
databaseName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ export async function migrateMongoDBDatabaseToManualThroughput(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string
|
databaseName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -178,7 +180,7 @@ export async function migrateMongoDBCollectionToAutoscale(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
collectionName: string
|
collectionName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -190,7 +192,7 @@ export async function migrateMongoDBCollectionToManualThroughput(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
collectionName: string
|
collectionName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/mongodbDatabases/${databaseName}/collections/${collectionName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Lists all of the available Cosmos DB Resource Provider operations. */
|
/* Lists all of the available Cosmos DB Resource Provider operations. */
|
||||||
export async function list(): Promise<Types.OperationListResult> {
|
export async function list(): Promise<Types.OperationListResult> {
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given partition key range id. */
|
/* Retrieves the metrics determined by the given filter for the given partition key range id. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given partition key range id and region. */
|
/* Retrieves the metrics determined by the given filter for the given partition key range id and region. */
|
||||||
export async function listMetrics(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data */
|
/* 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(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* 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 */
|
/* 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(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data */
|
/* 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(
|
export async function listMetrics(
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Lists the SQL databases under an existing Azure Cosmos DB database account. */
|
/* Lists the SQL databases under an existing Azure Cosmos DB database account. */
|
||||||
export async function listSqlDatabases(
|
export async function listSqlDatabases(
|
||||||
|
@ -82,7 +84,7 @@ export async function migrateSqlDatabaseToAutoscale(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string
|
databaseName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ export async function migrateSqlDatabaseToManualThroughput(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string
|
databaseName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -178,7 +180,7 @@ export async function migrateSqlContainerToAutoscale(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
containerName: string
|
containerName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -190,7 +192,7 @@ export async function migrateSqlContainerToManualThroughput(
|
||||||
accountName: string,
|
accountName: string,
|
||||||
databaseName: string,
|
databaseName: string,
|
||||||
containerName: string
|
containerName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/sqlDatabases/${databaseName}/containers/${containerName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
|
@ -1,13 +1,15 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
import { armRequest } from "../../request";
|
import { armRequest } from "../../request";
|
||||||
import * as Types from "./types";
|
import * as Types from "./types";
|
||||||
import { configContext } from "../../../../ConfigContext";
|
const apiVersion = "2021-04-15";
|
||||||
const apiVersion = "2020-04-01";
|
|
||||||
|
|
||||||
/* Lists the Tables under an existing Azure Cosmos DB database account. */
|
/* Lists the Tables under an existing Azure Cosmos DB database account. */
|
||||||
export async function listTables(
|
export async function listTables(
|
||||||
|
@ -82,7 +84,7 @@ export async function migrateTableToAutoscale(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
tableName: string
|
tableName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default/migrateToAutoscale`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default/migrateToAutoscale`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ export async function migrateTableToManualThroughput(
|
||||||
resourceGroupName: string,
|
resourceGroupName: string,
|
||||||
accountName: string,
|
accountName: string,
|
||||||
tableName: string
|
tableName: string
|
||||||
): Promise<Types.ThroughputSettingsGetResults | void> {
|
): Promise<Types.ThroughputSettingsGetResults | void | Types.CloudError> {
|
||||||
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`;
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/tables/${tableName}/throughputSettings/default/migrateToManualThroughput`;
|
||||||
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
}
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
/*
|
/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/cosmos-db.json
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The List operation response, that contains the database accounts and their properties. */
|
/* The List operation response, that contains the database accounts and their properties. */
|
||||||
|
@ -90,6 +92,12 @@ export interface ErrorResponse {
|
||||||
message?: string;
|
message?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* An error response from the service. */
|
||||||
|
export interface CloudError {
|
||||||
|
/* undocumented */
|
||||||
|
error?: ErrorResponse;
|
||||||
|
}
|
||||||
|
|
||||||
/* The list of new failover policies for the failover priority change. */
|
/* The list of new failover policies for the failover priority change. */
|
||||||
export interface FailoverPolicies {
|
export interface FailoverPolicies {
|
||||||
/* List of failover policies. */
|
/* List of failover policies. */
|
||||||
|
@ -156,22 +164,23 @@ export interface ARMProxyResource {
|
||||||
/* An Azure Cosmos DB database account. */
|
/* An Azure Cosmos DB database account. */
|
||||||
export type DatabaseAccountGetResults = ARMResourceProperties & {
|
export type DatabaseAccountGetResults = ARMResourceProperties & {
|
||||||
/* Indicates the type of database account. This can only be set at database account creation. */
|
/* Indicates the type of database account. This can only be set at database account creation. */
|
||||||
kind?: string;
|
kind?: "GlobalDocumentDB" | "MongoDB" | "Parse";
|
||||||
|
|
||||||
|
/* undocumented */
|
||||||
|
identity?: ManagedServiceIdentity;
|
||||||
|
|
||||||
/* undocumented */
|
/* undocumented */
|
||||||
properties?: DatabaseAccountGetProperties;
|
properties?: DatabaseAccountGetProperties;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs. */
|
/* The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin graphs. */
|
||||||
// TODO: ExtendedResourceProperties was missing some properties such as _self which was manually added. Need to fix this in the RP spec.
|
|
||||||
export interface ExtendedResourceProperties {
|
export interface ExtendedResourceProperties {
|
||||||
/* A system generated property. A unique identifier. */
|
/* A system generated property. A unique identifier. */
|
||||||
readonly _rid?: string;
|
readonly _rid?: string;
|
||||||
/* A system generated property that denotes the last updated timestamp of the resource. */
|
/* A system generated property that denotes the last updated timestamp of the resource. */
|
||||||
readonly _ts?: unknown;
|
readonly _ts?: number;
|
||||||
/* A system generated property representing the resource etag required for optimistic concurrency control. */
|
/* A system generated property representing the resource etag required for optimistic concurrency control. */
|
||||||
readonly _etag: string;
|
readonly _etag?: string;
|
||||||
// TODO: This property was manually added. It should be auto-generated like the other properties.
|
|
||||||
readonly _self: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* An Azure Cosmos DB resource throughput. */
|
/* An Azure Cosmos DB resource throughput. */
|
||||||
|
@ -351,7 +360,8 @@ export interface GremlinGraphGetProperties {
|
||||||
/* The consistency policy for the Cosmos DB database account. */
|
/* The consistency policy for the Cosmos DB database account. */
|
||||||
export interface ConsistencyPolicy {
|
export interface ConsistencyPolicy {
|
||||||
/* The default consistency level and configuration settings of the Cosmos DB account. */
|
/* The default consistency level and configuration settings of the Cosmos DB account. */
|
||||||
defaultConsistencyLevel: string;
|
defaultConsistencyLevel: "Eventual" | "Session" | "BoundedStaleness" | "Strong" | "ConsistentPrefix";
|
||||||
|
|
||||||
/* 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'. */
|
/* 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;
|
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'. */
|
/* 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'. */
|
||||||
|
@ -411,7 +421,7 @@ export interface DatabaseAccountGetProperties {
|
||||||
virtualNetworkRules?: VirtualNetworkRule[];
|
virtualNetworkRules?: VirtualNetworkRule[];
|
||||||
|
|
||||||
/* List of Private Endpoint Connections configured for the Cosmos DB account. */
|
/* List of Private Endpoint Connections configured for the Cosmos DB account. */
|
||||||
readonly privateEndpointConnections?: PrivateEndpointConnection[];
|
readonly privateEndpointConnections?: unknown[];
|
||||||
|
|
||||||
/* Enables the account to write in multiple locations */
|
/* Enables the account to write in multiple locations */
|
||||||
enableMultipleWriteLocations?: boolean;
|
enableMultipleWriteLocations?: boolean;
|
||||||
|
@ -424,6 +434,8 @@ export interface DatabaseAccountGetProperties {
|
||||||
disableKeyBasedMetadataWriteAccess?: boolean;
|
disableKeyBasedMetadataWriteAccess?: boolean;
|
||||||
/* The URI of the key vault */
|
/* The URI of the key vault */
|
||||||
keyVaultKeyUri?: string;
|
keyVaultKeyUri?: string;
|
||||||
|
/* The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. */
|
||||||
|
defaultIdentity?: string;
|
||||||
/* Whether requests from Public Network are allowed */
|
/* Whether requests from Public Network are allowed */
|
||||||
publicNetworkAccess?: PublicNetworkAccess;
|
publicNetworkAccess?: PublicNetworkAccess;
|
||||||
|
|
||||||
|
@ -434,8 +446,17 @@ export interface DatabaseAccountGetProperties {
|
||||||
|
|
||||||
/* Flag to indicate whether to enable storage analytics. */
|
/* Flag to indicate whether to enable storage analytics. */
|
||||||
enableAnalyticalStorage?: boolean;
|
enableAnalyticalStorage?: boolean;
|
||||||
|
/* The object representing the policy for taking backups on an account. */
|
||||||
|
backupPolicy?: BackupPolicy;
|
||||||
|
|
||||||
/* The CORS policy for the Cosmos DB database account. */
|
/* The CORS policy for the Cosmos DB database account. */
|
||||||
cors?: CorsPolicy[];
|
cors?: CorsPolicy[];
|
||||||
|
|
||||||
|
/* Indicates what services are allowed to bypass firewall checks. */
|
||||||
|
networkAclBypass?: NetworkAclBypass;
|
||||||
|
|
||||||
|
/* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */
|
||||||
|
networkAclBypassResourceIds?: unknown[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Properties to create and update Azure Cosmos DB database accounts. */
|
/* Properties to create and update Azure Cosmos DB database accounts. */
|
||||||
|
@ -473,6 +494,8 @@ export interface DatabaseAccountCreateUpdateProperties {
|
||||||
disableKeyBasedMetadataWriteAccess?: boolean;
|
disableKeyBasedMetadataWriteAccess?: boolean;
|
||||||
/* The URI of the key vault */
|
/* The URI of the key vault */
|
||||||
keyVaultKeyUri?: string;
|
keyVaultKeyUri?: string;
|
||||||
|
/* The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. */
|
||||||
|
defaultIdentity?: string;
|
||||||
/* Whether requests from Public Network are allowed */
|
/* Whether requests from Public Network are allowed */
|
||||||
publicNetworkAccess?: PublicNetworkAccess;
|
publicNetworkAccess?: PublicNetworkAccess;
|
||||||
|
|
||||||
|
@ -483,14 +506,27 @@ export interface DatabaseAccountCreateUpdateProperties {
|
||||||
|
|
||||||
/* Flag to indicate whether to enable storage analytics. */
|
/* Flag to indicate whether to enable storage analytics. */
|
||||||
enableAnalyticalStorage?: boolean;
|
enableAnalyticalStorage?: boolean;
|
||||||
|
/* The object representing the policy for taking backups on an account. */
|
||||||
|
backupPolicy?: BackupPolicy;
|
||||||
|
|
||||||
/* The CORS policy for the Cosmos DB database account. */
|
/* The CORS policy for the Cosmos DB database account. */
|
||||||
cors?: CorsPolicy[];
|
cors?: CorsPolicy[];
|
||||||
|
|
||||||
|
/* Indicates what services are allowed to bypass firewall checks. */
|
||||||
|
networkAclBypass?: NetworkAclBypass;
|
||||||
|
|
||||||
|
/* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */
|
||||||
|
networkAclBypassResourceIds?: unknown[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB database accounts. */
|
/* Parameters to create and update Cosmos DB database accounts. */
|
||||||
export type DatabaseAccountCreateUpdateParameters = ARMResourceProperties & {
|
export type DatabaseAccountCreateUpdateParameters = ARMResourceProperties & {
|
||||||
/* Indicates the type of database account. This can only be set at database account creation. */
|
/* Indicates the type of database account. This can only be set at database account creation. */
|
||||||
kind?: string;
|
kind?: "GlobalDocumentDB" | "MongoDB" | "Parse";
|
||||||
|
|
||||||
|
/* undocumented */
|
||||||
|
identity?: ManagedServiceIdentity;
|
||||||
|
|
||||||
/* undocumented */
|
/* undocumented */
|
||||||
properties: DatabaseAccountCreateUpdateProperties;
|
properties: DatabaseAccountCreateUpdateProperties;
|
||||||
};
|
};
|
||||||
|
@ -527,6 +563,8 @@ export interface DatabaseAccountUpdateProperties {
|
||||||
disableKeyBasedMetadataWriteAccess?: boolean;
|
disableKeyBasedMetadataWriteAccess?: boolean;
|
||||||
/* The URI of the key vault */
|
/* The URI of the key vault */
|
||||||
keyVaultKeyUri?: string;
|
keyVaultKeyUri?: string;
|
||||||
|
/* The default identity for accessing key vault used in features like customer managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more. */
|
||||||
|
defaultIdentity?: string;
|
||||||
/* Whether requests from Public Network are allowed */
|
/* Whether requests from Public Network are allowed */
|
||||||
publicNetworkAccess?: PublicNetworkAccess;
|
publicNetworkAccess?: PublicNetworkAccess;
|
||||||
|
|
||||||
|
@ -537,8 +575,17 @@ export interface DatabaseAccountUpdateProperties {
|
||||||
|
|
||||||
/* Flag to indicate whether to enable storage analytics. */
|
/* Flag to indicate whether to enable storage analytics. */
|
||||||
enableAnalyticalStorage?: boolean;
|
enableAnalyticalStorage?: boolean;
|
||||||
|
/* The object representing the policy for taking backups on an account. */
|
||||||
|
backupPolicy?: BackupPolicy;
|
||||||
|
|
||||||
/* The CORS policy for the Cosmos DB database account. */
|
/* The CORS policy for the Cosmos DB database account. */
|
||||||
cors?: CorsPolicy[];
|
cors?: CorsPolicy[];
|
||||||
|
|
||||||
|
/* Indicates what services are allowed to bypass firewall checks. */
|
||||||
|
networkAclBypass?: NetworkAclBypass;
|
||||||
|
|
||||||
|
/* An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. */
|
||||||
|
networkAclBypassResourceIds?: unknown[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters for patching Azure Cosmos DB database account properties. */
|
/* Parameters for patching Azure Cosmos DB database account properties. */
|
||||||
|
@ -548,6 +595,9 @@ export interface DatabaseAccountUpdateParameters {
|
||||||
|
|
||||||
/* The location of the resource group to which the resource belongs. */
|
/* The location of the resource group to which the resource belongs. */
|
||||||
location?: string;
|
location?: string;
|
||||||
|
/* undocumented */
|
||||||
|
identity?: ManagedServiceIdentity;
|
||||||
|
|
||||||
/* undocumented */
|
/* undocumented */
|
||||||
properties?: DatabaseAccountUpdateProperties;
|
properties?: DatabaseAccountUpdateProperties;
|
||||||
}
|
}
|
||||||
|
@ -585,7 +635,7 @@ export interface DatabaseAccountListConnectionStringsResult {
|
||||||
/* Parameters to regenerate the keys within the database account. */
|
/* Parameters to regenerate the keys within the database account. */
|
||||||
export interface DatabaseAccountRegenerateKeyParameters {
|
export interface DatabaseAccountRegenerateKeyParameters {
|
||||||
/* The access key to regenerate. */
|
/* The access key to regenerate. */
|
||||||
keyKind: string;
|
keyKind: "primary" | "secondary" | "primaryReadonly" | "secondaryReadonly";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The offer type for the Cosmos DB database account. */
|
/* The offer type for the Cosmos DB database account. */
|
||||||
|
@ -615,7 +665,7 @@ export interface SqlDatabaseCreateUpdateProperties {
|
||||||
resource: SqlDatabaseResource;
|
resource: SqlDatabaseResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB container. */
|
/* Parameters to create and update Cosmos DB container. */
|
||||||
|
@ -630,7 +680,7 @@ export interface SqlContainerCreateUpdateProperties {
|
||||||
resource: SqlContainerResource;
|
resource: SqlContainerResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB storedProcedure. */
|
/* Parameters to create and update Cosmos DB storedProcedure. */
|
||||||
|
@ -645,7 +695,7 @@ export interface SqlStoredProcedureCreateUpdateProperties {
|
||||||
resource: SqlStoredProcedureResource;
|
resource: SqlStoredProcedureResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB userDefinedFunction. */
|
/* Parameters to create and update Cosmos DB userDefinedFunction. */
|
||||||
|
@ -660,7 +710,7 @@ export interface SqlUserDefinedFunctionCreateUpdateProperties {
|
||||||
resource: SqlUserDefinedFunctionResource;
|
resource: SqlUserDefinedFunctionResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB trigger. */
|
/* Parameters to create and update Cosmos DB trigger. */
|
||||||
|
@ -675,7 +725,7 @@ export interface SqlTriggerCreateUpdateProperties {
|
||||||
resource: SqlTriggerResource;
|
resource: SqlTriggerResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB MongoDB database. */
|
/* Parameters to create and update Cosmos DB MongoDB database. */
|
||||||
|
@ -690,7 +740,7 @@ export interface MongoDBDatabaseCreateUpdateProperties {
|
||||||
resource: MongoDBDatabaseResource;
|
resource: MongoDBDatabaseResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB MongoDB collection. */
|
/* Parameters to create and update Cosmos DB MongoDB collection. */
|
||||||
|
@ -705,7 +755,7 @@ export interface MongoDBCollectionCreateUpdateProperties {
|
||||||
resource: MongoDBCollectionResource;
|
resource: MongoDBCollectionResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB Table. */
|
/* Parameters to create and update Cosmos DB Table. */
|
||||||
|
@ -720,7 +770,7 @@ export interface TableCreateUpdateProperties {
|
||||||
resource: TableResource;
|
resource: TableResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB Cassandra keyspace. */
|
/* Parameters to create and update Cosmos DB Cassandra keyspace. */
|
||||||
|
@ -735,7 +785,7 @@ export interface CassandraKeyspaceCreateUpdateProperties {
|
||||||
resource: CassandraKeyspaceResource;
|
resource: CassandraKeyspaceResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB Cassandra table. */
|
/* Parameters to create and update Cosmos DB Cassandra table. */
|
||||||
|
@ -750,7 +800,7 @@ export interface CassandraTableCreateUpdateProperties {
|
||||||
resource: CassandraTableResource;
|
resource: CassandraTableResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB Gremlin database. */
|
/* Parameters to create and update Cosmos DB Gremlin database. */
|
||||||
|
@ -765,7 +815,7 @@ export interface GremlinDatabaseCreateUpdateProperties {
|
||||||
resource: GremlinDatabaseResource;
|
resource: GremlinDatabaseResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parameters to create and update Cosmos DB Gremlin graph. */
|
/* Parameters to create and update Cosmos DB Gremlin graph. */
|
||||||
|
@ -780,7 +830,7 @@ export interface GremlinGraphCreateUpdateProperties {
|
||||||
resource: GremlinGraphResource;
|
resource: GremlinGraphResource;
|
||||||
|
|
||||||
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
/* A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. */
|
||||||
options: CreateUpdateOptions;
|
options?: CreateUpdateOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. */
|
/* Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. */
|
||||||
|
@ -853,8 +903,7 @@ export interface SqlContainerResource {
|
||||||
/* The conflict resolution policy for the container. */
|
/* The conflict resolution policy for the container. */
|
||||||
conflictResolutionPolicy?: ConflictResolutionPolicy;
|
conflictResolutionPolicy?: ConflictResolutionPolicy;
|
||||||
|
|
||||||
//TODO: this property is manually added. It should be auto-generated instead. Need to be fixed in the API spec.
|
/* Analytical TTL. */
|
||||||
/* Analytical storage time to live */
|
|
||||||
analyticalStorageTtl?: number;
|
analyticalStorageTtl?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,7 +912,8 @@ export interface IndexingPolicy {
|
||||||
/* Indicates if the indexing policy is automatic */
|
/* Indicates if the indexing policy is automatic */
|
||||||
automatic?: boolean;
|
automatic?: boolean;
|
||||||
/* Indicates the indexing mode. */
|
/* Indicates the indexing mode. */
|
||||||
indexingMode?: string;
|
indexingMode?: "consistent" | "lazy" | "none";
|
||||||
|
|
||||||
/* List of paths to include in the indexing */
|
/* List of paths to include in the indexing */
|
||||||
includedPaths?: IncludedPath[];
|
includedPaths?: IncludedPath[];
|
||||||
|
|
||||||
|
@ -894,11 +944,12 @@ export interface IncludedPath {
|
||||||
/* The indexes for the path. */
|
/* The indexes for the path. */
|
||||||
export interface Indexes {
|
export interface Indexes {
|
||||||
/* The datatype for which the indexing behavior is applied to. */
|
/* The datatype for which the indexing behavior is applied to. */
|
||||||
dataType?: string;
|
dataType?: "String" | "Number" | "Point" | "Polygon" | "LineString" | "MultiPolygon";
|
||||||
|
|
||||||
/* The precision of the index. -1 is maximum precision. */
|
/* The precision of the index. -1 is maximum precision. */
|
||||||
precision?: number;
|
precision?: number;
|
||||||
/* Indicates the type of index. */
|
/* Indicates the type of index. */
|
||||||
kind?: string;
|
kind?: "Hash" | "Range" | "Spatial";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* List of composite path */
|
/* List of composite path */
|
||||||
|
@ -909,7 +960,7 @@ export interface CompositePath {
|
||||||
/* The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) */
|
/* The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) */
|
||||||
path?: string;
|
path?: string;
|
||||||
/* Sort order for composite paths. */
|
/* Sort order for composite paths. */
|
||||||
order?: string;
|
order?: "ascending" | "descending";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* undocumented */
|
/* undocumented */
|
||||||
|
@ -928,10 +979,13 @@ export interface ContainerPartitionKey {
|
||||||
/* List of paths using which data within the container can be partitioned */
|
/* List of paths using which data within the container can be partitioned */
|
||||||
paths?: Path[];
|
paths?: Path[];
|
||||||
|
|
||||||
/* Indicates the kind of algorithm used for partitioning */
|
/* Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create */
|
||||||
kind?: string;
|
kind?: "Hash" | "Range" | "MultiHash";
|
||||||
|
|
||||||
/* Indicates the version of the partition key definition */
|
/* Indicates the version of the partition key definition */
|
||||||
version?: number;
|
version?: number;
|
||||||
|
/* Indicates if the container is using a system generated partition key */
|
||||||
|
readonly systemKey?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A path. These typically start with root (/path) */
|
/* A path. These typically start with root (/path) */
|
||||||
|
@ -952,7 +1006,8 @@ export interface UniqueKey {
|
||||||
/* The conflict resolution policy for the container. */
|
/* The conflict resolution policy for the container. */
|
||||||
export interface ConflictResolutionPolicy {
|
export interface ConflictResolutionPolicy {
|
||||||
/* Indicates the conflict resolution mode. */
|
/* Indicates the conflict resolution mode. */
|
||||||
mode?: string;
|
mode?: "LastWriterWins" | "Custom";
|
||||||
|
|
||||||
/* The conflict resolution path in the case of LastWriterWins mode. */
|
/* The conflict resolution path in the case of LastWriterWins mode. */
|
||||||
conflictResolutionPath?: string;
|
conflictResolutionPath?: string;
|
||||||
/* The procedure to resolve conflicts in the case of custom mode. */
|
/* The procedure to resolve conflicts in the case of custom mode. */
|
||||||
|
@ -980,11 +1035,12 @@ export interface SqlTriggerResource {
|
||||||
/* Name of the Cosmos DB SQL trigger */
|
/* Name of the Cosmos DB SQL trigger */
|
||||||
id: string;
|
id: string;
|
||||||
/* Body of the Trigger */
|
/* Body of the Trigger */
|
||||||
body?: string;
|
body: string;
|
||||||
/* Type of the Trigger */
|
/* Type of the Trigger */
|
||||||
triggerType?: string;
|
triggerType?: "Pre" | "Post";
|
||||||
|
|
||||||
/* The operation the trigger is associated with */
|
/* The operation the trigger is associated with */
|
||||||
triggerOperation?: string;
|
triggerOperation?: "All" | "Create" | "Update" | "Delete" | "Replace";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cosmos DB MongoDB database resource object */
|
/* Cosmos DB MongoDB database resource object */
|
||||||
|
@ -1143,6 +1199,19 @@ export interface Capability {
|
||||||
/* 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". */
|
/* 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 };
|
export type Tags = { [key: string]: string };
|
||||||
|
|
||||||
|
/* Identity for the resource. */
|
||||||
|
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?: "SystemAssigned" | "UserAssigned" | "SystemAssigned,UserAssigned" | "None";
|
||||||
|
|
||||||
|
/* The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */
|
||||||
|
userAssignedIdentities?: unknown;
|
||||||
|
}
|
||||||
|
|
||||||
/* 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. */
|
/* 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. */
|
||||||
export type ProvisioningState = string;
|
export type ProvisioningState = string;
|
||||||
|
|
||||||
|
@ -1163,34 +1232,8 @@ export interface VirtualNetworkRule {
|
||||||
ignoreMissingVNetServiceEndpoint?: boolean;
|
ignoreMissingVNetServiceEndpoint?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A private endpoint connection */
|
/* Indicates what services are allowed to bypass firewall checks. */
|
||||||
export type PrivateEndpointConnection = unknown & {
|
export type NetworkAclBypass = "None" | "AzureServices";
|
||||||
/* Resource properties. */
|
|
||||||
properties?: PrivateEndpointConnectionProperties;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Properties of a private endpoint connection. */
|
|
||||||
export interface PrivateEndpointConnectionProperties {
|
|
||||||
/* Private endpoint which the connection belongs to. */
|
|
||||||
privateEndpoint?: PrivateEndpointProperty;
|
|
||||||
|
|
||||||
/* Connection State of the Private Endpoint Connection. */
|
|
||||||
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Private endpoint which the connection belongs to. */
|
|
||||||
export interface PrivateEndpointProperty {
|
|
||||||
/* Resource id of the private endpoint. */
|
|
||||||
id?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Connection State of the Private Endpoint Connection. */
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* REST API operation */
|
/* REST API operation */
|
||||||
export interface Operation {
|
export interface Operation {
|
||||||
|
@ -1257,7 +1300,8 @@ export interface MetricDefinition {
|
||||||
readonly metricAvailabilities?: MetricAvailability[];
|
readonly metricAvailabilities?: MetricAvailability[];
|
||||||
|
|
||||||
/* The primary aggregation type of the metric. */
|
/* The primary aggregation type of the metric. */
|
||||||
readonly primaryAggregationType?: string;
|
readonly primaryAggregationType?: "None" | "Average" | "Total" | "Minimum" | "Maximum" | "Last";
|
||||||
|
|
||||||
/* The unit of the metric. */
|
/* The unit of the metric. */
|
||||||
unit?: UnitType;
|
unit?: UnitType;
|
||||||
|
|
||||||
|
@ -1391,5 +1435,31 @@ export type PublicNetworkAccess = "Enabled" | "Disabled";
|
||||||
/* undocumented */
|
/* undocumented */
|
||||||
export interface ApiProperties {
|
export interface ApiProperties {
|
||||||
/* Describes the ServerVersion of an a MongoDB account. */
|
/* Describes the ServerVersion of an a MongoDB account. */
|
||||||
serverVersion?: string;
|
serverVersion?: "3.2" | "3.6" | "4.0";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The object representing the policy for taking backups on an account. */
|
||||||
|
export interface BackupPolicy {
|
||||||
|
/* undocumented */
|
||||||
|
type: BackupPolicyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Describes the mode of backups. */
|
||||||
|
export type BackupPolicyType = "Periodic" | "Continuous";
|
||||||
|
|
||||||
|
/* The object representing periodic mode backup policy. */
|
||||||
|
export type PeriodicModeBackupPolicy = BackupPolicy & {
|
||||||
|
/* Configuration values for periodic mode backup */
|
||||||
|
periodicModeProperties?: PeriodicModeProperties;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The object representing continuous mode backup policy. */
|
||||||
|
export type ContinuousModeBackupPolicy = BackupPolicy;
|
||||||
|
|
||||||
|
/* Configuration values for periodic mode backup */
|
||||||
|
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;
|
||||||
}
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/notebook.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-04-15";
|
||||||
|
|
||||||
|
/* Gets the notebook workspace resources of an existing Cosmos DB account. */
|
||||||
|
export async function listByDatabaseAccount(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string
|
||||||
|
): Promise<Types.NotebookWorkspaceListResult> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Gets the notebook workspace for a Cosmos DB account. */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string,
|
||||||
|
notebookWorkspaceName: string
|
||||||
|
): Promise<Types.NotebookWorkspace> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces/${notebookWorkspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Creates the notebook workspace for a Cosmos DB account. */
|
||||||
|
export async function createOrUpdate(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string,
|
||||||
|
notebookWorkspaceName: string,
|
||||||
|
body: Types.NotebookWorkspaceCreateUpdateParameters
|
||||||
|
): Promise<Types.NotebookWorkspace> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces/${notebookWorkspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Deletes the notebook workspace for a Cosmos DB account. */
|
||||||
|
export async function destroy(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string,
|
||||||
|
notebookWorkspaceName: string
|
||||||
|
): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces/${notebookWorkspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Retrieves the connection info for the notebook workspace */
|
||||||
|
export async function listConnectionInfo(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string,
|
||||||
|
notebookWorkspaceName: string
|
||||||
|
): Promise<Types.NotebookWorkspaceConnectionInfoResult> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces/${notebookWorkspaceName}/listConnectionInfo`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Regenerates the auth token for the notebook workspace */
|
||||||
|
export async function regenerateAuthToken(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string,
|
||||||
|
notebookWorkspaceName: string
|
||||||
|
): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces/${notebookWorkspaceName}/regenerateAuthToken`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Starts the notebook workspace */
|
||||||
|
export async function start(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
accountName: string,
|
||||||
|
notebookWorkspaceName: string
|
||||||
|
): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${accountName}/notebookWorkspaces/${notebookWorkspaceName}/start`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "POST", apiVersion });
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-04-15/notebook.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Parameters to create a notebook workspace resource */
|
||||||
|
export type NotebookWorkspaceCreateUpdateParameters = unknown;
|
||||||
|
|
||||||
|
/* A list of notebook workspace resources */
|
||||||
|
export interface NotebookWorkspaceListResult {
|
||||||
|
/* Array of notebook workspace resources */
|
||||||
|
value?: NotebookWorkspace[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A notebook workspace resource */
|
||||||
|
export type NotebookWorkspace = unknown & {
|
||||||
|
/* Resource properties. */
|
||||||
|
properties?: NotebookWorkspaceProperties;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Properties of a notebook workspace resource. */
|
||||||
|
export interface NotebookWorkspaceProperties {
|
||||||
|
/* Specifies the endpoint of Notebook server. */
|
||||||
|
readonly notebookServerEndpoint?: string;
|
||||||
|
/* Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating. */
|
||||||
|
readonly status?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The connection info for the given notebook workspace */
|
||||||
|
export interface NotebookWorkspaceConnectionInfoResult {
|
||||||
|
/* Specifies auth token used for connecting to Notebook server (uses token-based auth). */
|
||||||
|
readonly authToken?: string;
|
||||||
|
/* Specifies the endpoint of Notebook server. */
|
||||||
|
readonly notebookServerEndpoint?: string;
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/bigDataPool.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-03-01";
|
||||||
|
|
||||||
|
/* Get a Big Data pool. */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
bigDataPoolName: string
|
||||||
|
): Promise<Types.BigDataPoolResourceInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/bigDataPools/${bigDataPoolName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Patch a Big Data pool. */
|
||||||
|
export async function update(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
bigDataPoolName: string,
|
||||||
|
body: Types.BigDataPoolPatchInfo
|
||||||
|
): Promise<Types.BigDataPoolResourceInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/bigDataPools/${bigDataPoolName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PATCH", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a new Big Data pool. */
|
||||||
|
export async function createOrUpdate(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
bigDataPoolName: string,
|
||||||
|
body: Types.BigDataPoolResourceInfo
|
||||||
|
): Promise<Types.BigDataPoolResourceInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/bigDataPools/${bigDataPoolName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Delete a Big Data pool from the workspace. */
|
||||||
|
export async function destroy(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
bigDataPoolName: string
|
||||||
|
): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/bigDataPools/${bigDataPoolName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* List Big Data pools in a workspace. */
|
||||||
|
export async function listByWorkspace(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string
|
||||||
|
): Promise<Types.BigDataPoolResourceInfoListResult> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/bigDataPools`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/bigDataPool.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Collection of Big Data pool information */
|
||||||
|
export interface BigDataPoolResourceInfoListResult {
|
||||||
|
/* Link to the next page of results */
|
||||||
|
nextLink?: string;
|
||||||
|
/* List of Big Data pools */
|
||||||
|
value?: BigDataPoolResourceInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Properties patch for a Big Data pool */
|
||||||
|
export interface BigDataPoolPatchInfo {
|
||||||
|
/* Updated tags for the Big Data pool */
|
||||||
|
tags?: unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A Big Data pool */
|
||||||
|
export type BigDataPoolResourceInfo = unknown & {
|
||||||
|
/* Big Data pool properties */
|
||||||
|
properties?: BigDataPoolResourceProperties;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Properties of a Big Data pool powered by Apache Spark */
|
||||||
|
export interface BigDataPoolResourceProperties {
|
||||||
|
/* The state of the Big Data pool. */
|
||||||
|
provisioningState?: string;
|
||||||
|
/* Auto-scaling properties */
|
||||||
|
autoScale?: AutoScaleProperties;
|
||||||
|
|
||||||
|
/* The time when the Big Data pool was created. */
|
||||||
|
creationDate?: string;
|
||||||
|
/* Auto-pausing properties */
|
||||||
|
autoPause?: AutoPauseProperties;
|
||||||
|
|
||||||
|
/* Whether compute isolation is required or not. */
|
||||||
|
isComputeIsolationEnabled?: boolean;
|
||||||
|
/* Whether session level packages enabled. */
|
||||||
|
sessionLevelPackagesEnabled?: boolean;
|
||||||
|
/* The cache size */
|
||||||
|
cacheSize?: number;
|
||||||
|
/* Dynamic Executor Allocation */
|
||||||
|
dynamicExecutorAllocation?: DynamicExecutorAllocation;
|
||||||
|
|
||||||
|
/* The Spark events folder */
|
||||||
|
sparkEventsFolder?: string;
|
||||||
|
/* The number of nodes in the Big Data pool. */
|
||||||
|
nodeCount?: number;
|
||||||
|
/* Library version requirements */
|
||||||
|
libraryRequirements?: LibraryRequirements;
|
||||||
|
|
||||||
|
/* List of custom libraries/packages associated with the spark pool. */
|
||||||
|
customLibraries?: LibraryInfo[];
|
||||||
|
|
||||||
|
/* Spark configuration file to specify additional properties */
|
||||||
|
sparkConfigProperties?: LibraryRequirements;
|
||||||
|
|
||||||
|
/* The Apache Spark version. */
|
||||||
|
sparkVersion?: string;
|
||||||
|
/* The default folder where Spark logs will be written. */
|
||||||
|
defaultSparkLogFolder?: string;
|
||||||
|
/* The level of compute power that each node in the Big Data pool has. */
|
||||||
|
nodeSize?: "None" | "Small" | "Medium" | "Large" | "XLarge" | "XXLarge" | "XXXLarge";
|
||||||
|
|
||||||
|
/* The kind of nodes that the Big Data pool provides. */
|
||||||
|
nodeSizeFamily?: "None" | "MemoryOptimized";
|
||||||
|
|
||||||
|
/* The time when the Big Data pool was updated successfully. */
|
||||||
|
readonly lastSucceededTimestamp?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Auto-scaling properties of a Big Data pool powered by Apache Spark */
|
||||||
|
export interface AutoScaleProperties {
|
||||||
|
/* The minimum number of nodes the Big Data pool can support. */
|
||||||
|
minNodeCount?: number;
|
||||||
|
/* Whether automatic scaling is enabled for the Big Data pool. */
|
||||||
|
enabled?: boolean;
|
||||||
|
/* The maximum number of nodes the Big Data pool can support. */
|
||||||
|
maxNodeCount?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Auto-pausing properties of a Big Data pool powered by Apache Spark */
|
||||||
|
export interface AutoPauseProperties {
|
||||||
|
/* Number of minutes of idle time before the Big Data pool is automatically paused. */
|
||||||
|
delayInMinutes?: number;
|
||||||
|
/* Whether auto-pausing is enabled for the Big Data pool. */
|
||||||
|
enabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dynamic Executor Allocation Properties */
|
||||||
|
export interface DynamicExecutorAllocation {
|
||||||
|
/* Indicates whether Dynamic Executor Allocation is enabled or not. */
|
||||||
|
enabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Library/package information of a Big Data pool powered by Apache Spark */
|
||||||
|
export interface LibraryInfo {
|
||||||
|
/* Name of the library. */
|
||||||
|
name?: string;
|
||||||
|
/* Storage blob path of library. */
|
||||||
|
path?: string;
|
||||||
|
/* Storage blob container name. */
|
||||||
|
containerName?: string;
|
||||||
|
/* The last update time of the library. */
|
||||||
|
readonly uploadedTimestamp?: string;
|
||||||
|
/* Type of the library. */
|
||||||
|
type?: string;
|
||||||
|
/* Provisioning status of the library/package. */
|
||||||
|
readonly provisioningStatus?: string;
|
||||||
|
/* Creator Id of the library/package. */
|
||||||
|
readonly creatorId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Library requirements for a Big Data pool powered by Apache Spark */
|
||||||
|
export interface LibraryRequirements {
|
||||||
|
/* The last update time of the library requirements file. */
|
||||||
|
readonly time?: string;
|
||||||
|
/* The library requirements. */
|
||||||
|
content?: string;
|
||||||
|
/* The filename of the library requirements file. */
|
||||||
|
filename?: string;
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/workspace.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-03-01";
|
||||||
|
|
||||||
|
/* Gets a deleted sql pool that can be restored */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
restorableDroppedSqlPoolId: string
|
||||||
|
): Promise<Types.RestorableDroppedSqlPool> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/restorableDroppedSqlPools/${restorableDroppedSqlPoolId}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Gets a list of deleted Sql pools that can be restored */
|
||||||
|
export async function listByWorkspace(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string
|
||||||
|
): Promise<Types.RestorableDroppedSqlPoolListResult> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/restorableDroppedSqlPools`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
|
@ -0,0 +1,249 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/workspace.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Workspace active directory administrator properties */
|
||||||
|
export interface AadAdminProperties {
|
||||||
|
/* Tenant ID of the workspace active directory administrator */
|
||||||
|
tenantId?: string;
|
||||||
|
/* Login of the workspace active directory administrator */
|
||||||
|
login?: string;
|
||||||
|
/* Workspace active directory administrator type */
|
||||||
|
administratorType?: string;
|
||||||
|
/* Object ID of the workspace active directory administrator */
|
||||||
|
sid?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* List of workspaces */
|
||||||
|
export interface WorkspaceInfoListResult {
|
||||||
|
/* Link to the next page of results */
|
||||||
|
nextLink?: string;
|
||||||
|
/* List of workspaces */
|
||||||
|
value?: Workspace[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Details of the data lake storage account associated with the workspace */
|
||||||
|
export interface DataLakeStorageAccountDetails {
|
||||||
|
/* Account URL */
|
||||||
|
accountUrl?: string;
|
||||||
|
/* Filesystem name */
|
||||||
|
filesystem?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Details of the encryption associated with the workspace */
|
||||||
|
export interface EncryptionDetails {
|
||||||
|
/* Double Encryption enabled */
|
||||||
|
readonly doubleEncryptionEnabled?: boolean;
|
||||||
|
/* Customer Managed Key Details */
|
||||||
|
cmk?: CustomerManagedKeyDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Details of the customer managed key associated with the workspace */
|
||||||
|
export interface CustomerManagedKeyDetails {
|
||||||
|
/* The customer managed key status on the workspace */
|
||||||
|
readonly status?: string;
|
||||||
|
/* The key object of the workspace */
|
||||||
|
key?: WorkspaceKeyDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Details of the customer managed key associated with the workspace */
|
||||||
|
export interface WorkspaceKeyDetails {
|
||||||
|
/* Workspace Key sub-resource name */
|
||||||
|
name?: string;
|
||||||
|
/* Workspace Key sub-resource key vault url */
|
||||||
|
keyVaultUrl?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The workspace managed identity */
|
||||||
|
export interface ManagedIdentity {
|
||||||
|
/* The principal ID of the workspace managed identity */
|
||||||
|
readonly principalId?: string;
|
||||||
|
/* The tenant ID of the workspace managed identity */
|
||||||
|
readonly tenantId?: string;
|
||||||
|
/* The type of managed identity for the workspace */
|
||||||
|
type?: "None" | "SystemAssigned";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Virtual Network Profile */
|
||||||
|
export interface VirtualNetworkProfile {
|
||||||
|
/* Subnet ID used for computes in workspace */
|
||||||
|
computeSubnetId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Managed Virtual Network Settings */
|
||||||
|
export interface ManagedVirtualNetworkSettings {
|
||||||
|
/* Prevent Data Exfiltration */
|
||||||
|
preventDataExfiltration?: boolean;
|
||||||
|
/* Linked Access Check On Target Resource */
|
||||||
|
linkedAccessCheckOnTargetResource?: boolean;
|
||||||
|
/* Allowed Aad Tenant Ids For Linking */
|
||||||
|
allowedAadTenantIdsForLinking?: unknown[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Git integration settings */
|
||||||
|
export interface WorkspaceRepositoryConfiguration {
|
||||||
|
/* Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration */
|
||||||
|
type?: string;
|
||||||
|
/* GitHub Enterprise host name. For example: https://github.mydomain.com */
|
||||||
|
hostName?: string;
|
||||||
|
/* Account name */
|
||||||
|
accountName?: string;
|
||||||
|
/* VSTS project name */
|
||||||
|
projectName?: string;
|
||||||
|
/* Repository name */
|
||||||
|
repositoryName?: string;
|
||||||
|
/* Collaboration branch */
|
||||||
|
collaborationBranch?: string;
|
||||||
|
/* Root folder to use in the repository */
|
||||||
|
rootFolder?: string;
|
||||||
|
/* The last commit ID */
|
||||||
|
lastCommitId?: string;
|
||||||
|
/* The VSTS tenant ID */
|
||||||
|
tenantId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Purview Configuration */
|
||||||
|
export interface PurviewConfiguration {
|
||||||
|
/* Purview Resource ID */
|
||||||
|
purviewResourceId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Workspace active directory administrator */
|
||||||
|
export type WorkspaceAadAdminInfo = unknown & {
|
||||||
|
/* Workspace active directory administrator properties */
|
||||||
|
properties?: AadAdminProperties;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* A workspace */
|
||||||
|
export type Workspace = unknown & {
|
||||||
|
/* Workspace resource properties */
|
||||||
|
properties?: WorkspaceProperties;
|
||||||
|
|
||||||
|
/* Identity of the workspace */
|
||||||
|
identity?: ManagedIdentity;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Workspace properties */
|
||||||
|
export interface WorkspaceProperties {
|
||||||
|
/* Workspace default data lake storage account details */
|
||||||
|
defaultDataLakeStorage?: DataLakeStorageAccountDetails;
|
||||||
|
|
||||||
|
/* SQL administrator login password */
|
||||||
|
sqlAdministratorLoginPassword?: string;
|
||||||
|
/* Workspace managed resource group. The resource group name uniquely identifies the resource group within the user subscriptionId. The resource group name must be no longer than 90 characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name cannot end with '.' */
|
||||||
|
managedResourceGroupName?: string;
|
||||||
|
/* Resource provisioning state */
|
||||||
|
readonly provisioningState?: string;
|
||||||
|
/* Login for workspace SQL active directory administrator */
|
||||||
|
sqlAdministratorLogin?: string;
|
||||||
|
/* Virtual Network profile */
|
||||||
|
virtualNetworkProfile?: VirtualNetworkProfile;
|
||||||
|
|
||||||
|
/* Connectivity endpoints */
|
||||||
|
connectivityEndpoints?: unknown;
|
||||||
|
|
||||||
|
/* Setting this to 'default' will ensure that all compute for this workspace is in a virtual network managed on behalf of the user. */
|
||||||
|
managedVirtualNetwork?: string;
|
||||||
|
/* Private endpoint connections to the workspace */
|
||||||
|
privateEndpointConnections?: unknown[];
|
||||||
|
|
||||||
|
/* The encryption details of the workspace */
|
||||||
|
encryption?: EncryptionDetails;
|
||||||
|
|
||||||
|
/* The workspace unique identifier */
|
||||||
|
readonly workspaceUID?: string;
|
||||||
|
/* Workspace level configs and feature flags */
|
||||||
|
readonly extraProperties?: unknown;
|
||||||
|
|
||||||
|
/* Managed Virtual Network Settings */
|
||||||
|
managedVirtualNetworkSettings?: ManagedVirtualNetworkSettings;
|
||||||
|
|
||||||
|
/* Git integration settings */
|
||||||
|
workspaceRepositoryConfiguration?: WorkspaceRepositoryConfiguration;
|
||||||
|
|
||||||
|
/* Purview Configuration */
|
||||||
|
purviewConfiguration?: PurviewConfiguration;
|
||||||
|
|
||||||
|
/* The ADLA resource ID. */
|
||||||
|
readonly adlaResourceId?: string;
|
||||||
|
/* Enable or Disable public network access to workspace */
|
||||||
|
publicNetworkAccess?: "Enabled" | "Disabled";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Workspace patch details */
|
||||||
|
export interface WorkspacePatchInfo {
|
||||||
|
/* Resource tags */
|
||||||
|
tags?: unknown;
|
||||||
|
|
||||||
|
/* The identity of the workspace */
|
||||||
|
identity?: ManagedIdentity;
|
||||||
|
|
||||||
|
/* Workspace patch properties */
|
||||||
|
properties?: WorkspacePatchProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Workspace patch properties */
|
||||||
|
export interface WorkspacePatchProperties {
|
||||||
|
/* SQL administrator login password */
|
||||||
|
sqlAdministratorLoginPassword?: string;
|
||||||
|
/* Managed Virtual Network Settings */
|
||||||
|
managedVirtualNetworkSettings?: ManagedVirtualNetworkSettings;
|
||||||
|
|
||||||
|
/* Git integration settings */
|
||||||
|
workspaceRepositoryConfiguration?: WorkspaceRepositoryConfiguration;
|
||||||
|
|
||||||
|
/* Purview Configuration */
|
||||||
|
purviewConfiguration?: PurviewConfiguration;
|
||||||
|
|
||||||
|
/* Resource provisioning state */
|
||||||
|
readonly provisioningState?: string;
|
||||||
|
/* The encryption details of the workspace */
|
||||||
|
encryption?: EncryptionDetails;
|
||||||
|
|
||||||
|
/* Enable or Disable public network access to workspace */
|
||||||
|
publicNetworkAccess?: "Enabled" | "Disabled";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sql Control Settings for workspace managed identity */
|
||||||
|
export type ManagedIdentitySqlControlSettingsModel = unknown & {
|
||||||
|
/* Sql Control Settings for workspace managed identity */
|
||||||
|
properties?: unknown;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The properties of a restorable dropped Sql pool */
|
||||||
|
export interface RestorableDroppedSqlPoolProperties {
|
||||||
|
/* The name of the database */
|
||||||
|
readonly databaseName?: string;
|
||||||
|
/* The edition of the database */
|
||||||
|
readonly edition?: string;
|
||||||
|
/* The max size in bytes of the database */
|
||||||
|
readonly maxSizeBytes?: string;
|
||||||
|
/* The service level objective name of the database */
|
||||||
|
readonly serviceLevelObjective?: string;
|
||||||
|
/* The elastic pool name of the database */
|
||||||
|
readonly elasticPoolName?: string;
|
||||||
|
/* The creation date of the database (ISO8601 format) */
|
||||||
|
readonly creationDate?: string;
|
||||||
|
/* The deletion date of the database (ISO8601 format) */
|
||||||
|
readonly deletionDate?: string;
|
||||||
|
/* The earliest restore date of the database (ISO8601 format) */
|
||||||
|
readonly earliestRestoreDate?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* A restorable dropped Sql pool */
|
||||||
|
export type RestorableDroppedSqlPool = unknown & {
|
||||||
|
/* The geo-location where the resource lives */
|
||||||
|
readonly location?: string;
|
||||||
|
/* The properties of a restorable dropped Sql pool */
|
||||||
|
properties?: RestorableDroppedSqlPoolProperties;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* The response to a list restorable dropped Sql pools request */
|
||||||
|
export interface RestorableDroppedSqlPoolListResult {
|
||||||
|
/* A list of restorable dropped Sql pools */
|
||||||
|
value: RestorableDroppedSqlPool[];
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/workspace.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-03-01";
|
||||||
|
|
||||||
|
/* Gets a workspace active directory admin */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string
|
||||||
|
): Promise<Types.WorkspaceAadAdminInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/administrators/activeDirectory`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Creates or updates a workspace active directory admin */
|
||||||
|
export async function createOrUpdate(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
body: Types.WorkspaceAadAdminInfo
|
||||||
|
): Promise<Types.WorkspaceAadAdminInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/administrators/activeDirectory`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Deletes a workspace active directory admin */
|
||||||
|
export async function destroy(subscriptionId: string, resourceGroupName: string, workspaceName: string): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/administrators/activeDirectory`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/workspace.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-03-01";
|
||||||
|
|
||||||
|
/* undocumented */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string
|
||||||
|
): Promise<Types.ManagedIdentitySqlControlSettingsModel> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/managedIdentitySqlControlSettings/default`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* undocumented */
|
||||||
|
export async function createOrUpdate(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
body: Types.ManagedIdentitySqlControlSettingsModel
|
||||||
|
): Promise<Types.ManagedIdentitySqlControlSettingsModel | void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/managedIdentitySqlControlSettings/default`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/workspace.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-03-01";
|
||||||
|
|
||||||
|
/* Gets a workspace SQL active directory admin */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string
|
||||||
|
): Promise<Types.WorkspaceAadAdminInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/sqlAdministrators/activeDirectory`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Creates or updates a workspace SQL active directory admin */
|
||||||
|
export async function createOrUpdate(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
body: Types.WorkspaceAadAdminInfo
|
||||||
|
): Promise<Types.WorkspaceAadAdminInfo> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/sqlAdministrators/activeDirectory`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Deletes a workspace SQL active directory admin */
|
||||||
|
export async function destroy(subscriptionId: string, resourceGroupName: string, workspaceName: string): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}/sqlAdministrators/activeDirectory`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
AUTOGENERATED FILE
|
||||||
|
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/master/specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-03-01/workspace.json
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { configContext } from "../../../../ConfigContext";
|
||||||
|
import { armRequest } from "../../request";
|
||||||
|
import * as Types from "./types";
|
||||||
|
const apiVersion = "2021-03-01";
|
||||||
|
|
||||||
|
/* Returns a list of workspaces in a resource group */
|
||||||
|
export async function listByResourceGroup(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string
|
||||||
|
): Promise<Types.WorkspaceInfoListResult> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Gets a workspace */
|
||||||
|
export async function get(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string
|
||||||
|
): Promise<Types.Workspace> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Updates a workspace */
|
||||||
|
export async function update(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
body: Types.WorkspacePatchInfo
|
||||||
|
): Promise<Types.Workspace> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PATCH", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Creates or updates a workspace */
|
||||||
|
export async function createOrUpdate(
|
||||||
|
subscriptionId: string,
|
||||||
|
resourceGroupName: string,
|
||||||
|
workspaceName: string,
|
||||||
|
body: Types.Workspace
|
||||||
|
): Promise<Types.Workspace> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "PUT", apiVersion, body });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Deletes a workspace */
|
||||||
|
export async function destroy(subscriptionId: string, resourceGroupName: string, workspaceName: string): Promise<void> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroupName}/providers/Microsoft.Synapse/workspaces/${workspaceName}`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "DELETE", apiVersion });
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Returns a list of workspaces in a subscription */
|
||||||
|
export async function list(subscriptionId: string): Promise<Types.WorkspaceInfoListResult> {
|
||||||
|
const path = `/subscriptions/${subscriptionId}/providers/Microsoft.Synapse/workspaces`;
|
||||||
|
return armRequest({ host: configContext.ARM_ENDPOINT, path, method: "GET", apiVersion });
|
||||||
|
}
|
|
@ -27,7 +27,7 @@ import {
|
||||||
import { CollectionCreation } from "../Shared/Constants";
|
import { CollectionCreation } from "../Shared/Constants";
|
||||||
import { DefaultExperienceUtility } from "../Shared/DefaultExperienceUtility";
|
import { DefaultExperienceUtility } from "../Shared/DefaultExperienceUtility";
|
||||||
import { PortalEnv, updateUserContext, userContext } from "../UserContext";
|
import { PortalEnv, updateUserContext, userContext } from "../UserContext";
|
||||||
import { listKeys } from "../Utils/arm/generatedClients/2020-04-01/databaseAccounts";
|
import { listKeys } from "../Utils/arm/generatedClients/cosmos/databaseAccounts";
|
||||||
import { isInvalidParentFrameOrigin } from "../Utils/MessageValidation";
|
import { isInvalidParentFrameOrigin } from "../Utils/MessageValidation";
|
||||||
|
|
||||||
// This hook will create a new instance of Explorer.ts and bind it to the DOM
|
// This hook will create a new instance of Explorer.ts and bind it to the DOM
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { ClientSecretCredential } from "@azure/identity";
|
||||||
import "../../less/hostedexplorer.less";
|
import "../../less/hostedexplorer.less";
|
||||||
import { DataExplorerInputsFrame } from "../../src/Contracts/ViewModels";
|
import { DataExplorerInputsFrame } from "../../src/Contracts/ViewModels";
|
||||||
import { updateUserContext } from "../../src/UserContext";
|
import { updateUserContext } from "../../src/UserContext";
|
||||||
import { get, listKeys } from "../../src/Utils/arm/generatedClients/2020-04-01/databaseAccounts";
|
import { get, listKeys } from "../../src/Utils/arm/generatedClients/cosmos/databaseAccounts";
|
||||||
|
|
||||||
const resourceGroup = process.env.RESOURCE_GROUP || "";
|
const resourceGroup = process.env.RESOURCE_GROUP || "";
|
||||||
const subscriptionId = process.env.SUBSCRIPTION_ID || "";
|
const subscriptionId = process.env.SUBSCRIPTION_ID || "";
|
||||||
|
|
|
@ -15,12 +15,14 @@ But it does work well enough to generate a fully typed tree-shakeable client for
|
||||||
Results of this file should be checked into the repo.
|
Results of this file should be checked into the repo.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// CHANGE THESE VALUES TO GENERATE NEW CLIENTS
|
||||||
|
const version = "2021-04-15";
|
||||||
|
const resourceName = "cosmosNotebooks";
|
||||||
|
const schemaURL = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/${version}/notebook.json`;
|
||||||
|
const outputDir = path.join(__dirname, `../../src/Utils/arm/generatedClients/${resourceName}/${version}`);
|
||||||
|
|
||||||
// Array of strings to use for eventual output
|
// Array of strings to use for eventual output
|
||||||
const outputTypes: string[] = [""];
|
const outputTypes: string[] = [""];
|
||||||
const version = "2020-04-01";
|
|
||||||
const schemaURL = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/${version}/cosmos-db.json`;
|
|
||||||
|
|
||||||
const outputDir = path.join(__dirname, `../../src/Utils/arm/generatedClients/${version}`);
|
|
||||||
mkdirp.sync(outputDir);
|
mkdirp.sync(outputDir);
|
||||||
|
|
||||||
// Buckets for grouping operations based on their name
|
// Buckets for grouping operations based on their name
|
||||||
|
@ -33,7 +35,7 @@ const clients: { [key: string]: Client } = {};
|
||||||
|
|
||||||
// Mapping for OpenAPI types to TypeScript types
|
// Mapping for OpenAPI types to TypeScript types
|
||||||
const propertyMap: { [key: string]: string } = {
|
const propertyMap: { [key: string]: string } = {
|
||||||
integer: "number"
|
integer: "number",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Converts a Open API reference: "#/definitions/Foo" to a type name: Foo
|
// Converts a Open API reference: "#/definitions/Foo" to a type name: Foo
|
||||||
|
@ -84,6 +86,7 @@ function responseType(operation: Operation, namespace: string) {
|
||||||
return refToType(operation.responses[responseCode].schema.$ref, namespace);
|
return refToType(operation.responses[responseCode].schema.$ref, namespace);
|
||||||
})
|
})
|
||||||
.filter((value, index, array) => array.indexOf(value) === index)
|
.filter((value, index, array) => array.indexOf(value) === index)
|
||||||
|
.filter((value) => value !== "unknown")
|
||||||
.join(" | ");
|
.join(" | ");
|
||||||
}
|
}
|
||||||
return "unknown";
|
return "unknown";
|
||||||
|
@ -98,6 +101,7 @@ interface Property {
|
||||||
items?: {
|
items?: {
|
||||||
$ref: string;
|
$ref: string;
|
||||||
};
|
};
|
||||||
|
enum?: string[];
|
||||||
allOf?: {
|
allOf?: {
|
||||||
$ref: string;
|
$ref: string;
|
||||||
}[];
|
}[];
|
||||||
|
@ -129,6 +133,13 @@ const propertyToType = (property: Property, prop: string, required: boolean) =>
|
||||||
/* ${property.description || "undocumented"} */
|
/* ${property.description || "undocumented"} */
|
||||||
${property.readOnly ? "readonly " : ""}${prop}${required ? "" : "?"}: ${type}
|
${property.readOnly ? "readonly " : ""}${prop}${required ? "" : "?"}: ${type}
|
||||||
`);
|
`);
|
||||||
|
} else if (property.enum) {
|
||||||
|
outputTypes.push(`
|
||||||
|
/* ${property.description || "undocumented"} */
|
||||||
|
${property.readOnly ? "readonly " : ""}${prop}${required ? "" : "?"}: ${property.enum
|
||||||
|
.map((v: string) => `"${v}"`)
|
||||||
|
.join(" | ")}
|
||||||
|
`);
|
||||||
} else {
|
} else {
|
||||||
if (property.type === undefined) {
|
if (property.type === undefined) {
|
||||||
console.log(`UHANDLED TYPE: ${prop}. Falling back to unknown`);
|
console.log(`UHANDLED TYPE: ${prop}. Falling back to unknown`);
|
||||||
|
@ -162,9 +173,6 @@ async function main() {
|
||||||
} else {
|
} else {
|
||||||
outputTypes.push(`export interface ${definition} {`);
|
outputTypes.push(`export interface ${definition} {`);
|
||||||
}
|
}
|
||||||
if (definition === "SqlDatabaseGetProperties") {
|
|
||||||
console.log(schema.definitions[definition]);
|
|
||||||
}
|
|
||||||
for (const prop in schema.definitions[definition].properties) {
|
for (const prop in schema.definitions[definition].properties) {
|
||||||
const property = schema.definitions[definition].properties[prop];
|
const property = schema.definitions[definition].properties[prop];
|
||||||
propertyToType(property, prop, schema.definitions[definition].required?.includes(prop));
|
propertyToType(property, prop, schema.definitions[definition].required?.includes(prop));
|
||||||
|
@ -225,9 +233,9 @@ async function main() {
|
||||||
// Write all grouped fetch functions to objects
|
// Write all grouped fetch functions to objects
|
||||||
for (const clientName in clients) {
|
for (const clientName in clients) {
|
||||||
const outputClient: string[] = [""];
|
const outputClient: string[] = [""];
|
||||||
outputClient.push(`import { armRequest } from "../../request"\n`);
|
outputClient.push(`import { armRequest } from "../../../request"\n`);
|
||||||
outputClient.push(`import * as Types from "./types"\n`);
|
outputClient.push(`import * as Types from "./types"\n`);
|
||||||
outputClient.push(`import { configContext } from "../../../../ConfigContext";\n`);
|
outputClient.push(`import { configContext } from "../../../../../ConfigContext";\n`);
|
||||||
outputClient.push(`const apiVersion = "${version}"\n\n`);
|
outputClient.push(`const apiVersion = "${version}"\n\n`);
|
||||||
for (const path of clients[clientName].paths) {
|
for (const path of clients[clientName].paths) {
|
||||||
for (const method in schema.paths[path]) {
|
for (const method in schema.paths[path]) {
|
||||||
|
@ -240,7 +248,7 @@ async function main() {
|
||||||
/* ${operation.description || "undocumented"} */
|
/* ${operation.description || "undocumented"} */
|
||||||
export async function ${sanitize(camelize(methodName))} (
|
export async function ${sanitize(camelize(methodName))} (
|
||||||
${parametersFromPath(path)
|
${parametersFromPath(path)
|
||||||
.map(p => `${p}: string`)
|
.map((p) => `${p}: string`)
|
||||||
.join(",\n")}
|
.join(",\n")}
|
||||||
${bodyParam(bodyParameter, "Types")}
|
${bodyParam(bodyParameter, "Types")}
|
||||||
) : Promise<${responseType(operation, "Types")}> {
|
) : Promise<${responseType(operation, "Types")}> {
|
||||||
|
@ -268,13 +276,15 @@ function sanitize(name: string) {
|
||||||
function writeOutputFile(outputPath: string, components: string[]) {
|
function writeOutputFile(outputPath: string, components: string[]) {
|
||||||
components.unshift(`/*
|
components.unshift(`/*
|
||||||
AUTOGENERATED FILE
|
AUTOGENERATED FILE
|
||||||
Do not manually edit
|
|
||||||
Run "npm run generateARMClients" to regenerate
|
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: ${schemaURL}
|
||||||
*/\n\n`);
|
*/\n\n`);
|
||||||
writeFileSync(path.join(outputDir, outputPath), components.join(""));
|
writeFileSync(path.join(outputDir, outputPath), components.join(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch(e => {
|
main().catch((e) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue