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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ jdk:
- oraclejdk8

script:
- mvn compile
- mvn install -DskipTests=true
- mvn --projects runtimes,azure-mgmt-storage,azure-mgmt-network,azure-mgmt-compute checkstyle:check
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.microsoft.azure.management.compute;

import com.microsoft.azure.CloudException;
import com.microsoft.azure.management.compute.implementation.api.AvailabilitySetInner;
import com.microsoft.azure.management.compute.implementation.api.InstanceViewStatus;
import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource;
Expand All @@ -10,10 +11,11 @@
import com.microsoft.azure.management.resources.fluentcore.model.Updatable;
import com.microsoft.azure.management.resources.fluentcore.model.Wrapper;

import java.io.IOException;
import java.util.List;

/**
* An immutable client-side representation of an Azure availability set.
* An immutable client-side representation of an Azure availability set.
*/
public interface AvailabilitySet extends
GroupableResource,
Expand Down Expand Up @@ -52,8 +54,11 @@ public interface AvailabilitySet extends
* Lists the virtual machines in the availability set.
*
* @return list of virtual machines
* @throws CloudException exceptions thrown from the cloud
* @throws IOException exceptions thrown from serialization/deserialization

*/
List<VirtualMachine> virtualMachines() throws Exception;
List<VirtualMachine> virtualMachines() throws CloudException, IOException;

/**
* Lists the statuses of the existing virtual machines in the availability set.
Expand All @@ -68,32 +73,32 @@ public interface AvailabilitySet extends
**************************************************************/

/**
* Container interface for all the definitions
* Container interface for all the definitions.
*/
interface Definitions extends
DefinitionBlank,
DefinitionWithGroup,
DefinitionCreatable {
}

/**
* The first stage of an availability set definition
* The first stage of an availability set definition.
*/
interface DefinitionBlank extends GroupableResource.DefinitionWithRegion<DefinitionWithGroup> {
}

/**
* The stage of the availability set definition allowing to specify the resource group
* The stage of the availability set definition allowing to specify the resource group.
*/
interface DefinitionWithGroup extends GroupableResource.DefinitionWithGroup<DefinitionCreatable> {
}

/**
* The stage of an availability set definition which contains all the minimum required inputs for
* the resource to be created (via {@link DefinitionCreatable#create()}), but also allows
* the resource to be created (via {@link DefinitionCreatable#create()}), but also allows
* for any other optional settings to be specified.
*/
interface DefinitionCreatable extends
*/
interface DefinitionCreatable extends
Creatable<AvailabilitySet>,
Resource.DefinitionWithTags<DefinitionCreatable> {
/**
Expand All @@ -102,22 +107,22 @@ interface DefinitionCreatable extends
* @return the next stage of the resource definition
*/
DefinitionCreatable withUpdateDomainCount(int updateDomainCount);

/**
* Specifies the fault domain count for the availability set.
* @param faultDomainCount fault domain count
* @return the next stage of the resource definition
*/
DefinitionCreatable withFaultDomainCount(int faultDomainCount);
}

/**
* The template for an availability set update operation, containing all the settings that
* The template for an availability set update operation, containing all the settings that
* can be modified.
* <p>
* Call {@link Update#apply()} to apply the changes to the resource in Azure.
*/
interface Update extends
interface Update extends
Appliable<AvailabilitySet>,
Resource.UpdateWithTags<Update> {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package com.microsoft.azure.management.compute.implementation;

import com.microsoft.azure.CloudException;
import com.microsoft.azure.SubResource;
import com.microsoft.azure.management.compute.AvailabilitySet;
import com.microsoft.azure.management.compute.VirtualMachine;
Expand All @@ -17,15 +18,17 @@
import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl;
import com.microsoft.rest.ServiceResponse;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* The type representing Azure availability set.
* The implementation for {@link AvailabilitySet} and its create and update interfaces.
*/
class AvailabilitySetImpl
extends GroupableResourceImpl<AvailabilitySet, AvailabilitySetInner, AvailabilitySetImpl>
extends
GroupableResourceImpl<AvailabilitySet, AvailabilitySetInner, AvailabilitySetImpl>
implements
AvailabilitySet,
AvailabilitySet.Definitions,
Expand Down Expand Up @@ -71,7 +74,7 @@ public List<String> virtualMachineIds() {
}

@Override
public List<VirtualMachine> virtualMachines() throws Exception {
public List<VirtualMachine> virtualMachines() throws CloudException, IOException {
if (vmsInSet == null) {
vmsInSet = new ResourceLazyList<>(virtualMachineIds(), new ResourceLazyList.Loader<VirtualMachine>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import java.util.List;

/**
* The type representing Azure Azure availability sets.
* The implementation for {@link AvailabilitySets}.
*/
public class AvailabilitySetsImpl implements AvailabilitySets {
class AvailabilitySetsImpl implements AvailabilitySets {
private final AvailabilitySetsInner client;
private final ResourceGroups resourceGroups;
private final VirtualMachines virtualMachines;
Expand Down Expand Up @@ -99,7 +99,9 @@ public void delete(String groupName, String name) throws Exception {
this.client.delete(groupName, name);
}

/** Fluent model create helpers. **/
/**************************************************************
* Fluent model helpers.
**************************************************************/

private AvailabilitySetImpl createFluentModel(String name) {
AvailabilitySetInner availabilitySetInner = new AvailabilitySetInner();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,36 @@
* The popular Azure images.
*/
public enum KnownVirtualMachineImage {
/** Linux images*/
/**************************************************************
* Linux images
**************************************************************/

/** Ubuntu server 14.04 LTS. **/
/** UbuntuServer 14.04LTS. */
UBUNTU_SERVER_14_04_LTS("Canonical", "UbuntuServer", "14.04.4-LTS"),
/** Ubuntu server 16.04 LTS. **/
/** UbuntuServer 16.04LTS. */
UBUNTU_SERVER_16_04_LTS("Canonical", "UbuntuServer", "16.04.0-LTS"),
/** Debian 8. **/
/** Debian 8. */
DEBIAN_8("credativ", "Debian", "8"),
/** OpenLogic CentOS 7.2. **/
/** CentOS 7.2. */
CENTOS_7_2("OpenLogic", "CentOS", "7.2"),
/** OpenSUSE 42.1. **/
/** OpenSUSE-Leap 42.1. */
OPENSUSE_LEAP_42_1("SUSE", "openSUSE-Leap", "42.1"),
/** SUSE 12-SP1. **/
/** SLES 12-SP1. */
SLES_12_SP1("SUSE", "SLES", "12-SP1"),

/** WINDOWS images */
/**************************************************************
* Windows images
**************************************************************/

/** Windows Server 2008 R2 SP1. **/
/** Windows Server 2008 R2 SP1. */
WINDOWS_SERVER_2008_R2_SP1("MicrosoftWindowsServer", "WindowsServer", "2008-R2-SP1"),
/** Windows Server 2012 data center. **/
/** Windows Server 2012 Data center. */
WINDOWS_SERVER_2012_DATACENTER("MicrosoftWindowsServer", "WindowsServer", "2012-Datacenter"),
/** Windows Server 2012 R2 data center. **/
/** Windows Server 2012 R2 Data center. */
WINDOWS_SERVER_2012_R2_DATACENTER("MicrosoftWindowsServer", "WindowsServer", "2012-R2-Datacenter"),
/** Windows Server 2016 technical preview with containers. **/
WINDOWS_SERVER_2016_TECHNICAL_PREVIEW_WITH_CONTAINIERS("MicrosoftWindowsServer", "WindowsServer", "2016-Technical-Preview-with-Containers"),
/** Windows Server technical preview . **/
/** Windows Server 2016 technical preview with container support. */
WINDOWS_SERVER_2016_TECHNICAL_PREVIEW_WITH_CONTAINERS("MicrosoftWindowsServer", "WindowsServer", "2016-Technical-Preview-with-Containers"),
/** Windows Server 2016 technical preview. */
WINDOWS_SERVER_TECHNICAL_PREVIEW("MicrosoftWindowsServer", "WindowsServer", "Windows-Server-Technical-Preview");

private final String publisher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.microsoft.azure.management.compute.implementation;

import com.microsoft.azure.management.compute.VirtualMachineImage;
import com.microsoft.azure.management.compute.implementation.api.VirtualMachineImageInner;
import com.microsoft.azure.management.compute.implementation.api.VirtualMachineImagesInner;
import com.microsoft.azure.management.compute.implementation.api.DataDiskImage;
import com.microsoft.azure.management.compute.implementation.api.ImageReference;
import com.microsoft.azure.management.compute.implementation.api.PurchasePlan;
import com.microsoft.azure.management.compute.implementation.api.OSDiskImage;
import com.microsoft.azure.management.compute.implementation.api.DataDiskImage;
import com.microsoft.azure.management.compute.implementation.api.PurchasePlan;
import com.microsoft.azure.management.compute.implementation.api.VirtualMachineImageInner;
import com.microsoft.azure.management.compute.implementation.api.VirtualMachineImagesInner;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.fluentcore.model.implementation.IndexableWrapperImpl;

import java.util.List;

/**
* Represents an Azure virtual machine image.
* The implementation for {@link VirtualMachineImage}.
*/
class VirtualMachineImageImpl
extends IndexableWrapperImpl<VirtualMachineImageInner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import java.util.ArrayList;
import java.util.List;

/**
* The implementation for {@link VirtualMachineImage.Offer}.
*/
class VirtualMachineImageOfferImpl
implements VirtualMachineImage.Offer {
private final VirtualMachineImagesInner client;
Expand Down Expand Up @@ -40,8 +43,8 @@ public String offer() {
@Override
public List<VirtualMachineImage.Sku> listSkus() throws CloudException, IOException {
List<VirtualMachineImage.Sku> skus = new ArrayList<>();
for (VirtualMachineImageResourceInner inner :
client.listSkus(region().toString(), publisher(), offer()).getBody()) {
for (VirtualMachineImageResourceInner inner
: client.listSkus(region().toString(), publisher(), offer()).getBody()) {
skus.add(new VirtualMachineImageSkuImpl(this, inner.name(), client));
}
return skus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.List;

/**
* Represents an Azure virtual machine image publisher.
* The implementation for {@link VirtualMachineImage.Publisher}.
*/
class VirtualMachineImagePublisherImpl
implements VirtualMachineImage.Publisher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.List;

/**
* Represents an Azure virtual machine image sku.
* The implementation for {@link VirtualMachineImage.Sku}.
*/
class VirtualMachineImageSkuImpl
implements VirtualMachineImage.Sku {
Expand Down Expand Up @@ -47,8 +47,8 @@ public String sku() {
@Override
public List<VirtualMachineImage> listImages() throws CloudException, IOException {
List<VirtualMachineImage> images = new ArrayList<>();
for (VirtualMachineImageResourceInner inner :
client.list(
for (VirtualMachineImageResourceInner inner
: client.list(
region().toString(),
publisher(),
offer(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import java.util.ArrayList;
import java.util.List;

/**
* The implementation for {@link VirtualMachineImages}.
*/
class VirtualMachineImagesImpl
implements VirtualMachineImages {
private final VirtualMachineImagesInner client;
Expand All @@ -22,8 +25,8 @@ class VirtualMachineImagesImpl
@Override
public List<VirtualMachineImage.Publisher> listPublishers(final Region region) throws CloudException, IOException {
List<VirtualMachineImage.Publisher> publishers = new ArrayList<>();
for (VirtualMachineImageResourceInner inner :
client.listPublishers(region.toString()).getBody()) {
for (VirtualMachineImageResourceInner inner
: client.listPublishers(region.toString()).getBody()) {
publishers.add(new VirtualMachineImagePublisherImpl(region, inner.name(), client));
}
return publishers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.microsoft.azure.management.compute.implementation.api.VirtualMachineSizeInner;

/**
* Represents an Azure virtual machine size.
* The implementation for {@link VirtualMachineSize}.
*/
class VirtualMachineSizeImpl implements VirtualMachineSize {
private VirtualMachineSizeInner innerModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
import java.util.List;

/**
<<<<<<< HEAD
* The implementation for {@link VirtualMachines}.
=======
* The type representing Azure virtual machines.
>>>>>>> eca873299bef401bbca4c7084dc790063446e986
*/
class VirtualMachinesImpl
implements VirtualMachines {
Expand Down
Loading