UNPKG

azure-cli

Version:

Microsoft Azure Cross Platform Command Line tool

529 lines (252 loc) 40.2 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 service = serviceFabric.category("service").description($("Commands to manage your service")); service.command("show [applicationName]").description($("Show service")).option("-n --application-name <serviceName>", $("the name of the application")).option("-e --service-name <serviceName>", $("the name of the service")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __1(applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__1", line: 38 }; return __func(_, this, arguments, __1, 2, __frame, function __$__1() { progress = cli.interaction.progress($("Show service")); 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(applicationName, __cb(_, __frame, 7, 45, function ___(__0, __4) { applicationName = __4; res = null; return (function __$__1(__then) { if (!options.serviceName) { return client.services.list(applicationName, options, __cb(_, __frame, 10, 32, function ___(__0, __5) { res = __5; __then(); }, true)); } else { return serviceFabricUtils.parseUrl(options.serviceName, __cb(_, __frame, 13, 51, function ___(__0, __6) { options.serviceName = __6; return client.services.get(applicationName, options.serviceName, options, __cb(_, __frame, 14, 32, function ___(__0, __7) { res = __7; __then(); }, true)); }, true)); } ; })(function __$__1() { return (function __$__1(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 17, 35, function ___(__0, __8) { res = __8; __then(); }, true)); } else { __then(); } ; })(function __$__1() { serviceFabricUtils.setServiceEnumVal(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() { _(); }); }); }); }); service.command("create [applicationName] [serviceName] [serviceTypeName] [serviceKind] [partitionScheme]").description($("Create service, Example: servicefabric service create --application-name fabric:/app --service-name fabric:/app/service --service-type-name ServiceType1 --service-kind Stateless --instance-count 1 --partition-scheme Singleton")).option("-n --application-name <applicationName>", $("the name of the application")).option("-e --service-name <serviceName>", $("the name of the service")).option("-t --service-type-name <serviceTypeName>", $("the name of the service type")).option("-k --service-kind <serviceKind>", $("the kind of the service, values are [Stateless|Stateful]")).option("-c --instance-count <instanceCount>", $("the count of the instance")).option("-r --target-replica-set-size <targetReplicaSetSize>", $("the size of the target replica set")).option("-m --min-replica-set-size <minReplicaSetSize>", $("the size of the min replica set")).option("-p --has-persisted-state", $("the state of the persisted")).option("-a --partition-scheme <partitionScheme>", $("the scheme of the partition")).option("-i --partition-count <partitionCount>", $("the count of the partition")).option("-o --partition-names <partitionNames>", $("the names of the partition")).option("-l --partition-low-key <partitionLowKey>", $("the key of the partition low")).option("-g --partition-high-key <partitionHighKey>", $("the key of the partition high")).option("-b --placement-constraints <placementConstraints>", $("the constraints of the placement")).option("-c --correlation-schema <correlationSchema>", $("the schema of the correlation, json string")).option("-d --service-load-metrics <serviceLoadMetrics>", $("the metrics of the service load, json string")).option("-f --service-placement-policy-description <servicePlacementPolicyDescription>", $("the description of the service placement policy, json string")).execute(function __2(applicationName, serviceName, serviceTypeName, serviceKind, partitionScheme, options, _) { var progress, config, client, serviceDescription, res; var __frame = { name: "__2", line: 90 }; return __func(_, this, arguments, __2, 6, __frame, function __$__2() { return cli.interaction.promptIfNotGiven("applicationName:", applicationName, __cb(_, __frame, 1, 40, function ___(__0, __1) { applicationName = __1; return cli.interaction.promptIfNotGiven("serviceName:", serviceName, __cb(_, __frame, 2, 36, function ___(__0, __2) { serviceName = __2; return cli.interaction.promptIfNotGiven("serviceTypeName:", serviceTypeName, __cb(_, __frame, 3, 40, function ___(__0, __3) { serviceTypeName = __3; return cli.interaction.promptIfNotGiven("serviceKind:", serviceKind, __cb(_, __frame, 4, 36, function ___(__0, __4) { serviceKind = __4; return (function __$__2(__then) { if ((serviceKind === "Stateless")) { return cli.interaction.promptIfNotGiven("instanceCount:", options.instanceCount, __cb(_, __frame, 6, 48, function ___(__0, __5) { options.instanceCount = __5; __then(); }, true)); } else { return (function __$__2(__then) { if ((serviceKind === "Stateful")) { return cli.interaction.promptIfNotGiven("targetReplicaSetSize:", options.targetReplicaSetSize, __cb(_, __frame, 9, 55, function ___(__0, __6) { options.targetReplicaSetSize = __6; return cli.interaction.promptIfNotGiven("minReplicaSetSize:", options.minReplicaSetSize, __cb(_, __frame, 10, 52, function ___(__0, __7) { options.minReplicaSetSize = __7; __then(); }, true)); }, true)); } else { __then(); } ; })(__then); } ; })(function __$__2() { return cli.interaction.promptIfNotGiven("partitionScheme:", partitionScheme, __cb(_, __frame, 12, 40, function ___(__0, __8) { partitionScheme = __8; return serviceFabricUtils.isSubPath(applicationName, serviceName, __cb(_, __frame, 13, 30, function ___(__0, __10) { var __9 = !__10; return (function __$__2(__then) { if (__9) { return _("ServiceName is not a sub-path of the applicationName"); } else { __then(); } ; })(function __$__2() { progress = cli.interaction.progress($("Create service")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 20, 40, function ___(__0, __11) { config = __11; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 22, 79, function ___(__0, __12) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 22, 130, function ___(__0, __13) { client = new serviceFabricClient("3.0-preview", __12, __13); serviceDescription = { }; serviceDescription.applicationName = applicationName; serviceDescription.serviceName = serviceName; serviceDescription.serviceTypeName = serviceTypeName; serviceDescription.ServiceKind = serviceFabricUtils.getEnumVal("serviceKind", serviceKind); if ((serviceKind === "Stateless")) { serviceDescription.instanceCount = Number(options.instanceCount); } else { if ((serviceKind === "Stateful")) { serviceDescription.targetReplicaSetSize = Number(options.targetReplicaSetSize); serviceDescription.minReplicaSetSize = Number(options.minReplicaSetSize); if (options.hasPersistedState) { serviceDescription.hasPersistedState = true; } else { serviceDescription.hasPersistedState = false; } ; } ; } ; serviceDescription.partitionDescription = { partitionScheme: serviceFabricUtils.getEnumVal("partitionScheme", partitionScheme) }; if (options.partitionCount) { serviceDescription.partitionDescription.count = Number(options.partitionCount); } ; if (options.partitionNames) { serviceDescription.partitionDescription.names = JSON.parse(options.partitionNames); } ; if (options.partitionLowKey) { serviceDescription.partitionDescription.lowKey = options.partitionLowKey; } ; if (options.partitionHighKey) { serviceDescription.partitionDescription.highKey = options.partitionHighKey; } ; if (options.placementConstraints) { serviceDescription.placementConstraints = options.placementConstraints; } ; if (options.correlationSchema) { serviceDescription.correlationSchema = JSON.parse(options.correlationSchema); serviceDescription.correlationSchema.forEach(function(element) { if (element.serviceCorrelationScheme) { element.serviceCorrelationScheme = serviceFabricUtils.getEnumVal("serviceCorrelationScheme", element.serviceCorrelationScheme); } ; }); } ; if (options.serviceLoadMetrics) { serviceDescription.serviceLoadMetrics = JSON.parse(options.serviceLoadMetrics); } ; if (options.servicePlacementPolicyDescription) { serviceDescription.servicePlacementPolicyDescription = JSON.parse(options.servicePlacementPolicyDescription); serviceDescription.servicePlacementPolicyDescription.forEach(function(element) { if (element.type) { element.type = serviceFabricUtils.getEnumVal("servicePlacementPolicyType", element.type); } ; }); } ; return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 66, 60, function ___(__0, __14) { return client.services.create(__14, serviceDescription, options, __cb(_, __frame, 66, 34, function ___(__0, __15) { res = __15; progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__2() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__2() { _(); }); }); }); }, true)); }, true)); }); }, true)); }, true)); }, true)); }, true)); }); }); service.command("update [serviceName] [serviceKind]").description($("Update service, Example: azure servicefabric service update --service-name fabric:/app --instance-count 1")).option("-n --service-name <serviceName>", $("the name of the service")).option("-k --service-kind <serviceKind>", $("the kind of the service, values are [Stateless|Stateful]")).option("-c --instance-count <instanceCount>", $("the count of the instance")).option("-r --target-replica-set-size <targetReplicaSetSize>", $("the size of the target replica set")).option("-m --min-replica-set-size <minReplicaSetSize>", $("the size of the min replica set")).option("-i --replica-restart-wait-duration-in-milliseconds <replicaRestartWaitDurationInMilliseconds>", $("the milliseconds of the replica restart wait duration")).option("-d --quorum-loss-wait-duration-in-milliseconds <quorumLossWaitDurationInMilliseconds>", $("the milliseconds of the quorum loss wait duration")).option("-t --stand-by-replica-keep-duration-in-milliseconds <standByReplicaKeepDurationInMilliseconds>", $("the milliseconds of the stand by replica keep duration")).execute(function __3(serviceName, serviceKind, options, _) { var progress, config, client, updateServiceDescription, res; var __frame = { name: "__3", line: 179 }; return __func(_, this, arguments, __3, 3, __frame, function __$__3() { return cli.interaction.promptIfNotGiven("serviceName:", serviceName, __cb(_, __frame, 1, 36, function ___(__0, __1) { serviceName = __1; return cli.interaction.promptIfNotGiven("serviceKind:", serviceKind, __cb(_, __frame, 2, 36, function ___(__0, __2) { serviceKind = __2; progress = cli.interaction.progress($("Update service")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { 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); return serviceFabricUtils.parseUrl(serviceName, __cb(_, __frame, 10, 41, function ___(__0, __6) { serviceName = __6; updateServiceDescription = { }; if (serviceKind) { updateServiceDescription.ServiceKind = serviceFabricUtils.getEnumVal("serviceKind", serviceKind); } ; updateServiceDescription.flags = 0; if ((options.targetReplicaSetSize || options.instanceCount)) { updateServiceDescription.flags |= 1; } ; if (options.replicaRestartWaitDurationInMilliseconds) { updateServiceDescription.flags |= 2; } ; if (options.quorumLossWaitDurationInMilliseconds) { updateServiceDescription.flags |= 4; } ; if (options.standByReplicaKeepDurationInMilliseconds) { updateServiceDescription.flags |= 8; } ; if (options.minReplicaSetSize) { updateServiceDescription.flags |= 16; } ; if ((serviceKind === "Stateless")) { updateServiceDescription.instanceCount = Number(options.instanceCount); } else { if ((serviceKind === "Stateful")) { updateServiceDescription.targetReplicaSetSize = Number(options.targetReplicaSetSize); updateServiceDescription.minReplicaSetSize = Number(options.minReplicaSetSize); } ; } ; if (options.replicaRestartWaitDurationInMilliseconds) { updateServiceDescription.replicaRestartWaitDurationInMilliseconds = Number(options.replicaRestartWaitDurationInMilliseconds); } ; if (options.quorumLossWaitDurationInMilliseconds) { updateServiceDescription.quorumLossWaitDurationInMilliseconds = Number(options.quorumLossWaitDurationInMilliseconds); } ; if (options.standByReplicaKeepDurationInMilliseconds) { updateServiceDescription.standByReplicaKeepDurationInMilliseconds = Number(options.standByReplicaKeepDurationInMilliseconds); } ; return client.services.update(serviceName, updateServiceDescription, options, __cb(_, __frame, 39, 34, 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 __$__3() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__3() { _(); }); }); }, true)); }, true)); }); }); service.command("delete [serviceName]").description($("Delete service")).option("-n --service-name <serviceName>", $("the name of the service")).execute(function __4(serviceName, options, _) { var progress, config, client, res; var __frame = { name: "__4", line: 234 }; return __func(_, this, arguments, __4, 2, __frame, function __$__4() { return cli.interaction.promptIfNotGiven("serviceName", serviceName, __cb(_, __frame, 1, 36, function ___(__0, __1) { serviceName = __1; progress = cli.interaction.progress($("Delete service")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() { 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); return serviceFabricUtils.parseUrl(serviceName, __cb(_, __frame, 9, 41, function ___(__0, __5) { serviceName = __5; return client.services.remove(serviceName, options, __cb(_, __frame, 10, 34, 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 __$__4() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__4() { _(); }); }); }, true)); }); }); service.command("resolve [serviceName]").description($("Resolve service")).option("-n --service-name <serviceName>", $("the name of the service")).option("-t --partition-key-type <partitionKeyType>", $("the type of the partition key, values are [Singleton|Int64Range|Named]")).option("-k --partition-key-value <partitionKeyValue>", $("the value of the partition key")).option("-r --previous-rsp-version <previousRspVersion>", $("the version of the previous rsp")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __5(serviceName, options, _) { var progress, config, client, res; var __frame = { name: "__5", line: 264 }; return __func(_, this, arguments, __5, 2, __frame, function __$__5() { return cli.interaction.promptIfNotGiven("serviceName", serviceName, __cb(_, __frame, 1, 36, function ___(__0, __1) { serviceName = __1; progress = cli.interaction.progress($("Resolve service")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__5() { 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); return serviceFabricUtils.parseUrl(serviceName, __cb(_, __frame, 9, 41, function ___(__0, __5) { serviceName = __5; return client.services.resolve(serviceName, options, __cb(_, __frame, 10, 34, function ___(__0, __6) { res = __6; return (function __$__5(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 12, 35, function ___(__0, __7) { res = __7; __then(); }, true)); } else { __then(); } ; })(function __$__5() { serviceFabricUtils.setServiceEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__5() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__5() { _(); }); }); }, true)); }); }); var serviceTemplate = service.category("template").description($("Commands to manage your service template")); serviceTemplate.command("create [applicationName] [serviceName] [serviceTypeName]").description($("Create service from template")).option("-n --application-name <applicationName>", $("the name of the application")).option("-e --service-name <serviceName>", $("the name of the service")).option("-t --service-type-name <serviceTypeName>", $("the name of the service type")).execute(function __6(applicationName, serviceName, serviceTypeName, options, _) { var progress, config, client, serviceTemplate, res; var __frame = { name: "__6", line: 299 }; return __func(_, this, arguments, __6, 4, __frame, function __$__6() { return cli.interaction.promptIfNotGiven("applicationName", applicationName, __cb(_, __frame, 1, 40, function ___(__0, __1) { applicationName = __1; return cli.interaction.promptIfNotGiven("serviceName", serviceName, __cb(_, __frame, 2, 36, function ___(__0, __2) { serviceName = __2; return cli.interaction.promptIfNotGiven("serviceTypeName", serviceTypeName, __cb(_, __frame, 3, 40, function ___(__0, __3) { serviceTypeName = __3; progress = cli.interaction.progress($("Create service from template")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__6() { return serviceFabricUtils.readServiceFabricConfig(progress, __cb(_, __frame, 8, 40, function ___(__0, __4) { config = __4; return serviceFabricUtils.createConnectionUrl(config, __cb(_, __frame, 10, 79, function ___(__0, __5) { return serviceFabricUtils.getClientOptions(config, __cb(_, __frame, 10, 130, function ___(__0, __6) { client = new serviceFabricClient("3.0-preview", __5, __6); return serviceFabricUtils.parseUrl(applicationName, __cb(_, __frame, 11, 45, function ___(__0, __7) { applicationName = __7; serviceTemplate = { }; if (serviceName) { serviceTemplate.serviceName = serviceName; } ; if (serviceTypeName) { serviceTemplate.serviceTypeName = serviceTypeName; } ; return client.serviceFromTemplates.create(applicationName, serviceTemplate, options, __cb(_, __frame, 15, 46, 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 __$__6() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__6() { _(); }); }); }, true)); }, true)); }, true)); }); }); var serviceType = service.category("type").description($("Commands to manage your service manifest")); serviceType.command("show [applicationTypeName] [applicationTypeVersion]").description($("Show service type")).option("-n --application-type-name <applicationTypeName>", $("the type of the application type")).option("-t --application-type-version <applicationTypeVersion>", $("the version of the application type")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __7(applicationTypeName, applicationTypeVersion, options, _) { var progress, config, client, res; var __frame = { name: "__7", line: 335 }; return __func(_, this, arguments, __7, 3, __frame, function __$__7() { progress = cli.interaction.progress($("Show service type")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__7() { 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.serviceTypes.get(applicationTypeName, applicationTypeVersion, options, __cb(_, __frame, 7, 38, function ___(__0, __4) { res = __4; return (function __$__7(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 9, 35, function ___(__0, __5) { res = __5; __then(); }, true)); } else { __then(); } ; })(function __$__7() { serviceFabricUtils.setServiceEnumVal(res); 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() { _(); }); }); }); }); var serviceTypeDeployed = serviceType.category("deployed").description($("Commands to manage your deployed service type")); serviceTypeDeployed.command("show [nodeName] [applicationName]").description($("Show deployed service type")).option("-n --node-name <nodeName>", $("the name of the node")).option("-a --application-name <applicationName>", $("the name of the application")).option("-p --service-package-name <servicePackageName>", $("the name of the service package")).option("-l --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 __8(nodeName, applicationName, options, _) { var progress, config, client, res; var __frame = { name: "__8", line: 370 }; return __func(_, this, arguments, __8, 3, __frame, function __$__8() { progress = cli.interaction.progress($("ShowDeployedServicePackage")); 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.deployedServicePackages.get(nodeName, applicationName, options, __cb(_, __frame, 8, 49, 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.setServiceEnumVal(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() { _(); }); }); }); }); var serviceManifest = service.category("manifest").description($("Commands to manage your service manifest")); serviceManifest.command("show [applicationTypeName] [applicationTypeVersion] [serviceManifestName]").description($("Show service manifest")).option("-n --application-type-name <applicationTypeName>", $("the type of the application type")).option("-t --application-type-version <applicationTypeVersion>", $("the version of the application type")).option("-m --service-manifest-name <serviceManifestName>", $("the name of the service manifest")).execute(function __9(applicationTypeName, applicationTypeVersion, serviceManifestName, options, _) { var progress, config, client, res; var __frame = { name: "__9", line: 403 }; return __func(_, this, arguments, __9, 4, __frame, function __$__9() { progress = cli.interaction.progress($("Show service manifest")); 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); return client.serviceManifests.get(applicationTypeName, applicationTypeVersion, serviceManifestName, options, __cb(_, __frame, 7, 42, function ___(__0, __4) { res = __4; return (function __$__9(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 9, 35, function ___(__0, __5) { res = __5; __then(); }, true)); } else { __then(); } ; })(function __$__9() { serviceFabricUtils.setServiceEnumVal(res); 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 serviceDescription = service.category("description").description($("Commands to manage your service")); serviceDescription.command("show [serviceName]").description($("Show service description")).option("-n --service-name <serviceName>", $("the name of the service")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __10(serviceName, options, _) { var progress, config, client, res; var __frame = { name: "__10", line: 434 }; return __func(_, this, arguments, __10, 2, __frame, function __$__10() { progress = cli.interaction.progress($("Show service description")); 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); return serviceFabricUtils.parseUrl(serviceName, __cb(_, __frame, 7, 41, function ___(__0, __4) { serviceName = __4; return client.serviceDescriptions.get(serviceName, options, __cb(_, __frame, 8, 45, function ___(__0, __5) { res = __5; return (function __$__10(__then) { if (options.select) { return serviceFabricUtils.pick(res, options.select, __cb(_, __frame, 10, 35, function ___(__0, __6) { res = __6; __then(); }, true)); } else { __then(); } ; })(function __$__10() { serviceFabricUtils.setServiceEnumVal(res); progress.end(); cli.interaction.formatOutput(res, function(data) { log.json(data); }); __then(); }); }, true)); }, true)); }, true)); }, true)); }, true)); }); })(function ___(e, __result) { __catch(function __$__10() { if (e) { progress.end(); return _(e); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__10() { _(); }); }); }); }); var serviceHealth = service.category("health").description($("Commands to manage your service")); serviceHealth.command("show [serviceName]").description($("Show service health")).option("-n --service-name <serviceName>", $("the name of the service")).option("--select <fields>", $("select fields to show, call without this parameter to see all fields")).execute(function __11(serviceName, options, _) { var progress, config, client, res; var __frame = { name: "__11", line: 466 }; return __func(_, this, arguments, __11, 2, __frame, function __$__11() { progress = cli.interaction.progress($("Show service description")); 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(serviceName, __cb(_, __frame, 7, 41, function ___(__0, __4) { serviceName = __4; return client.serviceHealths.get(serviceName, options, __cb(_, __frame, 8, 40, 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.setServiceEnumVal(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() { _(); }); }); }); }); serviceHealth.command("send [serviceName] [sourceId] [property] [healthState]").description($("Send service health, Example: azure servicefabric service health send --service-name fabric:/app/svc fabric:app --source-id monitor --property pc --health-state Ok --description healthy")).option("-n --service-name <serviceName>", $("the id of the partition")).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")).execute(function __12(serviceName, sourceId, property, healthState, options, _) { var progress, config, client, serviceHealthReport, res; var __frame = { name: "__12", line: 501 }; return __func(_, this, arguments, __12, 5, __frame, function __$__12() { progress = cli.interaction.progress($("Send service 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, 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(serviceName, __cb(_, __frame, 7, 41, function ___(__0, __4) { serviceName = __4; serviceHealthReport = { }; if (sourceId) { serviceHealthReport.sourceId = sourceId; } ; if (property) { serviceHealthReport.property = property; } ; if (healthState) { serviceHealthReport.healthState = serviceFabricUtils.getEnumVal("healthState", healthState); } ; if (options.description) { serviceHealthReport.description = options.description; } ; if (options.timeToLiveInMilliseconds) { serviceHealthReport.timeToLiveInMilliSeconds = options.timeToLiveInMilliseconds; } ; if (options.sequenceNumber) { serviceHealthReport.sequenceNumber = options.sequenceNumber; } ; if (options.removeWhenExpired) { serviceHealthReport.removeWhenExpired = true; } ; return client.serviceHealths.send(serviceName, serviceHealthReport, options, __cb(_, __frame, 18, 40, 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() { _(); }); }); }); });};