Skip to content

Commit

Permalink
Release 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
anuchandy committed Mar 8, 2018
1 parent 51a306a commit f6d90e9
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 1 deletion.
Binary file removed Asset/documentdb-dotnet-todo-app.zip
Binary file not shown.
166 changes: 166 additions & 0 deletions Common/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
using Microsoft.Azure.ServiceBus;
using System.Threading;
using System.Net.Http.Headers;
using Microsoft.Azure.Management.BatchAI.Fluent;
using Microsoft.Azure.Management.CosmosDB.Fluent;
using Microsoft.Azure.Management.CosmosDB.Fluent.Models;
using Microsoft.Azure.Management.Compute.Fluent.Models;
Expand All @@ -45,6 +46,7 @@
using Microsoft.Azure.Management.ContainerInstance.Fluent;
using Microsoft.Azure.Management.Locks.Fluent;
using Microsoft.Azure.Management.Msi.Fluent;
using Microsoft.Azure.Management.Eventhub.Fluent;

namespace Microsoft.Azure.Management.Samples.Common
{
Expand Down Expand Up @@ -2085,6 +2087,170 @@ public static void Print(IVirtualNetworkGatewayConnection resource)
Utilities.Log(sb.ToString());
}

public static void Print(IEventHubNamespace resource)
{
StringBuilder eh = new StringBuilder("Eventhub Namespace: ")
.Append("Eventhub Namespace: ").Append(resource.Id)
.Append("\n\tName: ").Append(resource.Name)
.Append("\n\tRegion: ").Append(resource.Region)
.Append("\n\tTags: ").Append(resource.Tags.ToString())
.Append("\n\tAzureInsightMetricId: ").Append(resource.AzureInsightMetricId)
.Append("\n\tIsAutoScale enabled: ").Append(resource.IsAutoScaleEnabled)
.Append("\n\tServiceBus endpoint: ").Append(resource.ServiceBusEndpoint)
.Append("\n\tThroughPut upper limit: ").Append(resource.ThroughputUnitsUpperLimit)
.Append("\n\tCurrent ThroughPut: ").Append(resource.CurrentThroughputUnits)
.Append("\n\tCreated time: ").Append(resource.CreatedAt)
.Append("\n\tUpdated time: ").Append(resource.UpdatedAt);
Utilities.Log(eh.ToString());
}

public static void Print(IEventHub resource)
{
StringBuilder info = new StringBuilder();
info.Append("Eventhub: ").Append(resource.Id)
.Append("\n\tName: ").Append(resource.Name)
.Append("\n\tNamespace resource group: ").Append(resource.NamespaceResourceGroupName)
.Append("\n\tNamespace: ").Append(resource.NamespaceName)
.Append("\n\tIs data capture enabled: ").Append(resource.IsDataCaptureEnabled)
.Append("\n\tPartition ids: ").Append(resource.PartitionIds);
if (resource.IsDataCaptureEnabled)
{
info.Append("\n\t\t\tData capture window size in MB: ").Append(resource.DataCaptureWindowSizeInMB);
info.Append("\n\t\t\tData capture window size in seconds: ").Append(resource.DataCaptureWindowSizeInSeconds);
if (resource.CaptureDestination != null)
{
info.Append("\n\t\t\tData capture storage account: ").Append(resource.CaptureDestination.StorageAccountResourceId);
info.Append("\n\t\t\tData capture storage container: ").Append(resource.CaptureDestination.BlobContainer);
}
}
Utilities.Log(info.ToString());
}

public static void Print(IEventHubDisasterRecoveryPairing resource)
{
StringBuilder info = new StringBuilder();
info.Append("DisasterRecoveryPairing: ").Append(resource.Id)
.Append("\n\tName: ").Append(resource.Name)
.Append("\n\tPrimary namespace resource group name: ").Append(resource.PrimaryNamespaceResourceGroupName)
.Append("\n\tPrimary namespace name: ").Append(resource.PrimaryNamespaceName)
.Append("\n\tSecondary namespace: ").Append(resource.SecondaryNamespaceId)
.Append("\n\tNamespace role: ").Append(resource.NamespaceRole);
Utilities.Log(info.ToString());
}

public static void Print(IDisasterRecoveryPairingAuthorizationRule resource)
{
StringBuilder info = new StringBuilder();
info.Append("DisasterRecoveryPairing auth rule: ").Append(resource.Name);
List<String> rightsStr = new List<string>();
foreach (var rights in resource.Rights)
{
rightsStr.Add(rights.ToString());
}
info.Append("\n\tRights: ").Append(rightsStr);
Utilities.Log(info.ToString());
}

public static void Print(IDisasterRecoveryPairingAuthorizationKey resource)
{
StringBuilder info = new StringBuilder();
info.Append("DisasterRecoveryPairing auth key: ")
.Append("\n\t Alias primary connection string: ").Append(resource.AliasPrimaryConnectionString)
.Append("\n\t Alias secondary connection string: ").Append(resource.AliasSecondaryConnectionString)
.Append("\n\t Primary key: ").Append(resource.PrimaryKey)
.Append("\n\t Secondary key: ").Append(resource.SecondaryKey)
.Append("\n\t Primary connection string: ").Append(resource.PrimaryConnectionString)
.Append("\n\t Secondary connection string: ").Append(resource.SecondaryConnectionString);
Utilities.Log(info.ToString());
}

public static void Print(IEventHubConsumerGroup resource)
{
StringBuilder info = new StringBuilder();
info.Append("Event hub consumer group: ").Append(resource.Id)
.Append("\n\tName: ").Append(resource.Name)
.Append("\n\tNamespace resource group: ").Append(resource.NamespaceResourceGroupName)
.Append("\n\tNamespace: ").Append(resource.NamespaceName)
.Append("\n\tEvent hub name: ").Append(resource.EventHubName)
.Append("\n\tUser metadata: ").Append(resource.UserMetadata);
Utilities.Log(info.ToString());
}

public static void Print(IBatchAICluster resource)
{
StringBuilder sb = new StringBuilder("Batch AI cluster: ")
.Append("\n\tId: ").Append(resource.Id)
.Append("\n\tName: ").Append(resource.Name)
.Append("\n\tResource group: ").Append(resource.ResourceGroupName)
.Append("\n\tRegion: ").Append(resource.RegionName)
.Append("\n\tVM Size: ").Append(resource.VMSize)
.Append("\n\tVM Priority: ").Append(resource.VMPriority)
.Append("\n\tSubnet: ").Append(resource.Subnet)
.Append("\n\tAllocation state: ").Append(resource.AllocationState)
.Append("\n\tAllocation state transition time: ").Append(resource.AllocationStateTransitionTime)
.Append("\n\tCreation time: ").Append(resource.CreationTime)
.Append("\n\tCurrent node count: ").Append(resource.CurrentNodeCount)
.Append("\n\tAllocation state transition time: ").Append(resource.AllocationStateTransitionTime)
.Append("\n\tAllocation state transition time: ").Append(resource.AllocationStateTransitionTime);
if (resource.ScaleSettings.AutoScale != null)
{
sb.Append("\n\tAuto scale settings: ")
.Append("\n\t\tInitial node count: ").Append(resource.ScaleSettings.AutoScale.InitialNodeCount)
.Append("\n\t\tMinimum node count: ").Append(resource.ScaleSettings.AutoScale.MinimumNodeCount)
.Append("\n\t\tMaximum node count: ").Append(resource.ScaleSettings.AutoScale.MaximumNodeCount);
}
if (resource.ScaleSettings.Manual != null)
{
sb.Append("\n\tManual scale settings: ")
.Append("\n\t\tTarget node count: ").Append(resource.ScaleSettings.Manual.TargetNodeCount)
.Append("\n\t\tDeallocation option: ")
.Append(resource.ScaleSettings.Manual.NodeDeallocationOption.GetValueOrDefault());
}
if (resource.NodeStateCounts != null)
{
sb.Append("\n\tNode state counts: ")
.Append("\n\t\tRunning nodes count: ").Append(resource.NodeStateCounts.RunningNodeCount)
.Append("\n\t\tIdle nodes count: ").Append(resource.NodeStateCounts.IdleNodeCount)
.Append("\n\t\tPreparing nodes count: ").Append(resource.NodeStateCounts.PreparingNodeCount)
.Append("\n\t\tLeaving nodes count: ").Append(resource.NodeStateCounts.LeavingNodeCount)
.Append("\n\t\tPreparing nodes count: ").Append(resource.NodeStateCounts.PreparingNodeCount);
}
if (resource.VirtualMachineConfiguration != null && resource.VirtualMachineConfiguration.ImageReference != null)
{
sb.Append("\n\tVirtual machine configuration: ")
.Append("\n\t\tPublisher: ").Append(resource.VirtualMachineConfiguration.ImageReference.Publisher)
.Append("\n\t\tOffer: ").Append(resource.VirtualMachineConfiguration.ImageReference.Offer)
.Append("\n\t\tSku: ").Append(resource.VirtualMachineConfiguration.ImageReference.Sku)
.Append("\n\t\tVersion: ").Append(resource.VirtualMachineConfiguration.ImageReference.Version);
}
if (resource.NodeSetup != null && resource.NodeSetup.SetupTask != null)
{
sb.Append("\n\tSetup task: ")
.Append("\n\t\tCommand line: ").Append(resource.NodeSetup.SetupTask.CommandLine)
.Append("\n\t\tRun elevated: ").Append(resource.NodeSetup.SetupTask.RunElevated)
.Append("\n\t\tStdout/err Path Prefix: ").Append(resource.NodeSetup.SetupTask.StdOutErrPathPrefix);
}
Utilities.Log(sb.ToString());
}

public static void Print(IBatchAIJob resource)
{
StringBuilder sb = new StringBuilder("Batch AI job: ")
.Append("\n\tId: ").Append(resource.Id)
.Append("\n\tName: ").Append(resource.Name)
.Append("\n\tResource group: ").Append(resource.ResourceGroupName)
.Append("\n\tRegion: ").Append(resource.RegionName)
.Append("\n\tCluster Id: ").Append(resource.Cluster)
.Append("\n\tCreation time: ").Append(resource.CreationTime)
.Append("\n\tNode count: ").Append(resource.NodeCount)
.Append("\n\tPriority: ").Append(resource.Priority)
.Append("\n\tExecution state: ").Append(resource.ExecutionState)
.Append("\n\tExecution state transition time: ").Append(resource.ExecutionStateTransitionTime)
.Append("\n\tTool type: ").Append(resource.ToolType)
.Append("\n\tExperiment name: ").Append(resource.ExperimentName);
Utilities.Log(sb.ToString());
}

public static void CreateCertificate(string domainName, string pfxPath, string password)
{
if (!IsRunningMocked)
Expand Down
2 changes: 1 addition & 1 deletion ManageVirtualMachineScaleSetAsync.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
<PackageReference Include="Microsoft.Azure.Management.Fluent" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.Management.Fluent" Version="1.7.0" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="2.3.2" />
<PackageReference Include="CoreFTP" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="0.0.2-preview" />
Expand Down

0 comments on commit f6d90e9

Please sign in to comment.