/
AzureResourceManager.java
999 lines (880 loc) · 41.1 KB
/
AzureResourceManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.resourcemanager;
import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpPipeline;
import com.azure.core.management.AzureEnvironment;
import com.azure.resourcemanager.appplatform.AppPlatformManager;
import com.azure.resourcemanager.appplatform.models.SpringServices;
import com.azure.resourcemanager.appservice.AppServiceManager;
import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrders;
import com.azure.resourcemanager.appservice.models.AppServiceCertificates;
import com.azure.resourcemanager.appservice.models.AppServiceDomains;
import com.azure.resourcemanager.appservice.models.AppServicePlans;
import com.azure.resourcemanager.appservice.models.FunctionApps;
import com.azure.resourcemanager.appservice.models.WebApps;
import com.azure.resourcemanager.authorization.AuthorizationManager;
import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications;
import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups;
import com.azure.resourcemanager.authorization.models.ActiveDirectoryUsers;
import com.azure.resourcemanager.authorization.models.RoleAssignments;
import com.azure.resourcemanager.authorization.models.RoleDefinitions;
import com.azure.resourcemanager.authorization.models.ServicePrincipals;
import com.azure.resourcemanager.cdn.CdnManager;
import com.azure.resourcemanager.cdn.models.CdnProfiles;
import com.azure.resourcemanager.compute.ComputeManager;
import com.azure.resourcemanager.compute.models.AvailabilitySets;
import com.azure.resourcemanager.compute.models.ComputeSkus;
import com.azure.resourcemanager.compute.models.ComputeUsages;
import com.azure.resourcemanager.compute.models.DiskEncryptionSets;
import com.azure.resourcemanager.compute.models.Disks;
import com.azure.resourcemanager.compute.models.Galleries;
import com.azure.resourcemanager.compute.models.GalleryImageVersions;
import com.azure.resourcemanager.compute.models.GalleryImages;
import com.azure.resourcemanager.compute.models.Snapshots;
import com.azure.resourcemanager.compute.models.VirtualMachineCustomImages;
import com.azure.resourcemanager.compute.models.VirtualMachineImages;
import com.azure.resourcemanager.compute.models.VirtualMachineScaleSets;
import com.azure.resourcemanager.compute.models.VirtualMachines;
import com.azure.resourcemanager.containerinstance.ContainerInstanceManager;
import com.azure.resourcemanager.containerinstance.models.ContainerGroups;
import com.azure.resourcemanager.containerregistry.ContainerRegistryManager;
import com.azure.resourcemanager.containerregistry.models.Registries;
import com.azure.resourcemanager.containerregistry.models.RegistryTaskRuns;
import com.azure.resourcemanager.containerregistry.models.RegistryTasks;
import com.azure.resourcemanager.containerservice.ContainerServiceManager;
import com.azure.resourcemanager.containerservice.models.KubernetesClusters;
import com.azure.resourcemanager.cosmos.CosmosManager;
import com.azure.resourcemanager.cosmos.models.CosmosDBAccounts;
import com.azure.resourcemanager.dns.DnsZoneManager;
import com.azure.resourcemanager.dns.models.DnsZones;
import com.azure.resourcemanager.eventhubs.EventHubsManager;
import com.azure.resourcemanager.eventhubs.models.EventHubDisasterRecoveryPairings;
import com.azure.resourcemanager.eventhubs.models.EventHubNamespaces;
import com.azure.resourcemanager.eventhubs.models.EventHubs;
import com.azure.resourcemanager.keyvault.KeyVaultManager;
import com.azure.resourcemanager.keyvault.models.ManagedHsms;
import com.azure.resourcemanager.keyvault.models.Vaults;
import com.azure.resourcemanager.monitor.MonitorManager;
import com.azure.resourcemanager.monitor.models.ActionGroups;
import com.azure.resourcemanager.monitor.models.ActivityLogs;
import com.azure.resourcemanager.monitor.models.AlertRules;
import com.azure.resourcemanager.monitor.models.AutoscaleSettings;
import com.azure.resourcemanager.monitor.models.DiagnosticSettings;
import com.azure.resourcemanager.monitor.models.MetricDefinitions;
import com.azure.resourcemanager.msi.MsiManager;
import com.azure.resourcemanager.msi.models.Identities;
import com.azure.resourcemanager.network.NetworkManager;
import com.azure.resourcemanager.network.models.ApplicationGateways;
import com.azure.resourcemanager.network.models.ApplicationSecurityGroups;
import com.azure.resourcemanager.network.models.DdosProtectionPlans;
import com.azure.resourcemanager.network.models.ExpressRouteCircuits;
import com.azure.resourcemanager.network.models.ExpressRouteCrossConnections;
import com.azure.resourcemanager.network.models.LoadBalancers;
import com.azure.resourcemanager.network.models.LocalNetworkGateways;
import com.azure.resourcemanager.network.models.NetworkInterfaces;
import com.azure.resourcemanager.network.models.NetworkProfiles;
import com.azure.resourcemanager.network.models.NetworkSecurityGroups;
import com.azure.resourcemanager.network.models.NetworkUsages;
import com.azure.resourcemanager.network.models.NetworkWatchers;
import com.azure.resourcemanager.network.models.Networks;
import com.azure.resourcemanager.network.models.PrivateEndpoints;
import com.azure.resourcemanager.network.models.PublicIpAddresses;
import com.azure.resourcemanager.network.models.PublicIpPrefixes;
import com.azure.resourcemanager.network.models.RouteFilters;
import com.azure.resourcemanager.network.models.RouteTables;
import com.azure.resourcemanager.network.models.VirtualNetworkGateways;
import com.azure.resourcemanager.privatedns.PrivateDnsZoneManager;
import com.azure.resourcemanager.privatedns.models.PrivateDnsZones;
import com.azure.resourcemanager.redis.RedisManager;
import com.azure.resourcemanager.redis.models.RedisCaches;
import com.azure.resourcemanager.resources.ResourceManager;
import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable;
import com.azure.core.management.profile.AzureProfile;
import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl;
import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider;
import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils;
import com.azure.resourcemanager.resources.models.Deployments;
import com.azure.resourcemanager.resources.models.Features;
import com.azure.resourcemanager.resources.models.GenericResources;
import com.azure.resourcemanager.resources.models.ManagementLocks;
import com.azure.resourcemanager.resources.models.PolicyAssignments;
import com.azure.resourcemanager.resources.models.PolicyDefinitions;
import com.azure.resourcemanager.resources.models.Providers;
import com.azure.resourcemanager.resources.models.ResourceGroups;
import com.azure.resourcemanager.resources.models.Subscription;
import com.azure.resourcemanager.resources.models.Subscriptions;
import com.azure.resourcemanager.resources.models.TagOperations;
import com.azure.resourcemanager.resources.models.Tenants;
import com.azure.resourcemanager.search.SearchServiceManager;
import com.azure.resourcemanager.search.models.SearchServices;
import com.azure.resourcemanager.servicebus.ServiceBusManager;
import com.azure.resourcemanager.servicebus.models.ServiceBusNamespaces;
import com.azure.resourcemanager.sql.SqlServerManager;
import com.azure.resourcemanager.sql.models.SqlServers;
import com.azure.resourcemanager.storage.StorageManager;
import com.azure.resourcemanager.storage.models.BlobContainers;
import com.azure.resourcemanager.storage.models.BlobServices;
import com.azure.resourcemanager.storage.models.ManagementPolicies;
import com.azure.resourcemanager.storage.models.StorageAccounts;
import com.azure.resourcemanager.storage.models.StorageSkus;
import com.azure.resourcemanager.storage.models.Usages;
import com.azure.resourcemanager.trafficmanager.TrafficManager;
import com.azure.resourcemanager.trafficmanager.models.TrafficManagerProfiles;
import java.util.Objects;
/**
* The entry point for accessing resource management APIs in Azure.
*
* <p><strong>Instantiating an Azure Client</strong></p>
*
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.authenticate#credential-profile -->
* <pre>
* AzureProfile profile = new AzureProfile(tenantId, subscriptionId, AzureEnvironment.AZURE);
* TokenCredential credential = new DefaultAzureCredentialBuilder()
* .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
* .build();
* AzureResourceManager azure = AzureResourceManager
* .authenticate(credential, profile)
* .withDefaultSubscription();
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.authenticate#credential-profile -->
*/
public final class AzureResourceManager {
private final ResourceManager resourceManager;
private final StorageManager storageManager;
private final ComputeManager computeManager;
private final NetworkManager networkManager;
private final KeyVaultManager keyVaultManager;
private final TrafficManager trafficManager;
private final RedisManager redisManager;
private final CdnManager cdnManager;
private final DnsZoneManager dnsZoneManager;
private final AppServiceManager appServiceManager;
private final SqlServerManager sqlServerManager;
private final ServiceBusManager serviceBusManager;
private final ContainerInstanceManager containerInstanceManager;
private final ContainerRegistryManager containerRegistryManager;
private final ContainerServiceManager containerServiceManager;
private final SearchServiceManager searchServiceManager;
private final CosmosManager cosmosManager;
private final MsiManager msiManager;
private final MonitorManager monitorManager;
private final EventHubsManager eventHubsManager;
private final AppPlatformManager appPlatformManager;
private final PrivateDnsZoneManager privateDnsZoneManager;
private final Authenticated authenticated;
private final String subscriptionId;
private final String tenantId;
/**
* Authenticate to Azure using an Azure credential object.
*
* <p><strong>Code Samples</strong></p>
*
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.authenticate#credential-profile -->
* <pre>
* AzureProfile profile = new AzureProfile(tenantId, subscriptionId, AzureEnvironment.AZURE);
* TokenCredential credential = new DefaultAzureCredentialBuilder()
* .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
* .build();
* AzureResourceManager azure = AzureResourceManager
* .authenticate(credential, profile)
* .withDefaultSubscription();
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.authenticate#credential-profile -->
*
* @param credential the credential object
* @param profile the profile to use
* @return the authenticated Azure client
*/
public static Authenticated authenticate(TokenCredential credential, AzureProfile profile) {
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new AuthenticatedImpl(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile);
}
/**
* Authenticates API access using a RestClient instance.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the profile used in Active Directory
* @return authenticated Azure client
*/
public static Authenticated authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new AuthenticatedImpl(httpPipeline, profile);
}
/**
* Configures the Azure client.
*
* <p><strong>Code Samples</strong></p>
*
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.configure -->
* <pre>
* AzureResourceManager azure = AzureResourceManager
* .configure()
* .withLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)
* .withPolicy(customPolicy)
* .withRetryPolicy(customRetryPolicy)
* .withHttpClient(httpClient)
* //...
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.configure -->
*
* @return an interface allow configurations on the client.
*/
public static Configurable configure() {
return new ConfigurableImpl();
}
/** The interface allowing configurations to be made on the client. */
public interface Configurable extends AzureConfigurable<Configurable> {
/**
* Authenticates API access based on the provided credential.
*
* @param credential The credential to authenticate API access with
* @param profile the profile to use
* @return the authenticated Azure client
*/
Authenticated authenticate(TokenCredential credential, AzureProfile profile);
}
/** The implementation for {@link Configurable}. */
private static final class ConfigurableImpl extends AzureConfigurableImpl<Configurable> implements Configurable {
@Override
public Authenticated authenticate(TokenCredential credential, AzureProfile profile) {
return AzureResourceManager.authenticate(buildHttpPipeline(credential, profile), profile);
}
}
/**
* Provides authenticated access to a subset of Azure APIs that do not require a specific subscription.
*
* <p>To access the subscription-specific APIs, use {@link Authenticated#withSubscription(String)}, or
* withDefaultSubscription() if a default subscription has already been previously specified (for example, in a
* previously specified authentication file).
*/
public interface Authenticated extends AccessManagement {
/** @return the currently selected tenant ID this client is authenticated to work with */
String tenantId();
/**
* Entry point to subscription management APIs.
*
* @return Subscriptions interface providing access to subscription management
*/
Subscriptions subscriptions();
/**
* Entry point to tenant management APIs.
*
* @return Tenants interface providing access to tenant management
*/
Tenants tenants();
/**
* Specifies a specific tenant for azure.
*
* <p>Only Graph RBAC APIs require a tenant to be selected.</p>
*
* @param tenantId the ID of the tenant
* @return the authenticated itself for chaining
*/
Authenticated withTenantId(String tenantId);
/**
* Selects a specific subscription for the APIs to work with.
*
* <p>Most Azure APIs require a specific subscription to be selected.</p>
*
* @param subscriptionId the ID of the subscription
* @return an authenticated Azure client configured to work with the specified subscription
*/
AzureResourceManager withSubscription(String subscriptionId);
/**
* Selects the default subscription as the subscription for the APIs to work with.
*
* <p>The default subscription can be specified inside the Azure profile using {@link
* AzureProfile}. If no default subscription provided, we will try to set the only
* subscription if applicable returned by {@link Authenticated#subscriptions()}</p>
*
* @throws IllegalStateException when no subscription or more than one subscription found in the tenant.
* @return an authenticated Azure client configured to work with the default subscription
*/
AzureResourceManager withDefaultSubscription();
}
/** The implementation for the Authenticated interface. */
private static final class AuthenticatedImpl implements Authenticated {
private final HttpPipeline httpPipeline;
private final ResourceManager.Authenticated resourceManagerAuthenticated;
private AuthorizationManager authorizationManager;
private String tenantId;
private String subscriptionId;
private final AzureEnvironment environment;
private AuthenticatedImpl(HttpPipeline httpPipeline, AzureProfile profile) {
this.resourceManagerAuthenticated = ResourceManager.authenticate(httpPipeline, profile);
this.authorizationManager = AuthorizationManager.authenticate(httpPipeline, profile);
this.httpPipeline = httpPipeline;
this.tenantId = profile.getTenantId();
this.subscriptionId = profile.getSubscriptionId();
this.environment = profile.getEnvironment();
}
@Override
public String tenantId() {
return this.tenantId;
}
@Override
public Subscriptions subscriptions() {
return resourceManagerAuthenticated.subscriptions();
}
@Override
public Tenants tenants() {
return resourceManagerAuthenticated.tenants();
}
@Override
public ActiveDirectoryUsers activeDirectoryUsers() {
return authorizationManager.users();
}
@Override
public ActiveDirectoryGroups activeDirectoryGroups() {
return authorizationManager.groups();
}
@Override
public ServicePrincipals servicePrincipals() {
return authorizationManager.servicePrincipals();
}
@Override
public ActiveDirectoryApplications activeDirectoryApplications() {
return authorizationManager.applications();
}
@Override
public RoleDefinitions roleDefinitions() {
return authorizationManager.roleDefinitions();
}
@Override
public RoleAssignments roleAssignments() {
return authorizationManager.roleAssignments();
}
@Override
public Authenticated withTenantId(String tenantId) {
Objects.requireNonNull(tenantId);
this.tenantId = tenantId;
this.authorizationManager = AuthorizationManager.authenticate(
this.httpPipeline, new AzureProfile(tenantId, subscriptionId, environment));
return this;
}
@Override
public AzureResourceManager withSubscription(String subscriptionId) {
return new AzureResourceManager(
httpPipeline, new AzureProfile(tenantId, subscriptionId, environment), this);
}
@Override
public AzureResourceManager withDefaultSubscription() {
if (subscriptionId == null) {
subscriptionId = ResourceManagerUtils.getDefaultSubscription(this.subscriptions().list());
}
return new AzureResourceManager(
httpPipeline, new AzureProfile(tenantId, subscriptionId, environment), this);
}
}
private AzureResourceManager(HttpPipeline httpPipeline, AzureProfile profile) {
this(httpPipeline, profile, AzureResourceManager.authenticate(httpPipeline, profile));
}
private AzureResourceManager(HttpPipeline httpPipeline, AzureProfile profile, Authenticated authenticated) {
this.resourceManager = ResourceManager.authenticate(httpPipeline, profile).withDefaultSubscription();
this.storageManager = StorageManager.authenticate(httpPipeline, profile);
this.computeManager = ComputeManager.authenticate(httpPipeline, profile);
this.networkManager = NetworkManager.authenticate(httpPipeline, profile);
this.keyVaultManager = KeyVaultManager.authenticate(httpPipeline, profile);
this.trafficManager = TrafficManager.authenticate(httpPipeline, profile);
this.redisManager = RedisManager.authenticate(httpPipeline, profile);
this.cdnManager = CdnManager.authenticate(httpPipeline, profile);
this.dnsZoneManager = DnsZoneManager.authenticate(httpPipeline, profile);
this.appServiceManager = AppServiceManager.authenticate(httpPipeline, profile);
this.sqlServerManager = SqlServerManager.authenticate(httpPipeline, profile);
this.serviceBusManager = ServiceBusManager.authenticate(httpPipeline, profile);
this.containerInstanceManager = ContainerInstanceManager.authenticate(httpPipeline, profile);
this.containerRegistryManager = ContainerRegistryManager.authenticate(httpPipeline, profile);
this.containerServiceManager = ContainerServiceManager.authenticate(httpPipeline, profile);
this.cosmosManager = CosmosManager.authenticate(httpPipeline, profile);
this.searchServiceManager = SearchServiceManager.authenticate(httpPipeline, profile);
this.msiManager = MsiManager.authenticate(httpPipeline, profile);
this.monitorManager = MonitorManager.authenticate(httpPipeline, profile);
this.eventHubsManager = EventHubsManager.authenticate(httpPipeline, profile);
this.appPlatformManager = AppPlatformManager.authenticate(httpPipeline, profile);
this.privateDnsZoneManager = PrivateDnsZoneManager.authenticate(httpPipeline, profile);
this.authenticated = authenticated;
this.subscriptionId = profile.getSubscriptionId();
this.tenantId = profile.getTenantId();
}
/** @return the currently selected subscription ID this client is authenticated to work with */
public String subscriptionId() {
return this.subscriptionId;
}
/** @return the currently selected tenant ID this client is authenticated to work with */
public String tenantId() {
return this.tenantId;
}
/** @return the currently selected subscription this client is authenticated to work with */
public Subscription getCurrentSubscription() {
return this.subscriptions().getById(this.subscriptionId());
}
/** @return entry point to managing subscriptions */
public Subscriptions subscriptions() {
return this.resourceManager.subscriptions();
}
/** @return entry point to managing tenants */
public Tenants tenants() {
return this.resourceManager.tenants();
}
/** @return entry point to managing resource groups */
public ResourceGroups resourceGroups() {
return this.resourceManager.resourceGroups();
}
/** @return entry point to managing deployments */
public Deployments deployments() {
return this.resourceManager.deployments();
}
/** @return entry point to managing generic resources */
public GenericResources genericResources() {
return resourceManager.genericResources();
}
/** @return entry point to managing features */
public Features features() {
return resourceManager.features();
}
/** @return entry point to managing resource providers */
public Providers providers() {
return resourceManager.providers();
}
/** @return entry point to managing policy definitions. */
public PolicyDefinitions policyDefinitions() {
return resourceManager.policyDefinitions();
}
/** @return entry point to managing policy assignments. */
public PolicyAssignments policyAssignments() {
return resourceManager.policyAssignments();
}
/** @return entry point to managing locks. */
public ManagementLocks managementLocks() {
return resourceManager.managementLocks();
}
/**
* Entry point to managing storage accounts
*
* <p><strong>Code Samples</strong></p>
*
* <p>Create an Azure Storage Account</p>
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.storageAccounts.createStorageAccount -->
* <pre>
* azure.storageAccounts().define("<storage-account-name>")
* .withRegion(Region.US_EAST)
* .withNewResourceGroup(resourceGroupName)
* .withSku(StorageAccountSkuType.STANDARD_LRS)
* .withGeneralPurposeAccountKindV2()
* .withOnlyHttpsTraffic()
* //...
* .create();
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.storageAccounts.createStorageAccount -->
*
* @return entry point to managing storage accounts
*/
public StorageAccounts storageAccounts() {
return storageManager.storageAccounts();
}
/** @return entry point to managing storage account usages */
public Usages storageUsages() {
return storageManager.usages();
}
/** @return entry point to managing storage service SKUs */
public StorageSkus storageSkus() {
return storageManager.storageSkus();
}
/** @return entry point to managing availability sets */
public AvailabilitySets availabilitySets() {
return computeManager.availabilitySets();
}
/** @return entry point to managing virtual networks */
public Networks networks() {
return networkManager.networks();
}
/** @return entry point to managing route tables */
public RouteTables routeTables() {
return networkManager.routeTables();
}
/** @return entry point to managing load balancers */
public LoadBalancers loadBalancers() {
return networkManager.loadBalancers();
}
/** @return entry point to managing application gateways */
public ApplicationGateways applicationGateways() {
return networkManager.applicationGateways();
}
/** @return entry point to managing network security groups */
public NetworkSecurityGroups networkSecurityGroups() {
return networkManager.networkSecurityGroups();
}
/** @return entry point to managing network resource usages */
public NetworkUsages networkUsages() {
return networkManager.usages();
}
/** @return entry point to managing network watchers */
public NetworkWatchers networkWatchers() {
return networkManager.networkWatchers();
}
/** @return entry point to managing virtual network gateways */
public VirtualNetworkGateways virtualNetworkGateways() {
return networkManager.virtualNetworkGateways();
}
/** @return entry point to managing local network gateways */
public LocalNetworkGateways localNetworkGateways() {
return networkManager.localNetworkGateways();
}
/** @return entry point to managing express route circuits */
public ExpressRouteCircuits expressRouteCircuits() {
return networkManager.expressRouteCircuits();
}
/** @return entry point to managing express route cross connections */
public ExpressRouteCrossConnections expressRouteCrossConnections() {
return networkManager.expressRouteCrossConnections();
}
/** @return entry point to managing express route circuits */
public ApplicationSecurityGroups applicationSecurityGroups() {
return networkManager.applicationSecurityGroups();
}
/** @return entry point to managing route filters */
public RouteFilters routeFilters() {
return networkManager.routeFilters();
}
/** @return entry point to managing DDoS protection plans */
public DdosProtectionPlans ddosProtectionPlans() {
return networkManager.ddosProtectionPlans();
}
/**
* Entry point to managing virtual machines.
*
* <p><strong>Code Samples</strong></p>
*
* <p>Create a Virtual Machine instance.</p>
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.virtualMachines.createVirtualMachine -->
* <pre>
* VirtualMachine linuxVM = azure.virtualMachines()
* .define(linuxVMName)
* .withRegion(region)
* .withNewResourceGroup(resourceGroupName)
* .withNewPrimaryNetwork("10.0.0.0/28")
* .withPrimaryPrivateIPAddressDynamic()
* .withoutPrimaryPublicIPAddress()
* .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_20_04_LTS_GEN2)
* .withRootUsername(userName)
* .withSsh(sshPublicKey)
* .withNewDataDisk(10)
* .withExistingDataDisk(dataDisk)
* .withSize(VirtualMachineSizeTypes.STANDARD_DS1_V2)
* .create();
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.virtualMachines.createVirtualMachine -->
*
* <p>Restart Virtual Machine instance.</p>
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.virtualMachines.restartVirtualMachineAsync -->
* <pre>
* azure.virtualMachines().listByResourceGroupAsync(resourceGroupName)
* .flatMap(VirtualMachine::restartAsync)
* //...
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.virtualMachines.restartVirtualMachineAsync -->
*
* @return entry point to managing virtual machines
*/
public VirtualMachines virtualMachines() {
return computeManager.virtualMachines();
}
/** @return entry point to managing virtual machine scale sets. */
public VirtualMachineScaleSets virtualMachineScaleSets() {
return computeManager.virtualMachineScaleSets();
}
/** @return entry point to managing virtual machine images */
public VirtualMachineImages virtualMachineImages() {
return computeManager.virtualMachineImages();
}
/** @return entry point to managing virtual machine custom images */
public VirtualMachineCustomImages virtualMachineCustomImages() {
return computeManager.virtualMachineCustomImages();
}
/** @return entry point to managing managed disks */
public Disks disks() {
return computeManager.disks();
}
/** @return entry point to managing managed snapshots */
public Snapshots snapshots() {
return computeManager.snapshots();
}
/** @return the compute service SKU management API entry point */
public ComputeSkus computeSkus() {
return computeManager.computeSkus();
}
/** @return entry point to managing public IP addresses */
public PublicIpAddresses publicIpAddresses() {
return this.networkManager.publicIpAddresses();
}
/** @return entry point to managing public IP prefixes */
public PublicIpPrefixes publicIpPrefixes() {
return this.networkManager.publicIpPrefixes();
}
/** @return entry point to managing network interfaces */
public NetworkInterfaces networkInterfaces() {
return this.networkManager.networkInterfaces();
}
/** @return entry point to managing compute resource usages */
public ComputeUsages computeUsages() {
return computeManager.usages();
}
/** @return entry point to managing key vaults */
public Vaults vaults() {
return this.keyVaultManager.vaults();
}
// /**
// * @return entry point to managing batch accounts.
// */
// public BatchAccounts batchAccounts() {
// return batchManager.batchAccounts();
// }
/**
* @return entry point to managing traffic manager profiles.
*/
public TrafficManagerProfiles trafficManagerProfiles() {
return trafficManager.profiles();
}
/** @return entry point to managing Redis Caches. */
public RedisCaches redisCaches() {
return redisManager.redisCaches();
}
/**
* @return entry point to managing cdn manager profiles.
*/
public CdnProfiles cdnProfiles() {
return cdnManager.profiles();
}
/** @return entry point to managing DNS zones. */
public DnsZones dnsZones() {
return dnsZoneManager.zones();
}
/** @return entry point to managing web apps. */
public WebApps webApps() {
return appServiceManager.webApps();
}
/**
* Entry point to managing function apps.
*
* <p><strong>Code Samples</strong></p>
*
* <p>Create an Azure Function App</p>
*
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.functionApps.createFunctionApp -->
* <pre>
* Creatable<StorageAccount> creatableStorageAccount = azure.storageAccounts()
* .define("<storage-account-name>")
* .withRegion(Region.US_EAST)
* .withExistingResourceGroup(resourceGroupName)
* .withGeneralPurposeAccountKindV2()
* .withSku(StorageAccountSkuType.STANDARD_LRS);
* Creatable<AppServicePlan> creatableAppServicePlan = azure.appServicePlans()
* .define("<app-service-plan-name>")
* .withRegion(Region.US_EAST)
* .withExistingResourceGroup(resourceGroupName)
* .withPricingTier(PricingTier.STANDARD_S1)
* .withOperatingSystem(OperatingSystem.LINUX);
* FunctionApp linuxFunctionApp = azure.functionApps().define("<function-app-name>")
* .withRegion(Region.US_EAST)
* .withExistingResourceGroup(resourceGroupName)
* .withNewLinuxAppServicePlan(creatableAppServicePlan)
* .withBuiltInImage(FunctionRuntimeStack.JAVA_8)
* .withNewStorageAccount(creatableStorageAccount)
* .withHttpsOnly(true)
* .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", "<function-app-package-url>")
* .create();
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.functionApps.createFunctionApp -->
*
* @return entry point to managing function apps.
*/
public FunctionApps functionApps() {
return appServiceManager.functionApps();
}
/** @return entry point to managing app service plans. */
public AppServicePlans appServicePlans() {
return appServiceManager.appServicePlans();
}
/** @return entry point to managing domains. */
public AppServiceDomains appServiceDomains() {
return appServiceManager.domains();
}
/** @return entry point to managing certificates. */
public AppServiceCertificates appServiceCertificates() {
return appServiceManager.certificates();
}
/** @return entry point to managing certificates orders. */
public AppServiceCertificateOrders appServiceCertificateOrders() {
return appServiceManager.certificateOrders();
}
/** @return entry point to managing Sql server. */
public SqlServers sqlServers() {
return sqlServerManager.sqlServers();
}
/**
* @return entry point to managing Service Bus.
*/
public ServiceBusNamespaces serviceBusNamespaces() {
return serviceBusManager.namespaces();
}
/** @return entry point to managing Service Bus operations. */
// TODO: To be revisited in the future
// @Beta(SinceVersion.V1_1_0)
// public ServiceBusOperations serviceBusOperations() {
// return serviceBusManager.operations();
// }
/** @return entry point to managing Kubernetes clusters. */
public KubernetesClusters kubernetesClusters() {
return containerServiceManager.kubernetesClusters();
}
/** @return entry point to managing Azure Container Instances. */
public ContainerGroups containerGroups() {
return containerInstanceManager.containerGroups();
}
/** @return entry point to managing Container Registries. */
public Registries containerRegistries() {
return containerRegistryManager.containerRegistries();
}
/** @return entry point to managing Container Registry RegistryTasks. */
public RegistryTasks containerRegistryTasks() {
return containerRegistryManager.containerRegistryTasks();
}
/** @return entry point to managing Container Registry RegistryTask Runs. */
public RegistryTaskRuns containerRegistryTaskRuns() {
return containerRegistryManager.registryTaskRuns();
}
/** @return entry point to managing Container Regsitries. */
public CosmosDBAccounts cosmosDBAccounts() {
return cosmosManager.databaseAccounts();
}
/**
* @return entry point to managing Search services.
*/
public SearchServices searchServices() {
return searchServiceManager.searchServices();
}
/** @return entry point to managing Managed Service Identity (MSI) identities. */
public Identities identities() {
return msiManager.identities();
}
/** @return entry point to authentication and authorization management in Azure */
public AccessManagement accessManagement() {
return this.authenticated;
}
/** @return entry point to listing activity log events in Azure */
public ActivityLogs activityLogs() {
return this.monitorManager.activityLogs();
}
/** @return entry point to listing metric definitions in Azure */
public MetricDefinitions metricDefinitions() {
return this.monitorManager.metricDefinitions();
}
/** @return entry point to listing diagnostic settings in Azure */
public DiagnosticSettings diagnosticSettings() {
return this.monitorManager.diagnosticSettings();
}
/** @return entry point to managing action groups in Azure */
public ActionGroups actionGroups() {
return this.monitorManager.actionGroups();
}
/** @return entry point to managing alertRules in Azure */
public AlertRules alertRules() {
return this.monitorManager.alertRules();
}
/** @return entry point to managing Autoscale Settings in Azure */
public AutoscaleSettings autoscaleSettings() {
return this.monitorManager.autoscaleSettings();
}
/**
* @return entry point to managing event hub namespaces.
*/
public EventHubNamespaces eventHubNamespaces() {
return this.eventHubsManager.namespaces();
}
/**
* @return entry point to managing event hubs.
*/
public EventHubs eventHubs() {
return this.eventHubsManager.eventHubs();
}
/**
* @return entry point to managing event hub namespace geo disaster recovery.
*/
public EventHubDisasterRecoveryPairings eventHubDisasterRecoveryPairings() {
return this.eventHubsManager.eventHubDisasterRecoveryPairings();
}
/** @return entry point to manage compute galleries. */
public Galleries galleries() {
return this.computeManager.galleries();
}
/** @return entry point to manage compute gallery images. */
public GalleryImages galleryImages() {
return this.computeManager.galleryImages();
}
/** @return entry point to manage compute gallery image versions. */
public GalleryImageVersions galleryImageVersions() {
return this.computeManager.galleryImageVersions();
}
/**
* Entry point to blob container management API.
*
* <p><strong>Code Samples</strong></p>
*
* <p>Create a Blob Container</p>
*
* <!-- src_embed com.azure.resourcemanager.azureResourceManager.storageBlobContainers.createBlobContainer -->
* <pre>
* azure.storageBlobContainers()
* .defineContainer("container")
* .withExistingStorageAccount(storageAccount)
* .withPublicAccess(PublicAccess.NONE)
* //...
* .create();
* </pre>
* <!-- end com.azure.resourcemanager.azureResourceManager.storageBlobContainers.createBlobContainer -->
*
* @return the blob container management API entry point
*/
public BlobContainers storageBlobContainers() {
return this.storageManager.blobContainers();
}
/** @return the blob service management API entry point */
public BlobServices storageBlobServices() {
return this.storageManager.blobServices();
}
/** @return the blob service management API entry point */
public ManagementPolicies storageManagementPolicies() {
return this.storageManager.managementPolicies();
}
/** @return the spring service management API entry point */
public SpringServices springServices() {
return this.appPlatformManager.springServices();
}
/** @return the private DNS zone management API entry point */
public PrivateDnsZones privateDnsZones() {
return this.privateDnsZoneManager.privateZones();
}
/** @return entry point to private endpoints management */
public PrivateEndpoints privateEndpoints() {
return this.networkManager.privateEndpoints();
}
/** @return entry point to tag management management */
public TagOperations tagOperations() {
return this.resourceManager.tagOperations();
}
/** @return entry point to network profiles management */
public NetworkProfiles networkProfiles() {
return this.networkManager.networkProfiles();
}
/** @return entry point to disk encryption sets management */
public DiskEncryptionSets diskEncryptionSets() {
return this.computeManager.diskEncryptionSets();
}
/** @return entry point to Managed Hardware Security Module management */
public ManagedHsms managedHsms() {
return this.keyVaultManager.managedHsms();
}
}