Skip to content

Commit

Permalink
renaming with*Group --> with*ResourceGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Jun 27, 2016
1 parent 53bd408 commit 8c28c6e
Show file tree
Hide file tree
Showing 29 changed files with 92 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ public VirtualMachineImpl withNewStorageAccount(String name) {
.withRegion(this.regionName());
Creatable<StorageAccount> definitionAfterGroup;
if (this.newGroup != null) {
definitionAfterGroup = definitionWithGroup.withNewGroup(this.newGroup);
definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.newGroup);
} else {
definitionAfterGroup = definitionWithGroup.withExistingGroup(this.resourceGroupName());
definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName());
}
return withNewStorageAccount(definitionAfterGroup);
}
Expand Down Expand Up @@ -611,7 +611,7 @@ public VirtualMachineImpl withNewAvailabilitySet(Creatable<AvailabilitySet> crea
public VirtualMachineImpl withNewAvailabilitySet(String name) {
return withNewAvailabilitySet(super.myManager.availabilitySets().define(name)
.withRegion(this.regionName())
.withExistingGroup(this.resourceGroupName())
.withExistingResourceGroup(this.resourceGroupName())
);
}

Expand Down Expand Up @@ -968,7 +968,7 @@ private void handleStorageSettings() throws Exception {
storageAccount = this.storageManager.storageAccounts()
.define(this.namer.randomName("stg", 24))
.withRegion(this.regionName())
.withExistingGroup(this.resourceGroupName())
.withExistingResourceGroup(this.resourceGroupName())
.create();
}

Expand Down Expand Up @@ -1029,7 +1029,7 @@ public void success(ServiceResponse<StorageAccount> result) {
this.storageManager.storageAccounts()
.define(this.namer.randomName("stg", 24))
.withRegion(this.regionName())
.withExistingGroup(this.resourceGroupName())
.withExistingResourceGroup(this.resourceGroupName())
.createAsync(new ServiceCallback<StorageAccount>() {
@Override
public void failure(Throwable t) {
Expand Down Expand Up @@ -1165,9 +1165,9 @@ private NetworkInterface.DefinitionStages.WithPrimaryPublicIpAddress prepareNetw
.withRegion(this.regionName());
NetworkInterface.DefinitionStages.WithPrimaryNetwork definitionWithNetwork;
if (this.newGroup != null) {
definitionWithNetwork = definitionWithGroup.withNewGroup(this.newGroup);
definitionWithNetwork = definitionWithGroup.withNewResourceGroup(this.newGroup);
} else {
definitionWithNetwork = definitionWithGroup.withExistingGroup(this.resourceGroupName());
definitionWithNetwork = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName());
}
return definitionWithNetwork
.withNewPrimaryNetwork("vnet" + name)
Expand All @@ -1192,9 +1192,9 @@ private NetworkInterface.DefinitionStages.WithPrimaryNetwork preparePrimaryNetwo
.withRegion(this.regionName());
NetworkInterface.DefinitionStages.WithPrimaryNetwork definitionAfterGroup;
if (this.newGroup != null) {
definitionAfterGroup = definitionWithGroup.withNewGroup(this.newGroup);
definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.newGroup);
} else {
definitionAfterGroup = definitionWithGroup.withExistingGroup(this.resourceGroupName());
definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName());
}
return definitionAfterGroup;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void canCreateVirtualMachine() throws Exception {
VirtualMachine vm = computeManager.virtualMachines()
.define(VMNAME)
.withRegion(LOCATION)
.withNewGroup(RG_NAME)
.withNewResourceGroup(RG_NAME)
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIpAddressDynamic()
.withoutPrimaryPublicIpAddress()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ public NicIpConfigurationImpl withNewNetwork(String name, String addressSpaceCid

Network.DefinitionStages.WithCreate definitionAfterGroup;
if (this.parent().newGroup() != null) {
definitionAfterGroup = definitionWithGroup.withNewGroup(this.parent().newGroup());
definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.parent().newGroup());
} else {
definitionAfterGroup = definitionWithGroup.withExistingGroup(this.parent().resourceGroupName());
definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.parent().resourceGroupName());
}
return withNewNetwork(definitionAfterGroup.withAddressSpace(addressSpaceCidr));
}
Expand Down Expand Up @@ -218,9 +218,9 @@ private Creatable<PublicIpAddress> prepareCreatablePublicIp(String name, String

PublicIpAddress.DefinitionStages.WithCreate definitionAfterGroup;
if (this.parent().newGroup() != null) {
definitionAfterGroup = definitionWithGroup.withNewGroup(this.parent().newGroup());
definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.parent().newGroup());
} else {
definitionAfterGroup = definitionWithGroup.withExistingGroup(this.parent().resourceGroupName());
definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.parent().resourceGroupName());
}
return definitionAfterGroup.withLeafDomainLabel(leafDnsLabel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,21 @@ interface Blank extends DefinitionStages.WithGroup {
/**
* A deployment definition allowing resource group to be specified.
*/
interface WithGroup extends GroupableResource.DefinitionStages.WithExistingGroup<WithTemplate> {
interface WithGroup extends GroupableResource.DefinitionStages.WithExistingResourceGroup<WithTemplate> {
/**
* Creates a new resource group to put the deployment in.
* @param name the name of the new group
* @param region the region to create the resource group in
* @return the next stage of the deployment definition
*/
WithTemplate withNewGroup(String name, Region region);
WithTemplate withNewResourceGroup(String name, Region region);

/**
* Creates a new resource group to put the resource in, based on the definition specified.
* @param groupDefinition a creatable definition for a new resource group
* @return the next stage of the deployment definition
*/
WithTemplate withNewGroup(Creatable<ResourceGroup> groupDefinition);
WithTemplate withNewResourceGroup(Creatable<ResourceGroup> groupDefinition);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ interface DefinitionStages {
* @param <T> the next stage of the resource definition
*/
interface WithGroup<T> extends
WithExistingGroup<T>,
WithNewGroup<T> {
WithExistingResourceGroup<T>,
WithNewResourceGroup<T> {
}

/**
* A resource definition allowing a new resource group to be created.
*
* @param <T> the next stage of the resource definition
*/
interface WithNewGroup<T> {
interface WithNewResourceGroup<T> {
/**
* Creates a new resource group to put the resource in.
* <p>
* The group will be created in the same location as the resource.
* @param name the name of the new group
* @return the next stage of the resource definition
*/
T withNewGroup(String name);
T withNewResourceGroup(String name);

/**
* Creates a new resource group to put the resource in.
Expand All @@ -54,35 +54,35 @@ interface WithNewGroup<T> {
* The group's name is automatically derived from the resource's name.
* @return the next stage of the resource definition
*/
T withNewGroup();
T withNewResourceGroup();

/**
* Creates a new resource group to put the resource in, based on the definition specified.
* @param groupDefinition a creatable definition for a new resource group
* @return the next stage of the resource definition
*/
T withNewGroup(Creatable<ResourceGroup> groupDefinition);
T withNewResourceGroup(Creatable<ResourceGroup> groupDefinition);
}

/**
* A resource definition allowing an existing resource group to be selected.
*
* @param <T> the next stage of the resource definition
*/
interface WithExistingGroup<T> {
interface WithExistingResourceGroup<T> {
/**
* Associates the resource with an existing resource group.
* @param groupName the name of an existing resource group to put this resource in.
* @return the next stage of the resource definition
*/
T withExistingGroup(String groupName);
T withExistingResourceGroup(String groupName);

/**
* Associates the resource with an existing resource group.
* @param group an existing resource group to put the resource in
* @return the next stage of the resource definition
*/
T withExistingGroup(ResourceGroup group);
T withExistingResourceGroup(ResourceGroup group);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public String resourceGroupName() {
* @param groupName the name of the new group
* @return the next stage of the resource definition
*/
public final FluentModelImplT withNewGroup(String groupName) {
return this.withNewGroup(
public final FluentModelImplT withNewResourceGroup(String groupName) {
return this.withNewResourceGroup(
this.myManager.resourceManager().resourceGroups().define(groupName).withRegion(this.regionName()));
}

Expand All @@ -79,8 +79,8 @@ public final FluentModelImplT withNewGroup(String groupName) {
* The group's name is automatically derived from the resource's name.
* @return the next stage of the resource definition
*/
public final FluentModelImplT withNewGroup() {
return this.withNewGroup(this.name() + "group");
public final FluentModelImplT withNewResourceGroup() {
return this.withNewResourceGroup(this.name() + "group");
}

/**
Expand All @@ -89,7 +89,7 @@ public final FluentModelImplT withNewGroup() {
* @return the next stage of the resource definition
*/
@SuppressWarnings("unchecked")
public final FluentModelImplT withNewGroup(Creatable<ResourceGroup> creatable) {
public final FluentModelImplT withNewResourceGroup(Creatable<ResourceGroup> creatable) {
this.groupName = creatable.key();
this.newGroup = creatable;
addCreatableDependency(creatable);
Expand All @@ -102,7 +102,7 @@ public final FluentModelImplT withNewGroup(Creatable<ResourceGroup> creatable) {
* @return the next stage of the resource definition
*/
@SuppressWarnings("unchecked")
public final FluentModelImplT withExistingGroup(String groupName) {
public final FluentModelImplT withExistingResourceGroup(String groupName) {
this.groupName = groupName;
return (FluentModelImplT) this;
}
Expand All @@ -112,7 +112,7 @@ public final FluentModelImplT withExistingGroup(String groupName) {
* @param group an existing resource group to put the resource in
* @return the next stage of the resource definition
*/
public final FluentModelImplT withExistingGroup(ResourceGroup group) {
return this.withExistingGroup(group.name());
public final FluentModelImplT withExistingResourceGroup(ResourceGroup group) {
return this.withExistingResourceGroup(group.name());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,28 +187,28 @@ public DeploymentExportResult exportTemplate() throws CloudException, IOExceptio
// Withers

@Override
public DeploymentImpl withNewGroup(String resourceGroupName, Region region) {
public DeploymentImpl withNewResourceGroup(String resourceGroupName, Region region) {
this.creatableResourceGroup = this.resourceManager.resourceGroups().define(resourceGroupName).withRegion(region);
this.resourceGroupName = resourceGroupName;
return this;
}

@Override
public DeploymentImpl withNewGroup(Creatable<ResourceGroup> resourceGroupDefinition) {
public DeploymentImpl withNewResourceGroup(Creatable<ResourceGroup> resourceGroupDefinition) {
this.resourceGroupName = resourceGroupDefinition.key();
addCreatableDependency(resourceGroupDefinition);
return this;

}

@Override
public DeploymentImpl withExistingGroup(String resourceGroupName) {
public DeploymentImpl withExistingResourceGroup(String resourceGroupName) {
this.resourceGroupName = resourceGroupName;
return this;
}

@Override
public DeploymentImpl withExistingGroup(ResourceGroup resourceGroup) {
public DeploymentImpl withExistingResourceGroup(ResourceGroup resourceGroup) {
this.resourceGroupName = resourceGroup.name();
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public GenericResource get(String resourceGroupName, String resourceProviderName
serviceClient,
this.myManager);

return resource.withExistingGroup(resourceGroupName)
return resource.withExistingResourceGroup(resourceGroupName)
.withProviderNamespace(resourceProviderNamespace)
.withParentResource(parentResourcePath)
.withResourceType(resourceType)
Expand Down Expand Up @@ -115,7 +115,7 @@ protected GenericResourceImpl wrapModel(String id) {
this.innerCollection,
this.serviceClient,
this.myManager)
.withExistingGroup(ResourceUtils.groupFromResourceId(id))
.withExistingResourceGroup(ResourceUtils.groupFromResourceId(id))
.withProviderNamespace(ResourceUtils.resourceProviderFromResourceId(id))
.withResourceType(ResourceUtils.resourceTypeFromResourceId(id))
.withParentResource(ResourceUtils.parentResourcePathFromResourceId(id));
Expand All @@ -129,7 +129,7 @@ protected GenericResourceImpl wrapModel(GenericResourceInner inner) {
this.innerCollection,
this.serviceClient,
this.myManager)
.withExistingGroup(ResourceUtils.groupFromResourceId(inner.id()))
.withExistingResourceGroup(ResourceUtils.groupFromResourceId(inner.id()))
.withProviderNamespace(ResourceUtils.resourceProviderFromResourceId(inner.id()))
.withResourceType(ResourceUtils.resourceTypeFromResourceId(inner.id()))
.withParentResource(ResourceUtils.parentResourcePathFromResourceId(inner.id()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void canDeployVirtualNetwork() throws Exception {
// Create
resourceClient.deployments()
.define(dp1)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withTemplateLink(templateUri, contentVersion)
.withParametersLink(parametersUri, contentVersion)
.withMode(DeploymentMode.COMPLETE)
Expand Down Expand Up @@ -82,7 +82,7 @@ public void canCancelVirtualNetworkDeployment() throws Exception {
// Begin create
resourceClient.deployments()
.define(dp2)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withTemplateLink(templateUri, contentVersion)
.withParametersLink(parametersUri, contentVersion)
.withMode(DeploymentMode.COMPLETE)
Expand All @@ -101,7 +101,7 @@ public void canUpdateVirtualNetworkDeployment() throws Exception {
// Begin create
resourceClient.deployments()
.define(dp3)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withTemplateLink(templateUri, contentVersion)
.withParametersLink(parametersUri, contentVersion)
.withMode(DeploymentMode.COMPLETE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void canCreateUpdateMoveResource() throws Exception {
// Create
GenericResource resource = genericResources.define(resourceName)
.withRegion(Region.US_SOUTH_CENTRAL)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withResourceType("sites")
.withProviderNamespace("Microsoft.Web")
.withParentResource("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void canCRUDStorageAccount() throws Exception {
StorageAccount storageAccount = storageManager.storageAccounts()
.define(SA_NAME)
.withRegion(Region.ASIA_EAST)
.withNewGroup(RG_NAME)
.withNewResourceGroup(RG_NAME)
.create();
Assert.assertEquals(RG_NAME, storageAccount.resourceGroupName());
Assert.assertEquals(SkuName.STANDARD_GRS, storageAccount.sku().name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void main(String[] args) {

AvailabilitySet availSet1 = azure.availabilitySets().define(availSetName1)
.withRegion(Region.US_EAST)
.withNewGroup(rgName)
.withNewResourceGroup(rgName)
.withFaultDomainCount(2)
.withUpdateDomainCount(4)
.withTag("cluster", "Windowslinux")
Expand All @@ -90,7 +90,7 @@ public static void main(String[] args) {
Network.DefinitionStages.WithCreate network = azure.networks()
.define(vnetName)
.withRegion(Region.US_EAST)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withAddressSpace("10.0.0.0/28");


Expand All @@ -101,7 +101,7 @@ public static void main(String[] args) {

VirtualMachine vm1 = azure.virtualMachines().define(vm1Name)
.withRegion(Region.US_EAST)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withNewPrimaryNetwork(network)
.withPrimaryPrivateIpAddressDynamic()
.withoutPrimaryPublicIpAddress()
Expand All @@ -124,7 +124,7 @@ public static void main(String[] args) {

VirtualMachine vm2 = azure.virtualMachines().define(vm2Name)
.withRegion(Region.US_EAST)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.withNewPrimaryNetwork(network)
.withPrimaryPrivateIpAddressDynamic()
.withoutPrimaryPublicIpAddress()
Expand Down Expand Up @@ -158,7 +158,7 @@ public static void main(String[] args) {

AvailabilitySet availSet2 = azure.availabilitySets().define(availSetName2)
.withRegion(Region.US_EAST)
.withExistingGroup(rgName)
.withExistingResourceGroup(rgName)
.create();

System.out.println("Created second availability set: " + availSet2.id());
Expand Down
Loading

0 comments on commit 8c28c6e

Please sign in to comment.