UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

639 lines (301 loc) 49.5 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,__catch=__rt.__catch,__tryCatch=__rt.__tryCatch; var utils = require("../../util/utils"); var serviceFabricUtils = require("./serviceFabricUtils"); var serviceFabricClient = require("azure-servicefabric"); var $ = utils.getLocaleString; exports.init = function(cli) { var log = cli.output; var serviceFabric = cli.category("servicefabric").description($("Commands to manage your Azure Service Fabric")); var application = serviceFabric.category("application").description($("Commands to manage your application")); application.command("show").description($("Show application")).option("-n --application-name <applicationName>", $("the name of the application")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __1(options, _) { var progress, config, client, res; var __frame = { name: "__1", line: 37 }; return __func(_, this, arguments, __1, 1, __frame, function __$__1() { progress = cli.interaction.progress($("Show application")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return serviceFabricUtils.parseUrl(options.applicationName, __cb(_, __frame, 7, 53, function ___(__0, __4) { options.applicationName = __4; res = null; return (function __$__1(__then) { if (!options.applicationName) { return client.applications.list(options, __cb(_, __frame, 10, 36, function ___(__0, __5) { res = __5; __then(); }, true)); } else { return client.applications.get(options.applicationName, options, __cb(_, __frame, 13, 36, function ___(__0, __6) { res = __6; __then(); }, true)); } ; })(function __$__1() { return (function __$__1(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 16, 35, function ___(__0, __7) { res = __7; __then(); }, true)); } else { __then(); } ; })(function __$__1() { serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__1() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__1() { _(); }); }); }); }); application.command("create [applicationName] [applicationTypeName] [applicationTypeVersion]").description($("Create application, Example: azure servicefabric application create --application-name fabric:/app --application-type-name type1 --application-type-version 1.0")).option("-n --application-name <applicationName>", $("the name of the application")).option("-t --application-type-name <applicationTypeName>", $("the name of the application type")).option("-a --application-type-version <applicationTypeVersion>", $("the version of the application type")).option("-p --application-parameter <applicationParameter>", $("the parameter of the application, json string \"{\"Key\": \"key1\", \"Value\": \"value1\"}\"")).execute(function __2(applicationName, applicationTypeName, applicationTypeVersion, options, _) { var progress, config, client, applicationDescription, res; var __frame = { name: "__2", line: 74 }; return __func(_, this, arguments, __2, 4, __frame, function __$__2() { progress = cli.interaction.progress($("Create application")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); applicationDescription = { }; if (applicationName) { applicationDescription.name = applicationName; } ; if (applicationTypeName) { applicationDescription.typeName = applicationTypeName; } ; if (applicationTypeVersion) { applicationDescription.typeVersion = applicationTypeVersion; } ; if (options.applicationParameter) { applicationDescription.parameterList = JSON.parse(options.applicationParameter); } ; return client.applications.create(applicationDescription, options, __cb(_, __frame, 12, 38, function ___(__0, __4) { res = __4; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__2() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__2() { _(); }); }); }); }); application.command("delete [applicationName]").description($("Delete application")).option("-n --application-name <applicationName>", $("the name of the application")).execute(function __3(applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__3", line: 102 }; return __func(_, this, arguments, __3, 2, __frame, function __$__3() { progress = cli.interaction.progress($("Delete application")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 7, 45, function ___(__0, __4) { applicationName = __4; return client.applications.remove(applicationName, options, __cb(_, __frame, 8, 38, function ___(__0, __5) { res = __5; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__3() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__3() { _(); }); }); }); }); var applicationManifest = application.category("manifest").description($("Commands to manage your application manifest")); applicationManifest.command("show [applicationTypeName] [applicationTypeVersion]").description($("Show application manifest")).option("-n --application-type-name <applicationTypeName>", $("the name of the application type")).option("-t --application-type-version <applicationTypeVersion>", $("the type of the application version")).execute(function __4(applicationTypeName, applicationTypeVersion, options, _) { var progress, config, client, res; var __frame = { name: "__4", line: 130 }; return __func(_, this, arguments, __4, 3, __frame, function __$__4() { progress = cli.interaction.progress($("Show application manifest")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return client.applicationManifests.get(applicationTypeName, applicationTypeVersion, options, __cb(_, __frame, 7, 46, function ___(__0, __4) { res = __4; serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__4() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__4() { _(); }); }); }); }); var applicationType = application.category("type").description($("Commands to manage your application type")); applicationType.command("show").description($("Show application type, Example: azure servicefabric application type show --application-type-name type1")).option("-n --application-type-name <applicationTypeName>", $("the type of the application")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __5(options, _) { var progress, config, client, res; var __frame = { name: "__5", line: 158 }; return __func(_, this, arguments, __5, 1, __frame, function __$__5() { progress = cli.interaction.progress($("Show application type")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__5() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); res = null; return (function __$__5(__then) { if (!options.applicationTypeName) { return client.applicationTypes.list(options, __cb(_, __frame, 9, 40, function ___(__0, __4) { res = __4; __then(); }, true)); } else { return client.applicationTypes.get(options.applicationTypeName, options, __cb(_, __frame, 12, 40, function ___(__0, __5) { res = __5; __then(); }, true)); } ; })(function __$__5() { return (function __$__5(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 15, 35, function ___(__0, __6) { res = __6; __then(); }, true)); } else { __then(); } ; })(function __$__5() { serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__5() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__5() { _(); }); }); }); }); applicationType.command("register [applicationTypeBuildPath]").description($("Register application type, Example: azure servicefabric application type register --application-type-build-path Package1")).option("-p --application-type-build-path <applicationTypeBuildPath>", $("the path of the application type build")).option("-t --timeout <timeout>", $("the timeout, seconds")).execute(function __6(applicationTypeBuildPath, options, _) { var progress, config, client, registerApplicationType, res; var __frame = { name: "__6", line: 192 }; return __func(_, this, arguments, __6, 2, __frame, function __$__6() { return cli.interaction.promptIfNotGiven("applicationTypeBuildPath: ", applicationTypeBuildPath, __cb(_, __frame, 1, 49, function ___(__0, __1) { applicationTypeBuildPath = __1; progress = cli.interaction.progress($("Register application type")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__6() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 6, 40, function ___(__0, __2) { config = __2; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 8, 79, function ___(__0, __3) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 8, 130, function ___(__0, __4) { client = new serviceFabricClient("3.0-preview", __3, __4); registerApplicationType = { }; registerApplicationType.applicationTypeBuildPath = applicationTypeBuildPath; if (options.timeout) { options.timeout = Number(options.timeout); } ; return client.applicationTypes.register(registerApplicationType, options, __cb(_, __frame, 12, 42, function ___(__0, __5) { res = __5; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__6() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__6() { _(); }); }); }, true)); }); }); applicationType.command("unregister [applicationTypeName] [applicationTypeVersion]").description($("Unregister application type, Example: azure servicefabric application type unregister --application-type-name type1 --application-type-version 1.0")).option("-n --application-type-name <applicationTypeName>", $("the name of the application type")).option("-t --application-type-version <applicationTypeVersion>", $("the version of the application type")).execute(function __7(applicationTypeName, applicationTypeVersion, options, _) { var progress, config, client, unregisterApplicationType, res; var __frame = { name: "__7", line: 221 }; return __func(_, this, arguments, __7, 3, __frame, function __$__7() { return cli.interaction.promptIfNotGiven("applicationTypeName:", applicationTypeName, __cb(_, __frame, 1, 44, function ___(__0, __1) { applicationTypeName = __1; return cli.interaction.promptIfNotGiven("applicationTypeVersion: ", applicationTypeVersion, __cb(_, __frame, 2, 47, function ___(__0, __2) { applicationTypeVersion = __2; progress = cli.interaction.progress($("Unregister application type")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__7() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 7, 40, function ___(__0, __3) { config = __3; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 9, 79, function ___(__0, __4) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 9, 130, function ___(__0, __5) { client = new serviceFabricClient("3.0-preview", __4, __5); unregisterApplicationType = { }; unregisterApplicationType.applicationTypeVersion = applicationTypeVersion; return client.applicationTypes.unregister(applicationTypeName, unregisterApplicationType, options, __cb(_, __frame, 12, 42, function ___(__0, __6) { res = __6; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__7() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__7() { _(); }); }); }, true)); }, true)); }); }); var applicationHealth = application.category("health").description($("Commands to send your application health")); applicationHealth.command("show [applicationName]").description($("Show application health")).option("-n --application-name <applicationName>", $("the name of the application")).option("-e --events-health-state-filter <eventsHealthStateFilter>", $("the filter of the event health state, values are [Default|None|Ok|Warning|Error|All]")).option("-f --deployed-applications-health-state-filter <deployedapplicationsHealthStateFilter>", $("the filter of the deployed applications health state, values are [Default|None|Ok|Warning|Error|All]")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __8(applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__8", line: 255 }; return __func(_, this, arguments, __8, 2, __frame, function __$__8() { progress = cli.interaction.progress($("Show application health")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__8() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 7, 45, function ___(__0, __4) { applicationName = __4; return client.applicationHealths.get(applicationName, options, __cb(_, __frame, 8, 44, function ___(__0, __5) { res = __5; return (function __$__8(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 10, 35, function ___(__0, __6) { res = __6; __then(); }, true)); } else { __then(); } ; })(function __$__8() { serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__8() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__8() { _(); }); }); }); }); applicationHealth.command("send [applicationName] [sourceId] [property] [healthState]").description($("Send application health, Example: azure servicefabric application health send --application-name fabric:app --source-id monitor --property pc --health-state Ok --description healthy")).option("-n --application-name <applicationName>", $("the name of the application")).option("-i --source-id <sourceId>", $("the id of the source")).option("-p --property <property>", $("the property")).option("-e --health-state <healthState>", $("the state of the health, values are [Ok|Warning|Error|Unknown]")).option("-d --description <description>", $("the description")).option("-m --time-to-live-in-milliSeconds <timeToLiveInMilliSeconds>", $("the time in milliseconds for live")).option("-q --sequence-number <sequenceNumber>", $("the number of the sequence")).option("-w --remove-when-expired", $("the boolean of the remove when expired")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __9(applicationName, sourceId, property, healthState, options, _) { var progress, config, client, applicationHealthReport, res; var __frame = { name: "__9", line: 291 }; return __func(_, this, arguments, __9, 5, __frame, function __$__9() { progress = cli.interaction.progress($("Send application health")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__9() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); applicationHealthReport = { }; if (sourceId) { applicationHealthReport.sourceId = sourceId; } ; if (property) { applicationHealthReport.property = property; } ; if (healthState) { applicationHealthReport.healthState = serviceFabricUtils.getEnumVal("healthState", healthState); } ; if (options.description) { applicationHealthReport.description = options.description; } ; if (options.timeToLiveInMilliSeconds) { applicationHealthReport.timeToLiveInMilliSeconds = options.timeToLiveInMilliSeconds; } ; if (options.sequenceNumber) { applicationHealthReport.sequenceNumber = options.sequenceNumber; } ; if (options.removeWhenExpired) { applicationHealthReport.removeWhenExpired = true; } ; return client.applicationHealths.send(applicationName, applicationHealthReport, options, __cb(_, __frame, 17, 44, function ___(__0, __4) { res = __4; return (function __$__9(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 19, 35, function ___(__0, __5) { res = __5; __then(); }, true)); } else { __then(); } ; })(function __$__9() { progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__9() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__9() { _(); }); }); }); }); var applicationDeployed = application.category("deployed").description($("Commands to manage your deployed application")); applicationDeployed.command("show [nodeName]").description($("Show deployed application")).option("-n --node-name <nodeName>", $("the name of the node")).option("-a --application-name <applicationName>", $("the name of the application")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __10(nodeName, options, _) { var progress, config, client, res; var __frame = { name: "__10", line: 332 }; return __func(_, this, arguments, __10, 2, __frame, function __$__10() { progress = cli.interaction.progress($("Show deployed application")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__10() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); res = null; return (function __$__10(__then) { if (!options.applicationName) { return client.deployedApplications.list(nodeName, options, __cb(_, __frame, 9, 44, function ___(__0, __4) { res = __4; __then(); }, true)); } else { return serviceFabricUtils.parseUrl(options.applicationName, __cb(_, __frame, 12, 55, function ___(__0, __5) { options.applicationName = __5; return client.deployedApplications.get(nodeName, options.applicationName, options, __cb(_, __frame, 13, 44, function ___(__0, __6) { res = __6; __then(); }, true)); }, true)); } ; })(function __$__10() { return (function __$__10(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 16, 35, function ___(__0, __7) { res = __7; __then(); }, true)); } else { __then(); } ; })(function __$__10() { serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__10() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__10() { _(); }); }); }); }); var applicationDeployedHealth = applicationDeployed.category("health").description($("Commands to manage your deployed application health")); applicationDeployedHealth.command("show [nodeName] [applicationName]").description($("Show deployed application health")).option("-n --node-name <nodeName>", $("the name of the node")).option("-a --application-name <applicationName>", $("the name of the application")).option("-f --events-health-state-filter <eventsHealthStateFilter>", $("the filter of the event health state, values are [Default|None|Ok|Warning|Error|All]")).option("-p --deployed-service-packages-health-state-filter <deployedServicePackagesHealthStateFilter>", $("the filter of the deployed service packages health state, values are [Default|None|Ok|Warning|Error|All]")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __11(nodeName, applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__11", line: 373 }; return __func(_, this, arguments, __11, 3, __frame, function __$__11() { progress = cli.interaction.progress($("Show deployed application health")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__11() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 6, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 6, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 7, 45, function ___(__0, __4) { applicationName = __4; return client.deployedApplicationHealths.get(nodeName, applicationName, options, __cb(_, __frame, 8, 52, function ___(__0, __5) { res = __5; return (function __$__11(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 10, 35, function ___(__0, __6) { res = __6; __then(); }, true)); } else { __then(); } ; })(function __$__11() { serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__11() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__11() { _(); }); }); }); }); applicationDeployedHealth.command("send [nodeName] [applicationName] [sourceId] [property] [healthState]").description($("Send deployed application health, Example: azure servicefabric deployed application health send --node-name node1 --application-name fabric:app --source-id monitor --property pc --health-state Ok --description healthy")).option("-n --node-name <nodeName>", $("the name of the node")).option("-a --application-name <applicationName>", $("the name of the application")).option("-i --source-id <sourceId>", $("the id of the source")).option("-p --property <property>", $("the property")).option("-e --health-state <healthState>", $("the state of the health, values are [Ok|Warning|Error|Unknown]")).option("-d --description <description>", $("the description")).option("-t --time-to-live-in-milliseconds <timeToLiveInMilliseconds>", $("the time in milliseconds for live")).option("-q --sequence-number <sequenceNumber>", $("the number of the sequence")).option("-r --remove-when-expired", $("the boolean of the remove when expired")).execute(function __12(nodeName, applicationName, sourceId, property, healthState, options, _) { var progress, config, client, applicationHealthReport, res; var __frame = { name: "__12", line: 409 }; return __func(_, this, arguments, __12, 6, __frame, function __$__12() { progress = cli.interaction.progress($("Send cluster health")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__12() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 5, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 5, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 6, 45, function ___(__0, __4) { applicationName = __4; applicationHealthReport = { }; if (sourceId) { applicationHealthReport.sourceId = sourceId; } ; if (property) { applicationHealthReport.property = property; } ; if (healthState) { applicationHealthReport.healthState = serviceFabricUtils.getEnumVal("healthState", healthState); } ; if (options.description) { applicationHealthReport.description = options.description; } ; if (options.timeToLiveInMilliseconds) { applicationHealthReport.timeToLiveInMilliSeconds = options.timeToLiveInMilliseconds; } ; if (options.sequenceNumber) { applicationHealthReport.sequenceNumber = options.sequenceNumber; } ; if (options.removeWhenExpired) { applicationHealthReport.removeWhenExpired = true; } ; return client.deployedApplicationHealths.send(nodeName, applicationName, applicationHealthReport, options, __cb(_, __frame, 15, 52, function ___(__0, __5) { res = __5; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__12() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__12() { _(); }); }); }); }); var applicationUpgrade = application.category("upgrade").description($("Commands to manage your application upgrade")); applicationUpgrade.command("show [applicationName]").description($("Show application upgrade")).option("-n --application-name <applicationName>", $("the name of the application")).execute(function __13(applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__13", line: 443 }; return __func(_, this, arguments, __13, 2, __frame, function __$__13() { progress = cli.interaction.progress($("Show application upgrade")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__13() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 4, 40, function ___(__0, __1) { config = __1; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 5, 79, function ___(__0, __2) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 5, 130, function ___(__0, __3) { client = new serviceFabricClient("3.0-preview", __2, __3); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 6, 45, function ___(__0, __4) { applicationName = __4; return client.applicationUpgrades.get(applicationName, options, __cb(_, __frame, 7, 45, function ___(__0, __5) { res = __5; serviceFabricUtils.setApplicationEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__13() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__13() { _(); }); }); }); }); applicationUpgrade.command("start [applicationName] [targetApplicationTypeVersion] [rollingUpgradeMode]").description($("Start application upgrade, Example: azure servicefabric application upgrade start --application-name fabric:/app --target-application-type-version 1.1 --rolling-upgrade-mode Monitored --force-restart true")).option("-n --application-name <applicationName>", $("the name of the application")).option("-t --target-application-type-version <targetApplicationTypeVersion>", $("the version of the target application type")).option("-p --parameters <parameters>", $("the parameters, json string \"{\"Key\": \"key1\", \"Value\": \"value1\"}\"")).option("-m --rolling-upgrade-mode <rollingUpgradeMode>", $("the mode of the rolling upgrade, values are [UnmonitoredAuto|UnmonitoredManual|Monitored]")).option("-r --upgrade-replica-set-check-timeout-in-seconds <upgradeReplicaSetCheckTimeoutInSeconds>", $("the name of the upgrade domain")).option("-f --force-restart", $("the force restart")).option("-o --monitoring-policy <monitoringPolicy>", $("the policy of the monitoring")).option("-a --application-health-policy <applicationHealthPolicy>", $("the policy of the health application")).execute(function __14(applicationName, targetApplicationTypeVersion, rollingUpgradeMode, options, _) { var progress, config, client, startApplicationUpgradeDescription, res; var __frame = { name: "__14", line: 474 }; return __func(_, this, arguments, __14, 4, __frame, function __$__14() { return cli.interaction.promptIfNotGiven("applicationName: ", applicationName, __cb(_, __frame, 1, 40, function ___(__0, __1) { applicationName = __1; return cli.interaction.promptIfNotGiven("targetApplicationTypeVersion: ", targetApplicationTypeVersion, __cb(_, __frame, 2, 53, function ___(__0, __2) { targetApplicationTypeVersion = __2; return cli.interaction.promptIfNotGiven("rollingUpgradeMode: ", rollingUpgradeMode, __cb(_, __frame, 3, 43, function ___(__0, __3) { rollingUpgradeMode = __3; progress = cli.interaction.progress($("Start application upgrade")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__14() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 8, 40, function ___(__0, __4) { config = __4; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 9, 79, function ___(__0, __5) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 9, 130, function ___(__0, __6) { client = new serviceFabricClient("3.0-preview", __5, __6); startApplicationUpgradeDescription = { }; startApplicationUpgradeDescription.name = applicationName; startApplicationUpgradeDescription.targetApplicationTypeVersion = targetApplicationTypeVersion; if (options.parameters) { startApplicationUpgradeDescription.parameters = JSON.parse(options.parameters); } ; startApplicationUpgradeDescription.upgradeKind = "Rolling"; startApplicationUpgradeDescription.rollingUpgradeMode = serviceFabricUtils.getEnumVal("rollingUpgradeMode", rollingUpgradeMode); if (options.upgradeReplicaSetCheckTimeoutInSeconds) { startApplicationUpgradeDescription.upgradeReplicaSetCheckTimeoutInSeconds = Number(options.upgradeReplicaSetCheckTimeoutInSeconds); } ; if (options.forceRestart) { startApplicationUpgradeDescription.forceRestart = true; } ; if (options.monitoringPolicy) { startApplicationUpgradeDescription.monitoringPolicy = JSON.parse(options.monitoringPolicy); if (options.failureAction) { startApplicationUpgradeDescription.monitoringPolicy.failureAction = serviceFabricUtils.getEnumVal("failureAction", options.failureAction); } ; } ; if (options.applicationHealthPolicy) { startApplicationUpgradeDescription.applicationHealthPolicy = JSON.parse(options.applicationHealthPolicy); } ; return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 33, 70, function ___(__0, __7) { return client.applicationUpgrades.start(__7, startApplicationUpgradeDescription, options, __cb(_, __frame, 33, 45, function ___(__0, __8) { res = __8; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__14() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__14() { _(); }); }); }, true)); }, true)); }, true)); }); }); applicationUpgrade.command("update [applicationName]").description($("Update application upgrade, Example: azure servicefabric application upgrade update --application-name fabric:/app --rolling-upgrade-mode Monitored")).option("-n --application-name <applicationName>", $("the name of the application")).option("-m --rolling-upgrade-mode <rollingUpgradeMode>", $("the mode of the rolling upgrade, values are [UnmonitoredAuto|UnmonitoredManual|Monitored]")).option("-r --force-restart", $("the boolean of the force restart")).option("-a --failure-action <failureAction>", $("the mode of the failure action, values are [Rollback|Manual]")).option("-i --upgrade-replica-set-check-timeout-in-seconds <upgradeReplicaSetCheckTimeoutInSeconds>", $("the mode of the rolling upgrade")).option("-d --health-check-wait-duration-in-milliseconds <healthCheckWaitDurationInMilliseconds>", $("the mode of the rolling upgrade")).option("-c --health-check-stable-duration-in-milliseconds <healthCheckStableDurationInMilliseconds>", $("the mode of the rolling upgrade")).option("-e --health-check-retry-timeout-in-milliseconds <healthCheckRetryTimeoutInMilliseconds>", $("the mode of the rolling upgrade")).option("-u --upgrade-timeout-in-milliseconds <upgradeTimeoutInMilliseconds>", $("the mode of the rolling upgrade")).option("-p --upgrade-domain-timeout-in-milliseconds <upgradeDomainTimeoutInMilliseconds>", $("the mode of the rolling upgrade")).option("-l --application-health-policy <applicationHealthPolicy>", $("the policy of the health application")).execute(function __15(applicationName, options, _) { var progress, config, client, updateApplicationUpgradeDescription, res; var __frame = { name: "__15", line: 533 }; return __func(_, this, arguments, __15, 2, __frame, function __$__15() { return cli.interaction.promptIfNotGiven("applicationName:", applicationName, __cb(_, __frame, 1, 40, function ___(__0, __1) { applicationName = __1; progress = cli.interaction.progress($("Update application upgrade")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__15() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 6, 40, function ___(__0, __2) { config = __2; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 7, 79, function ___(__0, __3) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 7, 130, function ___(__0, __4) { client = new serviceFabricClient("3.0-preview", __3, __4); updateApplicationUpgradeDescription = { }; updateApplicationUpgradeDescription.name = applicationName; updateApplicationUpgradeDescription.upgradeKind = "Rolling"; updateApplicationUpgradeDescription.updateDescription = { }; if (options.rollingUpgradeMode) { updateApplicationUpgradeDescription.updateDescription.rollingUpgradeMode = serviceFabricUtils.getEnumVal("rollingUpgradeMode", options.rollingUpgradeMode); } ; if (options.forceRestart) { updateApplicationUpgradeDescription.updateDescription.forceRestart = true; } ; if (options.failureAction) { updateApplicationUpgradeDescription.updateDescription.failureAction = serviceFabricUtils.getEnumVal("failureAction", options.failureAction); } ; if (options.upgradeReplicaSetCheckTimeoutInSeconds) { updateApplicationUpgradeDescription.updateDescription.upgradeReplicaSetCheckTimeoutInSeconds = Number(options.upgradeReplicaSetCheckTimeoutInSeconds); } ; if (options.healthCheckWaitDurationInMilliseconds) { updateApplicationUpgradeDescription.updateDescription.healthCheckWaitDurationInMilliseconds = options.healthCheckWaitDurationInMilliseconds; } ; if (options.healthCheckStableDurationInMilliseconds) { updateApplicationUpgradeDescription.updateDescription.healthCheckStableDurationInMilliseconds = options.healthCheckStableDurationInMilliseconds; } ; if (options.healthCheckRetryTimeoutInMilliseconds) { updateApplicationUpgradeDescription.updateDescription.healthCheckRetryTimeoutInMilliseconds = options.healthCheckRetryTimeoutInMilliseconds; } ; if (options.upgradeTimeoutInMilliseconds) { updateApplicationUpgradeDescription.updateDescription.upgradeTimeoutInMilliseconds = options.upgradeTimeoutInMilliseconds; } ; if (options.upgradeDomainTimeoutInMilliseconds) { updateApplicationUpgradeDescription.updateDescription.upgradeDomainTimeoutInMilliseconds = options.upgradeDomainTimeoutInMilliseconds; } ; if (options.applicationHealthPolicy) { updateApplicationUpgradeDescription.applicationHealthPolicy = JSON.parse(options.applicationHealthPolicy); } ; return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 42, 71, function ___(__0, __5) { return client.applicationUpgrades.update(__5, updateApplicationUpgradeDescription, options, __cb(_, __frame, 42, 45, function ___(__0, __6) { res = __6; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__15() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__15() { _(); }); }); }, true)); }); }); applicationUpgrade.command("resume [applicationName] [upgradeDomainName]").description($("Resume application upgrade")).option("-n --application-name <applicationName>", $("the name of the application")).option("-d --upgrade-domain-name <upgradeDomainName>", $("the name of the upgrade domain")).execute(function __16(applicationName, upgradeDomainName, options, _) { var progress, config, client, resumeApplicationUpgrade, res; var __frame = { name: "__16", line: 592 }; return __func(_, this, arguments, __16, 3, __frame, function __$__16() { return cli.interaction.promptIfNotGiven("applicationName:", applicationName, __cb(_, __frame, 1, 40, function ___(__0, __1) { applicationName = __1; return cli.interaction.promptIfNotGiven("upgradeDomainName:", upgradeDomainName, __cb(_, __frame, 2, 42, function ___(__0, __2) { upgradeDomainName = __2; progress = cli.interaction.progress($("Resume application upgrade")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__16() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 7, 40, function ___(__0, __3) { config = __3; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 8, 79, function ___(__0, __4) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 8, 130, function ___(__0, __5) { client = new serviceFabricClient("3.0-preview", __4, __5); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 9, 45, function ___(__0, __6) { applicationName = __6; resumeApplicationUpgrade = { }; resumeApplicationUpgrade.upgradeDomainName = upgradeDomainName; return client.applicationUpgrades.resume(applicationName, resumeApplicationUpgrade, options, __cb(_, __frame, 12, 45, function ___(__0, __7) { res = __7; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__16() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__16() { _(); }); }); }, true)); }, true)); }); }); applicationUpgrade.command("rollback [applicationName]").description($("Start application upgrade rollback")).option("-n --application-name <applicationName>", $("the name of the application")).execute(function __17(applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__17", line: 620 }; return __func(_, this, arguments, __17, 2, __frame, function __$__17() { return cli.interaction.promptIfNotGiven("applicationName:", applicationName, __cb(_, __frame, 1, 40, function ___(__0, __1) { applicationName = __1; progress = cli.interaction.progress($("Start application upgrade rollback")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__17() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 6, 40, function ___(__0, __2) { config = __2; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 7, 79, function ___(__0, __3) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 7, 130, function ___(__0, __4) { client = new serviceFabricClient("3.0-preview", __3, __4); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 8, 45, function ___(__0, __5) { applicationName = __5; return client.applicationRollbacks.start(applicationName, options, __cb(_, __frame, 9, 46, function ___(__0, __6) { res = __6; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__17() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__17() { _(); }); }); }, true)); }); });};