azure-cli
Version:
Microsoft Azure Cross Platform Command Line tool
484 lines (221 loc) • 30.6 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,__catch=__rt.__catch,__tryCatch=__rt.__tryCatch; var generatorUtils = require("../../../util/generatorUtils");
var tagUtils = require("../tag/tagUtils");
var util = require("util");
var validation = require("../../../util/validation");
var profile = require("../../../util/profile");
var utils = require("../../../util/utils");
var $ = utils.getLocaleString;
exports.init = function(cli) {
var network = cli.category("network").description($("Commands to manage network resources"));
var trafficManager = network.category("traffic-manager").description($("Commands to manage Traffic Manager"));
var profiles = trafficManager.category("profile").description($("Commands to manage profiles"));
var defaultProfileStatus = "Enabled";
var defaultTrafficRoutingMethod = "Performance";
var defaultTtl = "300";
var defaultProtocol = "HTTP";
var defaultPort = "80";
var defaultIntervalInSeconds = "30";
var defaultTimeoutInSeconds = "10";
var defaultToleratedNumberOfFailures = "3";
var defaultType = "Microsoft.Network/trafficManagerProfiles";
profiles.command("create [resource-group] [name] [relative-dns-name]").description($("Create a profile")).usage("[options] <resource-group> <name> <relative-dns-name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the profile")).option("-u, --profile-status [profile-status]", $(("the status of the Traffic Manager" + "\n profile"))).option("-m, --traffic-routing-method [traffic-routing-method]", $(("the traffic routing method of the" + "\n Traffic Manager profile"))).option("-r, --relative-dns-name <relative-dns-name>", $(((("the relative DNS name provided by this" + "\n Traffic Manager profile. This value is combined with the DNS domain name used") + "\n by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the") + "\n profile"))).option("-l, --ttl [ttl]", $((("the DNS Time-To-Live (TTL), in seconds." + "\n This informs the local DNS resolvers and DNS clients how long to cache DNS") + "\n responses provided by this Traffic Manager profile"))).option("-p, --monitor-protocol [monitor-protocol]", $(("the protocol (HTTP, HTTPS or TCP) used" + "\n to probe for endpoint health"))).option("-o, --monitor-port [monitor-port]", $(("the TCP port used to probe for endpoint" + "\n health"))).option("-a, --monitor-path [monitor-path]", $(("the path relative to the endpoint" + "\n domain name used to probe for endpoint health"))).option("-e, --interval-in-seconds [interval-in-seconds]", $((("the monitor interval for endpoints in" + "\n this profile. This is the interval at which Traffic Manager will check the") + "\n health of each endpoint in this profile"))).option("-i, --timeout-in-seconds [timeout-in-seconds]", $((("the monitor timeout for endpoints in" + "\n this profile. This is the time that Traffic Manager allows endpoints in this") + "\n profile to response to the health check"))).option("-f, --tolerated-number-of-failures [tolerated-number-of-failures]", $((("the number of consecutive failed health" + "\n check that Traffic Manager tolerates before declaring an endpoint in this") + "\n profile Degraded after the next failed health check"))).option("-t, --tags [tags]", $("the list of tags.\n Can be multiple. In the format of \"name=value\".\n Name is required and value is optional.\n For example, -t \"tag1=value1;tag2\"")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __1(resourceGroup, name, relativeDnsName, options, _) { var useDefaults, subscription, trafficManagerManagementClient, profileResultVar, progress, parameters; var __frame = { name: "__1", line: 84 }; return __func(_, this, arguments, __1, 4, __frame, function __$__1() {
useDefaults = true;
return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __1) { resourceGroup = __1;
return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 3, 29, function ___(__0, __2) { name = __2;
return cli.interaction.promptIfNotGiven($("relative dns name : "), relativeDnsName, __cb(_, __frame, 4, 48, function ___(__0, __3) { options.relativeDnsName = __3;
subscription = profile.current.getSubscription(options.subscription);
trafficManagerManagementClient = utils.createTrafficManagerManagementClient(subscription);
progress = cli.interaction.progress(util.format($("Looking up the profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() {
return trafficManagerManagementClient.profiles.get(resourceGroup, name, null, __cb(_, __frame, 12, 67, function ___(__0, __4) { profileResultVar = __4; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__1() { if (e) {
if ((e.statusCode === 404)) {
profileResultVar = null; }
else {
return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__1() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__1() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__1() {
if (profileResultVar) {
return _(new Error(util.format($("profile with name \"%s\" already exists in the resource group \"%s\""), name, resourceGroup))); } ;
parameters = { };
parameters.location = "global";
if (options.profileStatus) {
parameters.profileStatus = validation.isIn(options.profileStatus, ["Enabled","Disabled",], "--profile-status"); } else {
if (useDefaults) {
parameters.profileStatus = defaultProfileStatus; } ; } ;
if (options.trafficRoutingMethod) {
parameters.trafficRoutingMethod = validation.isIn(options.trafficRoutingMethod, ["Performance","Priority","Weighted","Geographic",], "--traffic-routing-method"); } else {
if (useDefaults) {
parameters.trafficRoutingMethod = defaultTrafficRoutingMethod; } ; } ;
if (!parameters.dnsConfig) {
parameters.dnsConfig = { }; } ;
if (options.relativeDnsName) {
parameters.dnsConfig.relativeName = options.relativeDnsName; } ;
if (options.ttl) {
parameters.dnsConfig.ttl = parseInt(options.ttl, 10); } else {
if (useDefaults) {
parameters.dnsConfig.ttl = parseInt(defaultTtl, 10); } ; } ;
if (!parameters.monitorConfig) {
parameters.monitorConfig = { }; } ;
if (options.monitorProtocol) {
parameters.monitorConfig.protocol = validation.isIn(options.monitorProtocol, ["HTTP","HTTPS","TCP",], "--monitor-protocol"); } else {
if (useDefaults) {
parameters.monitorConfig.protocol = defaultProtocol; } ; } ;
if (options.monitorPort) {
parameters.monitorConfig.port = parseInt(options.monitorPort, 10); } else {
if (useDefaults) {
parameters.monitorConfig.port = parseInt(defaultPort, 10); } ; } ;
if (options.monitorPath) {
parameters.monitorConfig.path = options.monitorPath; } ;
if (options.intervalInSeconds) {
parameters.monitorConfig.intervalInSeconds = parseInt(options.intervalInSeconds, 10); } else {
if (useDefaults) {
parameters.monitorConfig.intervalInSeconds = parseInt(defaultIntervalInSeconds, 10); } ; } ;
if (options.timeoutInSeconds) {
parameters.monitorConfig.timeoutInSeconds = parseInt(options.timeoutInSeconds, 10); } else {
if (useDefaults) {
parameters.monitorConfig.timeoutInSeconds = parseInt(defaultTimeoutInSeconds, 10); } ; } ;
if (options.toleratedNumberOfFailures) {
parameters.monitorConfig.toleratedNumberOfFailures = parseInt(options.toleratedNumberOfFailures, 10); } else {
if (useDefaults) {
parameters.monitorConfig.toleratedNumberOfFailures = parseInt(defaultToleratedNumberOfFailures, 10); } ; } ;
if ((options.tags && utils.argHasValue(options.tags))) {
tagUtils.appendTags(parameters, options); } ;
generatorUtils.removeEmptyObjects(parameters);
progress = cli.interaction.progress(util.format($("Creating profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__1() {
return trafficManagerManagementClient.profiles.createOrUpdate(resourceGroup, name, parameters, __cb(_, __frame, 99, 67, function ___(__0, __5) { profileResultVar = __5; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__1() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__1() {
cli.interaction.formatOutput(profileResultVar, generatorUtils.traverse); _(); }); }); }); }); }, true)); }, true)); }, true)); }); });
profiles.command("set [resource-group] [name]").description($("Update a profile")).usage("[options] <resource-group> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the profile")).option("-u, --profile-status [profile-status]", $(("the status of the Traffic Manager" + "\n profile"))).option("-m, --traffic-routing-method [traffic-routing-method]", $(("the traffic routing method of the" + "\n Traffic Manager profile"))).option("-r, --relative-dns-name [relative-dns-name]", $(((("the relative DNS name provided by this" + "\n Traffic Manager profile. This value is combined with the DNS domain name used") + "\n by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the") + "\n profile"))).option("-l, --ttl [ttl]", $((("the DNS Time-To-Live (TTL), in seconds." + "\n This informs the local DNS resolvers and DNS clients how long to cache DNS") + "\n responses provided by this Traffic Manager profile"))).option("-p, --monitor-protocol [monitor-protocol]", $(("the protocol (HTTP, HTTPS or TCP) used" + "\n to probe for endpoint health"))).option("-o, --monitor-port [monitor-port]", $(("the TCP port used to probe for endpoint" + "\n health"))).option("-a, --monitor-path [monitor-path]", $(("the path relative to the endpoint" + "\n domain name used to probe for endpoint health"))).option("-e, --interval-in-seconds [interval-in-seconds]", $((("the monitor interval for endpoints in" + "\n this profile. This is the interval at which Traffic Manager will check the") + "\n health of each endpoint in this profile"))).option("-i, --timeout-in-seconds [timeout-in-seconds]", $((("the monitor timeout for endpoints in" + "\n this profile. This is the time that Traffic Manager allows endpoints in this") + "\n profile to response to the health check"))).option("-f, --tolerated-number-of-failures [tolerated-number-of-failures]", $((("the number of consecutive failed health" + "\n check that Traffic Manager tolerates before declaring an endpoint in this") + "\n profile Degraded after the next failed health check"))).option("-t, --tags [tags]", $("the list of tags.\n Can be multiple. In the format of \"name=value\".\n Name is required and value is optional.\n For example, -t \"tag1=value1;tag2\"")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __2(resourceGroup, name, options, _) { var useDefaults, subscription, trafficManagerManagementClient, profileResultVar, progress, parameters; var __frame = { name: "__2", line: 224 }; return __func(_, this, arguments, __2, 3, __frame, function __$__2() {
useDefaults = false;
return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 2, 38, function ___(__0, __1) { resourceGroup = __1;
return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 3, 29, function ___(__0, __2) { name = __2;
subscription = profile.current.getSubscription(options.subscription);
trafficManagerManagementClient = utils.createTrafficManagerManagementClient(subscription);
progress = cli.interaction.progress(util.format($("Looking up the profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() {
return trafficManagerManagementClient.profiles.get(resourceGroup, name, null, __cb(_, __frame, 11, 67, function ___(__0, __3) { profileResultVar = __3; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__2() { if (e) {
if ((e.statusCode === 404)) {
profileResultVar = null; }
else {
return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__2() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__2() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__2() {
if (!profileResultVar) {
return _(new Error(util.format($("profile with name \"%s\" not found in the resource group \"%s\""), name, resourceGroup))); } ;
parameters = profileResultVar;
if (options.profileStatus) {
parameters.profileStatus = validation.isIn(options.profileStatus, ["Enabled","Disabled",], "--profile-status"); } else {
if (useDefaults) {
parameters.profileStatus = defaultProfileStatus; } ; } ;
if (options.trafficRoutingMethod) {
parameters.trafficRoutingMethod = validation.isIn(options.trafficRoutingMethod, ["Performance","Priority","Weighted","Geographic",], "--traffic-routing-method"); } else {
if (useDefaults) {
parameters.trafficRoutingMethod = defaultTrafficRoutingMethod; } ; } ;
if (!parameters.dnsConfig) {
parameters.dnsConfig = { }; } ;
if (options.relativeDnsName) {
parameters.dnsConfig.relativeName = options.relativeDnsName; } ;
if (options.ttl) {
parameters.dnsConfig.ttl = parseInt(options.ttl, 10); } else {
if (useDefaults) {
parameters.dnsConfig.ttl = parseInt(defaultTtl, 10); } ; } ;
if (!parameters.monitorConfig) {
parameters.monitorConfig = { }; } ;
if (options.monitorProtocol) {
parameters.monitorConfig.protocol = validation.isIn(options.monitorProtocol, ["HTTP","HTTPS","TCP",], "--monitor-protocol"); } else {
if (useDefaults) {
parameters.monitorConfig.protocol = defaultProtocol; } ; } ;
if (options.monitorPort) {
parameters.monitorConfig.port = parseInt(options.monitorPort, 10); } else {
if (useDefaults) {
parameters.monitorConfig.port = parseInt(defaultPort, 10); } ; } ;
if (options.monitorPath) {
parameters.monitorConfig.path = options.monitorPath; } ;
if (options.intervalInSeconds) {
parameters.monitorConfig.intervalInSeconds = parseInt(options.intervalInSeconds, 10); } else {
if (useDefaults) {
parameters.monitorConfig.intervalInSeconds = parseInt(defaultIntervalInSeconds, 10); } ; } ;
if (options.timeoutInSeconds) {
parameters.monitorConfig.timeoutInSeconds = parseInt(options.timeoutInSeconds, 10); } else {
if (useDefaults) {
parameters.monitorConfig.timeoutInSeconds = parseInt(defaultTimeoutInSeconds, 10); } ; } ;
if (options.toleratedNumberOfFailures) {
parameters.monitorConfig.toleratedNumberOfFailures = parseInt(options.toleratedNumberOfFailures, 10); } else {
if (useDefaults) {
parameters.monitorConfig.toleratedNumberOfFailures = parseInt(defaultToleratedNumberOfFailures, 10); } ; } ;
if ((options.tags && utils.argHasValue(options.tags))) {
tagUtils.appendTags(parameters, options); } ;
generatorUtils.removeEmptyObjects(parameters);
progress = cli.interaction.progress(util.format($("Updating profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__2() {
return trafficManagerManagementClient.profiles.createOrUpdate(resourceGroup, name, parameters, __cb(_, __frame, 96, 67, function ___(__0, __4) { profileResultVar = __4; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__2() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__2() {
cli.interaction.formatOutput(profileResultVar, generatorUtils.traverse); _(); }); }); }); }); }, true)); }, true)); }); });
profiles.command("delete [resource-group] [name]").description($("Delete a profile")).usage("[options] <resource-group> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the profile")).option("-q, --quiet", $("quiet mode, do not ask for delete confirmation")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __3(resourceGroup, name, options, _) { var subscription, trafficManagerManagementClient, profileResultVar, progress; var __frame = { name: "__3", line: 335 }; return __func(_, this, arguments, __3, 3, __frame, function __$__3() {
return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 1, 38, function ___(__0, __2) { resourceGroup = __2;
return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 2, 29, function ___(__0, __3) { name = __3;
subscription = profile.current.getSubscription(options.subscription);
trafficManagerManagementClient = utils.createTrafficManagerManagementClient(subscription);
progress = cli.interaction.progress(util.format($("Looking up the profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() {
return trafficManagerManagementClient.profiles.get(resourceGroup, name, null, __cb(_, __frame, 10, 67, function ___(__0, __4) { profileResultVar = __4; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__3() { if (e) {
if ((e.statusCode === 404)) {
profileResultVar = null; }
else {
return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__3() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__3() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__3() {
if (!profileResultVar) {
return _(new Error(util.format($("profile with name \"%s\" not found in the resource group \"%s\""), name, resourceGroup))); } ; return (function __$__3(_) {
var __1 = !options.quiet; if (!__1) { return _(null, __1); } ; return cli.interaction.confirm(util.format($("Delete profile \"%s\"? [y/n] "), name), __cb(_, __frame, 25, 45, function ___(__0, __3) { var __2 = !__3; return _(null, __2); }, true)); })(__cb(_, __frame, -334, 17, function ___(__0, __5) { return (function __$__3(__then) { if (__5) {
cli.output.info(util.format($("profile \"%s\" was not deleted and still exists in the resource group \"%s\""), name, resourceGroup)); return _(null); } else { __then(); } ; })(function __$__3() {
progress = cli.interaction.progress(util.format($("Deleting profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__3() {
return trafficManagerManagementClient.profiles.deleteMethod(resourceGroup, name, __cb(_, __frame, 32, 67, function ___(__0, __6) { profileResultVar = __6;
cli.output.info(util.format($("profile \"%s\" was successfully deleted from resource group \"%s\""), name, resourceGroup)); _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__3() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__3() { _(); }); }); }); }, true)); }); }); }, true)); }, true)); }); });
profiles.command("show [resource-group] [name]").description($("Show a profile")).usage("[options] <resource-group> <name>").option("-g, --resource-group <resource-group>", $("the name of the resource group")).option("-n, --name <name>", $("the name of the profile")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __4(resourceGroup, name, options, _) { var subscription, trafficManagerManagementClient, profileResultVar, progress; var __frame = { name: "__4", line: 380 }; return __func(_, this, arguments, __4, 3, __frame, function __$__4() {
return cli.interaction.promptIfNotGiven($("resource group : "), resourceGroup, __cb(_, __frame, 1, 38, function ___(__0, __1) { resourceGroup = __1;
return cli.interaction.promptIfNotGiven($("name : "), name, __cb(_, __frame, 2, 29, function ___(__0, __2) { name = __2;
subscription = profile.current.getSubscription(options.subscription);
trafficManagerManagementClient = utils.createTrafficManagerManagementClient(subscription);
progress = cli.interaction.progress(util.format($("Looking up the profile \"%s\""), name)); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() { return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__4() {
return trafficManagerManagementClient.profiles.get(resourceGroup, name, null, __cb(_, __frame, 10, 67, function ___(__0, __3) { profileResultVar = __3; __then(); }, true)); }); })(function ___(e, __result) { __catch(function __$__4() { if (e) {
if ((e.statusCode === 404)) {
profileResultVar = null; }
else {
return _(e); } ; __then(); } else { _(null, __result); } ; }, _); }); })(function ___() { __tryCatch(_, function __$__4() { _(null, null, true); }); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__4() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__4() {
if (!profileResultVar) {
cli.output.warn(util.format($("profile with name \"%s\" not found in the resource group \"%s\""), name, resourceGroup)); } ;
cli.interaction.formatOutput(profileResultVar, generatorUtils.traverse); _(); }); }); }, true)); }, true)); }); });
profiles.command("list [resource-group]").description($("List profile")).usage("[options] <resource-group>").option("-g, --resource-group [resource-group]", $("the name of the resource group")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __5(resourceGroup, options, _) { var subscription, trafficManagerManagementClient, profileResultVar, progress; var __frame = { name: "__5", line: 413 }; return __func(_, this, arguments, __5, 2, __frame, function __$__5() {
options.resourceGroup = resourceGroup;
subscription = profile.current.getSubscription(options.subscription);
trafficManagerManagementClient = utils.createTrafficManagerManagementClient(subscription);
profileResultVar = null; return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__5() { return (function __$__5(__then) {
if ((typeof trafficManagerManagementClient.profiles.listAll != "function")) {
return cli.interaction.promptIfNotGiven($("resource-group : "), resourceGroup, __cb(_, __frame, 9, 42, function ___(__0, __1) { resourceGroup = __1;
progress = cli.interaction.progress($("Getting the profile"));
return trafficManagerManagementClient.profiles.listAllInResourceGroup(resourceGroup, __cb(_, __frame, 11, 69, function ___(__0, __2) { profileResultVar = __2; __then(); }, true)); }, true)); } else { return (function __$__5(__then) {
if (options.resourceGroup) {
progress = cli.interaction.progress($("Getting the profile"));
return trafficManagerManagementClient.profiles.listAllInResourceGroup(resourceGroup, __cb(_, __frame, 15, 71, function ___(__0, __3) { profileResultVar = __3; __then(); }, true)); } else {
progress = cli.interaction.progress($("Getting the profile"));
return trafficManagerManagementClient.profiles.listAll(__cb(_, __frame, 18, 71, function ___(__0, __4) { profileResultVar = __4; __then(); }, true)); } ; })(__then); } ; })(function __$__5() { _(null, null, true); }); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__5() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__5() {
cli.interaction.formatOutput(profileResultVar, function(profileResultVar) {
if ((!profileResultVar || (profileResultVar.length === 0))) {
cli.output.warn($("No profile found")); }
else {
cli.output.table(profileResultVar, function(row, item) {
generatorUtils.showTableRow(row, item); }); } ; }); _(); }); }); }); });
profiles.command("is-dns-available [relative-dns-name]").description($("Perform check traffic manager relative dns name availability operation on a profile")).usage("[options] <relative-dns-name>").option("-r, --relative-dns-name <relative-dns-name>", $("The name of profile.")).option("-y, --type [type]", $("the type of the resource")).option("-s, --subscription <subscription>", $("the subscription identifier")).execute(function __6(relativeDnsName, options, _) { var useDefaults, subscription, trafficManagerManagementClient, profileResultVar, parameters, progress; var __frame = { name: "__6", line: 455 }; return __func(_, this, arguments, __6, 2, __frame, function __$__6() {
useDefaults = true;
return cli.interaction.promptIfNotGiven($("relative dns name : "), relativeDnsName, __cb(_, __frame, 2, 48, function ___(__0, __1) { options.relativeDnsName = __1;
subscription = profile.current.getSubscription(options.subscription);
trafficManagerManagementClient = utils.createTrafficManagerManagementClient(subscription);
parameters = { };
if (options.relativeDnsName) {
parameters.name = options.relativeDnsName; } ;
if (options.type) {
parameters.type = options.type; } else {
if (useDefaults) {
parameters.type = defaultType; } ; } ;
generatorUtils.removeEmptyObjects(parameters);
progress = cli.interaction.progress($("Performing check traffic manager relative dns name availability operation")); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$__6() {
return trafficManagerManagementClient.profiles.checkTrafficManagerRelativeDnsNameAvailability(parameters, __cb(_, __frame, 23, 67, function ___(__0, __2) { profileResultVar = __2; _(null, null, true); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$__6() {
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$__6() {
cli.interaction.formatOutput(profileResultVar, generatorUtils.traverse); _(); }); }); }, true)); }); });};