From 2f877458f6f5aa16bcd67767ee5ebac3c75abc40 Mon Sep 17 00:00:00 2001 From: Asir Vedamuthu Selvasingh Date: Thu, 6 Oct 2016 16:41:35 -0700 Subject: [PATCH] Changes to README (#1168) * readme update #1 * readme update #2 * readme update #2 * fixing HTML table * fixing HTML table * added a vmss example * editorial * editorial * editorial * first draft * Editorial * Editorial * added hyperlinks * added hyperlinks * linked * editorial * editorial * added one more sample --- README.md | 175 +++++++++++++++++++------------ notes/prepare-for-1.0.0-beta3.md | 148 ++++++++++++++++++++++++++ 2 files changed, 256 insertions(+), 67 deletions(-) create mode 100644 notes/prepare-for-1.0.0-beta3.md diff --git a/README.md b/README.md index 4a0e5dae5a0a..8135ab47c302 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ #Azure Management Libraries for Java -This README is based on the latest released preview version (1.0.0-beta2). If you are looking for other releases, see [More Information](#more-information) +This README is based on the latest released preview version (1.0.0-beta3). If you are looking for other releases, see [More Information](#more-information) The Azure Management Libraries for Java is a higher-level, object-oriented API for managing Azure resources. -> **1.0.0-beta2** is a developer preview that supports major parts of Azure Compute, Storage, Networking and Resource Manager. The next preview version of the Azure Management Libraries for Java is a work in-progress. We will be adding support for more Azure services and tweaking the API over the next few months. +> **1.0.0-beta3** is a developer preview that supports major parts of Azure Virtual Machines, Virtual Machine Scale Sets, Storage, Networking, Resource Manager, Key Vault and Batch. The next preview version of the Azure Management Libraries for Java is a work in-progress. We will be adding support for more Azure services and tweaking the API over the next few months. **Azure Authentication** @@ -17,14 +17,14 @@ The `Azure` class is the simplest entry point for creating and interacting with **Create a Virtual Machine** -You can create a virtual machine instance by using the `define() … create()` method chain. +You can create a virtual machine instance by using a `define() … create()` method chain. ```java System.out.println("Creating a Linux VM"); VirtualMachine linuxVM = azure.virtualMachines().define("myLinuxVM") .withRegion(Region.US_EAST) - .withNewResourceGroup("myResourceGroup") + .withNewResourceGroup(rgName) .withNewPrimaryNetwork("10.0.0.0/28") .withPrimaryPrivateIpAddressDynamic() .withNewPrimaryPublicIpAddress("mylinuxvmdns") @@ -39,7 +39,7 @@ System.out.println("Created a Linux VM: " + linuxVM.id()); **Update a Virtual Machine** -You can update a virtual machine instance by using the `update() … apply()` method chain. +You can update a virtual machine instance by using an `update() … apply()` method chain. ```java linuxVM.update() @@ -49,10 +49,33 @@ linuxVM.update() .attach() .apply(); ``` +**Create a Virtual Machine Scale Set** + +You can create a virtual machine scale set instance by using another `define() … create()` method chain. + +```java + VirtualMachineScaleSet virtualMachineScaleSet = azure.virtualMachineScaleSets() + .define(vmssName) + .withRegion(Region.US_EAST) + .withExistingResourceGroup(rgName) + .withSku(VirtualMachineScaleSetSkuTypes.STANDARD_D3_V2) + .withExistingPrimaryNetworkSubnet(network, "Front-end") + .withPrimaryInternetFacingLoadBalancer(loadBalancer1) + .withPrimaryInternetFacingLoadBalancerBackends(backendPoolName1, backendPoolName2) + .withPrimaryInternetFacingLoadBalancerInboundNatPools(natPool50XXto22, natPool60XXto23) + .withoutPrimaryInternalLoadBalancer() + .withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS) + .withRootUserName(userName) + .withSsh(sshKey) + .withNewStorageAccount(storageAccountName1) + .withNewStorageAccount(storageAccountName2) + .withCapacity(3) + .create(); +``` **Create a Network Security Group** -You can create a network security group instance by using the `define() … create()` method chain. +You can create a network security group instance by using another `define() … create()` method chain. ```java NetworkSecurityGroup frontEndNSG = azure.networkSecurityGroups().define(frontEndNSGName) @@ -84,80 +107,94 @@ NetworkSecurityGroup frontEndNSG = azure.networkSecurityGroups().define(frontEnd #Sample Code -You can find plenty of sample code that illustrates management scenarios in Azure Compute, Storage, Network and Resource Manager … - - - -- [Manage virtual machine](https://github.com/Azure-Samples/compute-java-manage-vm) -- [Manage availability set](https://github.com/Azure-Samples/compute-java-manage-availability-sets) -- [List virtual machine images](https://github.com/Azure-Samples/compute-java-list-vm-images) -- [Manage storage accounts](https://github.com/Azure-Samples/storage-java-manage-storage-accounts) -- [Manage virtual network](https://github.com/Azure-Samples/network-java-manage-virtual-network) -- [Manage network interface](https://github.com/Azure-Samples/network-java-manage-network-interface) -- [Manage network security group](https://github.com/Azure-Samples/network-java-manage-network-security-group) -- [Manage IP address](https://github.com/Azure-Samples/network-java-manage-ip-address) -- [Manage resource groups](https://github.com/Azure-Samples/resources-java-manage-resource-group) -- [Manage resources](https://github.com/Azure-Samples/resources-java-manage-resource) -- [Deploy resources with ARM templates](https://github.com/Azure-Samples/resources-java-deploy-using-arm-template) -- Deploy resources with ARM templates (with progress). Link will become available as soon as the sample is ready +You can find plenty of sample code that illustrates management scenarios in Azure Virtual Machines, Virtual Machine Scale Sets, Storage, Networking, Resource Manager, Key Vault and Batch … + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ServiceManagement Scenario
Virtual Machines +
Virtual Machines - parallel execution
Virtual Machine Scale Sets
Storage
Network +
Resource Groups
Key Vault
Batch
# Download -**1.0.0-beta2** +**1.0.0-beta3** -If you are using released builds from 1.0.0-beta2, add the following to your POM file: +If you are using released builds from 1.0.0-beta3, add the following to your POM file: ```xml com.microsoft.azure azure - 1.0.0-beta2 + 1.0.0-beta3 ``` -or Gradle: - - compile group: 'com.microsoft.azure', name: 'azure', version: '1.0.0-beta2' - -**Snapshots builds for this repo** - -If you are using snapshots builds for this repo, add the following repository and dependency to your POM file: - -```xml - - - ossrh - Sonatype Snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - default - - true - always - - - -``` - -```xml - - com.microsoft.azure - azure - 1.0.0-SNAPSHOT - -``` - -or Gradle: -```groovy -repositories { - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - .... -} -``` - - - compile group: 'com.microsoft.azure', name: 'azure', version: '1.0.0-SNAPSHOTS' - #Pre-requisites - A Java Developer Kit (JDK), v 1.7 or later @@ -166,6 +203,9 @@ repositories { ## Help + +If you are migrating your code to 1.0.0-beta3, you can use these notes for [preparing your code for 1.0.0-beta3 from 1.0.0-beta2](./notes/prepare-for-1.0.0-beta3.md). + If you encounter any bugs with these libraries, please file issues via [Issues](https://github.com/Azure/azure-sdk-for-java/issues) or checkout [StackOverflow for Azure Java SDK](http://stackoverflow.com/questions/tagged/azure-java-sdk). #Contribute Code @@ -187,6 +227,7 @@ If you would like to become an active contributor to this project please follow | Version | SHA1 | Remarks | |-------------------|-------------------------------------------------------------------------------------------|-------------------------------------------------------| +| 1.0.0-beta2 | [1.0.0-beta2](https://github.com/Azure/azure-sdk-for-java/tree/1.0.0-beta2) | Tagged release for 1.0.0-beta2 version of Azure management libraries | | 1.0.0-beta1 | [1.0.0-beta1](https://github.com/Azure/azure-sdk-for-java/tree/1.0.0-beta1) | Maintenance branch for AutoRest generated raw clients | | 1.0.0-beta1+fixes | [v1.0.0-beta1+fixes](https://github.com/Azure/azure-sdk-for-java/tree/v1.0.0-beta1+fixes) | Stable build for AutoRest generated raw clients | | 0.9.x-SNAPSHOTS | [0.9](https://github.com/Azure/azure-sdk-for-java/tree/0.9) | Maintenance branch for service management libraries | diff --git a/notes/prepare-for-1.0.0-beta3.md b/notes/prepare-for-1.0.0-beta3.md new file mode 100644 index 000000000000..90a504ebc989 --- /dev/null +++ b/notes/prepare-for-1.0.0-beta3.md @@ -0,0 +1,148 @@ +# Prepare for Azure Management Libraries for Java 1.0.0-beta3# + +Steps to migrate code that uses Azure Management Libraries for Java from beta 2 to beta 3 … + +> If this note missed any breaking changes, please open a pull request. + +# Replace Import Statement # + + + + + + + + + + + + +
ReplaceWithRef
import com.microsoft.azure.Azureimport com.microsoft.azure.management.Azure#1144
+ +# Change Method Names # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromToRef
Subnet.networkSecurityGroup()Subnet.getNetworkSecurityGroup()#1140
Network.dsnServerIPs()Network.dnsServerIps()#1140
NicIpConfiguration.publicIpAddress()NicIpConfiguration.getPublicIpAddress()#1083
NicIpConfiguration.network()NicIpConfiguration.getNetwork()#1083
NetworkInterface.networkSecurityGroup()NetworkInterface.getNetworkSecurityGroup()#1065
NicIpConfiguration.privateIp()NicIpConfiguration.privateIpAddress()#1055
VirtualMachine.primaryPublicIpAddress()VirtualMachine.getPrimaryPublicIpAddress()#1090
StorageAccount.refreshKeys()StorageAccount.getKeys()#1090
NetworkInterface.primaryNetwork()NetworkInterface.getPrimaryNetwork()#1090
+ +# Change Receiving Variable Type # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromToFor MethodRef
ListMapNetworkInterface.ipConfigurations()#1055
ListMapVirtualMachine.resources()#1045
ListMapNetworkSecurityGroup.securityRules()#970
ListMapNetworkSecurityGroup.defaultSecurityRules()#970
+ +# Drop Method Usage or Use Alternate # + +There are alternate ways to achieve the same thing: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Drop MethodUse AlternateRef
NetworkInterface.primarySubnetId()NetworkInterface.primaryIpConfiguration().subnetId()#1090
NicIpConfiguration.subnetId()Use NicIpConfiguration.subnetName() for the name of the subnet, and .networkId() for its parent virtual network ID. Or simply call .getNetwork() for the actual associated Network instance and look up the subnet using Network.subnets().get(subnetName)#1090
NetworkInterface.primaryPublicIpAddress()NetworkInterface.primaryIpConfiguration().getPublicIpAddress()#1090
StorageAccount.keys()StorageAccount.getKeys()#1090
+ +# Add Property # + +Add another property graphURL=https\://graph.windows.net/ to the experimental Azure Auth file [#1107](https://github.com/Azure/azure-sdk-for-java/pull/1107). + +