Files

28 lines
1.1 KiB
TypeScript

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* This sample demonstrates how to List all the performance tiers for a PostgreSQL server.
*
* @summary List all the performance tiers for a PostgreSQL server.
* x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json
*/
import { PostgreSQLManagementClient } from "@azure/arm-postgresql";
import { DefaultAzureCredential } from "@azure/identity";
async function performanceTiersList(): Promise<void> {
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
const resourceGroupName = "TestGroup";
const serverName = "testserver";
const credential = new DefaultAzureCredential();
const client = new PostgreSQLManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.serverBasedPerformanceTier.list(resourceGroupName, serverName)) {
resArray.push(item);
}
console.log(resArray);
}
performanceTiersList().catch(console.error);