Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6321e90
Virtual machine extensions
anuchandy Aug 30, 2016
d742be8
Simplifying the error handling in stream
anuchandy Aug 31, 2016
02b6e02
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into ext…
anuchandy Aug 31, 2016
166dbdb
applyAsync is now must for CreatableUpdatable types
anuchandy Aug 31, 2016
0c04778
Adding ExternalChildResourcesImpl and relaxing bounding constraints o…
anuchandy Aug 31, 2016
5379717
allow inprogress operations to finish, aggregate any exceptions and r…
anuchandy Sep 1, 2016
8450f8e
use do* methods to perform actions that has side effects
anuchandy Sep 2, 2016
8c4ae82
Using explict methods for create and update (instead of set that was …
anuchandy Sep 2, 2016
b6278d3
adding unit tests for externalChildResource commit actions
anuchandy Sep 3, 2016
2cee3b9
attach -> parent
anuchandy Sep 3, 2016
d1ce9b5
using extension::commitAsync after vm create, adding unit test for re…
anuchandy Sep 5, 2016
cb5d69f
Merge branch 'master' of github.com:Azure/azure-sdk-for-java into ext…
anuchandy Sep 5, 2016
d9ab47a
Merge branch 'applyAsyncFix' of github.com:anuchandy/azure-sdk-for-ja…
anuchandy Sep 5, 2016
cc0b48f
unit test for vmaccess extension
anuchandy Sep 5, 2016
5526a48
Enabling extension update as part of vm update
anuchandy Sep 6, 2016
fdf9d2b
sample showing crud on virtual machine extensions
anuchandy Sep 6, 2016
c793153
Adding sample for virtual machine extension images
anuchandy Sep 6, 2016
92ca539
synching with upstream
anuchandy Sep 7, 2016
1c2b385
Removing duplicate methods
anuchandy Sep 7, 2016
51af9ad
Updating sample to showcase updateExtension
anuchandy Sep 7, 2016
123f6f0
updating vm extension sample scenarios
anuchandy Sep 8, 2016
2cea55c
Some comments update and minor changes
anuchandy Sep 8, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.microsoft.azure.management.compute;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for ComputeRoles.
*/
public enum ComputeRoles {
/** Enum value PaaS. */
PAAS("PaaS"),

/** Enum value IaaS. */
IAAS("IaaS");

/** The actual serialized value for a ComputeRoles instance. */
private String value;

ComputeRoles(String value) {
this.value = value;
}

/**
* Parses a serialized value to a ComputeRoles instance.
*
* @param value the serialized value to parse.
* @return the parsed ComputeRoles object, or null if unable to parse.
*/
@JsonCreator
public static ComputeRoles fromString(String value) {
ComputeRoles[] items = ComputeRoles.values();
for (ComputeRoles item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.microsoft.azure.management.compute;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's okay to keep this in compute for now

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.. its used only in compute, can be moved to resource once we identify similar pattern in other packages.


import com.microsoft.azure.management.resources.fluentcore.arm.models.ChildResource;
import com.microsoft.azure.management.resources.fluentcore.model.Refreshable;

/**
* Represents an external child resource.
*
* @param <T> fluent type of the external child resource
*/
public interface ExternalChildResource<T> extends ChildResource, Refreshable<T> {
/**
* @return the id of the external child resource
*/
String id();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.microsoft.azure.CloudException;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.compute.implementation.VirtualMachineInner;
import com.microsoft.azure.management.compute.implementation.VirtualMachineExtensionInner;
import com.microsoft.azure.management.network.Network;
import com.microsoft.azure.management.network.NetworkInterface;
import com.microsoft.azure.management.network.PublicIpAddress;
Expand All @@ -19,6 +18,7 @@

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

/**
* An immutable client-side representation of an Azure virtual machine.
Expand Down Expand Up @@ -192,9 +192,9 @@ public interface VirtualMachine extends
String licenseType();

/**
* @return the resources value
* @return the extensions attached to the Azure Virtual Machine
*/
List<VirtualMachineExtensionInner> resources();
Map<String, VirtualMachineExtension> extensions();

/**
* @return the plan value
Expand Down Expand Up @@ -812,6 +812,19 @@ interface WithSecondaryNetworkInterface {
WithCreate withExistingSecondaryNetworkInterface(NetworkInterface networkInterface);
}

/**
* The stage of the virtual machine definition allowing to specify extensions.
*/
interface WithExtension {
/**
* Specifies definition of an extension to be attached to the virtual machine.
*
* @param name the reference name for the extension
* @return the stage representing configuration for the extension
*/
VirtualMachineExtension.DefinitionStages.Blank<WithCreate> defineNewExtension(String name);
}

/**
* The stage of the definition which contains all the minimum required inputs for
* the resource to be created (via {@link WithCreate#create()}), but also allows
Expand All @@ -826,7 +839,8 @@ interface WithCreate extends
DefinitionStages.WithStorageAccount,
DefinitionStages.WithDataDisk,
DefinitionStages.WithAvailabilitySet,
DefinitionStages.WithSecondaryNetworkInterface {
DefinitionStages.WithSecondaryNetworkInterface,
DefinitionStages.WithExtension {
}
}

Expand Down Expand Up @@ -936,6 +950,37 @@ interface WithSecondaryNetworkInterface {
*/
Update withoutSecondaryNetworkInterface(String name);
}

/**
* The stage of the virtual machine definition allowing to specify extensions.
*/
interface WithExtension {
/**
* Specifies definition of an extension to be attached to the virtual machine.
*
* @param name the reference name for the extension
* @return the stage representing configuration for the extension
*/
VirtualMachineExtension
.UpdateDefinitionStages
.Blank<Update> defineNewExtension(String name);

/**
* Begins the description of an update of an existing extension of this virtual machine.
*
* @param name the reference name for the extension
* @return the stage representing updatable VM definition
*/
VirtualMachineExtension.Update updateExtension(String name);

/**
* Detaches an extension with the given name from the virtual machine.
*
* @param name the reference name for the extension to be removed/uninstalled
* @return the stage representing updatable VM definition
*/
Update withoutExtension(String name);
}
}

/**
Expand All @@ -948,7 +993,8 @@ interface Update extends
Appliable<VirtualMachine>,
Resource.UpdateWithTags<Update>,
UpdateStages.WithDataDisk,
UpdateStages.WithSecondaryNetworkInterface {
UpdateStages.WithSecondaryNetworkInterface,
UpdateStages.WithExtension {
/**
* Specifies the caching type for the Operating System disk.
*
Expand Down Expand Up @@ -981,4 +1027,4 @@ interface Update extends
*/
Update withSize(VirtualMachineSizeTypes size);
}
}
}
Loading