|
57 | 57 | import com.microsoft.azure.management.dns.SrvRecordSet;
|
58 | 58 | import com.microsoft.azure.management.dns.TxtRecord;
|
59 | 59 | 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; |
60 | 66 | import com.microsoft.azure.management.graphrbac.ActiveDirectoryApplication;
|
61 | 67 | import com.microsoft.azure.management.graphrbac.ActiveDirectoryGroup;
|
62 | 68 | import com.microsoft.azure.management.graphrbac.ActiveDirectoryObject;
|
@@ -2502,6 +2508,117 @@ public static void print(ContainerGroup resource) {
|
2502 | 2508 | System.out.println(info.toString());
|
2503 | 2509 | }
|
2504 | 2510 |
|
| 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 | + |
2505 | 2622 | private static OkHttpClient httpClient;
|
2506 | 2623 |
|
2507 | 2624 | /**
|
|
0 commit comments