azure-cli
Version:
Microsoft Azure Cross Platform Command Line tool
58 lines (24 loc) • 3.11 kB
JavaScript
/*** 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 containerServiceScale = cli.category("acs").description($("Commands to manage your container service. "));
containerServiceScale.command("scale [resource-group] [name] [new-agent-count]").description($("The operation to scale a container service.")).usage("[options] <resource-group> <name> <new-agent-count>").option("-g, --resource-group <resource-group>", $("resource-group")).option("-n, --name <name>", $("name")).option("-o, --new-agent-count <new-agent-count>", $("New agent count")).option("-s, --subscription <subscription>", $("The subscription identifier")).execute(function __1(resourceGroup, name, newAgentCount, options, _) { var subscription, computeManagementClient, acs, result; var __frame = { name: "__1", line: 32 }; return __func(_, this, arguments, __1, 4, __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(("resource-group = " + resourceGroup)); return (function __$__1(__then) {
if (!name) {
return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 7, 29, function ___(__0, __2) { name = __2; __then(); }, true)); } else { __then(); } ; })(function __$__1() {
cli.output.verbose(("name = " + name)); return (function __$__1(__then) {
if (!newAgentCount) {
return cli.interaction.promptIfNotGiven($("new-agent-count : "), newAgentCount, __cb(_, __frame, 12, 38, function ___(__0, __3) { newAgentCount = __3; __then(); }, true)); } else { __then(); } ; })(function __$__1() {
cli.output.verbose(("new-agent-count = " + newAgentCount));
subscription = profile.current.getSubscription(options.subscription);
computeManagementClient = utils.createComputeManagementClient(subscription);
return computeManagementClient.containerServiceOperations.get(resourceGroup, name, __cb(_, __frame, 18, 65, function ___(__0, __4) { acs = __4;
if ((newAgentCount == acs.agentPoolProfiles[0].count)) {
return _(new Error("New agent count should be greater than existing count.")); } ;
acs.agentPoolProfiles[0].count = parseInt(newAgentCount);
return computeManagementClient.containerServiceOperations.createOrUpdate(resourceGroup, name, acs, __cb(_, __frame, 23, 65, function ___(__0, __5) { result = __5;
if (result) {
cli.output.json(result); } ; _(); }, true)); }, true)); }); }); }); }); });};