Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ Mono<SiteLogsConfigInner> updateDiagnosticLogsConfig(SiteLogsConfigInner siteLog
}

private AppServicePlanImpl newDefaultAppServicePlan() {
String planName = this.manager().getSdkContext().randomResourceName(name() + "plan", 32);
String planName = this.manager().sdkContext().randomResourceName(name() + "plan", 32);
return newDefaultAppServicePlan(planName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Mono<Indexable> submitAppSettings() {
SETTING_WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, connectionString);
addAppSettingIfNotModified(
SETTING_WEBSITE_CONTENTSHARE,
this.manager().getSdkContext().randomResourceName(name(), 32));
this.manager().sdkContext().randomResourceName(name(), 32));
}
return FunctionAppImpl.super.submitAppSettings();
}))
Expand Down Expand Up @@ -631,7 +631,7 @@ public Flux<Indexable> createAsync() {
}
if (currentStorageAccount == null && storageAccountToSet == null && storageAccountCreatable == null) {
withNewStorageAccount(
this.manager().getSdkContext().randomResourceName(name(), 20),
this.manager().sdkContext().randomResourceName(name(), 20),
com.azure.management.storage.SkuName.STANDARD_GRS);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public JsonProperty.Access findPropertyAccess(Annotated annotated) {
this.networkManager = networkManager;
this.vmName = name;
this.isMarketplaceLinuxImage = false;
this.namer = this.manager().getSdkContext().getResourceNamerFactory().createResourceNamer(this.vmName);
this.namer = this.manager().sdkContext().getResourceNamerFactory().createResourceNamer(this.vmName);
this.creatableSecondaryNetworkInterfaceKeys = new ArrayList<>();
this.existingSecondaryNetworkInterfacesToAssociate = new ArrayList<>();
this.virtualMachineExtensions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public class VirtualMachineScaleSetImpl
super(name, innerModel, computeManager);
this.storageManager = storageManager;
this.networkManager = networkManager;
this.namer = this.manager().getSdkContext().getResourceNamerFactory().createResourceNamer(this.name());
this.namer = this.manager().sdkContext().getResourceNamerFactory().createResourceNamer(this.name());
this.managedDataDisks = new ManagedDataDiskCollection(this);
this.virtualMachineScaleSetMsiHandler = new VirtualMachineScaleSetMsiHandler(rbacManager, this);
this.bootDiagnosticsHandler = new BootDiagnosticsHandler(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public void testAppGatewaysPublicUrlPathBased() throws Exception {

@Test
public void testAppGatewayBackendHealthCheck() throws Exception {
String testId = azure.applicationGateways().manager().getSdkContext().randomResourceName("", 15);
String testId = azure.applicationGateways().manager().sdkContext().randomResourceName("", 15);
String name = "ag" + testId;
Region region = Region.US_EAST;
String password = azure.applicationGateways().manager().getSdkContext().randomResourceName("Abc.123", 12);
String password = azure.applicationGateways().manager().sdkContext().randomResourceName("Abc.123", 12);
String vnetName = "net" + testId;
String rgName = "rg" + testId;

Expand Down Expand Up @@ -278,7 +278,7 @@ public void testAppGatewaysStartStop() throws Exception {

@Test
public void testApplicationGatewaysInParallel() throws Exception {
String rgName = azure.applicationGateways().manager().getSdkContext().randomResourceName("rg", 13);
String rgName = azure.applicationGateways().manager().sdkContext().randomResourceName("rg", 13);
Region region = Region.US_EAST;
Creatable<ResourceGroup> resourceGroup = azure.resourceGroups().define(rgName).withRegion(region);
List<Creatable<ApplicationGateway>> agCreatables = new ArrayList<>();
Expand All @@ -287,7 +287,7 @@ public void testApplicationGatewaysInParallel() throws Exception {
.add(
azure
.applicationGateways()
.define(azure.applicationGateways().manager().getSdkContext().randomResourceName("ag", 13))
.define(azure.applicationGateways().manager().sdkContext().randomResourceName("ag", 13))
.withRegion(Region.US_EAST)
.withNewResourceGroup(resourceGroup)
.defineRequestRoutingRule("rule1")
Expand All @@ -302,7 +302,7 @@ public void testApplicationGatewaysInParallel() throws Exception {
.add(
azure
.applicationGateways()
.define(azure.applicationGateways().manager().getSdkContext().randomResourceName("ag", 13))
.define(azure.applicationGateways().manager().sdkContext().randomResourceName("ag", 13))
.withRegion(Region.US_EAST)
.withNewResourceGroup(resourceGroup)
.defineRequestRoutingRule("rule1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void run() {
*/
@Test
public void testDeployments() throws Exception {
String testId = azure.deployments().manager().getSdkContext().randomResourceName("", 8);
String testId = azure.deployments().manager().sdkContext().randomResourceName("", 8);
PagedIterable<Deployment> deployments = azure.deployments().list();
System.out.println("Deployments: " + TestUtilities.getSize(deployments));
Deployment deployment =
Expand Down Expand Up @@ -216,13 +216,13 @@ public void testGenericResources() throws Exception {
NetworkSecurityGroup nsg =
azure
.networkSecurityGroups()
.define(azure.networkSecurityGroups().manager().getSdkContext().randomResourceName("nsg", 13))
.define(azure.networkSecurityGroups().manager().sdkContext().randomResourceName("nsg", 13))
.withRegion(Region.US_EAST)
.withNewResourceGroup()
.create();
azure
.publicIpAddresses()
.define(azure.networkSecurityGroups().manager().getSdkContext().randomResourceName("pip", 13))
.define(azure.networkSecurityGroups().manager().sdkContext().randomResourceName("pip", 13))
.withRegion(Region.US_EAST)
.withExistingResourceGroup(nsg.resourceGroupName())
.create();
Expand Down Expand Up @@ -559,7 +559,7 @@ public void testLoadBalancersInternalWithAvailabilityZone() throws Exception {

@Test
public void testManagedDiskVMUpdate() throws Exception {
SdkContext context = azure.disks().manager().getSdkContext();
SdkContext context = azure.disks().manager().sdkContext();
final String rgName = context.randomResourceName("rg", 13);
final String linuxVM2Name = context.randomResourceName("vm" + "-", 10);
final String linuxVM2Pip = context.randomResourceName("pip" + "-", 18);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class TestAvailabilitySet extends TestTemplate<AvailabilitySet, AvailabilitySets> {
@Override
public AvailabilitySet createResource(AvailabilitySets availabilitySets) throws Exception {
final String newName = availabilitySets.manager().getSdkContext().randomResourceName("as", 10);
final String newName = availabilitySets.manager().sdkContext().randomResourceName("as", 10);
AvailabilitySet aset =
availabilitySets
.define(newName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TestContainerRegistry extends TestTemplate<Registry, Registries> {

@Override
public Registry createResource(Registries registries) throws Exception {
final String testId = registries.manager().getSdkContext().randomResourceName("", 8);
final String testId = registries.manager().sdkContext().randomResourceName("", 8);
final String newName = "acr" + testId;
final String rgName = "rgacr" + testId;
Registry registry =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TestCosmosDB extends TestTemplate<CosmosDBAccount, CosmosDBAccounts

@Override
public CosmosDBAccount createResource(CosmosDBAccounts resources) throws Exception {
final String newName = "docDB" + resources.manager().getSdkContext().randomResourceName("", 8);
final String newName = "docDB" + resources.manager().sdkContext().randomResourceName("", 8);
CosmosDBAccount databaseAccount =
resources
.define(newName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private void initializeResourceNames(SdkContext sdkContext) {
public class Basic extends TestTemplate<ExpressRouteCircuit, ExpressRouteCircuits> {
@Override
public ExpressRouteCircuit createResource(ExpressRouteCircuits expressRouteCircuits) throws Exception {
initializeResourceNames(expressRouteCircuits.manager().getSdkContext());
initializeResourceNames(expressRouteCircuits.manager().sdkContext());

// create Express Route Circuit
ExpressRouteCircuit erc =
Expand Down Expand Up @@ -78,7 +78,7 @@ public void print(ExpressRouteCircuit resource) {
public class ExpressRouteCircuitPeering extends TestTemplate<ExpressRouteCircuit, ExpressRouteCircuits> {
@Override
public ExpressRouteCircuit createResource(ExpressRouteCircuits expressRouteCircuits) throws Exception {
initializeResourceNames(expressRouteCircuits.manager().getSdkContext());
initializeResourceNames(expressRouteCircuits.manager().sdkContext());

// create Express Route Circuit
ExpressRouteCircuit erc =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TestKubernetesCluster extends TestTemplate<KubernetesCluster, Kuber
public KubernetesCluster createResource(KubernetesClusters kubernetesClusters) throws Exception {
final String sshKeyData = this.getSshKey();

final String newName = "aks" + kubernetesClusters.manager().getSdkContext().randomResourceName("", 8);
final String newName = "aks" + kubernetesClusters.manager().sdkContext().randomResourceName("", 8);
final String dnsPrefix = "dns" + newName;
final String agentPoolName = "ap" + newName;
String clientId = "clientId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class InternetWithNatPool extends TestTemplate<LoadBalancer, LoadBalancer
* @param computeManager compute manager
*/
public InternetWithNatPool(ComputeManager computeManager) {
initializeResourceNames(computeManager.getSdkContext());
initializeResourceNames(computeManager.sdkContext());
this.computeManager = computeManager;
}

Expand Down Expand Up @@ -214,7 +214,7 @@ public class InternetWithNatRule extends TestTemplate<LoadBalancer, LoadBalancer
* @param computeManager compute manager
*/
public InternetWithNatRule(ComputeManager computeManager) {
initializeResourceNames(computeManager.getSdkContext());
initializeResourceNames(computeManager.sdkContext());
this.computeManager = computeManager;
}

Expand Down Expand Up @@ -410,7 +410,7 @@ public class InternetNatOnly extends TestTemplate<LoadBalancer, LoadBalancers> {
* @param computeManager compute manager
*/
public InternetNatOnly(ComputeManager computeManager) {
initializeResourceNames(computeManager.getSdkContext());
initializeResourceNames(computeManager.sdkContext());
this.computeManager = computeManager;
}

Expand Down Expand Up @@ -562,7 +562,7 @@ public class InternetMinimal extends TestTemplate<LoadBalancer, LoadBalancers> {
* @param computeManager compute manager
*/
public InternetMinimal(ComputeManager computeManager) {
initializeResourceNames(computeManager.getSdkContext());
initializeResourceNames(computeManager.sdkContext());
this.computeManager = computeManager;
}

Expand All @@ -574,7 +574,7 @@ public void print(LoadBalancer resource) {
@Override
public LoadBalancer createResource(LoadBalancers resources) throws Exception {
VirtualMachine[] existingVMs = ensureVMs(resources.manager().networks(), this.computeManager, 2);
String pipDnsLabel = resources.manager().getSdkContext().randomResourceName("pip", 20);
String pipDnsLabel = resources.manager().sdkContext().randomResourceName("pip", 20);

// Create a load balancer
LoadBalancer lb =
Expand Down Expand Up @@ -736,7 +736,7 @@ public class InternalMinimal extends TestTemplate<LoadBalancer, LoadBalancers> {
* @param computeManager compute manager
*/
public InternalMinimal(ComputeManager computeManager) {
initializeResourceNames(computeManager.getSdkContext());
initializeResourceNames(computeManager.sdkContext());
this.computeManager = computeManager;
}

Expand Down Expand Up @@ -916,7 +916,7 @@ public class InternalWithZone extends TestTemplate<LoadBalancer, LoadBalancers>
*/
public InternalWithZone(ComputeManager computeManager) {
region = Region.US_EAST2;
initializeResourceNames(computeManager.getSdkContext());
initializeResourceNames(computeManager.sdkContext());
this.computeManager = computeManager;
}

Expand Down Expand Up @@ -1052,7 +1052,7 @@ private VirtualMachine[] ensureVMs(Networks networks, ComputeManager computeMana
String userName = "testuser" + testId;
List<Creatable<VirtualMachine>> vmDefinitions = new ArrayList<>();
for (int i = 0; i < count; i++) {
String vmName = computeManager.getSdkContext().randomResourceName("vm", 15);
String vmName = computeManager.sdkContext().randomResourceName("vm", 15);

Creatable<VirtualMachine> vm =
computeManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private void initializeResourceNames(SdkContext sdkContext) {

@Override
public LocalNetworkGateway createResource(LocalNetworkGateways localNetworkGateways) throws Exception {
initializeResourceNames(localNetworkGateways.manager().getSdkContext());
initializeResourceNames(localNetworkGateways.manager().sdkContext());
LocalNetworkGateway gateway =
localNetworkGateways
.define(lngwName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
public class TestNSG extends TestTemplate<NetworkSecurityGroup, NetworkSecurityGroups> {
@Override
public NetworkSecurityGroup createResource(NetworkSecurityGroups nsgs) throws Exception {
String postFix = nsgs.manager().getSdkContext().randomResourceName("", 8);
String postFix = nsgs.manager().sdkContext().randomResourceName("", 8);
final String newName = "nsg" + postFix;
final String resourceGroupName = "rg" + postFix;
final String nicName = "nic" + postFix;
final String asgName = nsgs.manager().getSdkContext().randomResourceName("asg", 8);
final String asgName = nsgs.manager().sdkContext().randomResourceName("asg", 8);
final Region region = Region.US_WEST;
final SettableFuture<NetworkSecurityGroup> nsgFuture = SettableFuture.create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class WithSubnets extends TestTemplate<Network, Networks> {
@Override
public Network createResource(Networks networks) throws Exception {

String postFix = networks.manager().getSdkContext().randomResourceName("", 8);
String postFix = networks.manager().sdkContext().randomResourceName("", 8);
final String newName = "net" + postFix;
Region region = Region.US_WEST;
String groupName = "rg" + postFix;
Expand Down Expand Up @@ -91,7 +91,7 @@ public Network updateResource(Network resource) throws Exception {
resource
.manager()
.networkSecurityGroups()
.define(resource.manager().getSdkContext().randomResourceName("nsgB", 10))
.define(resource.manager().sdkContext().randomResourceName("nsgB", 10))
.withRegion(resource.region())
.withExistingResourceGroup(resource.resourceGroupName())
.create();
Expand Down Expand Up @@ -153,7 +153,7 @@ public class WithAccessFromServiceToSubnet extends TestTemplate<Network, Network

@Override
public Network createResource(Networks networks) throws Exception {
String postfix = networks.manager().getSdkContext().randomResourceName("", 8);
String postfix = networks.manager().sdkContext().randomResourceName("", 8);
final String newName = "net" + postfix;
Region region = Region.US_WEST;
String groupName = "rg" + postfix;
Expand Down Expand Up @@ -250,10 +250,10 @@ public class WithPeering extends TestTemplate<Network, Networks> {
@Override
public Network createResource(Networks networks) throws Exception {
Region region = Region.US_EAST;
String groupName = networks.manager().getSdkContext().randomResourceName("rg", 10);
String groupName = networks.manager().sdkContext().randomResourceName("rg", 10);

String networkName = networks.manager().getSdkContext().randomResourceName("net", 15);
String networkName2 = networks.manager().getSdkContext().randomResourceName("net", 15);
String networkName = networks.manager().sdkContext().randomResourceName("net", 15);
String networkName2 = networks.manager().sdkContext().randomResourceName("net", 15);

Creatable<Network> remoteNetworkDefinition =
networks
Expand Down Expand Up @@ -374,9 +374,9 @@ public class WithDDosProtectionPlanAndVmProtection extends TestTemplate<Network,
@Override
public Network createResource(Networks networks) throws Exception {
Region region = Region.US_EAST2;
String groupName = networks.manager().getSdkContext().randomResourceName("rg", 10);
String groupName = networks.manager().sdkContext().randomResourceName("rg", 10);

String networkName = networks.manager().getSdkContext().randomResourceName("net", 15);
String networkName = networks.manager().sdkContext().randomResourceName("net", 15);

Network network =
networks
Expand Down Expand Up @@ -413,9 +413,9 @@ public class WithUpdateTags extends TestTemplate<Network, Networks> {
@Override
public Network createResource(Networks networks) throws Exception {
Region region = Region.US_SOUTH_CENTRAL;
String groupName = networks.manager().getSdkContext().randomResourceName("rg", 10);
String groupName = networks.manager().sdkContext().randomResourceName("rg", 10);

String networkName = networks.manager().getSdkContext().randomResourceName("net", 15);
String networkName = networks.manager().sdkContext().randomResourceName("net", 15);

Network network =
networks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class TestNetworkInterface extends TestTemplate<NetworkInterface, Network
@Override
public NetworkInterface createResource(NetworkInterfaces networkInterfaces) throws Exception {

String postfix = networkInterfaces.manager().getSdkContext().randomResourceName("", 8);
String postfix = networkInterfaces.manager().sdkContext().randomResourceName("", 8);
final String nicName = "nic" + postfix;
final String vnetName = "net" + postfix;
final String pipName = "pip" + postfix;
Expand Down
Loading