50 строки
1.5 KiB
TypeScript
50 строки
1.5 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 {
|
|
ReplaceAllIpFirewallRulesRequest,
|
|
SynapseManagementClient
|
|
} from "@azure/arm-synapse";
|
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
|
|
/**
|
|
* This sample demonstrates how to Replaces firewall rules
|
|
*
|
|
* @summary Replaces firewall rules
|
|
* x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/ReplaceAllIpFirewallRules.json
|
|
*/
|
|
async function replaceAllIPFirewallRulesInAWorkspace() {
|
|
const subscriptionId = "01234567-89ab-4def-0123-456789abcdef";
|
|
const resourceGroupName = "ExampleResourceGroup";
|
|
const workspaceName = "ExampleWorkspace";
|
|
const request: ReplaceAllIpFirewallRulesRequest = {
|
|
ipFirewallRules: {
|
|
anotherExampleFirewallRule: {
|
|
endIpAddress: "10.0.1.254",
|
|
startIpAddress: "10.0.1.0"
|
|
},
|
|
exampleFirewallRule: {
|
|
endIpAddress: "10.0.0.254",
|
|
startIpAddress: "10.0.0.0"
|
|
}
|
|
}
|
|
};
|
|
const credential = new DefaultAzureCredential();
|
|
const client = new SynapseManagementClient(credential, subscriptionId);
|
|
const result = await client.ipFirewallRules.beginReplaceAllAndWait(
|
|
resourceGroupName,
|
|
workspaceName,
|
|
request
|
|
);
|
|
console.log(result);
|
|
}
|
|
|
|
replaceAllIPFirewallRulesInAWorkspace().catch(console.error);
|