Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit 6fb26af

Browse files
committed
Release 1.7.0
1 parent b47bcf5 commit 6fb26af

File tree

2 files changed

+119
-2
lines changed

2 files changed

+119
-2
lines changed

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
<dependency>
5454
<groupId>com.microsoft.azure</groupId>
5555
<artifactId>azure</artifactId>
56-
<version>1.6.0</version>
56+
<version>1.7.0</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>commons-net</groupId>
6060
<artifactId>commons-net</artifactId>
61-
<version>3.3</version>
61+
<version>3.6</version>
6262
</dependency>
6363
</dependencies>
6464
</project>

src/main/java/com/microsoft/azure/management/samples/Utils.java

+117
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
import com.microsoft.azure.management.dns.SrvRecordSet;
5858
import com.microsoft.azure.management.dns.TxtRecord;
5959
import com.microsoft.azure.management.dns.TxtRecordSet;
60+
import com.microsoft.azure.management.eventhub.EventHubDisasterRecoveryPairing;
61+
import com.microsoft.azure.management.eventhub.EventHubNamespace;
62+
import com.microsoft.azure.management.eventhub.EventHub;
63+
import com.microsoft.azure.management.eventhub.DisasterRecoveryPairingAuthorizationRule;
64+
import com.microsoft.azure.management.eventhub.DisasterRecoveryPairingAuthorizationKey;
65+
import com.microsoft.azure.management.eventhub.EventHubConsumerGroup;
6066
import com.microsoft.azure.management.graphrbac.ActiveDirectoryApplication;
6167
import com.microsoft.azure.management.graphrbac.ActiveDirectoryGroup;
6268
import com.microsoft.azure.management.graphrbac.ActiveDirectoryObject;
@@ -2502,6 +2508,117 @@ public static void print(ContainerGroup resource) {
25022508
System.out.println(info.toString());
25032509
}
25042510

2511+
/**
2512+
* Print event hub namespace.
2513+
*
2514+
* @param resource a virtual machine
2515+
*/
2516+
public static void print(EventHubNamespace resource) {
2517+
StringBuilder info = new StringBuilder();
2518+
info.append("Eventhub Namespace: ").append(resource.id())
2519+
.append("\n\tName: ").append(resource.name())
2520+
.append("\n\tRegion: ").append(resource.region())
2521+
.append("\n\tTags: ").append(resource.tags())
2522+
.append("\n\tAzureInsightMetricId: ").append(resource.azureInsightMetricId())
2523+
.append("\n\tIsAutoScale enabled: ").append(resource.isAutoScaleEnabled())
2524+
.append("\n\tServiceBus endpoint: ").append(resource.serviceBusEndpoint())
2525+
.append("\n\tThroughPut upper limit: ").append(resource.throughputUnitsUpperLimit())
2526+
.append("\n\tCurrent ThroughPut: ").append(resource.currentThroughputUnits())
2527+
.append("\n\tCreated time: ").append(resource.createdAt())
2528+
.append("\n\tUpdated time: ").append(resource.updatedAt());
2529+
2530+
System.out.println(info.toString());
2531+
}
2532+
2533+
/**
2534+
* Print event hub.
2535+
*
2536+
* @param resource event hub
2537+
*/
2538+
public static void print(EventHub resource) {
2539+
StringBuilder info = new StringBuilder();
2540+
info.append("Eventhub: ").append(resource.id())
2541+
.append("\n\tName: ").append(resource.name())
2542+
.append("\n\tNamespace resource group: ").append(resource.namespaceResourceGroupName())
2543+
.append("\n\tNamespace: ").append(resource.namespaceName())
2544+
.append("\n\tIs data capture enabled: ").append(resource.isDataCaptureEnabled())
2545+
.append("\n\tPartition ids: ").append(resource.partitionIds());
2546+
if (resource.isDataCaptureEnabled()) {
2547+
info.append("\n\t\t\tData capture window size in MB: ").append(resource.dataCaptureWindowSizeInMB());
2548+
info.append("\n\t\t\tData capture window size in seconds: ").append(resource.dataCaptureWindowSizeInSeconds());
2549+
if (resource.captureDestination() != null) {
2550+
info.append("\n\t\t\tData capture storage account: ").append(resource.captureDestination().storageAccountResourceId());
2551+
info.append("\n\t\t\tData capture storage container: ").append(resource.captureDestination().blobContainer());
2552+
}
2553+
}
2554+
System.out.println(info.toString());
2555+
}
2556+
2557+
/**
2558+
* Print event hub namespace recovery pairing.
2559+
*
2560+
* @param resource event hub namespace disaster recovery pairing
2561+
*/
2562+
public static void print(EventHubDisasterRecoveryPairing resource) {
2563+
StringBuilder info = new StringBuilder();
2564+
info.append("DisasterRecoveryPairing: ").append(resource.id())
2565+
.append("\n\tName: ").append(resource.name())
2566+
.append("\n\tPrimary namespace resource group name: ").append(resource.primaryNamespaceResourceGroupName())
2567+
.append("\n\tPrimary namespace name: ").append(resource.primaryNamespaceName())
2568+
.append("\n\tSecondary namespace: ").append(resource.secondaryNamespaceId())
2569+
.append("\n\tNamespace role: ").append(resource.namespaceRole());
2570+
System.out.println(info.toString());
2571+
}
2572+
2573+
/**
2574+
* Print event hub namespace recovery pairing auth rules.
2575+
*
2576+
* @param resource event hub namespace disaster recovery pairing auth rule
2577+
*/
2578+
public static void print(DisasterRecoveryPairingAuthorizationRule resource) {
2579+
StringBuilder info = new StringBuilder();
2580+
info.append("DisasterRecoveryPairing auth rule: ").append(resource.name());
2581+
List<String> rightsStr = new ArrayList<>();
2582+
for (com.microsoft.azure.management.eventhub.AccessRights rights : resource.rights()) {
2583+
rightsStr.add(rights.toString());
2584+
}
2585+
info.append("\n\tRights: ").append(rightsStr);
2586+
System.out.println(info.toString());
2587+
}
2588+
2589+
/**
2590+
* Print event hub namespace recovery pairing auth rule key.
2591+
*
2592+
* @param resource event hub namespace disaster recovery pairing auth rule key
2593+
*/
2594+
public static void print(DisasterRecoveryPairingAuthorizationKey resource) {
2595+
StringBuilder info = new StringBuilder();
2596+
info.append("DisasterRecoveryPairing auth key: ")
2597+
.append("\n\t Alias primary connection string: ").append(resource.aliasPrimaryConnectionString())
2598+
.append("\n\t Alias secondary connection string: ").append(resource.aliasSecondaryConnectionString())
2599+
.append("\n\t Primary key: ").append(resource.primaryKey())
2600+
.append("\n\t Secondary key: ").append(resource.secondaryKey())
2601+
.append("\n\t Primary connection string: ").append(resource.primaryConnectionString())
2602+
.append("\n\t Secondary connection string: ").append(resource.secondaryConnectionString());
2603+
System.out.println(info.toString());
2604+
}
2605+
2606+
/**
2607+
* Print event hub consumer group.
2608+
*
2609+
* @param resource event hub consumer group
2610+
*/
2611+
public static void print(EventHubConsumerGroup resource) {
2612+
StringBuilder info = new StringBuilder();
2613+
info.append("Event hub consumer group: ").append(resource.id())
2614+
.append("\n\tName: ").append(resource.name())
2615+
.append("\n\tNamespace resource group: ").append(resource.namespaceResourceGroupName())
2616+
.append("\n\tNamespace: ").append(resource.namespaceName())
2617+
.append("\n\tEvent hub name: ").append(resource.eventHubName())
2618+
.append("\n\tUser metadata: ").append(resource.userMetadata());
2619+
System.out.println(info.toString());
2620+
}
2621+
25052622
private static OkHttpClient httpClient;
25062623

25072624
/**

0 commit comments

Comments
 (0)