azure-sdk-for-js/sdk/synapse/arm-synapse/samples-dev/sqlPoolsListByWorkspaceSamp...

61 строка
2.0 KiB
TypeScript

/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { SynapseManagementClient } from "@azure/arm-synapse";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to List all SQL pools
*
* @summary List all SQL pools
* x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspace.json
*/
async function listSqlAnalyticsPoolsInAWorkspace() {
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const resourceGroupName = "sqlcrudtest-6845";
const workspaceName = "sqlcrudtest-7177";
const credential = new DefaultAzureCredential();
const client = new SynapseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.sqlPools.listByWorkspace(
resourceGroupName,
workspaceName
)) {
resArray.push(item);
}
console.log(resArray);
}
listSqlAnalyticsPoolsInAWorkspace().catch(console.error);
/**
* This sample demonstrates how to List all SQL pools
*
* @summary List all SQL pools
* x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ListSqlPoolsInWorkspaceWithFilter.json
*/
async function listSqlAnalyticsPoolsInAWorkspaceWithFilter() {
const subscriptionId = "00000000-1111-2222-3333-444444444444";
const resourceGroupName = "sqlcrudtest-6845";
const workspaceName = "sqlcrudtest-7177";
const credential = new DefaultAzureCredential();
const client = new SynapseManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.sqlPools.listByWorkspace(
resourceGroupName,
workspaceName
)) {
resArray.push(item);
}
console.log(resArray);
}
listSqlAnalyticsPoolsInAWorkspaceWithFilter().catch(console.error);