UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

71 lines (27 loc) 3.52 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,__tryCatch=__rt.__tryCatch; var generatorUtils = require("../../../util/generatorUtils"); 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 expressRoutes = network.category("express-route").description($("Commands to manage express routes")); var expressRouteServiceProviders = expressRoutes.category("provider").description($("Commands to manage express route service providers")); expressRouteServiceProviders.command("list").description($("List express route service providers")).usage("[options]").option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __1(options, _) { var subscription, networkManagementClient, expressRouteServiceProvider, progress; var __frame = { name: "__1", line: 42 }; return __func(_, this, arguments, __1, 1, __frame, function __$__1() { subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); expressRouteServiceProvider = null; return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return (function __$__1(__then) { if ((typeof networkManagementClient.expressRouteServiceProviders.listAll != "function")) { progress = cli.interaction.progress($("Getting the express route service providers")); return networkManagementClient.expressRouteServiceProviders.list(__cb(_, __frame, 9, 93, function ___(__0, __1) { expressRouteServiceProvider = __1; __then(); }, true)); } else { return (function __$__1(__then) { if (options.resourceGroup) { progress = cli.interaction.progress($("Getting the express route service providers")); return networkManagementClient.expressRouteServiceProviders.list(__cb(_, __frame, 13, 95, function ___(__0, __2) { expressRouteServiceProvider = __2; __then(); }, true)); } else { progress = cli.interaction.progress($("Getting the express route service providers")); return networkManagementClient.expressRouteServiceProviders.listAll(__cb(_, __frame, 16, 95, function ___(__0, __3) { expressRouteServiceProvider = __3; __then(); }, true)); } ; })(__then); } ; })(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() { cli.interaction.formatOutput(expressRouteServiceProvider, function(expressRouteServiceProvider) { if ((!expressRouteServiceProvider || (expressRouteServiceProvider.length === 0))) { cli.output.warn($("No express route service providers found")); } else { cli.output.table(expressRouteServiceProvider, function(row, item) { generatorUtils.showTableRow(row, item); }); } ; }); _(); }); }); }); });};