Created
August 12, 2013 12:39
-
-
Save SlavD/6210492 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Disk xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | |
<OS>$osType</OS> | |
<Label>$diskDescription</Label> | |
<MediaLink>$blobUri</MediaLink> | |
<Name>$diskName</Name> | |
</Disk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VelocityEngine ve = new VelocityEngine(); | |
ve.init(); | |
Template t = ve.getTemplate("templates/Azure-AddDisk.vm"); | |
VelocityContext context = new VelocityContext(); | |
context.put("osType", "Windows"); | |
context.put("diskDescription", "My First Azure Disk"); | |
context.put("blobUri", "http://myStorageAccount.blob.core.windows.net/vhds/firstDisk.vhd"); | |
context.put("diskName", "FirstDisk"); | |
StringWriter writer = new StringWriter(); | |
t.merge( context, writer ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment