UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

466 lines (216 loc) 31.9 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 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")); var ipConfigurations = networkInterfaces.category("ip-config").description($("Commands to manage ip configurations")); var defaultPrivateIPAddressVersion = "IPv4"; ipConfigurations.command("create [resource-group] [nic-name] [name]").description($("Create an ip configuration")).usage("[options] <resource-group> <nic-name> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-c, --nic-name <nic-name>", $("the nic name")).option("-n, --name <name>", $("the name of the ip configuration")).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("-y, --is-primary [is-primary]", $(("gets whether this is a primary customer" + "\n address on the network interface"))).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("-q, --quiet", $("quiet mode, do not ask for change primary IP config confirmation")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __1(resourceGroup, nicName, name, options, _) { var useDefaults, subscription, networkManagementClient, networkInterface, progress, parentItem, ipConfiguration, parameters, idContainerSubnet, primaryIpConfig, idContainerPublicIPAddress; var __frame = { name: "__1", line: 72 }; return __func(_, this, arguments, __1, 4, __frame, function __$__1() { useDefaults = true; return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __2) { resourceGroup = __2; return cli.interaction.promptIfNotGiven($("nic name : "), nicName, __cb(_, __frame, 3, 32, function ___(__0, __3) { nicName = __3; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 4, 29, function ___(__0, __4) { name = __4; 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 __$__1() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return networkManagementClient.networkInterfaces.get(resourceGroup, nicName, null, __cb(_, __frame, 12, 69, function ___(__0, __5) { networkInterface = __5; __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() { parentItem = networkInterface; if (!parentItem) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; ipConfiguration = utils.findFirstCaseIgnore(parentItem.ipConfigurations, { name: name }); if (ipConfiguration) { return _(new Error(util.format($("ip configuration with name \"%s\" already exists in network interface \"%s\""), name, nicName))); } ; parameters = { }; if (options.lbAddressPoolIds) { parameters.loadBalancerBackendAddressPools = options.lbAddressPoolIds.split(",").map(function(item) { return { id: item }; }); } ; if (options.lbInboundNatRuleIds) { parameters.loadBalancerInboundNatRules = options.lbInboundNatRuleIds.split(",").map(function(item) { return { id: item }; }); } ; if (options.privateIpAddress) { parameters.privateIPAddress = options.privateIpAddress; if ((!options.privateIpVersion || ((options.privateIpVersion && (options.privateIpVersion.toLowerCase() != "ipv6"))))) { parameters.privateIPAllocationMethod = "Static"; } ; } ; if (options.privateIpVersion) { parameters.privateIPAddressVersion = validation.isIn(options.privateIpVersion, ["IPv4","IPv6",], "--private-ip-version"); } else { if (useDefaults) { parameters.privateIPAddressVersion = defaultPrivateIPAddressVersion; } ; } ; if (!parameters.subnet) { parameters.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.subnet.id = options.subnetId; __then(); } else { return (function __$__1(__then) { if (options.subnetName) { return networkManagementClient.subnets.get(resourceGroup, options.subnetVnetName, options.subnetName, __cb(_, __frame, 65, 64, function ___(__0, __6) { idContainerSubnet = __6; parameters.subnet.id = idContainerSubnet.id; __then(); }, true)); } else { if ((((parameters.privateIPAddressVersion && (parameters.privateIPAddressVersion.toLowerCase() === "IPv4".toLowerCase())) && !options.subnetId) && !options.subnetName)) { primaryIpConfig = utils.findFirstCaseIgnore(networkInterface.ipConfigurations, { primary: true }); parameters.subnet = { }; parameters.subnet.id = primaryIpConfig.subnet.id; } ; __then(); } ; })(__then); } ; })(function __$__1() { return (function __$__1(__then) { if (options.isPrimary) { return (function __$__1(_) { var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return cli.interaction.confirm(util.format($(("There is a primary IP configuration already. " + "Do you want to make new config primary? [y/n] "))), __cb(_, __frame, 75, 46, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -71, 17, function ___(__0, __7) { return (function __$__1(__then) { if (__7) { return _(null); } else { __then(); } ; })(function __$__1() { networkInterface.ipConfigurations.map(function(item) { item.primary = false; }); parameters.primary = utils.parseBool(options.isPrimary); __then(); }); }, true)); } else { __then(); } ; })(function __$__1() { if (!parameters.publicIPAddress) { parameters.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.publicIPAddress.id = options.publicIpId; __then(); } else { return (function __$__1(__then) { if (options.publicIpName) { return networkManagementClient.publicIPAddresses.get(resourceGroup, options.publicIpName, __cb(_, __frame, 92, 83, function ___(__0, __8) { idContainerPublicIPAddress = __8; parameters.publicIPAddress.id = idContainerPublicIPAddress.id; __then(); }, true)); } else { __then(); } ; })(__then); } ; })(function __$__1() { if (options.applicationSecurityGroups) { parameters.applicationSecurityGroups = options.applicationSecurityGroups.split(",").map(function(item) { return { id: item }; }); } ; parameters.name = name; parentItem.ipConfigurations.push(parameters); generatorUtils.removeEmptyObjects(parameters); progress = cli.interaction.progress(util.format($("Creating ip configuration in network interface \"%s\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return networkManagementClient.networkInterfaces.createOrUpdate(resourceGroup, nicName, networkInterface, __cb(_, __frame, 106, 69, function ___(__0, __9) { networkInterface = __9; _(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)); }); }); ipConfigurations.command("set [resource-group] [nic-name] [name]").description($("Update an ip configuration")).usage("[options] <resource-group> <nic-name> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-c, --nic-name <nic-name>", $("the nic name")).option("-n, --name <name>", $("the name of the ip configuration")).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("-y, --is-primary [is-primary]", $(("gets whether this is a primary customer" + "\n address on the network interface"))).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("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __2(resourceGroup, nicName, name, options, _) { var useDefaults, subscription, networkManagementClient, networkInterface, progress, parentItem, ipConfiguration, parameters, idContainerSubnet, idContainerPublicIPAddress; var __frame = { name: "__2", line: 215 }; return __func(_, this, arguments, __2, 4, __frame, function __$__2() { useDefaults = false; return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __1) { resourceGroup = __1; return cli.interaction.promptIfNotGiven($("nic name : "), nicName, __cb(_, __frame, 3, 32, function ___(__0, __2) { nicName = __2; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 4, 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\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return networkManagementClient.networkInterfaces.get(resourceGroup, nicName, null, __cb(_, __frame, 12, 69, function ___(__0, __4) { networkInterface = __4; __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() { parentItem = networkInterface; if (!parentItem) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; ipConfiguration = utils.findFirstCaseIgnore(parentItem.ipConfigurations, { name: name }); if (!ipConfiguration) { return _(new Error(util.format($("ip configuration with name \"%s\" not found in network interface \"%s\""), name, nicName))); } ; parameters = ipConfiguration; if (options.lbAddressPoolIds) { if (!utils.argHasValue(options.lbAddressPoolIds)) { delete parameters.loadBalancerBackendAddressPools; } else { parameters.loadBalancerBackendAddressPools = options.lbAddressPoolIds.split(",").map(function(item) { return { id: item }; }); } ; } ; if (options.lbInboundNatRuleIds) { if (!utils.argHasValue(options.lbInboundNatRuleIds)) { delete parameters.loadBalancerInboundNatRules; } else { parameters.loadBalancerInboundNatRules = options.lbInboundNatRuleIds.split(",").map(function(item) { return { id: item }; }); } ; } ; if (options.privateIpAddress) { parameters.privateIPAddress = options.privateIpAddress; if ((!options.privateIpVersion || ((options.privateIpVersion && (options.privateIpVersion.toLowerCase() != "ipv6"))))) { parameters.privateIPAllocationMethod = "Static"; } ; } ; if (options.privateIpVersion) { parameters.privateIPAddressVersion = validation.isIn(options.privateIpVersion, ["IPv4","IPv6",], "--private-ip-version"); } else { if (useDefaults) { parameters.privateIPAddressVersion = defaultPrivateIPAddressVersion; } ; } ; if (!parameters.subnet) { parameters.subnet = { }; } ; return (function __$__2(__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.subnet.id = options.subnetId; __then(); } else { return (function __$__2(__then) { if (options.subnetName) { return networkManagementClient.subnets.get(resourceGroup, options.subnetVnetName, options.subnetName, __cb(_, __frame, 73, 64, function ___(__0, __5) { idContainerSubnet = __5; parameters.subnet.id = idContainerSubnet.id; __then(); }, true)); } else { __then(); } ; })(__then); } ; })(function __$__2() { if (options.isPrimary) { networkInterface.ipConfigurations.map(function(item) { item.primary = false; }); parameters.primary = utils.parseBool(options.isPrimary); } ; if (!parameters.publicIPAddress) { parameters.publicIPAddress = { }; } ; return (function __$__2(__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")); } ; if (!utils.argHasValue(options.publicIpId)) { delete parameters.publicIPAddress; } else { parameters.publicIPAddress.id = options.publicIpId; } ; __then(); } else { return (function __$__2(__then) { if (options.publicIpName) { return (function __$__2(__then) { if (!utils.argHasValue(options.publicIpName)) { delete parameters.publicIPAddress; __then(); } else { return networkManagementClient.publicIPAddresses.get(resourceGroup, options.publicIpName, __cb(_, __frame, 98, 85, function ___(__0, __6) { idContainerPublicIPAddress = __6; parameters.publicIPAddress.id = idContainerPublicIPAddress.id; __then(); }, true)); } ; })(__then); } else { __then(); } ; })(__then); } ; })(function __$__2() { if (options.applicationSecurityGroups) { parameters.applicationSecurityGroups = options.applicationSecurityGroups.split(",").map(function(item) { return { id: item }; }); } ; generatorUtils.removeEmptyObjects(parameters); progress = cli.interaction.progress(util.format($("Updating ip configuration in \"%s\""), nicName)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return networkManagementClient.networkInterfaces.createOrUpdate(resourceGroup, nicName, networkInterface, __cb(_, __frame, 110, 69, function ___(__0, __7) { networkInterface = __7; _(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)); }, true)); }); }); ipConfigurations.command("delete [resource-group] [nic-name] [name]").description($("Delete an ip configuration")).usage("[options] <resource-group> <nic-name> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-c, --nic-name <nic-name>", $("the nic name")).option("-n, --name <name>", $("the name of the ip configuration")).option("-q, --quiet", $("quiet mode, do not ask for delete confirmation")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __3(resourceGroup, nicName, name, options, _) { var subscription, networkManagementClient, networkInterface, progress, parentItem, index; var __frame = { name: "__3", line: 341 }; return __func(_, this, arguments, __3, 4, __frame, function __$__3() { return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 1, 38, function ___(__0, __2) { resourceGroup = __2; return cli.interaction.promptIfNotGiven($("nic name : "), nicName, __cb(_, __frame, 2, 32, function ___(__0, __3) { nicName = __3; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 3, 29, function ___(__0, __4) { name = __4; 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 __$__3() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return networkManagementClient.networkInterfaces.get(resourceGroup, nicName, null, __cb(_, __frame, 11, 69, function ___(__0, __5) { networkInterface = __5; __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() { parentItem = networkInterface; if (!parentItem) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; index = utils.indexOfCaseIgnore(parentItem.ipConfigurations, { name: name }); if ((index === -1)) { return _(new Error(util.format($("ip configuration \"%s\" not found in network interface \"%s\""), name, nicName))); } ; return (function __$__3(_) { var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return cli.interaction.confirm(util.format($("Delete ip configuration with name \"%s\" from network interface \"%s\"? [y/n] "), name, nicName), __cb(_, __frame, 32, 45, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -340, 17, function ___(__0, __6) { return (function __$__3(__then) { if (__6) { return _(null); } else { __then(); } ; })(function __$__3() { parentItem.ipConfigurations.splice(index, 1); progress = cli.interaction.progress("Deleting ip configuration"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return networkManagementClient.networkInterfaces.createOrUpdate(resourceGroup, nicName, networkInterface, __cb(_, __frame, 40, 69, function ___(__0, __7) { networkInterface = __7; _(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() { cli.interaction.formatOutput(networkInterface, generatorUtils.traverse); _(); }); }); }); }, true)); }); }); }, true)); }, true)); }, true)); }); }); ipConfigurations.command("show [resource-group] [nic-name] [name]").description($("Show an ip configuration")).usage("[options] <resource-group> <nic-name> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-c, --nic-name <nic-name>", $("the nic name")).option("-n, --name <name>", $("the name of the ip configuration")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __4(resourceGroup, nicName, name, options, _) { var subscription, networkManagementClient, networkInterface, progress, parentItem, ipConfiguration; var __frame = { name: "__4", line: 396 }; return __func(_, this, arguments, __4, 4, __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; return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 3, 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\""), 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, __4) { networkInterface = __4; __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() { parentItem = networkInterface; if (!parentItem) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; ipConfiguration = utils.findFirstCaseIgnore(parentItem.ipConfigurations, { name: name }); if (!ipConfiguration) { cli.output.warn(util.format($("ip configuration with name \"%s\" not found in the network interface \"%s\""), name, nicName)); } ; cli.interaction.formatOutput(ipConfiguration, generatorUtils.traverse); _(); }); }); }, true)); }, true)); }, true)); }); }); ipConfigurations.command("list [resource-group] [nic-name]").description($("List ip configurations")).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, parentItem; var __frame = { name: "__5", line: 437 }; return __func(_, this, arguments, __5, 3, __frame, function __$__5() { subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); networkInterface = null; 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, 7, 69, function ___(__0, __1) { networkInterface = __1; __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() { parentItem = networkInterface; if (!parentItem) { return _(new Error(util.format($("network interface with name \"%s\" not found in the resource group \"%s\""), nicName, resourceGroup))); } ; cli.interaction.formatOutput(parentItem.ipConfigurations, function(items) { if ((!items || (items.length === 0))) { cli.output.warn($("No ip configurations found")); } else { cli.output.table(items, function(row, item) { generatorUtils.showTableRow(row, item); }); } ; }); _(); }); }); }); });};