UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

446 lines (195 loc) 31.6 kB
/*** Generated by streamline 0.10.17 (callbacks) - DO NOT EDIT ***/ "use strict"; var __rt=require('streamline/lib/callbacks/runtime').runtime(__filename, false),__func=__rt.__func,__cb=__rt.__cb,__catch=__rt.__catch,__tryCatch=__rt.__tryCatch; var generatorUtils = require("../../../util/generatorUtils"); var tagUtils = require("../tag/tagUtils"); var util = require("util"); var validation = require("../../../util/validation"); var profile = require("../../../util/profile"); var utils = require("../../../util/utils"); var $ = utils.getLocaleString; exports.init = function(cli) { var network = cli.category("network").description($("Commands to manage network resources")); var networkInterfaces = network.category("nic").description($("Commands to manage network interfaces")); networkInterfaces.command("create [resource-group] [name] [location]").description($("Create a network interface")).usage("[options] <resource-group> <name> <location>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the network interface")).option("-l, --location <location>", $("the location")).option("-w, --network-security-group-id [network-security-group-id]", $(("sets network security group id. This" + "\n option is mutually exclusive with --network-security-group-name"))).option("-o, --network-security-group-name [network-security-group-name]", $(("sets network security group name. This" + "\n option is mutually exclusive with --network-security-group-id"))).option("-d, --lb-address-pool-ids [lb-address-pool-ids]", $(("the reference of" + "\n LoadBalancerBackendAddressPool resource"))).option("-e, --lb-inbound-nat-rule-ids [lb-inbound-nat-rule-ids]", $(("a list of references of" + "\n LoadBalancerInboundNatRules"))).option("-a, --private-ip-address [private-ip-address]", $(("private IP address of the IP" + "\n configuration"))).option("-b, --private-ip-version [private-ip-version]", $((("available from Api-Version 2016-03-30" + "\n onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6.") + "\n Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'"))).option("-k, --subnet-name [subnet-name]", $(("sets subnet name. This option is" + "\n mutually exclusive with --subnet-id"))).option("-m, --subnet-vnet-name [subnet-vnet-name]", $("name of the virtual network that contains subnet")).option("-u, --subnet-id [subnet-id]", $(("sets subnet id. This option is mutually" + "\n exclusive with --subnet-name"))).option("-i, --public-ip-id [public-ip-id]", $(("sets public ip address id. This option" + "\n is mutually exclusive with --public-ip-name"))).option("-p, --public-ip-name [public-ip-name]", $(("sets public ip address name. This" + "\n option is mutually exclusive with --public-ip-id"))).option("--application-security-groups [application-security-groups]", $(("application security groups in which" + "\n the IP configuration is included"))).option("-c, --ip-config-name [ip-config-name]", $("sets ip configurations name")).option("-r, --internal-dns-name-label [internal-dns-name-label]", $(("relative DNS name for this NIC used for" + "\n internal communications between VMs in the same virtual network"))).option("-j, --enable-accelerated-networking [enable-accelerated-networking]", $(("if the network interface is accelerated" + "\n networking enabled"))).option("-f, --enable-ip-forwarding [enable-ip-forwarding]", $(("indicates whether IP forwarding is" + "\n enabled on this network interface"))).option("-t, --tags [tags]", $("the list of tags.\n Can be multiple. In the format of \"name=value\".\n Name is required and value is optional.\n For example, -t \"tag1=value1;tag2\"")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __1(resourceGroup, name, location, options, _) { var index, subscription, networkManagementClient, networkInterface, progress, parameters, idContainerNetworkSecurityGroup, idContainerSubnet, idContainerPublicIPAddress; var __frame = { name: "__1", line: 78 }; return __func(_, this, arguments, __1, 4, __frame, function __$__1() { index = 0; return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __1) { resourceGroup = __1; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 3, 29, function ___(__0, __2) { name = __2; return cli.interaction.promptIfNotGiven($("location : "), location, __cb(_, __frame, 4, 41, function ___(__0, __3) { options.location = __3; subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); progress = cli.interaction.progress(util.format($("Looking up the network interface \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return networkManagementClient.networkInterfaces.get(resourceGroup, name, null, __cb(_, __frame, 12, 69, function ___(__0, __4) { networkInterface = __4; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__1() { if (e) { if ((e.statusCode === 404)) { networkInterface = null; } else { return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__1() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__1() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__1() { if (networkInterface) { return _(new Error(util.format($("network interface with name \"%s\" already exists in the resource group \"%s\""), name, resourceGroup))); } ; parameters = { }; if (options.location) { parameters.location = options.location; } ; if (!parameters.networkSecurityGroup) { parameters.networkSecurityGroup = { }; } ; return (function __$__1(__then) { if (options.networkSecurityGroupId) { if (options.networkSecurityGroupName) { cli.output.warn($("--network-security-group-name parameter will be ignored because --network-security-group-id and --network-security-group-name are mutually exclusive")); } ; parameters.networkSecurityGroup.id = options.networkSecurityGroupId; __then(); } else { return (function __$__1(__then) { if (options.networkSecurityGroupName) { return networkManagementClient.networkSecurityGroups.get(resourceGroup, options.networkSecurityGroupName, __cb(_, __frame, 41, 92, function ___(__0, __5) { idContainerNetworkSecurityGroup = __5; parameters.networkSecurityGroup.id = idContainerNetworkSecurityGroup.id; __then(); }, true)); } else { __then(); } ; })(__then); } ; })(function __$__1() { if (!parameters.ipConfigurations) { parameters.ipConfigurations = []; } ; if (!parameters.ipConfigurations[index]) { parameters.ipConfigurations[index] = { }; parameters.ipConfigurations[index].name = "default-ip-config"; } ; if (options.lbAddressPoolIds) { parameters.ipConfigurations[index].loadBalancerBackendAddressPools = options.lbAddressPoolIds.split(",").map(function(item) { return { id: item }; }); } ; if (options.lbInboundNatRuleIds) { parameters.ipConfigurations[index].loadBalancerInboundNatRules = options.lbInboundNatRuleIds.split(",").map(function(item) { return { id: item }; }); } ; if (options.privateIpAddress) { parameters.ipConfigurations[index].privateIPAddress = options.privateIpAddress; if ((!options.privateIpVersion || ((options.privateIpVersion && (options.privateIpVersion.toLowerCase() != "ipv6"))))) { parameters.ipConfigurations[index].privateIPAllocationMethod = "Static"; } ; } ; if (options.privateIpVersion) { parameters.ipConfigurations[index].privateIPAddressVersion = validation.isIn(options.privateIpVersion, ["IPv4","IPv6",], "--private-ip-version"); } ; if (!parameters.ipConfigurations[index].subnet) { parameters.ipConfigurations[index].subnet = { }; } ; return (function __$__1(__then) { if (options.subnetId) { if (options.subnetName) { cli.output.warn($("--subnet-name parameter will be ignored because --subnet-id and --subnet-name are mutually exclusive")); } ; parameters.ipConfigurations[index].subnet.id = options.subnetId; __then(); } else { return (function __$__1(__then) { if (options.subnetName) { return networkManagementClient.subnets.get(resourceGroup, options.subnetVnetName, options.subnetName, __cb(_, __frame, 80, 64, function ___(__0, __6) { idContainerSubnet = __6; parameters.ipConfigurations[index].subnet.id = idContainerSubnet.id; __then(); }, true)); } else { __then(); } ; })(__then); } ; })(function __$__1() { if (!parameters.ipConfigurations[index].publicIPAddress) { parameters.ipConfigurations[index].publicIPAddress = { }; } ; return (function __$__1(__then) { if (options.publicIpId) { if (options.publicIpName) { cli.output.warn($("--public-ip-name parameter will be ignored because --public-ip-id and --public-ip-name are mutually exclusive")); } ; parameters.ipConfigurations[index].publicIPAddress.id = options.publicIpId; __then(); } else { return (function __$__1(__then) { if (options.publicIpName) { return networkManagementClient.publicIPAddresses.get(resourceGroup, options.publicIpName, __cb(_, __frame, 93, 83, function ___(__0, __7) { idContainerPublicIPAddress = __7; parameters.ipConfigurations[index].publicIPAddress.id = idContainerPublicIPAddress.id; __then(); }, true)); } else { __then(); } ; })(__then); } ; })(function __$__1() { if (options.applicationSecurityGroups) { parameters.ipConfigurations[index].applicationSecurityGroups = options.applicationSecurityGroups.split(",").map(function(item) { return { id: item }; }); } ; if (options.ipConfigName) { parameters.ipConfigurations[index].name = options.ipConfigName; } ; if (!parameters.dnsSettings) { parameters.dnsSettings = { }; } ; if (options.internalDnsNameLabel) { parameters.dnsSettings.internalDnsNameLabel = options.internalDnsNameLabel; } ; if (options.enableAcceleratedNetworking) { parameters.enableAcceleratedNetworking = utils.parseBool(options.enableAcceleratedNetworking); } ; if (options.enableIpForwarding) { parameters.enableIPForwarding = utils.parseBool(options.enableIpForwarding); } ; if ((options.tags && utils.argHasValue(options.tags))) { tagUtils.appendTags(parameters, options); } ; generatorUtils.removeEmptyObjects(parameters); progress = cli.interaction.progress(util.format($("Creating network interface \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return networkManagementClient.networkInterfaces.createOrUpdate(resourceGroup, name, parameters, __cb(_, __frame, 127, 69, function ___(__0, __8) { networkInterface = __8; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__1() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__1() { cli.interaction.formatOutput(networkInterface, generatorUtils.traverse); _(); }); }); }); }); }); }); }); }, true)); }, true)); }, true)); }); }); networkInterfaces.command("set [resource-group] [name]").description($("Update a network interface")).usage("[options] <resource-group> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the network interface")).option("-w, --network-security-group-id [network-security-group-id]", $(("sets network security group id. This" + "\n option is mutually exclusive with --network-security-group-name"))).option("-o, --network-security-group-name [network-security-group-name]", $(("sets network security group name. This" + "\n option is mutually exclusive with --network-security-group-id"))).option("--application-security-groups [application-security-groups]", $(("application security groups in which" + "\n the IP configuration is included"))).option("-r, --internal-dns-name-label [internal-dns-name-label]", $(("relative DNS name for this NIC used for" + "\n internal communications between VMs in the same virtual network"))).option("-j, --enable-accelerated-networking [enable-accelerated-networking]", $(("if the network interface is accelerated" + "\n networking enabled"))).option("-f, --enable-ip-forwarding [enable-ip-forwarding]", $(("indicates whether IP forwarding is" + "\n enabled on this network interface"))).option("-t, --tags [tags]", $("the list of tags.\n Can be multiple. In the format of \"name=value\".\n Name is required and value is optional.\n For example, -t \"tag1=value1;tag2\"")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __2(resourceGroup, name, options, _) { var index, subscription, networkManagementClient, networkInterface, progress, parameters, idContainerNetworkSecurityGroup; var __frame = { name: "__2", line: 232 }; return __func(_, this, arguments, __2, 3, __frame, function __$__2() { index = 0; return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __1) { resourceGroup = __1; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 3, 29, function ___(__0, __2) { name = __2; subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); progress = cli.interaction.progress(util.format($("Looking up the network interface \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return networkManagementClient.networkInterfaces.get(resourceGroup, name, null, __cb(_, __frame, 11, 69, function ___(__0, __3) { networkInterface = __3; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__2() { if (e) { if ((e.statusCode === 404)) { networkInterface = null; } else { return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__2() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__2() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__2() { if (!networkInterface) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), name, resourceGroup))); } ; parameters = networkInterface; if (!parameters.networkSecurityGroup) { parameters.networkSecurityGroup = { }; } ; return (function __$__2(__then) { if (options.networkSecurityGroupId) { if (options.networkSecurityGroupName) { cli.output.warn($("--network-security-group-name parameter will be ignored because --network-security-group-id and --network-security-group-name are mutually exclusive")); } ; if (!utils.argHasValue(options.networkSecurityGroupId)) { delete parameters.networkSecurityGroup; } else { parameters.networkSecurityGroup.id = options.networkSecurityGroupId; } ; __then(); } else { return (function __$__2(__then) { if (options.networkSecurityGroupName) { return (function __$__2(__then) { if (!utils.argHasValue(options.networkSecurityGroupName)) { delete parameters.networkSecurityGroup; __then(); } else { return networkManagementClient.networkSecurityGroups.get(resourceGroup, options.networkSecurityGroupName, __cb(_, __frame, 43, 94, function ___(__0, __4) { idContainerNetworkSecurityGroup = __4; parameters.networkSecurityGroup.id = idContainerNetworkSecurityGroup.id; __then(); }, true)); } ; })(__then); } else { __then(); } ; })(__then); } ; })(function __$__2() { if (options.applicationSecurityGroups) { parameters.ipConfigurations[index].applicationSecurityGroups = options.applicationSecurityGroups.split(",").map(function(item) { return { id: item }; }); } ; if (!parameters.dnsSettings) { parameters.dnsSettings = { }; } ; if (options.internalDnsNameLabel) { parameters.dnsSettings.internalDnsNameLabel = options.internalDnsNameLabel; } ; if (options.enableAcceleratedNetworking) { parameters.enableAcceleratedNetworking = utils.parseBool(options.enableAcceleratedNetworking); } ; if (options.enableIpForwarding) { parameters.enableIPForwarding = utils.parseBool(options.enableIpForwarding); } ; if ((options.tags && utils.argHasValue(options.tags))) { tagUtils.appendTags(parameters, options); } ; generatorUtils.removeEmptyObjects(parameters); progress = cli.interaction.progress(util.format($("Updating network interface \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return networkManagementClient.networkInterfaces.createOrUpdate(resourceGroup, name, parameters, __cb(_, __frame, 74, 69, function ___(__0, __5) { networkInterface = __5; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__2() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__2() { cli.interaction.formatOutput(networkInterface, generatorUtils.traverse); _(); }); }); }); }); }); }, true)); }, true)); }); }); networkInterfaces.command("delete [resource-group] [name]").description($("Delete a network interface")).usage("[options] <resource-group> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the network interface")).option("-q, --quiet", $("quiet mode, do not ask for delete confirmation")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __3(resourceGroup, name, options, _) { var subscription, networkManagementClient, networkInterface, progress; var __frame = { name: "__3", line: 321 }; return __func(_, this, arguments, __3, 3, __frame, function __$__3() { return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 1, 38, function ___(__0, __2) { resourceGroup = __2; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 2, 29, function ___(__0, __3) { name = __3; subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); progress = cli.interaction.progress(util.format($("Looking up the network interface \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return networkManagementClient.networkInterfaces.get(resourceGroup, name, null, __cb(_, __frame, 10, 69, function ___(__0, __4) { networkInterface = __4; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__3() { if (e) { if ((e.statusCode === 404)) { networkInterface = null; } else { return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__3() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__3() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__3() { if (!networkInterface) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), name, resourceGroup))); } ; return (function __$__3(_) { var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return cli.interaction.confirm(util.format($("Delete network interface \"%s\"? [y/n] "), name), __cb(_, __frame, 25, 45, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -320, 17, function ___(__0, __5) { return (function __$__3(__then) { if (__5) { cli.output.info(util.format($("network interface \"%s\" was not deleted and still exists in the resource group \"%s\""), name, resourceGroup)); return _(null); } else { __then(); } ; })(function __$__3() { progress = cli.interaction.progress(util.format($("Deleting network interface \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return networkManagementClient.networkInterfaces.deleteMethod(resourceGroup, name, __cb(_, __frame, 32, 69, function ___(__0, __6) { networkInterface = __6; cli.output.info(util.format($("network interface \"%s\" was successfully deleted from resource group \"%s\""), name, resourceGroup)); _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__3() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__3() { _(); }); }); }); }, true)); }); }); }, true)); }, true)); }); }); var effectiveRouteTable = networkInterfaces.category("effective-route-table").description($("Commands to manage effective route table")); effectiveRouteTable.command("show [resource-group] [nic-name]").description($("Perform show operation on a network interface")).usage("[options] <resource-group> <nic-name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-c, --nic-name <nic-name>", $("the nic name")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __4(resourceGroup, nicName, options, _) { var subscription, networkManagementClient, networkInterface, progress; var __frame = { name: "__4", line: 369 }; return __func(_, this, arguments, __4, 3, __frame, function __$__4() { return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 1, 38, function ___(__0, __1) { resourceGroup = __1; return cli.interaction.promptIfNotGiven($("nic name : "), nicName, __cb(_, __frame, 2, 32, function ___(__0, __2) { nicName = __2; subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); progress = cli.interaction.progress(util.format($("Looking up the network interface \"%s\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() { return networkManagementClient.networkInterfaces.get(resourceGroup, nicName, null, __cb(_, __frame, 11, 69, function ___(__0, __3) { networkInterface = __3; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__4() { if (e) { if ((e.statusCode === 404)) { networkInterface = null; } else { return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__4() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__4() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__4() { if (!networkInterface) { return _(new Error(util.format($("a network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; progress = cli.interaction.progress(util.format($("Performing show operation on a network interface \"%s\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() { return networkManagementClient.networkInterfaces.getEffectiveRouteTable(resourceGroup, nicName, __cb(_, __frame, 27, 69, function ___(__0, __4) { networkInterface = __4; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__4() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__4() { cli.interaction.formatOutput(networkInterface, generatorUtils.traverse); _(); }); }); }); }); }, true)); }, true)); }); }); var effectiveNetworkSecurityGroups = networkInterfaces.category("effective-nsg").description($("Commands to manage effective nsg")); effectiveNetworkSecurityGroups.command("list [resource-group] [nic-name]").description($("Perform list operation on a network interface")).usage("[options] <resource-group> <nic-name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-c, --nic-name <nic-name>", $("the nic name")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __5(resourceGroup, nicName, options, _) { var subscription, networkManagementClient, networkInterface, progress; var __frame = { name: "__5", line: 413 }; return __func(_, this, arguments, __5, 3, __frame, function __$__5() { return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 1, 38, function ___(__0, __1) { resourceGroup = __1; return cli.interaction.promptIfNotGiven($("nic name : "), nicName, __cb(_, __frame, 2, 32, function ___(__0, __2) { nicName = __2; subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); progress = cli.interaction.progress(util.format($("Looking up the network interface \"%s\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__5() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__5() { return networkManagementClient.networkInterfaces.get(resourceGroup, nicName, null, __cb(_, __frame, 11, 69, function ___(__0, __3) { networkInterface = __3; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__5() { if (e) { if ((e.statusCode === 404)) { networkInterface = null; } else { return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__5() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__5() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__5() { if (!networkInterface) { return _(new Error(util.format($("a network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; progress = cli.interaction.progress(util.format($("Performing list operation on a network interface \"%s\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__5() { return networkManagementClient.networkInterfaces.listEffectiveNetworkSecurityGroups(resourceGroup, nicName, __cb(_, __frame, 27, 69, function ___(__0, __4) { networkInterface = __4; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__5() { progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__5() { cli.interaction.formatOutput(networkInterface, generatorUtils.traverse); _(); }); }); }); }); }, true)); }, true)); }); });};