Skip to content

Commit c686737

Browse files
authored
Merge pull request #615 from Azure/dev
huangpf PR: dev <- Azure:dev
2 parents c4b0721 + 1e4915b commit c686737

File tree

7 files changed

+44
-15
lines changed

7 files changed

+44
-15
lines changed

src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultCertificateOperation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class KeyVaultCertificateOperation
2121
{
2222
public string Id { get; private set; }
2323
public string Status { get; private set; }
24-
public string StatusDetais { get; private set; }
24+
public string StatusDetails { get; private set; }
2525
public string RequestId { get; private set; }
2626
public string Target { get; private set; }
2727
public string Issuer { get; private set; }
@@ -41,7 +41,7 @@ internal static KeyVaultCertificateOperation FromCertificateOperation(Certificat
4141
{
4242
Id = certificateOperation.Id,
4343
Status = certificateOperation.Status,
44-
StatusDetais = certificateOperation.StatusDetails,
44+
StatusDetails = certificateOperation.StatusDetails,
4545
RequestId = certificateOperation.RequestId,
4646
Target = certificateOperation.Target,
4747
Issuer = certificateOperation.IssuerReference.Name,

src/ResourceManager/MachineLearning/Commands.MachineLearning/Cmdlets/GetAzureMLWebService.cs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,25 @@ public class GetAzureMLWebService : WebServicesCmdletBase
3939

4040
protected override void RunCmdlet()
4141
{
42-
// If this is a simple get web service by name operation, resolve it as such
43-
if (!string.IsNullOrWhiteSpace(this.ResourceGroupName) &&
44-
!string.IsNullOrWhiteSpace(this.Name))
42+
if (!string.IsNullOrWhiteSpace(this.Name))
4543
{
46-
WebService service =
47-
this.WebServicesClient.GetAzureMlWebService(this.ResourceGroupName, this.Name);
44+
if (string.IsNullOrWhiteSpace(this.ResourceGroupName))
45+
{
46+
// If there is only web service name but no resource group name, it is invalid input.
47+
throw new PSArgumentNullException(ResourceGroupName, Resources.MissingResourceGroupName);
48+
}
49+
50+
// If this is a simple get web service by name operation, resolve it as such
51+
WebService service = this.WebServicesClient.GetAzureMlWebService(this.ResourceGroupName, this.Name);
4852
this.WriteObject(service);
4953
}
5054
else
5155
{
5256
// This is a collection of web services get call, so determine which flavor it is
5357
Func<Task<ResponseWithContinuation<WebService[]>>> getFirstServicesPageCall = () => this.WebServicesClient.GetAzureMlWebServicesBySubscriptionAsync(null, this.CancellationToken);
5458
Func<string, Task<ResponseWithContinuation<WebService[]>>> getNextPageCall = nextLink => this.WebServicesClient.GetAzureMlWebServicesBySubscriptionAsync(nextLink, this.CancellationToken);
55-
if (this.ResourceGroupName != null)
59+
60+
if (!string.IsNullOrWhiteSpace(this.ResourceGroupName))
5661
{
5762
// This is a call for resource retrieval within a resource group
5863
getFirstServicesPageCall = () => this.WebServicesClient.GetAzureMlWebServicesBySubscriptionAndGroupAsync(this.ResourceGroupName, null, this.CancellationToken);

src/ResourceManager/MachineLearning/Commands.MachineLearning/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/MachineLearning/Commands.MachineLearning/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@
123123
<data name="MissingDefinitionFile" xml:space="preserve">
124124
<value>The specified web service definition file path does not exist.</value>
125125
</data>
126+
<data name="MissingResourceGroupName" xml:space="preserve">
127+
<value>The resource group name is missing.</value>
128+
</data>
126129
<data name="NewServiceWarning" xml:space="preserve">
127130
<value>Are you sure you want to create a new machine learning web service "{0}" ?</value>
128131
</data>

src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Network/NewAzureRMSiteRecoveryNetworkMapping.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public class NewAzureRmSiteRecoveryNetworkMapping : SiteRecoveryCmdletBase
3030
/// <summary>
3131
/// Gets or sets Azure VM Network Id.
3232
/// </summary>
33-
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)]
34-
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = true)]
33+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = false)]
34+
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = false)]
3535
[ValidateNotNullOrEmpty]
3636
public string Name { get; set; }
3737

@@ -82,12 +82,16 @@ public override void ExecuteSiteRecoveryCmdlet()
8282
/// </summary>
8383
private void EnterpriseToEnterpriseNetworkMapping()
8484
{
85+
string mappingName = String.IsNullOrEmpty(this.Name) ?
86+
this.PrimaryNetwork.FriendlyName.Replace(" ", "") + "-" + this.RecoveryNetwork.FriendlyName.Replace(" ", "") + "-" + Guid.NewGuid().ToString() :
87+
this.Name;
88+
8589
LongRunningOperationResponse response =
8690
RecoveryServicesClient
8791
.NewAzureSiteRecoveryNetworkMapping(
8892
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationFabrics),
8993
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationNetworks),
90-
this.Name,
94+
mappingName,
9195
Utilities.GetValueFromArmId(this.RecoveryNetwork.ID, ARMResourceTypeConstants.ReplicationFabrics),
9296
this.RecoveryNetwork.ID);
9397

@@ -103,12 +107,16 @@ private void EnterpriseToEnterpriseNetworkMapping()
103107
/// </summary>
104108
private void EnterpriseToAzureNetworkMapping()
105109
{
110+
string mappingName = String.IsNullOrEmpty(this.Name) ?
111+
this.PrimaryNetwork.FriendlyName.Replace(" ", "") + "-" + Utilities.GetValueFromArmId(this.AzureVMNetworkId, ARMResourceTypeConstants.VirtualNetworks).Replace(" ", "") + "-" + Guid.NewGuid().ToString() :
112+
this.Name;
113+
106114
LongRunningOperationResponse response =
107115
RecoveryServicesClient
108116
.NewAzureSiteRecoveryNetworkMapping(
109117
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationFabrics),
110118
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationNetworks),
111-
this.Name,
119+
mappingName,
112120
"Microsoft Azure",
113121
this.AzureVMNetworkId);
114122

src/ResourceManager/SiteRecovery/Commands.SiteRecovery/Storage/Classification/NewAzureRmSiteRecoveryStorageClassificationMapping.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class NewAzureRmSiteRecoveryStorageClassificationMapping : SiteRecoveryCm
3030
/// <summary>
3131
/// Gets or sets Name.
3232
/// </summary>
33-
[Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = true)]
33+
[Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = false)]
3434
[ValidateNotNullOrEmpty]
3535
public string Name { get; set; }
3636

@@ -56,6 +56,10 @@ public override void ExecuteSiteRecoveryCmdlet()
5656
{
5757
base.ExecuteSiteRecoveryCmdlet();
5858

59+
string mappingName = string.IsNullOrEmpty(this.Name) ?
60+
string.Format("StrgMap_{0}_{1}_{2}", PrimaryStorageClassification.Name, RecoveryStorageClassification.Name, Guid.NewGuid()) :
61+
this.Name;
62+
5963
var props = new StorageClassificationMappingInputProperties()
6064
{
6165
TargetStorageClassificationId = RecoveryStorageClassification.Id
@@ -70,7 +74,7 @@ public override void ExecuteSiteRecoveryCmdlet()
7074
RecoveryServicesClient.MapStorageClassification(
7175
PrimaryStorageClassification,
7276
input,
73-
this.Name);
77+
mappingName);
7478

7579
JobResponse jobResponse =
7680
RecoveryServicesClient.GetAzureSiteRecoveryJobDetails(

src/ServiceManagement/Profile/Commands.Profile/Microsoft.WindowsAzure.Commands.Profile.dll-Help.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,7 @@
44934493
<dev:version />
44944494
</command:details>
44954495
<maml:description>
4496-
<maml:para>The Set-AzureSubscription cmdlet establishes and changes the properties of an Azure subscription. You can use this cmdlet to create a new subscription or change the properties of an existing subscription.</maml:para>
4496+
<maml:para>The Set-AzureSubscription cmdlet establishes and changes the properties of an Azure subscription object. You can use this cmdlet to work in an Azure subscription that is not your default subscription or to change your current storage account</maml:para>
44974497
<maml:para>To create a new subscription, select a unique name for the value of the SubscriptionName parameter. To change an existing subscription, use the SubscriptionName parameter to identify the subscription.</maml:para>
44984498
<maml:para>This cmdlet changes the data in the subscription data file that you create when you use the Add-AzureAccount or Import-AzurePublishSettingsFile cmdlet to add an Azure account to Windows PowerShell.</maml:para>
44994499
</maml:description>

0 commit comments

Comments
 (0)