azure-cli
Version:
Microsoft Azure Cross Platform Command Line tool
938 lines (454 loc) • 146 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 fs = require("fs");
var jsonpatch = require("fast-json-patch");
var profile = require("../../../util/profile");
var utils = require("../../../util/utils");
var $ = utils.getLocaleString;
function beautify(jsonText) {
var obj = JSON.parse(jsonText);
return JSON.stringify(obj, null, 2);};
function capitalize(str) {
if ((str && (str.length >= 1))) {
return (str.charAt(0).toUpperCase() + str.slice(1)); }
else {
return str; } ;};
function makeTuple(k, v, d) {
return { key: k, value: v, depth: d };};
function displayImpl(o, key, depth, arr) {
if (((!!o) && (((o.constructor === Object) || (o.constructor === Array))))) {
arr.push(makeTuple(key, "", depth));
var len = 0;
Object.keys(o).forEach(function(k1) {
var v1 = o[k1];
var p1 = ((o.constructor === Array) ? "#" : "");
var w = displayImpl(v1, (p1 + k1), (depth + 1), arr);
if ((w > len)) {
len = w; } ; });
return len; }
else {
arr.push(makeTuple(key, (o ? o.toString() : ""), depth));
return ((depth * 2) + ((key ? key.toString().length : 0))); } ;};
function display(cli, o) {
var arr = [];
var width = displayImpl(o, "", 0, arr);
for (var t in arr) {
var prebuf = new Array((arr[t].depth * 2)).join(" ");
var key = (arr[t].key ? arr[t].key : "");
var postLen = (width - ((prebuf.length + key.length)));
var postbuf = new Array(((postLen > 0) ? postLen : 0)).join(" ");
var str = ((prebuf + capitalize(key)) + postbuf);
if (arr[t].value) {
str += (" : " + arr[t].value); } ;
cli.output.data(str); };};
exports.init = function(cli) {
var containerServicesCreateOrUpdate = cli.category("acs").description($("Commands to manage your container services. "));
containerServicesCreateOrUpdate.command("create [resource-group] [name] [parameters]").description($("Creates or updates a container service.")).usage("[options] <resource-group> <name> <parameters>").option("-g, --resource-group <resource-group>", $("resource-group")).option("-n, --name <name>", $("name")).option("-p, --parameters <parameters>", $("A string of parameters in JSON format")).option("--parameter-file <parameter-file>", $("The text file that contains input parameter object in JSON format")).option("-s, --subscription <subscription>", $("The subscription identifier")).execute(function __1(resourceGroup, name, parameters, options, _) { var parametersObj, fileContent, subscription, computeManagementClient, result; var __frame = { name: "__1", line: 345 }; 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(("resourceGroup = " + 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));
cli.output.verbose(("parameters = " + parameters));
parametersObj = null;
if (options.parameterFile) {
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent); }
else {
parametersObj = JSON.parse(parameters); } ;
cli.output.verbose(("parametersObj = " + JSON.stringify(parametersObj)));
subscription = profile.current.getSubscription(options.subscription);
computeManagementClient = utils.createComputeManagementClient(subscription);
return computeManagementClient.containerServices.createOrUpdate(resourceGroup, name, parametersObj, __cb(_, __frame, 24, 59, function ___(__0, __3) { result = __3;
if (result) {
cli.output.json(result); } ; _(); }, true)); }); }); }); });
var containerServicesCreateOrUpdatecreateOrUpdateParameters2 = containerServicesCreateOrUpdate.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
containerServicesCreateOrUpdatecreateOrUpdateParameters2.command("create").description($("Generate containerServicesCreateOrUpdate parameter string or files.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).execute(function __2(options, _) { var filePath; var __frame = { name: "__2", line: 380 }; return __func(_, this, arguments, __2, 1, __frame, function __$__2() {
return cli.output.verbose("{\"provisioningState\":\"\",\"orchestratorProfile\":{\"orchestratorType\":\"\"},\"customProfile\":{\"orchestrator\":\"\"},\"servicePrincipalProfile\":{\"clientId\":\"\",\"secret\":\"\"},\"masterProfile\":{\"count\":null,\"dnsPrefix\":\"\",\"fqdn\":\"\"},\"agentPoolProfiles\":[{\"name\":\"\",\"count\":\"\",\"vmSize\":\"\",\"dnsPrefix\":\"\",\"fqdn\":\"\"}],\"windowsProfile\":{\"adminUsername\":\"\",\"adminPassword\":\"\"},\"linuxProfile\":{\"adminUsername\":\"\",\"ssh\":{\"publicKeys\":[{\"keyData\":\"\"}]}},\"diagnosticsProfile\":{\"vmDiagnostics\":{\"enabled\":false,\"storageUri\":\"\"}},\"id\":null,\"name\":null,\"type\":null,\"location\":\"\",\"tags\":{}}", __cb(_, __frame, 1, 15, function __$__2() {
filePath = "containerServicesCreateOrUpdate_createOrUpdate.json";
if (options.parameterFile) {
filePath = options.parameterFile; } ;
fs.writeFileSync(filePath, beautify("{\r\n\"provisioningState\":\"\",\r\n\"orchestratorProfile\":{\r\n\"orchestratorType\":\"\"\r\n},\r\n\"customProfile\":{\r\n\"orchestrator\":\"\"\r\n},\r\n\"servicePrincipalProfile\":{\r\n\"clientId\":\"\",\r\n\"secret\":\"\"\r\n},\r\n\"masterProfile\":{\r\n\"count\":null,\r\n\"dnsPrefix\":\"\",\r\n\"fqdn\":\"\"\r\n},\r\n\"agentPoolProfiles\":[\r\n{\r\n\"name\":\"\",\r\n\"count\":\"\",\r\n\"vmSize\":\"\",\r\n\"dnsPrefix\":\"\",\r\n\"fqdn\":\"\"\r\n}\r\n],\r\n\"windowsProfile\":{\r\n\"adminUsername\":\"\",\r\n\"adminPassword\":\"\"\r\n},\r\n\"linuxProfile\":{\r\n\"adminUsername\":\"\",\r\n\"ssh\":{\r\n\"publicKeys\":[\r\n{\r\n\"keyData\":\"\"\r\n}\r\n]\r\n}\r\n},\r\n\"diagnosticsProfile\":{\r\n\"vmDiagnostics\":{\r\n\"enabled\":false,\r\n\"storageUri\":\"\"\r\n}\r\n},\r\n\"id\":null,\r\n\"name\":null,\r\n\"type\":null,\r\n\"location\":\"\",\r\n\"tags\":{\r\n}\r\n}"));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file output to: " + filePath));
cli.output.verbose("====================================="); _(); }, true)); }); });
containerServicesCreateOrUpdatecreateOrUpdateParameters2.command("patch").description($("Command to patch containerServicesCreateOrUpdate parameter JSON file.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--operation <operation>", $("The JSON patch operation: add, remove, or replace.")).option("--path <path>", $("The JSON data path, e.g.: \"foo/1\".")).option("--value <value>", $("The JSON value.")).option("--parse", $("Parse the JSON value to object.")).execute(function __3(options, _) { var fileContent, parametersObj, updatedContent; var __frame = { name: "__3", line: 400 }; return __func(_, this, arguments, __3, 1, __frame, function __$__3() {
return cli.output.verbose(options.parameterFile, __cb(_, __frame, 1, 15, function __$__3() {
cli.output.verbose(options.operation);
cli.output.verbose(options.path);
cli.output.verbose(options.value);
cli.output.verbose(options.parse);
if (options.parse) {
options.value = JSON.parse(options.value); } ;
cli.output.verbose(options.value);
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
if ((options.operation == "add")) {
jsonpatch.apply(parametersObj, [{ op: options.operation, path: options.path, value: options.value },]); } else {
if ((options.operation == "remove")) {
jsonpatch.apply(parametersObj, [{ op: options.operation, path: options.path },]); } else {
if ((options.operation == "replace")) {
jsonpatch.apply(parametersObj, [{ op: options.operation, path: options.path, value: options.value },]); } ; } ; } ;
updatedContent = JSON.stringify(parametersObj);
cli.output.verbose("=====================================");
cli.output.verbose("JSON object (updated):");
cli.output.verbose(JSON.stringify(parametersObj));
cli.output.verbose("=====================================");
fs.writeFileSync(options.parameterFile, beautify(updatedContent));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file updated at: " + options.parameterFile));
cli.output.verbose("====================================="); _(); }, true)); }); });
var catparametersCreateOrUpdateContainerServicesContainerService01 = cli.category("acs");
var parametersCreateOrUpdateContainerServicesContainerService01 = catparametersCreateOrUpdateContainerServicesContainerService01.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
var setparametersCreateOrUpdateContainerServicesContainerService01 = parametersCreateOrUpdateContainerServicesContainerService01.category("container-service").description($("Commands to configure container-service of acs in config file."));
setparametersCreateOrUpdateContainerServicesContainerService01.command("set").description($("Set container-service in config string or files, e.g. \r\n{\r\n \"provisioningState\":\"\",\r\n \"orchestratorProfile\":{\r\n \"orchestratorType\":\"\"\r\n },\r\n \"customProfile\":{\r\n \"orchestrator\":\"\"\r\n },\r\n \"servicePrincipalProfile\":{\r\n \"clientId\":\"\",\r\n \"secret\":\"\"\r\n },\r\n \"masterProfile\":{\r\n \"count\":null,\r\n \"dnsPrefix\":\"\",\r\n \"fqdn\":\"\"\r\n },\r\n \"agentPoolProfiles\":[\r\n {\r\n \"name\":\"\",\r\n \"count\":\"\",\r\n \"vmSize\":\"\",\r\n \"dnsPrefix\":\"\",\r\n \"fqdn\":\"\"\r\n }\r\n ],\r\n \"windowsProfile\":{\r\n \"adminUsername\":\"\",\r\n \"adminPassword\":\"\"\r\n },\r\n \"linuxProfile\":{\r\n \"adminUsername\":\"\",\r\n \"ssh\":{\r\n \"publicKeys\":[\r\n {\r\n \"keyData\":\"\"\r\n }\r\n ]\r\n }\r\n },\r\n \"diagnosticsProfile\":{\r\n \"vmDiagnostics\":{\r\n \"enabled\":false,\r\n \"storageUri\":\"\"\r\n }\r\n },\r\n \"id\":null,\r\n \"name\":null,\r\n \"type\":null,\r\n \"location\":\"\",\r\n \"tags\":{\r\n }\r\n}\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, 'vmss show/list/stop' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas 'vmss config * generate/create/set/delete/add' commands \r\n are used to configure the input parameter file. The 'vmss config' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--parse", $("Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).")).option("--provisioning-state <provisioningState>", $("Set the provisioning-state value.")).option("--orchestrator-profile <orchestratorProfile>", $("Set the orchestrator-profile value.")).option("--custom-profile <customProfile>", $("Set the custom-profile value.")).option("--service-principal-profile <servicePrincipalProfile>", $("Set the service-principal-profile value.")).option("--master-profile <masterProfile>", $("Set the master-profile value.")).option("--agent-pool-profiles <agentPoolProfiles>", $("Set the agent-pool-profiles value.")).option("--windows-profile <windowsProfile>", $("Set the windows-profile value.")).option("--linux-profile <linuxProfile>", $("Set the linux-profile value.")).option("--diagnostics-profile <diagnosticsProfile>", $("Set the diagnostics-profile value.")).option("--id <id>", $("Set the id value.")).option("--name <name>", $("Set the name value.")).option("--type <type>", $("Set the type value.")).option("--location <location>", $("Set the location value.")).option("--tags <tags>", $("Set the tags value.")).execute(function __4(options, _) { var fileContent, parametersObj, error, paramPath, updatedContent; var __frame = { name: "__4", line: 462 }; return __func(_, this, arguments, __4, 1, __frame, function __$__4() {
return cli.output.verbose(JSON.stringify(options), __cb(_, __frame, 1, 15, function __$__4() { return (function __$__4(__then) {
if (!options.parameterFile) {
return cli.interaction.promptIfNotGiven($("parameter-file : "), options.parameterFile, __cb(_, __frame, 3, 46, function ___(__0, __1) { options.parameterFile = __1; __then(); }, true)); } else { __then(); } ; })(function __$__4() {
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = "replace";
options.path = "";
error = jsonpatch.validate([{ op: "remove", path: options.path },], parametersObj);
if ((typeof error !== "undefined")) {
jsonpatch.apply(parametersObj, [{ op: "add", path: options.path, value: { } },]); } ;
paramPath = ((options.path + "/") + "provisioningState");
if (options.provisioningState) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.provisioningState));
cli.output.verbose("================================================");
if ((options.parse && options.provisioningState)) {
options.provisioningState = JSON.parse(options.provisioningState); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.provisioningState },]); } ;
paramPath = ((options.path + "/") + "orchestratorProfile");
if (options.orchestratorProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.orchestratorProfile));
cli.output.verbose("================================================");
if ((options.parse && options.orchestratorProfile)) {
options.orchestratorProfile = JSON.parse(options.orchestratorProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.orchestratorProfile },]); } ;
paramPath = ((options.path + "/") + "customProfile");
if (options.customProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.customProfile));
cli.output.verbose("================================================");
if ((options.parse && options.customProfile)) {
options.customProfile = JSON.parse(options.customProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.customProfile },]); } ;
paramPath = ((options.path + "/") + "servicePrincipalProfile");
if (options.servicePrincipalProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.servicePrincipalProfile));
cli.output.verbose("================================================");
if ((options.parse && options.servicePrincipalProfile)) {
options.servicePrincipalProfile = JSON.parse(options.servicePrincipalProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.servicePrincipalProfile },]); } ;
paramPath = ((options.path + "/") + "masterProfile");
if (options.masterProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.masterProfile));
cli.output.verbose("================================================");
if ((options.parse && options.masterProfile)) {
options.masterProfile = JSON.parse(options.masterProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.masterProfile },]); } ;
paramPath = ((options.path + "/") + "agentPoolProfiles");
if (options.agentPoolProfiles) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.agentPoolProfiles));
cli.output.verbose("================================================");
if ((options.parse && options.agentPoolProfiles)) {
options.agentPoolProfiles = JSON.parse(options.agentPoolProfiles); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.agentPoolProfiles },]); } ;
paramPath = ((options.path + "/") + "windowsProfile");
if (options.windowsProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.windowsProfile));
cli.output.verbose("================================================");
if ((options.parse && options.windowsProfile)) {
options.windowsProfile = JSON.parse(options.windowsProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.windowsProfile },]); } ;
paramPath = ((options.path + "/") + "linuxProfile");
if (options.linuxProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.linuxProfile));
cli.output.verbose("================================================");
if ((options.parse && options.linuxProfile)) {
options.linuxProfile = JSON.parse(options.linuxProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.linuxProfile },]); } ;
paramPath = ((options.path + "/") + "diagnosticsProfile");
if (options.diagnosticsProfile) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.diagnosticsProfile));
cli.output.verbose("================================================");
if ((options.parse && options.diagnosticsProfile)) {
options.diagnosticsProfile = JSON.parse(options.diagnosticsProfile); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.diagnosticsProfile },]); } ;
paramPath = ((options.path + "/") + "id");
if (options.id) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.id));
cli.output.verbose("================================================");
if ((options.parse && options.id)) {
options.id = JSON.parse(options.id); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.id },]); } ;
paramPath = ((options.path + "/") + "name");
if (options.name) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.name));
cli.output.verbose("================================================");
if ((options.parse && options.name)) {
options.name = JSON.parse(options.name); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.name },]); } ;
paramPath = ((options.path + "/") + "type");
if (options.type) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.type));
cli.output.verbose("================================================");
if ((options.parse && options.type)) {
options.type = JSON.parse(options.type); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.type },]); } ;
paramPath = ((options.path + "/") + "location");
if (options.location) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.location));
cli.output.verbose("================================================");
if ((options.parse && options.location)) {
options.location = JSON.parse(options.location); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.location },]); } ;
paramPath = ((options.path + "/") + "tags");
if (options.tags) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.tags));
cli.output.verbose("================================================");
if ((options.parse && options.tags)) {
options.tags = JSON.parse(options.tags); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.tags },]); } ;
updatedContent = JSON.stringify(parametersObj);
cli.output.verbose("=====================================");
cli.output.verbose("JSON object (updated):");
cli.output.verbose(JSON.stringify(parametersObj));
cli.output.verbose("=====================================");
fs.writeFileSync(options.parameterFile, beautify(updatedContent));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file updated at: " + options.parameterFile));
cli.output.verbose("====================================="); _(); }); }, true)); }); });
var catparametersCreateOrUpdateContainerServicesContainerService11 = cli.category("acs");
var parametersCreateOrUpdateContainerServicesContainerService11 = catparametersCreateOrUpdateContainerServicesContainerService11.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
var deleteparametersCreateOrUpdateContainerServicesContainerService11 = parametersCreateOrUpdateContainerServicesContainerService11.category("container-service").description($("Commands to configure container-service of acs in config file."));
deleteparametersCreateOrUpdateContainerServicesContainerService11.command("delete").description($("Remove container-service in config string or files, e.g. \r\n{\r\n \"provisioningState\":\"\",\r\n \"orchestratorProfile\":{\r\n \"orchestratorType\":\"\"\r\n },\r\n \"customProfile\":{\r\n \"orchestrator\":\"\"\r\n },\r\n \"servicePrincipalProfile\":{\r\n \"clientId\":\"\",\r\n \"secret\":\"\"\r\n },\r\n \"masterProfile\":{\r\n \"count\":null,\r\n \"dnsPrefix\":\"\",\r\n \"fqdn\":\"\"\r\n },\r\n \"agentPoolProfiles\":[\r\n {\r\n \"name\":\"\",\r\n \"count\":\"\",\r\n \"vmSize\":\"\",\r\n \"dnsPrefix\":\"\",\r\n \"fqdn\":\"\"\r\n }\r\n ],\r\n \"windowsProfile\":{\r\n \"adminUsername\":\"\",\r\n \"adminPassword\":\"\"\r\n },\r\n \"linuxProfile\":{\r\n \"adminUsername\":\"\",\r\n \"ssh\":{\r\n \"publicKeys\":[\r\n {\r\n \"keyData\":\"\"\r\n }\r\n ]\r\n }\r\n },\r\n \"diagnosticsProfile\":{\r\n \"vmDiagnostics\":{\r\n \"enabled\":false,\r\n \"storageUri\":\"\"\r\n }\r\n },\r\n \"id\":null,\r\n \"name\":null,\r\n \"type\":null,\r\n \"location\":\"\",\r\n \"tags\":{\r\n }\r\n}\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, 'vmss show/list/stop' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas 'vmss config * generate/create/set/delete/add' commands \r\n are used to configure the input parameter file. The 'vmss config' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--provisioning-state", $("Remove the provisioning-state value.")).option("--orchestrator-profile", $("Remove the orchestrator-profile value.")).option("--custom-profile", $("Remove the custom-profile value.")).option("--service-principal-profile", $("Remove the service-principal-profile value.")).option("--master-profile", $("Remove the master-profile value.")).option("--agent-pool-profiles", $("Remove the agent-pool-profiles value.")).option("--windows-profile", $("Remove the windows-profile value.")).option("--linux-profile", $("Remove the linux-profile value.")).option("--diagnostics-profile", $("Remove the diagnostics-profile value.")).option("--id", $("Remove the id value.")).option("--name", $("Remove the name value.")).option("--type", $("Remove the type value.")).option("--location", $("Remove the location value.")).option("--tags", $("Remove the tags value.")).execute(function __5(options, _) { var fileContent, parametersObj, anySubItem, subItemPath, updatedContent; var __frame = { name: "__5", line: 670 }; return __func(_, this, arguments, __5, 1, __frame, function __$__5() {
return cli.output.verbose(JSON.stringify(options), __cb(_, __frame, 1, 15, function __$__5() { return (function __$__5(__then) {
if (!options.parameterFile) {
return cli.interaction.promptIfNotGiven($("parameter-file : "), options.parameterFile, __cb(_, __frame, 3, 46, function ___(__0, __1) { options.parameterFile = __1; __then(); }, true)); } else { __then(); } ; })(function __$__5() {
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = "remove";
options.path = "";
anySubItem = ((((((((((((((false || options.provisioningState) || options.orchestratorProfile) || options.customProfile) || options.servicePrincipalProfile) || options.masterProfile) || options.agentPoolProfiles) || options.windowsProfile) || options.linuxProfile) || options.diagnosticsProfile) || options.id) || options.name) || options.type) || options.location) || options.tags);
if (anySubItem) {
subItemPath = null;
if (options.provisioningState) {
subItemPath = (options.path + "/provisioningState");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.orchestratorProfile) {
subItemPath = (options.path + "/orchestratorProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.customProfile) {
subItemPath = (options.path + "/customProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.servicePrincipalProfile) {
subItemPath = (options.path + "/servicePrincipalProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.masterProfile) {
subItemPath = (options.path + "/masterProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.agentPoolProfiles) {
subItemPath = (options.path + "/agentPoolProfiles");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.windowsProfile) {
subItemPath = (options.path + "/windowsProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.linuxProfile) {
subItemPath = (options.path + "/linuxProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.diagnosticsProfile) {
subItemPath = (options.path + "/diagnosticsProfile");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.id) {
subItemPath = (options.path + "/id");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.name) {
subItemPath = (options.path + "/name");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.type) {
subItemPath = (options.path + "/type");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.location) {
subItemPath = (options.path + "/location");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ;
if (options.tags) {
subItemPath = (options.path + "/tags");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ; }
else {
jsonpatch.apply(parametersObj, [{ op: options.operation, path: options.path },]); } ;
updatedContent = JSON.stringify(parametersObj);
cli.output.verbose("=====================================");
cli.output.verbose("JSON object (updated):");
cli.output.verbose(JSON.stringify(parametersObj));
cli.output.verbose("=====================================");
fs.writeFileSync(options.parameterFile, beautify(updatedContent));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file updated at: " + options.parameterFile));
cli.output.verbose("====================================="); _(); }); }, true)); }); });
var catparametersCreateOrUpdateContainerServicesOrchestratorProfile0OP1 = cli.category("acs");
var parametersCreateOrUpdateContainerServicesOrchestratorProfile0OP1 = catparametersCreateOrUpdateContainerServicesOrchestratorProfile0OP1.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
var setparametersCreateOrUpdateContainerServicesOrchestratorProfile0OP1 = parametersCreateOrUpdateContainerServicesOrchestratorProfile0OP1.category("orchestrator-profile").description($("Commands to configure orchestrator-profile of acs in config file."));
setparametersCreateOrUpdateContainerServicesOrchestratorProfile0OP1.command("set").description($("Set orchestrator-profile in config string or files, e.g. \r\n {\r\n ...\r\n \"orchestratorProfile\" : {\r\n \"orchestratorType\":\"\"\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, 'vmss show/list/stop' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas 'vmss config * generate/create/set/delete/add' commands \r\n are used to configure the input parameter file. The 'vmss config' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--parse", $("Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).")).option("--orchestrator-type <orchestratorType>", $("Set the orchestrator-type value.")).execute(function __6(options, _) { var fileContent, parametersObj, error, paramPath, updatedContent; var __frame = { name: "__6", line: 771 }; return __func(_, this, arguments, __6, 1, __frame, function __$__6() {
return cli.output.verbose(JSON.stringify(options), __cb(_, __frame, 1, 15, function __$__6() { return (function __$__6(__then) {
if (!options.parameterFile) {
return cli.interaction.promptIfNotGiven($("parameter-file : "), options.parameterFile, __cb(_, __frame, 3, 46, function ___(__0, __1) { options.parameterFile = __1; __then(); }, true)); } else { __then(); } ; })(function __$__6() {
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = "replace";
options.path = "/orchestratorProfile";
error = jsonpatch.validate([{ op: "remove", path: options.path },], parametersObj);
if ((typeof error !== "undefined")) {
jsonpatch.apply(parametersObj, [{ op: "add", path: options.path, value: { } },]); } ;
paramPath = ((options.path + "/") + "orchestratorType");
if (options.orchestratorType) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.orchestratorType));
cli.output.verbose("================================================");
if ((options.parse && options.orchestratorType)) {
options.orchestratorType = JSON.parse(options.orchestratorType); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.orchestratorType },]); } ;
updatedContent = JSON.stringify(parametersObj);
cli.output.verbose("=====================================");
cli.output.verbose("JSON object (updated):");
cli.output.verbose(JSON.stringify(parametersObj));
cli.output.verbose("=====================================");
fs.writeFileSync(options.parameterFile, beautify(updatedContent));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file updated at: " + options.parameterFile));
cli.output.verbose("====================================="); _(); }); }, true)); }); });
var catparametersCreateOrUpdateContainerServicesOrchestratorProfile1OP1 = cli.category("acs");
var parametersCreateOrUpdateContainerServicesOrchestratorProfile1OP1 = catparametersCreateOrUpdateContainerServicesOrchestratorProfile1OP1.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
var deleteparametersCreateOrUpdateContainerServicesOrchestratorProfile1OP1 = parametersCreateOrUpdateContainerServicesOrchestratorProfile1OP1.category("orchestrator-profile").description($("Commands to configure orchestrator-profile of acs in config file."));
deleteparametersCreateOrUpdateContainerServicesOrchestratorProfile1OP1.command("delete").description($("Remove orchestrator-profile in config string or files, e.g. \r\n {\r\n ...\r\n \"orchestratorProfile\" : {\r\n \"orchestratorType\":\"\"\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, 'vmss show/list/stop' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas 'vmss config * generate/create/set/delete/add' commands \r\n are used to configure the input parameter file. The 'vmss config' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--orchestrator-type", $("Remove the orchestrator-type value.")).execute(function __7(options, _) { var fileContent, parametersObj, anySubItem, subItemPath, updatedContent; var __frame = { name: "__7", line: 823 }; return __func(_, this, arguments, __7, 1, __frame, function __$__7() {
return cli.output.verbose(JSON.stringify(options), __cb(_, __frame, 1, 15, function __$__7() { return (function __$__7(__then) {
if (!options.parameterFile) {
return cli.interaction.promptIfNotGiven($("parameter-file : "), options.parameterFile, __cb(_, __frame, 3, 46, function ___(__0, __1) { options.parameterFile = __1; __then(); }, true)); } else { __then(); } ; })(function __$__7() {
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = "remove";
options.path = "/orchestratorProfile";
anySubItem = (false || options.orchestratorType);
if (anySubItem) {
subItemPath = null;
if (options.orchestratorType) {
subItemPath = (options.path + "/orchestratorType");
jsonpatch.apply(parametersObj, [{ op: options.operation, path: subItemPath },]); } ; }
else {
jsonpatch.apply(parametersObj, [{ op: options.operation, path: options.path },]); } ;
updatedContent = JSON.stringify(parametersObj);
cli.output.verbose("=====================================");
cli.output.verbose("JSON object (updated):");
cli.output.verbose(JSON.stringify(parametersObj));
cli.output.verbose("=====================================");
fs.writeFileSync(options.parameterFile, beautify(updatedContent));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file updated at: " + options.parameterFile));
cli.output.verbose("====================================="); _(); }); }, true)); }); });
var catparametersCreateOrUpdateContainerServicesCustomProfile0CP1 = cli.category("acs");
var parametersCreateOrUpdateContainerServicesCustomProfile0CP1 = catparametersCreateOrUpdateContainerServicesCustomProfile0CP1.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
var setparametersCreateOrUpdateContainerServicesCustomProfile0CP1 = parametersCreateOrUpdateContainerServicesCustomProfile0CP1.category("custom-profile").description($("Commands to configure custom-profile of acs in config file."));
setparametersCreateOrUpdateContainerServicesCustomProfile0CP1.command("set").description($("Set custom-profile in config string or files, e.g. \r\n {\r\n ...\r\n \"customProfile\" : {\r\n \"orchestrator\":\"\"\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, 'vmss show/list/stop' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas 'vmss config * generate/create/set/delete/add' commands \r\n are used to configure the input parameter file. The 'vmss config' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--parse", $("Parse the input string, i.e. str, for parameters to a JSON object, e.g. JSON.parse(str).")).option("--orchestrator <orchestrator>", $("Set the orchestrator value.")).execute(function __8(options, _) { var fileContent, parametersObj, error, paramPath, updatedContent; var __frame = { name: "__8", line: 872 }; return __func(_, this, arguments, __8, 1, __frame, function __$__8() {
return cli.output.verbose(JSON.stringify(options), __cb(_, __frame, 1, 15, function __$__8() { return (function __$__8(__then) {
if (!options.parameterFile) {
return cli.interaction.promptIfNotGiven($("parameter-file : "), options.parameterFile, __cb(_, __frame, 3, 46, function ___(__0, __1) { options.parameterFile = __1; __then(); }, true)); } else { __then(); } ; })(function __$__8() {
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = "replace";
options.path = "/customProfile";
error = jsonpatch.validate([{ op: "remove", path: options.path },], parametersObj);
if ((typeof error !== "undefined")) {
jsonpatch.apply(parametersObj, [{ op: "add", path: options.path, value: { } },]); } ;
paramPath = ((options.path + "/") + "orchestrator");
if (options.orchestrator) {
cli.output.verbose("================================================");
cli.output.verbose(("Path : " + paramPath));
cli.output.verbose(("Value : " + options.orchestrator));
cli.output.verbose("================================================");
if ((options.parse && options.orchestrator)) {
options.orchestrator = JSON.parse(options.orchestrator); } ;
jsonpatch.apply(parametersObj, [{ op: options.operation, path: paramPath, value: options.orchestrator },]); } ;
updatedContent = JSON.stringify(parametersObj);
cli.output.verbose("=====================================");
cli.output.verbose("JSON object (updated):");
cli.output.verbose(JSON.stringify(parametersObj));
cli.output.verbose("=====================================");
fs.writeFileSync(options.parameterFile, beautify(updatedContent));
cli.output.verbose("=====================================");
cli.output.verbose(("Parameter file updated at: " + options.parameterFile));
cli.output.verbose("====================================="); _(); }); }, true)); }); });
var catparametersCreateOrUpdateContainerServicesCustomProfile1CP1 = cli.category("acs");
var parametersCreateOrUpdateContainerServicesCustomProfile1CP1 = catparametersCreateOrUpdateContainerServicesCustomProfile1CP1.category("config").description($("Commands to manage configuration of container-services in the parameter file."));
var deleteparametersCreateOrUpdateContainerServicesCustomProfile1CP1 = parametersCreateOrUpdateContainerServicesCustomProfile1CP1.category("custom-profile").description($("Commands to configure custom-profile of acs in config file."));
deleteparametersCreateOrUpdateContainerServicesCustomProfile1CP1.command("delete").description($("Remove custom-profile in config string or files, e.g. \r\n {\r\n ...\r\n \"customProfile\" : {\r\n \"orchestrator\":\"\"\r\n }\r\n ...\r\n }\r\n\r\n There are two sets of commands:\r\n 1) function commands that are used to manage Azure resources in the cloud, and \r\n 2) parameter commands that generate & edit input files for the other set of commands.\r\n For example, 'vmss show/list/stop' are the function commands that call get, list and stop operations of \r\n virtual machine scale set, whereas 'vmss config * generate/create/set/delete/add' commands \r\n are used to configure the input parameter file. The 'vmss config' command takes a parameter \r\n file as for the VM scale set configuration, and creates it online.")).usage("[options]").option("--parameter-file <parameter-file>", $("The parameter file path.")).option("--orchestrator", $("Remove the orchestrator value.")).execute(function __9(options, _) { var fileContent, parametersObj, anySubItem, subItemPath, updatedContent; var __frame = { name: "__9", line: 924 }; return __func(_, this, arguments, __9, 1, __frame, function __$__9() {
return cli.output.verbose(JSON.stringify(options), __cb(_, __frame, 1, 15, function __$__9() { return (function __$__9(__then) {
if (!options.parameterFile) {
return cli.interaction.promptIfNotGiven($("parameter-file : "), options.parameterFile, __cb(_, __frame, 3, 46, function ___(__0, __1) { options.parameterFile = __1; __then(); }, true)); } else { __then(); } ; })(function __$__9() {
cli.output.verbose("=====================================");
cli.output.verbose((("Reading file content from: \"" + options.parameterFile) + "\""));
cli.output.verbose("=====================================");
fileContent = fs.readFileSync(options.parameterFile, "utf8");
parametersObj = JSON.parse(fileContent);
cli.output.verbose("JSON object:");
cli.output.verbose(JSON.stringify(parametersObj));
options.operation = "remove";
options.path = "/customProfil