Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ready For Review] Virtual machine scale sets #1071

Merged
merged 25 commits into from
Sep 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2b7d733
VirtualMachineScaleSet interface with defintion and update stages of …
anuchandy Sep 10, 2016
68bd2f7
Adding more intermediate stage interfaces to update stages
anuchandy Sep 10, 2016
1539d2e
Adding more definition stages of virtual machine scale set
anuchandy Sep 10, 2016
0596d03
Initial VirtualMachineScaleSetImpl and Sku models
anuchandy Sep 10, 2016
5d750dc
Enabling wither for load balancer & it's backends and nat pools
anuchandy Sep 11, 2016
b4f3018
Logic to add & remove backend and inbound nat pool association with t…
anuchandy Sep 11, 2016
ffa0139
Adding support for virtual machine scale set extensions
anuchandy Sep 11, 2016
9641f2e
Adding scale sets entry point
anuchandy Sep 11, 2016
527b1e6
using lb state variables on update
anuchandy Sep 12, 2016
607688c
implementing createInner
anuchandy Sep 13, 2016
5c5cfc9
Adding withers to set computer name prefix and to remove the backends…
anuchandy Sep 13, 2016
8b49955
Exposing some actions
anuchandy Sep 13, 2016
e819bd9
Adding actions to vmss collction and enabling replacing load balancer…
anuchandy Sep 13, 2016
d0a921c
Merge remote-tracking branch 'origin/master' into vmss-fluent2
anuchandy Sep 13, 2016
dd48691
Starting unit test and some fixes
anuchandy Sep 13, 2016
520ae9e
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into vms…
anuchandy Sep 13, 2016
b4c249c
setting couple of default values and simplifying code
anuchandy Sep 14, 2016
8353c4a
first unit test that creates VMSS. Adding a check to avoid Azure putt…
anuchandy Sep 15, 2016
e100f6c
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into vms…
anuchandy Sep 15, 2016
d7b1241
fix checkstyle error due to incorrect javadoc
anuchandy Sep 15, 2016
64d4056
Adding unit test validate connection to vms in a scale set via intern…
anuchandy Sep 15, 2016
fb53fc1
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into vms…
anuchandy Sep 17, 2016
5be9ab4
Using updated ChildResource that exposes parent()
anuchandy Sep 17, 2016
fe9b75d
Addressing CR and adding annotations
anuchandy Sep 19, 2016
357b8bb
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into vms…
anuchandy Sep 20, 2016
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
6 changes: 6 additions & 0 deletions azure-mgmt-compute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
<artifactId>api-annotations</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.53</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.microsoft.azure.management.compute;

import com.microsoft.azure.management.apigeneration.LangDefinition;

/**
* A type representing sku available for virtual machines in a scale set.
*/
@LangDefinition(ContainerName = "~/")
public interface VirtualMachineScaleSetSku {
/**
* @return the type of resource the sku applies to.
*/
String resourceType();

/**
* @return the Sku type.
*/
VirtualMachineScaleSetSkuTypes skuType();

/**
* @return available scaling information.
*/
VirtualMachineScaleSetSkuCapacity capacity();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
package com.microsoft.azure.management.compute;

import com.microsoft.azure.management.apigeneration.LangDefinition;

/**
* Scale set virtual machine sku types.
*/
@LangDefinition
public class VirtualMachineScaleSetSkuTypes {
/** Static value Standard_A0 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A0 = new VirtualMachineScaleSetSkuTypes("Standard_A0", "Standard");

/** Static value Standard_A1 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A1 = new VirtualMachineScaleSetSkuTypes("Standard_A1", "Standard");

/** Static value Standard_A2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A2 = new VirtualMachineScaleSetSkuTypes("Standard_A2", "Standard");

/** Static value Standard_A3 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A3 = new VirtualMachineScaleSetSkuTypes("Standard_A3", "Standard");

/** Static value Standard_A4 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A4 = new VirtualMachineScaleSetSkuTypes("Standard_A4", "Standard");

/** Static value Standard_A5 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A5 = new VirtualMachineScaleSetSkuTypes("Standard_A5", "Standard");

/** Static value Standard_A6 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A6 = new VirtualMachineScaleSetSkuTypes("Standard_A6", "Standard");

/** Static value Standard_A7 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A7 = new VirtualMachineScaleSetSkuTypes("Standard_A7", "Standard");

/** Static value Standard_A8 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A8 = new VirtualMachineScaleSetSkuTypes("Standard_A8", "Standard");

/** Static value Standard_A9 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A9 = new VirtualMachineScaleSetSkuTypes("Standard_A9", "Standard");

/** Static value Standard_A10 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A10 = new VirtualMachineScaleSetSkuTypes("Standard_A10", "Standard");

/** Static value Standard_A11 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_A11 = new VirtualMachineScaleSetSkuTypes("Standard_A11", "Standard");

/** Static value Standard_D1 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D1 = new VirtualMachineScaleSetSkuTypes("Standard_D1", "Standard");

/** Static value Standard_D2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D2 = new VirtualMachineScaleSetSkuTypes("Standard_D2", "Standard");

/** Static value Standard_D3 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D3 = new VirtualMachineScaleSetSkuTypes("Standard_D3", "Standard");

/** Static value Standard_D4 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D4 = new VirtualMachineScaleSetSkuTypes("Standard_D4", "Standard");

/** Static value Standard_D11 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D11 = new VirtualMachineScaleSetSkuTypes("Standard_D11", "Standard");

/** Static value Standard_D12 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D12 = new VirtualMachineScaleSetSkuTypes("Standard_D12", "Standard");

/** Static value Standard_D13 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D13 = new VirtualMachineScaleSetSkuTypes("Standard_D13", "Standard");

/** Static value Standard_D14 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D14 = new VirtualMachineScaleSetSkuTypes("Standard_D14", "Standard");

/** Static value Standard_D1_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D1_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D1_v2", "Standard");

/** Static value Standard_D2_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D2_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D2_v2", "Standard");

/** Static value Standard_D3_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D3_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D3_v2", "Standard");

/** Static value Standard_D4_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D4_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D4_v2", "Standard");

/** Static value Standard_D5_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D5_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D5_v2", "Standard");

/** Static value Standard_D11_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D11_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D11_v2", "Standard");

/** Static value Standard_D12_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D12_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D12_v2", "Standard");

/** Static value Standard_D13_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D13_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D13_v2", "Standard");

/** Static value Standard_D14_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D14_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D14_v2", "Standard");

/** Static value Standard_D15_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_D15_V2 = new VirtualMachineScaleSetSkuTypes("Standard_D15_v2", "Standard");

/** Static value Standard_DS1 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS1 = new VirtualMachineScaleSetSkuTypes("Standard_DS1", "Standard");

/** Static value Standard_DS2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS2 = new VirtualMachineScaleSetSkuTypes("Standard_DS2", "Standard");

/** Static value Standard_DS3 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS3 = new VirtualMachineScaleSetSkuTypes("Standard_DS3", "Standard");

/** Static value Standard_DS4 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS4 = new VirtualMachineScaleSetSkuTypes("Standard_DS4", "Standard");

/** Static value Standard_DS11 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS11 = new VirtualMachineScaleSetSkuTypes("Standard_DS11", "Standard");

/** Static value Standard_DS12 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS12 = new VirtualMachineScaleSetSkuTypes("Standard_DS12", "Standard");

/** Static value Standard_DS13 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS13 = new VirtualMachineScaleSetSkuTypes("Standard_DS13", "Standard");

/** Static value Standard_DS14 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS14 = new VirtualMachineScaleSetSkuTypes("Standard_DS14", "Standard");

/** Static value Standard_DS1_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS1_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS1_v2", "Standard");

/** Static value Standard_DS2_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS2_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS2_v2", "Standard");

/** Static value Standard_DS3_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS3_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS3_v2", "Standard");

/** Static value Standard_DS4_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS4_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS4_v2", "Standard");

/** Static value Standard_DS5_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS5_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS5_v2", "Standard");

/** Static value Standard_DS11_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS11_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS11_v2", "Standard");

/** Static value Standard_DS12_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS12_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS12_v2", "Standard");

/** Static value Standard_DS13_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS13_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS13_v2", "Standard");

/** Static value Standard_DS14_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS14_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS14_v2", "Standard");

/** Static value Standard_DS15_v2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_DS15_V2 = new VirtualMachineScaleSetSkuTypes("Standard_DS15_v2", "Standard");

/** Static value STANDARD_F1S for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F1S = new VirtualMachineScaleSetSkuTypes("STANDARD_F1S", "Standard");

/** Static value STANDARD_F2S for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F2S = new VirtualMachineScaleSetSkuTypes("STANDARD_F2S", "Standard");

/** Static value STANDARD_F4S for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F4S = new VirtualMachineScaleSetSkuTypes("STANDARD_F4S", "Standard");

/** Static value STANDARD_F8S for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F8S = new VirtualMachineScaleSetSkuTypes("STANDARD_F8S", "Standard");

/** Static value STANDARD_F16S for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F16S = new VirtualMachineScaleSetSkuTypes("STANDARD_F16S", "Standard");

/** Static value STANDARD_F1 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F1 = new VirtualMachineScaleSetSkuTypes("STANDARD_F1", "Standard");

/** Static value STANDARD_F2 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F2 = new VirtualMachineScaleSetSkuTypes("STANDARD_F2", "Standard");

/** Static value STANDARD_F4 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F4 = new VirtualMachineScaleSetSkuTypes("STANDARD_F4", "Standard");

/** Static value STANDARD_F8 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F8 = new VirtualMachineScaleSetSkuTypes("STANDARD_F8", "Standard");

/** Static value STANDARD_F16 for VirtualMachineScaleSetSkuTypes. */
public static final VirtualMachineScaleSetSkuTypes STANDARD_F16 = new VirtualMachineScaleSetSkuTypes("STANDARD_F16", "Standard");

/**
* the sku corresponding to this size.
*/
private Sku sku;

/**
* The string value of the sku.
*/
private String value;
/**
* Creates a custom value for VirtualMachineSizeTypes.
* @param skuName the sku name
* @param skuTier thr sku tier
*/
public VirtualMachineScaleSetSkuTypes(String skuName, String skuTier) {
this(new Sku().withName(skuName).withTier(skuTier));
}

/**
* Creates a custom value for VirtualMachineSizeTypes.
* @param sku the sku
*/
public VirtualMachineScaleSetSkuTypes(Sku sku) {
this.sku = sku;
this.value = this.sku.name();
if (this.sku.tier() != null) {
this.value = this.value + "_" + this.sku.tier();
}
}

/**
* @return the sku
*/
public Sku sku() {
return this.sku;
}

@Override
public String toString() {
return this.value;
}

@Override
public int hashCode() {
return this.value.hashCode();
}

@Override
public boolean equals(Object obj) {
String value = this.toString();
if (!(obj instanceof VirtualMachineScaleSetSkuTypes)) {
return false;
}
if (obj == this) {
return true;
}
VirtualMachineScaleSetSkuTypes rhs = (VirtualMachineScaleSetSkuTypes) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package com.microsoft.azure.management.compute;

import com.microsoft.azure.CloudException;
import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByGroup;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsListingByGroup;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;

import java.io.IOException;

/**
* Entry point to virtual machine scale set management API.
*/
@LangDefinition(ContainerName = "~/")
public interface VirtualMachineScaleSets extends
SupportsListing<VirtualMachineScaleSet>,
SupportsListingByGroup<VirtualMachineScaleSet>,
SupportsGettingByGroup<VirtualMachineScaleSet>,
SupportsGettingById<VirtualMachineScaleSet>,
SupportsCreating<VirtualMachineScaleSet.DefinitionStages.Blank>,
SupportsDeleting,
SupportsDeletingByGroup,
SupportsBatchCreation<VirtualMachineScaleSet> {
/**
* Shuts down the Virtual Machine in the scale set and releases the compute resources.
* <p>
* You are not billed for the compute resources that the Virtual Machines uses
*
* @param groupName the name of the resource group the virtual machine scale set is in
* @param name the name of the virtual machine scale set
* @throws CloudException thrown for an invalid response from the service.
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when the operation is interrupted
*/
void deallocate(String groupName, String name) throws CloudException, IOException, InterruptedException;

/**
* Power off (stop) the virtual machines in the scale set.
* <p>
* You will be billed for the compute resources that the Virtual Machines uses.
*
* @param groupName the name of the resource group the virtual machine scale set is in
* @param name the name of the virtual machine scale set
* @throws CloudException thrown for an invalid response from the service.
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when the operation is interrupted
*/
void powerOff(String groupName, String name) throws CloudException, IOException, InterruptedException;

/**
* Restart the virtual machines in the scale set.
*
* @param groupName the name of the resource group the virtual machine scale set is in
* @param name the name of the virtual machine scale set
* @throws CloudException thrown for an invalid response from the service.
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when the operation is interrupted
*/
void restart(String groupName, String name) throws CloudException, IOException, InterruptedException;

/**
* Start the virtual machines in the scale set.
*
* @param groupName the name of the resource group the virtual machine scale set is in
* @param name the name of the virtual machine scale set
* @throws CloudException thrown for an invalid response from the service.
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when the operation is interrupted
*/
void start(String groupName, String name) throws CloudException, IOException, InterruptedException;

/**
* Re-image (update the version of the installed operating system) the virtual machines in the scale set.
*
* @param groupName the name of the resource group the virtual machine scale set is in
* @param name the name of the virtual machine scale set
* @throws CloudException thrown for an invalid response from the service.
* @throws IOException exception thrown from serialization/deserialization
* @throws InterruptedException exception thrown when the operation is interrupted
*/
void reimage(String groupName, String name) throws CloudException, IOException, InterruptedException;
}
Loading