Skip to content

huangpf PR: dev <- Azure:dev #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class KeyVaultCertificateOperation
{
public string Id { get; private set; }
public string Status { get; private set; }
public string StatusDetais { get; private set; }
public string StatusDetails { get; private set; }
public string RequestId { get; private set; }
public string Target { get; private set; }
public string Issuer { get; private set; }
Expand All @@ -41,7 +41,7 @@ internal static KeyVaultCertificateOperation FromCertificateOperation(Certificat
{
Id = certificateOperation.Id,
Status = certificateOperation.Status,
StatusDetais = certificateOperation.StatusDetails,
StatusDetails = certificateOperation.StatusDetails,
RequestId = certificateOperation.RequestId,
Target = certificateOperation.Target,
Issuer = certificateOperation.IssuerReference.Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,25 @@ public class GetAzureMLWebService : WebServicesCmdletBase

protected override void RunCmdlet()
{
// If this is a simple get web service by name operation, resolve it as such
if (!string.IsNullOrWhiteSpace(this.ResourceGroupName) &&
!string.IsNullOrWhiteSpace(this.Name))
if (!string.IsNullOrWhiteSpace(this.Name))
{
WebService service =
this.WebServicesClient.GetAzureMlWebService(this.ResourceGroupName, this.Name);
if (string.IsNullOrWhiteSpace(this.ResourceGroupName))
{
// If there is only web service name but no resource group name, it is invalid input.
throw new PSArgumentNullException(ResourceGroupName, Resources.MissingResourceGroupName);
}

// If this is a simple get web service by name operation, resolve it as such
WebService service = this.WebServicesClient.GetAzureMlWebService(this.ResourceGroupName, this.Name);
this.WriteObject(service);
}
else
{
// This is a collection of web services get call, so determine which flavor it is
Func<Task<ResponseWithContinuation<WebService[]>>> getFirstServicesPageCall = () => this.WebServicesClient.GetAzureMlWebServicesBySubscriptionAsync(null, this.CancellationToken);
Func<string, Task<ResponseWithContinuation<WebService[]>>> getNextPageCall = nextLink => this.WebServicesClient.GetAzureMlWebServicesBySubscriptionAsync(nextLink, this.CancellationToken);
if (this.ResourceGroupName != null)

if (!string.IsNullOrWhiteSpace(this.ResourceGroupName))
{
// This is a call for resource retrieval within a resource group
getFirstServicesPageCall = () => this.WebServicesClient.GetAzureMlWebServicesBySubscriptionAndGroupAsync(this.ResourceGroupName, null, this.CancellationToken);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<data name="MissingDefinitionFile" xml:space="preserve">
<value>The specified web service definition file path does not exist.</value>
</data>
<data name="MissingResourceGroupName" xml:space="preserve">
<value>The resource group name is missing.</value>
</data>
<data name="NewServiceWarning" xml:space="preserve">
<value>Are you sure you want to create a new machine learning web service "{0}" ?</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class NewAzureRmSiteRecoveryNetworkMapping : SiteRecoveryCmdletBase
/// <summary>
/// Gets or sets Azure VM Network Id.
/// </summary>
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = true)]
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = true)]
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToEnterprise, Mandatory = false)]
[Parameter(ParameterSetName = ASRParameterSets.EnterpriseToAzure, Mandatory = false)]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand Down Expand Up @@ -82,12 +82,16 @@ public override void ExecuteSiteRecoveryCmdlet()
/// </summary>
private void EnterpriseToEnterpriseNetworkMapping()
{
string mappingName = String.IsNullOrEmpty(this.Name) ?
this.PrimaryNetwork.FriendlyName.Replace(" ", "") + "-" + this.RecoveryNetwork.FriendlyName.Replace(" ", "") + "-" + Guid.NewGuid().ToString() :
this.Name;

LongRunningOperationResponse response =
RecoveryServicesClient
.NewAzureSiteRecoveryNetworkMapping(
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationFabrics),
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationNetworks),
this.Name,
mappingName,
Utilities.GetValueFromArmId(this.RecoveryNetwork.ID, ARMResourceTypeConstants.ReplicationFabrics),
this.RecoveryNetwork.ID);

Expand All @@ -103,12 +107,16 @@ private void EnterpriseToEnterpriseNetworkMapping()
/// </summary>
private void EnterpriseToAzureNetworkMapping()
{
string mappingName = String.IsNullOrEmpty(this.Name) ?
this.PrimaryNetwork.FriendlyName.Replace(" ", "") + "-" + Utilities.GetValueFromArmId(this.AzureVMNetworkId, ARMResourceTypeConstants.VirtualNetworks).Replace(" ", "") + "-" + Guid.NewGuid().ToString() :
this.Name;

LongRunningOperationResponse response =
RecoveryServicesClient
.NewAzureSiteRecoveryNetworkMapping(
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationFabrics),
Utilities.GetValueFromArmId(this.PrimaryNetwork.ID, ARMResourceTypeConstants.ReplicationNetworks),
this.Name,
mappingName,
"Microsoft Azure",
this.AzureVMNetworkId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class NewAzureRmSiteRecoveryStorageClassificationMapping : SiteRecoveryCm
/// <summary>
/// Gets or sets Name.
/// </summary>
[Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = true)]
[Parameter(ParameterSetName = ASRParameterSets.ByObject, Mandatory = false)]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

Expand All @@ -56,6 +56,10 @@ public override void ExecuteSiteRecoveryCmdlet()
{
base.ExecuteSiteRecoveryCmdlet();

string mappingName = string.IsNullOrEmpty(this.Name) ?
string.Format("StrgMap_{0}_{1}_{2}", PrimaryStorageClassification.Name, RecoveryStorageClassification.Name, Guid.NewGuid()) :
this.Name;

var props = new StorageClassificationMappingInputProperties()
{
TargetStorageClassificationId = RecoveryStorageClassification.Id
Expand All @@ -70,7 +74,7 @@ public override void ExecuteSiteRecoveryCmdlet()
RecoveryServicesClient.MapStorageClassification(
PrimaryStorageClassification,
input,
this.Name);
mappingName);

JobResponse jobResponse =
RecoveryServicesClient.GetAzureSiteRecoveryJobDetails(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4493,7 +4493,7 @@
<dev:version />
</command:details>
<maml:description>
<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>
<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>
<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>
<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>
</maml:description>
Expand Down