mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-30 22:31:56 +00:00
Rebase master
This commit is contained in:
@@ -16,13 +16,13 @@ Results of this file should be checked into the repo.
|
||||
*/
|
||||
|
||||
// CHANGE THESE VALUES TO GENERATE NEW CLIENTS
|
||||
const version = "2024-02-15-preview";
|
||||
/* The following are legal options for resourceName but you generally will only use cosmos-db:
|
||||
"cosmos-db" | "managedCassandra" | "mongorbac" | "notebook" | "privateEndpointConnection" | "privateLinkResources" |
|
||||
const version = "2025-05-01-preview";
|
||||
/* The following are legal options for resourceName but you generally will only use cosmos:
|
||||
"cosmos" | "managedCassandra" | "mongorbac" | "notebook" | "privateEndpointConnection" | "privateLinkResources" |
|
||||
"rbac" | "restorable" | "services" | "dataTransferService"
|
||||
*/
|
||||
const githubResourceName = "cosmos-db";
|
||||
const deResourceName = "cosmos-db";
|
||||
const deResourceName = "cosmos";
|
||||
const schemaURL = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/${version}/${githubResourceName}.json`;
|
||||
const outputDir = path.join(__dirname, `../../src/Utils/arm/generatedClients/${deResourceName}`);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
|
||||
const { AzureCliCredential } = require("@azure/identity");
|
||||
const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb");
|
||||
const ms = require("ms");
|
||||
|
||||
@@ -16,10 +16,14 @@ function friendlyTime(date) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const credentials = await msRestNodeAuth.AzureCliCredentials.create();
|
||||
const credentials = new AzureCliCredential();
|
||||
const client = new CosmosDBManagementClient(credentials, subscriptionId);
|
||||
const accounts = await client.databaseAccounts.list(resourceGroupName);
|
||||
for (const account of accounts) {
|
||||
if (account.name.endsWith("-readonly")) {
|
||||
console.log(`SKIPPED: ${account.name}`);
|
||||
continue;
|
||||
}
|
||||
if (account.kind === "MongoDB") {
|
||||
const mongoDatabases = await client.mongoDBResources.listMongoDBDatabases(resourceGroupName, account.name);
|
||||
for (const database of mongoDatabases) {
|
||||
|
||||
Reference in New Issue
Block a user