25
25
import com .microsoft .azure .management .batch .BatchAccount ;
26
26
import com .microsoft .azure .management .batch .BatchAccountKeys ;
27
27
import com .microsoft .azure .management .compute .AvailabilitySet ;
28
- import com .microsoft .azure .management .compute .ContainerService ;
29
- import com .microsoft .azure .management .compute .ContainerServiceOrchestratorTypes ;
30
28
import com .microsoft .azure .management .compute .DataDisk ;
31
29
import com .microsoft .azure .management .compute .ImageDataDisk ;
32
30
import com .microsoft .azure .management .compute .VirtualMachine ;
38
36
import com .microsoft .azure .management .containerinstance .EnvironmentVariable ;
39
37
import com .microsoft .azure .management .containerinstance .Volume ;
40
38
import com .microsoft .azure .management .containerinstance .VolumeMount ;
39
+ import com .microsoft .azure .management .containerregistry .AccessKeyType ;
41
40
import com .microsoft .azure .management .containerregistry .Registry ;
42
- import com .microsoft .azure .management .containerregistry .implementation .RegistryListCredentials ;
41
+ import com .microsoft .azure .management .containerregistry .RegistryCredentials ;
42
+ import com .microsoft .azure .management .containerservice .ContainerService ;
43
+ import com .microsoft .azure .management .containerservice .ContainerServiceOrchestratorTypes ;
44
+ import com .microsoft .azure .management .containerservice .KubernetesCluster ;
43
45
import com .microsoft .azure .management .cosmosdb .CosmosDBAccount ;
44
46
import com .microsoft .azure .management .dns .ARecordSet ;
45
47
import com .microsoft .azure .management .dns .AaaaRecordSet ;
65
67
import com .microsoft .azure .management .graphrbac .implementation .PermissionInner ;
66
68
import com .microsoft .azure .management .keyvault .AccessPolicy ;
67
69
import com .microsoft .azure .management .keyvault .Vault ;
70
+ import com .microsoft .azure .management .locks .ManagementLock ;
68
71
import com .microsoft .azure .management .network .ApplicationGateway ;
69
72
import com .microsoft .azure .management .network .ApplicationGatewayBackend ;
70
73
import com .microsoft .azure .management .network .ApplicationGatewayBackendAddress ;
73
76
import com .microsoft .azure .management .network .ApplicationGatewayIPConfiguration ;
74
77
import com .microsoft .azure .management .network .ApplicationGatewayListener ;
75
78
import com .microsoft .azure .management .network .ApplicationGatewayProbe ;
79
+ import com .microsoft .azure .management .network .ApplicationGatewayRedirectConfiguration ;
76
80
import com .microsoft .azure .management .network .ApplicationGatewayRequestRoutingRule ;
77
81
import com .microsoft .azure .management .network .ApplicationGatewaySslCertificate ;
78
82
import com .microsoft .azure .management .network .EffectiveNetworkSecurityRule ;
@@ -355,7 +359,6 @@ public static void print(Network resource) {
355
359
.append ("\n \t \t Remote network ID: " ).append (peering .remoteNetworkId ())
356
360
.append ("\n \t \t Peering state: " ).append (peering .state ())
357
361
.append ("\n \t \t Is traffic forwarded from remote network allowed? " ).append (peering .isTrafficForwardingFromRemoteNetworkAllowed ())
358
- //TODO .append("\n\t\tIs access from remote network allowed? ").append(peering.isAccessFromRemoteNetworkAllowed())
359
362
.append ("\n \t \t Gateway use: " ).append (peering .gatewayUse ());
360
363
}
361
364
System .out .println (info .toString ());
@@ -545,6 +548,18 @@ public static void print(RedisAccessKeys redisAccessKeys) {
545
548
System .out .println (redisKeys .toString ());
546
549
}
547
550
551
+ /**
552
+ * Print management lock.
553
+ * @param lock a management lock
554
+ */
555
+ public static void print (ManagementLock lock ) {
556
+ StringBuilder info = new StringBuilder ();
557
+ info .append ("\n Lock ID: " ).append (lock .id ())
558
+ .append ("\n Locked resource ID: " ).append (lock .lockedResourceId ())
559
+ .append ("\n Level: " ).append (lock .level ());
560
+ System .out .println (info .toString ());
561
+ }
562
+
548
563
/**
549
564
* Print load balancer.
550
565
*
@@ -874,11 +889,11 @@ public static void print(WebAppBase resource) {
874
889
}
875
890
}
876
891
builder = builder .append ("\n \t App settings: " );
877
- for (AppSetting setting : resource .appSettings ().values ()) {
892
+ for (AppSetting setting : resource .getAppSettings ().values ()) {
878
893
builder = builder .append ("\n \t \t " + setting .key () + ": " + setting .value () + (setting .sticky () ? " - slot setting" : "" ));
879
894
}
880
895
builder = builder .append ("\n \t Connection strings: " );
881
- for (ConnectionString conn : resource .connectionStrings ().values ()) {
896
+ for (ConnectionString conn : resource .getConnectionStrings ().values ()) {
882
897
builder = builder .append ("\n \t \t " + conn .name () + ": " + conn .value () + " - " + conn .type () + (conn .sticky () ? " - slot setting" : "" ));
883
898
}
884
899
System .out .println (builder .toString ());
@@ -1100,13 +1115,13 @@ public static void print(DnsZone dnsZone) {
1100
1115
public static void print (Registry azureRegistry ) {
1101
1116
StringBuilder info = new StringBuilder ();
1102
1117
1103
- RegistryListCredentials acrCredentials = azureRegistry .listCredentials ();
1118
+ RegistryCredentials acrCredentials = azureRegistry .getCredentials ();
1104
1119
info .append ("Azure Container Registry: " ).append (azureRegistry .id ())
1105
1120
.append ("\n \t Name: " ).append (azureRegistry .name ())
1106
1121
.append ("\n \t Server Url: " ).append (azureRegistry .loginServerUrl ())
1107
1122
.append ("\n \t User: " ).append (acrCredentials .username ())
1108
- .append ("\n \t First Password: " ).append (acrCredentials .passwords ().get (0 ). value ( ))
1109
- .append ("\n \t Second Password: " ).append (acrCredentials .passwords ().get (1 ). value ( ));
1123
+ .append ("\n \t First Password: " ).append (acrCredentials .accessKeys ().get (AccessKeyType . PRIMARY ))
1124
+ .append ("\n \t Second Password: " ).append (acrCredentials .accessKeys ().get (AccessKeyType . SECONDARY ));
1110
1125
System .out .println (info .toString ());
1111
1126
}
1112
1127
@@ -1122,12 +1137,12 @@ public static void print(ContainerService containerService) {
1122
1137
.append ("\n \t With orchestration: " ).append (containerService .orchestratorType ().toString ())
1123
1138
.append ("\n \t Master FQDN: " ).append (containerService .masterFqdn ())
1124
1139
.append ("\n \t Master node count: " ).append (containerService .masterNodeCount ())
1125
- .append ("\n \t Master leaf domain label: " ).append (containerService .masterLeafDomainLabel ())
1126
- .append ("\n \t \t With Agent pool name: " ).append (containerService .agentPoolName ( ))
1127
- .append ("\n \t \t Agent pool count: " ).append (containerService .agentPoolCount ())
1128
- .append ("\n \t \t Agent pool count : " ).append (containerService .agentPoolVMSize ().toString ())
1129
- .append ("\n \t \t Agent pool FQDN: " ).append (containerService .agentPoolFqdn ())
1130
- .append ("\n \t \t Agent pool leaf domain label: " ).append (containerService .agentPoolLeafDomainLabel ())
1140
+ .append ("\n \t Master domain label prefix : " ).append (containerService .masterDnsPrefix ())
1141
+ .append ("\n \t \t With Agent pool name: " ).append (new ArrayList <>( containerService .agentPools (). keySet ()). get ( 0 ))
1142
+ .append ("\n \t \t Agent pool count: " ).append (new ArrayList <>( containerService .agentPools (). values ()). get ( 0 ). count ())
1143
+ .append ("\n \t \t Agent pool VM size : " ).append (new ArrayList <>( containerService .agentPools (). values ()). get ( 0 ). vmSize ().toString ())
1144
+ .append ("\n \t \t Agent pool FQDN: " ).append (new ArrayList <>( containerService .agentPools (). values ()). get ( 0 ). fqdn ())
1145
+ .append ("\n \t \t Agent pool domain label prefix : " ).append (new ArrayList <>( containerService .agentPools (). values ()). get ( 0 ). dnsPrefix ())
1131
1146
.append ("\n \t Linux user name: " ).append (containerService .linuxRootUsername ())
1132
1147
.append ("\n \t SSH key: " ).append (containerService .sshKey ());
1133
1148
if (containerService .orchestratorType () == ContainerServiceOrchestratorTypes .KUBERNETES ) {
@@ -1137,6 +1152,30 @@ public static void print(ContainerService containerService) {
1137
1152
System .out .println (info .toString ());
1138
1153
}
1139
1154
1155
+ /**
1156
+ * Print an Azure Container Service (AKS).
1157
+ * @param kubernetesCluster a managed container service
1158
+ */
1159
+ public static void print (KubernetesCluster kubernetesCluster ) {
1160
+ StringBuilder info = new StringBuilder ();
1161
+
1162
+ info .append ("Azure Container Service: " ).append (kubernetesCluster .id ())
1163
+ .append ("\n \t Name: " ).append (kubernetesCluster .name ())
1164
+ .append ("\n \t FQDN: " ).append (kubernetesCluster .fqdn ())
1165
+ .append ("\n \t DNS prefix label: " ).append (kubernetesCluster .dnsPrefix ())
1166
+ .append ("\n \t \t With Agent pool name: " ).append (new ArrayList <>(kubernetesCluster .agentPools ().keySet ()).get (0 ))
1167
+ .append ("\n \t \t Agent pool count: " ).append (new ArrayList <>(kubernetesCluster .agentPools ().values ()).get (0 ).count ())
1168
+ .append ("\n \t \t Agent pool VM size: " ).append (new ArrayList <>(kubernetesCluster .agentPools ().values ()).get (0 ).vmSize ().toString ())
1169
+ .append ("\n \t Linux user name: " ).append (kubernetesCluster .linuxRootUsername ())
1170
+ .append ("\n \t SSH key: " ).append (kubernetesCluster .sshKey ())
1171
+ .append ("\n \t Service principal client ID: " ).append (kubernetesCluster .servicePrincipalClientId ());
1172
+ if (kubernetesCluster .keyVaultSecretReference () != null ) {
1173
+ info .append ("\n \t KeyVault reference: " ).append (kubernetesCluster .keyVaultSecretReference ().vaultID ());
1174
+ }
1175
+
1176
+ System .out .println (info .toString ());
1177
+ }
1178
+
1140
1179
/**
1141
1180
* Print an Azure Search Service.
1142
1181
* @param searchService an Azure Search Service
@@ -1514,12 +1553,17 @@ public static void print(ApplicationGateway resource) {
1514
1553
.append ("\n \t \t \t Cookie based affinity: " ).append (httpConfig .cookieBasedAffinity ())
1515
1554
.append ("\n \t \t \t Port: " ).append (httpConfig .port ())
1516
1555
.append ("\n \t \t \t Request timeout in seconds: " ).append (httpConfig .requestTimeout ())
1517
- .append ("\n \t \t \t Protocol: " ).append (httpConfig .protocol ());
1518
-
1556
+ .append ("\n \t \t \t Protocol: " ).append (httpConfig .protocol ())
1557
+ .append ("\n \t \t Host header: " ).append (httpConfig .hostHeader ())
1558
+ .append ("\n \t \t Host header comes from backend? " ).append (httpConfig .isHostHeaderFromBackend ())
1559
+ .append ("\n \t \t Connection draining timeout in seconds: " ).append (httpConfig .connectionDrainingTimeoutInSeconds ())
1560
+ .append ("\n \t \t Affinity cookie name: " ).append (httpConfig .affinityCookieName ())
1561
+ .append ("\n \t \t Path: " ).append (httpConfig .path ());
1519
1562
ApplicationGatewayProbe probe = httpConfig .probe ();
1520
1563
if (probe != null ) {
1521
1564
info .append ("\n \t \t Probe: " + probe .name ());
1522
1565
}
1566
+ info .append ("\n \t \t Is probe enabled? " ).append (httpConfig .isProbeEnabled ());
1523
1567
}
1524
1568
1525
1569
// Show SSL certificates
@@ -1530,6 +1574,19 @@ public static void print(ApplicationGateway resource) {
1530
1574
.append ("\n \t \t \t Cert data: " ).append (cert .publicData ());
1531
1575
}
1532
1576
1577
+ // Show redirect configurations
1578
+ Map <String , ApplicationGatewayRedirectConfiguration > redirects = resource .redirectConfigurations ();
1579
+ info .append ("\n \t Redirect configurations: " ).append (redirects .size ());
1580
+ for (ApplicationGatewayRedirectConfiguration redirect : redirects .values ()) {
1581
+ info .append ("\n \t \t Name: " ).append (redirect .name ())
1582
+ .append ("\n \t \t Target URL: " ).append (redirect .type ())
1583
+ .append ("\n \t \t Target URL: " ).append (redirect .targetUrl ())
1584
+ .append ("\n \t \t Target listener: " ).append (redirect .targetListener () != null ? redirect .targetListener ().name () : null )
1585
+ .append ("\n \t \t Is path included? " ).append (redirect .isPathIncluded ())
1586
+ .append ("\n \t \t Is query string included? " ).append (redirect .isQueryStringIncluded ())
1587
+ .append ("\n \t \t Referencing request routing rules: " ).append (redirect .requestRoutingRules ().values ());
1588
+ }
1589
+
1533
1590
// Show HTTP listeners
1534
1591
Map <String , ApplicationGatewayListener > listeners = resource .listeners ();
1535
1592
info .append ("\n \t HTTP listeners: " ).append (listeners .size ());
@@ -1555,22 +1612,25 @@ public static void print(ApplicationGateway resource) {
1555
1612
.append ("\n \t \t Interval in seconds: " ).append (probe .timeBetweenProbesInSeconds ())
1556
1613
.append ("\n \t \t Retries: " ).append (probe .retriesBeforeUnhealthy ())
1557
1614
.append ("\n \t \t Timeout: " ).append (probe .timeoutInSeconds ())
1558
- .append ("\n \t \t Host: " ).append (probe .host ());
1615
+ .append ("\n \t \t Host: " ).append (probe .host ())
1616
+ .append ("\n \t \t Healthy HTTP response status code ranges: " ).append (probe .healthyHttpResponseStatusCodeRanges ())
1617
+ .append ("\n \t \t Healthy HTTP response body contents: " ).append (probe .healthyHttpResponseBodyContents ());
1559
1618
}
1560
1619
1561
1620
// Show request routing rules
1562
1621
Map <String , ApplicationGatewayRequestRoutingRule > rules = resource .requestRoutingRules ();
1563
1622
info .append ("\n \t Request routing rules: " ).append (rules .size ());
1564
1623
for (ApplicationGatewayRequestRoutingRule rule : rules .values ()) {
1565
1624
info .append ("\n \t \t Name: " ).append (rule .name ())
1566
- .append ("\n \t \t \t Type: " ).append (rule .ruleType ())
1567
- .append ("\n \t \t \t Public IP address ID: " ).append (rule .publicIPAddressId ())
1568
- .append ("\n \t \t \t Host name: " ).append (rule .hostName ())
1569
- .append ("\n \t \t \t Server name indication required? " ).append (rule .requiresServerNameIndication ())
1570
- .append ("\n \t \t \t Frontend port: " ).append (rule .frontendPort ())
1571
- .append ("\n \t \t \t Frontend protocol: " ).append (rule .frontendProtocol ().toString ())
1572
- .append ("\n \t \t \t Backend port: " ).append (rule .backendPort ())
1573
- .append ("\n \t \t \t Cookie based affinity enabled? " ).append (rule .cookieBasedAffinity ());
1625
+ .append ("\n \t \t Type: " ).append (rule .ruleType ())
1626
+ .append ("\n \t \t Public IP address ID: " ).append (rule .publicIPAddressId ())
1627
+ .append ("\n \t \t Host name: " ).append (rule .hostName ())
1628
+ .append ("\n \t \t Server name indication required? " ).append (rule .requiresServerNameIndication ())
1629
+ .append ("\n \t \t Frontend port: " ).append (rule .frontendPort ())
1630
+ .append ("\n \t \t Frontend protocol: " ).append (rule .frontendProtocol ().toString ())
1631
+ .append ("\n \t \t Backend port: " ).append (rule .backendPort ())
1632
+ .append ("\n \t \t Cookie based affinity enabled? " ).append (rule .cookieBasedAffinity ())
1633
+ .append ("\n \t \t Redirect configuration: " ).append (rule .redirectConfiguration () != null ? rule .redirectConfiguration ().name () : "(none)" );
1574
1634
1575
1635
// Show backend addresses
1576
1636
Collection <ApplicationGatewayBackendAddress > addresses = rule .backendAddresses ();
0 commit comments