Permalink
Browse files

Merge pull request #3560 from Azure/release-0.10.12

Integrating from release to master as a part of Release 0.10.12
  • Loading branch information...
2 parents cab7cd4 + 2cfb089 commit 13afb5fa206b60988664773065645234e81b946b @balajikris balajikris committed on GitHub Apr 13, 2017
Showing 304 changed files with 56,948 additions and 21,612 deletions.
View
@@ -1,3 +1,17 @@
+##2017-04-05 Version 0.10.12
+* Storage
+ * Upgraded azure-storage to 2.1.0 #3544
+ * Added --incremental parameter to azure storage blob copy start command to support page blob incremental copy #3544
+* General
+ * fixed sinon.stub warnings by changing to the new signature #3547
+ * Handled the os.networkInterfaces() exception thrown while getting the host nic on win10 bash subsystem
+* TrafficManager
+ * Added api-version=2017-03-01 #3543
+ * Added geo mapping for endpoints #3543
+* Compute (ASM)
+ * Added new CLI command "initiate-maintenance" for a new API called "PerformMaintenance" #3542
+ * Added MaintenanceStatus field in the GetDeployment response #3542
+
##2017-03-14 Version 0.10.11 (npm only - hotfix)
* General
* Added a SHA-256 hash of macAddress to userAgent header, per VS Telemetry standard #3520
View
@@ -82,6 +82,7 @@
<Compile Include="lib\commands\arm\datalakestore\datalakestore.utils.js" />
<Compile Include="lib\util\authentication\adalAuthForUser.js" />
<Compile Include="lib\util\authentication\adalAuthForServicePrincipal.js" />
+ <Compile Include="lib\util\cliUserAgentFilter.js" />
<Compile Include="lib\util\interaction.js" />
<Compile Include="lib\util\profile\account.js" />
<Compile Include="lib\util\storage.util.js" />
@@ -257,6 +258,11 @@
<Compile Include="test\commands\cli.storage.service-tests.js" />
<Compile Include="test\commands\cli.storage.table-tests.js" />
<Compile Include="test\commands\cli.telemetry-test.js" />
+ <Compile Include="test\commands\cli.useragent-test.js" />
+ <Compile Include="test\commands\cli.useragentfilter-test.js">
+ <TestFramework>
+ </TestFramework>
+ </Compile>
<Compile Include="test\commands\cli.vm.acl-tests.js" />
<Compile Include="test\commands\cli.vm.capture-tests.js" />
<Compile Include="test\commands\cli.vm.create_affin_vnet_vm-tests.js" />
@@ -284,6 +290,7 @@
<Compile Include="test\commands\cli.vm.extension_set-custom_disable.js" />
<Compile Include="test\commands\cli.vm.extension_set-tests.js" />
<Compile Include="test\commands\cli.vm.image-tests.js" />
+ <Compile Include="test\commands\cli.vm.initiate-maintenance-tests.js" />
<Compile Include="test\commands\cli.vm.list_show-tests.js" />
<Compile Include="test\commands\cli.vm.loadbalancer-tests.js" />
<Compile Include="test\commands\cli.vm.negative-tests.js">
@@ -0,0 +1,236 @@
+/**
+ * Copyright (c) Microsoft. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Warning: This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if the
+// code is regenerated.
+
+'use strict';
+
+var generatorUtils = require('../../../util/generatorUtils');
+var resourceUtils = require('../resource/resourceUtils');
+var util = require('util');
+
+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 loadBalancers = network.category('lb')
+ .description($('Commands to manage load balancers'));
+ var backendAddressPools = loadBalancers.category('address-pool')
+ .description($('Commands to manage backend address pools'));
+
+ backendAddressPools.command('create [resource-group] [lb-name] [name]')
+ .description($('Create a backend address pools'))
+ .usage('[options] <resource-group> <lb-name> <name>')
+ .option('-g, --resource-group <resource-group>', $('the name of the resource group'))
+ .option('-l, --lb-name <lb-name>', $('the lb name'))
+ .option('-n, --name <name>', $('the name of the backend address pool'))
+ .option('-s, --subscription <subscription>', $('the subscription identifier'))
+ .execute(function(resourceGroup, lbName, name, options, _) {
+ resourceGroup = cli.interaction.promptIfNotGiven($('resource group : '), resourceGroup, _);
+ lbName = cli.interaction.promptIfNotGiven($('lb name : '), lbName, _);
+ name = cli.interaction.promptIfNotGiven($('name : '), name, _);
+
+ var subscription = profile.current.getSubscription(options.subscription);
+ var networkManagementClient = utils.createNetworkManagementClient(subscription);
+
+ var index = 0;
+ var loadBalancer;
+ var progress = cli.interaction.progress(util.format($('Looking up the load balancer "%s"'), lbName));
+ try {
+ loadBalancer = networkManagementClient.loadBalancers.get(resourceGroup, lbName, null, _);
+ } catch (e) {
+ if (e.statusCode === 404) {
+ loadBalancer = null;
+ } else {
+ throw e;
+ }
+ } finally {
+ progress.end();
+ }
+
+ if (!loadBalancer) {
+ throw new Error(util.format($('load balancer with name "%s" not found in the resource group "%s"'), lbName, resourceGroup));
+ }
+
+ if(utils.findFirstCaseIgnore(loadBalancer.backendAddressPools, {name: name})) {
+ throw new Error(util.format($('backend address pools with name "%s" already exists in the "%s"'), name, lbName));
+ }
+
+ var parameters = {};
+
+ if(!parameters.backendAddressPools) {
+ parameters.backendAddressPools = [];
+ }
+ if(!parameters.backendAddressPools[index]) {
+ parameters.backendAddressPools[index] = {};
+ }
+
+ parameters.backendAddressPools[index].name = name;
+ loadBalancer.backendAddressPools.push(parameters.backendAddressPools[index]);
+
+ generatorUtils.removeEmptyObjects(parameters);
+ progress = cli.interaction.progress(util.format($('Creating backend address pools in "%s"'), lbName));
+ try {
+ loadBalancer = networkManagementClient.loadBalancers.createOrUpdate(resourceGroup, lbName, loadBalancer, _);
+ } finally {
+ progress.end();
+ }
+
+ cli.interaction.formatOutput(loadBalancer.backendAddressPools[generatorUtils.findIndexByKeyValue(loadBalancer.backendAddressPools, 'name', name)], generatorUtils.traverse);
+ });
+
+ backendAddressPools.command('delete [resource-group] [lb-name] [name]')
+ .description($('Delete a backend address pools'))
+ .usage('[options] <resource-group> <lb-name> <name>')
+ .option('-g, --resource-group <resource-group>', $('the name of the resource group'))
+ .option('-l, --lb-name <lb-name>', $('the lb name'))
+ .option('-n, --name <name>', $('the name of the backend address pool'))
+ .option('-q, --quiet', $('quiet mode, do not ask for delete confirmation'))
+ .option('-s, --subscription <subscription>', $('the subscription identifier'))
+ .execute(function(resourceGroup, lbName, name, options, _) {
+ resourceGroup = cli.interaction.promptIfNotGiven($('resource group : '), resourceGroup, _);
+ lbName = cli.interaction.promptIfNotGiven($('lb name : '), lbName, _);
+ name = cli.interaction.promptIfNotGiven($('name : '), name, _);
+
+ var subscription = profile.current.getSubscription(options.subscription);
+ var networkManagementClient = utils.createNetworkManagementClient(subscription);
+
+ var loadBalancer;
+ var progress = cli.interaction.progress(util.format($('Looking up the load balancer "%s"'), lbName));
+ try {
+ loadBalancer = networkManagementClient.loadBalancers.get(resourceGroup, lbName, null, _);
+ } catch (e) {
+ if (e.statusCode === 404) {
+ loadBalancer = null;
+ } else {
+ throw e;
+ }
+ } finally {
+ progress.end();
+ }
+
+ if (!loadBalancer) {
+ throw new Error(util.format($('load balancer "%s" not found in the resource group "%s"'), lbName, resourceGroup));
+ }
+
+ var index = utils.indexOfCaseIgnore(loadBalancer.backendAddressPools, {name: name});
+ if (index === -1) {
+ throw new Error(util.format($('backend address pools "%s" not found in the lbName "%s"'), name, loadBalancer.name));
+ }
+
+ if (!options.quiet && !cli.interaction.confirm(util.format($('Delete backend address pools with name "%s" from "%s"? [y/n] '), name, lbName), _)) {
+ return;
+ }
+
+ loadBalancer.backendAddressPools.splice(index, 1);
+ progress = cli.interaction.progress('Deleting backend address pools');
+ try {
+ loadBalancer = networkManagementClient.loadBalancers.createOrUpdate(resourceGroup, lbName, loadBalancer, _);
+ } finally {
+ progress.end();
+ }
+ });
+
+ backendAddressPools.command('show [resource-group] [lb-name] [name]')
+ .description($('Show a backend address pools'))
+ .usage('[options] <resource-group> <lb-name> <name>')
+ .option('-g, --resource-group <resource-group>', $('the name of the resource group'))
+ .option('-l, --lb-name <lb-name>', $('the lb name'))
+ .option('-n, --name <name>', $('the name of the backend address pool'))
+ .option('-s, --subscription <subscription>', $('the subscription identifier'))
+ .execute(function(resourceGroup, lbName, name, options, _) {
+ resourceGroup = cli.interaction.promptIfNotGiven($('resource group : '), resourceGroup, _);
+ lbName = cli.interaction.promptIfNotGiven($('lb name : '), lbName, _);
+ name = cli.interaction.promptIfNotGiven($('name : '), name, _);
+
+ var subscription = profile.current.getSubscription(options.subscription);
+ var networkManagementClient = utils.createNetworkManagementClient(subscription);
+
+ var loadBalancer;
+ var progress = cli.interaction.progress(util.format($('Looking up the load balancer "%s"'), lbName));
+ try {
+ loadBalancer = networkManagementClient.loadBalancers.get(resourceGroup, lbName, null, _);
+ } catch (e) {
+ if (e.statusCode === 404) {
+ loadBalancer = null;
+ } else {
+ throw e;
+ }
+ } finally {
+ progress.end();
+ }
+
+ if (!loadBalancer) {
+ throw new Error(util.format($('load balancer with name "%s" not found in the resource group "%s"'), lbName, resourceGroup));
+ }
+
+ var backendAddressPool = utils.findFirstCaseIgnore(loadBalancer.backendAddressPools, {name: name});
+ if(!backendAddressPool) {
+ cli.output.warn(util.format($('backend address pools with name "%s" not found in the lbName "%s"'), name, loadBalancer.name));
+ }
+
+ cli.interaction.formatOutput(backendAddressPool, generatorUtils.traverse);
+ });
+
+ backendAddressPools.command('list [resource-group] [lb-name]')
+ .description($('List backend address pools'))
+ .usage('[options] <resource-group> <lb-name>')
+ .option('-g, --resource-group <resource-group>', $('the name of the resource group'))
+ .option('-l, --lb-name <lb-name>', $('the lb name'))
+ .option('-s, --subscription <subscription>', $('the subscription identifier'))
+ .execute(function(resourceGroup, lbName, options, _) {
+ var subscription = profile.current.getSubscription(options.subscription);
+ var networkManagementClient = utils.createNetworkManagementClient(subscription);
+
+ var loadBalancer = null;
+ var progress = cli.interaction.progress(util.format($('Looking up the load balancer "%s"'), lbName));
+ try {
+ loadBalancer = networkManagementClient.loadBalancers.get(resourceGroup, lbName, null, _);
+ } catch (e) {
+ if (e.statusCode === 404) {
+ loadBalancer = null;
+ } else {
+ throw e;
+ }
+ } finally {
+ progress.end();
+ }
+
+ if(!loadBalancer) {
+ throw new Error(util.format($('load balancers with name "%s" not found in the resource group "%s"'), lbName, resourceGroup));
+ }
+
+ var items = loadBalancer.backendAddressPools;
+ cli.interaction.formatOutput(items, function(items) {
+ if (items.length === 0) {
+ cli.output.warn($('No backend address pools found'));
+ } else {
+ cli.output.table(items, function (row, item) {
+ row.cell($('Name'), item.name);
+ var resInfo = resourceUtils.getResourceInformation(item.id);
+ row.cell($('Resource group'), resInfo.resourceGroup);
+ row.cell($('Provisioning state'), item.provisioningState);
+ });
+ }
+ });
+ });
+};
Oops, something went wrong.

0 comments on commit 13afb5f

Please sign in to comment.