UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

67 lines (16 loc) 2.21 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; var profile = require("../../../util/profile"); var utils = require("../../../util/utils"); var $ = utils.getLocaleString;exports.init = function(cli) { var virtualMachinesRedeploy = cli.category("vm").description($("Commands to manage your virtual machines. ")); virtualMachinesRedeploy.command("redeploy [resource-group] [vm-name]").description($("The operation to redeploy a virtual machine.")).usage("[options] <resource-group> <vm-name>").option("-g, --resource-group <resource-group>", $("resource-group")).option("-n, --vm-name <vm-name>", $("vm-name")).option("-s, --subscription <subscription>", $("The subscription identifier")).execute(function __1(resourceGroup, vMName, options, _) { var subscription, computeManagementClient, result; var __frame = { name: "__1", line: 51 }; return __func(_, this, arguments, __1, 3, __frame, function __$__1() { return (function __$__1(__then) { if (!resourceGroup) { return cli.interaction.promptIfNotGiven($("resource-group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __1) { resourceGroup = __1; __then(); }, true)); } else { __then(); } ; })(function __$__1() { cli.output.verbose(("resourceGroup = " + resourceGroup)); return (function __$__1(__then) { if (!vMName) { return cli.interaction.promptIfNotGiven($("vm-name : "), vMName, __cb(_, __frame, 7, 31, function ___(__0, __2) { vMName = __2; __then(); }, true)); } else { __then(); } ; })(function __$__1() { cli.output.verbose(("vMName = " + vMName)); subscription = profile.current.getSubscription(options.subscription); computeManagementClient = utils.createComputeManagementClient(subscription); return computeManagementClient.virtualMachines.redeploy(resourceGroup, vMName, __cb(_, __frame, 13, 57, function ___(__0, __3) { result = __3; if (result) { cli.output.json(result); } ; _(); }, true)); }); }); }); });};