mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
Configurations: 'specification/postgresql/DBforPostgreSQL.Management/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: 'd5ee6b87272dea7413a15e1403db07fe0450316a' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6405188 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. **Release plan link:** [https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=2264](https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=2264) **Submitted by**: [email protected] --------- Co-authored-by: kazrael2119 <[email protected]>
105 lines
3.7 KiB
TypeScript
105 lines
3.7 KiB
TypeScript
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
import { PostgreSQLManagementFlexibleServerClient } from "@azure/arm-postgresql-flexible";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to lists available object recommendations.
|
|
*
|
|
* @summary lists available object recommendations.
|
|
* x-ms-original-file: 2026-04-01-preview/TuningOptionsListIndexRecommendations.json
|
|
*/
|
|
async function listAvailableIndexRecommendations(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
|
|
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
|
|
const resArray = new Array();
|
|
for await (const item of client.tuningOptionsOperations.listRecommendations(
|
|
"exampleresourcegroup",
|
|
"exampleserver",
|
|
"index",
|
|
)) {
|
|
resArray.push(item);
|
|
}
|
|
|
|
console.log(resArray);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to lists available object recommendations.
|
|
*
|
|
* @summary lists available object recommendations.
|
|
* x-ms-original-file: 2026-04-01-preview/TuningOptionsListIndexRecommendationsFilteredForCreateIndex.json
|
|
*/
|
|
async function listAvailableIndexRecommendationsFilteredToExclusivelyGetThoseOfCreateIndexType(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
|
|
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
|
|
const resArray = new Array();
|
|
for await (const item of client.tuningOptionsOperations.listRecommendations(
|
|
"exampleresourcegroup",
|
|
"exampleserver",
|
|
"index",
|
|
{ recommendationType: "CreateIndex" },
|
|
)) {
|
|
resArray.push(item);
|
|
}
|
|
|
|
console.log(resArray);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to lists available object recommendations.
|
|
*
|
|
* @summary lists available object recommendations.
|
|
* x-ms-original-file: 2026-04-01-preview/TuningOptionsListTableRecommendations.json
|
|
*/
|
|
async function listAvailableTableRecommendations(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
|
|
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
|
|
const resArray = new Array();
|
|
for await (const item of client.tuningOptionsOperations.listRecommendations(
|
|
"exampleresourcegroup",
|
|
"exampleserver",
|
|
"table",
|
|
)) {
|
|
resArray.push(item);
|
|
}
|
|
|
|
console.log(resArray);
|
|
}
|
|
|
|
/**
|
|
* This sample demonstrates how to lists available object recommendations.
|
|
*
|
|
* @summary lists available object recommendations.
|
|
* x-ms-original-file: 2026-04-01-preview/TuningOptionsListTableRecommendationsFilteredForAnalyzeTable.json
|
|
*/
|
|
async function listAvailableTableRecommendationsFilteredToExclusivelyGetThoseOfAnalyzeTableType(): Promise<void> {
|
|
const credential = new DefaultAzureCredential();
|
|
const subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
|
|
const client = new PostgreSQLManagementFlexibleServerClient(credential, subscriptionId);
|
|
const resArray = new Array();
|
|
for await (const item of client.tuningOptionsOperations.listRecommendations(
|
|
"exampleresourcegroup",
|
|
"exampleserver",
|
|
"table",
|
|
{ recommendationType: "AnalyzeTable" },
|
|
)) {
|
|
resArray.push(item);
|
|
}
|
|
|
|
console.log(resArray);
|
|
}
|
|
|
|
async function main(): Promise<void> {
|
|
await listAvailableIndexRecommendations();
|
|
await listAvailableIndexRecommendationsFilteredToExclusivelyGetThoseOfCreateIndexType();
|
|
await listAvailableTableRecommendations();
|
|
await listAvailableTableRecommendationsFilteredToExclusivelyGetThoseOfAnalyzeTableType();
|
|
}
|
|
|
|
main().catch(console.error);
|