UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

72 lines (28 loc) 3.68 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 availableEndpointServices = network.category("endpoint-service").description($("Commands to manage available endpoint services")); availableEndpointServices.command("list [location]").description($("List available endpoint services")).usage("[options] <location>").option("-l, --location <location>", $("the location")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __1(location, options, _) { var subscription, networkManagementClient, availableEndpointService, progress; var __frame = { name: "__1", line: 41 }; return __func(_, this, arguments, __1, 2, __frame, function __$__1() { return cli.interaction.promptIfNotGiven($("location : "), location, __cb(_, __frame, 1, 41, function ___(__0, __1) { options.location = __1; location = options.location; subscription = profile.current.getSubscription(options.subscription); networkManagementClient = utils.createNetworkManagementClient(subscription); availableEndpointService = null; return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return (function __$__1(__then) { if ((typeof networkManagementClient.availableEndpointServices.listAll != "function")) { progress = cli.interaction.progress($("Getting the available endpoint services")); return networkManagementClient.availableEndpointServices.list(location, __cb(_, __frame, 11, 87, function ___(__0, __2) { availableEndpointService = __2; __then(); }, true)); } else { return (function __$__1(__then) { if (options.resourceGroup) { progress = cli.interaction.progress($("Getting the available endpoint services")); return networkManagementClient.availableEndpointServices.list(location, __cb(_, __frame, 15, 89, function ___(__0, __3) { availableEndpointService = __3; __then(); }, true)); } else { progress = cli.interaction.progress($("Getting the available endpoint services")); return networkManagementClient.availableEndpointServices.listAll(__cb(_, __frame, 18, 89, function ___(__0, __4) { availableEndpointService = __4; __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(availableEndpointService, function(availableEndpointService) { if ((!availableEndpointService || (availableEndpointService.length === 0))) { cli.output.warn($("No available endpoint services found")); } else { cli.output.table(availableEndpointService, function(row, item) { generatorUtils.showTableRow(row, item); }); } ; }); _(); }); }); }, true)); }); });};