mirror of https://github.com/apache/jclouds.git
[JCLOUDS-1474] Adds SKU field to both LB and PublicIP
Changes order in parameters to keep properties as last parameter Removes wrong @Nullable parameters Moves LoadBalancer and PublicAddress to new package with SKU as inner class Moves LoadBalancerSKU inside LoadBalancer. Creates new loadbalancer package Refactors PublicAddress domain objects Extracts SKU from LoadBalancer LoadBalancer SKU as inner class PublicIPAddress SKU as inner class Reorder parameters sku and properties
This commit is contained in:
parent
2d9bb93427
commit
d621edd79f
|
@ -116,7 +116,7 @@ public class AzureComputeProviderMetadata extends BaseProviderMetadata {
|
|||
properties.put(API_VERSION_PREFIX + NetworkSecurityGroupApi.class.getSimpleName(), "2016-03-30");
|
||||
properties.put(API_VERSION_PREFIX + NetworkSecurityRuleApi.class.getSimpleName(), "2016-03-30");
|
||||
properties.put(API_VERSION_PREFIX + OSImageApi.class.getSimpleName(), "2015-06-15");
|
||||
properties.put(API_VERSION_PREFIX + PublicIPAddressApi.class.getSimpleName(), "2015-06-15");
|
||||
properties.put(API_VERSION_PREFIX + PublicIPAddressApi.class.getSimpleName(), "2018-08-01");
|
||||
properties.put(API_VERSION_PREFIX + ResourceGroupApi.class.getSimpleName(), "2015-01-01");
|
||||
properties.put(API_VERSION_PREFIX + ResourceProviderApi.class.getSimpleName(), "2015-01-01");
|
||||
properties.put(API_VERSION_PREFIX + StorageAccountApi.class.getSimpleName(), "2015-06-15");
|
||||
|
@ -124,7 +124,7 @@ public class AzureComputeProviderMetadata extends BaseProviderMetadata {
|
|||
properties.put(API_VERSION_PREFIX + VirtualNetworkApi.class.getSimpleName(), "2015-06-15");
|
||||
properties.put(API_VERSION_PREFIX + VMSizeApi.class.getSimpleName(), "2015-06-15");
|
||||
properties.put(API_VERSION_PREFIX + VirtualMachineApi.class.getSimpleName(), "2018-06-01");
|
||||
properties.put(API_VERSION_PREFIX + LoadBalancerApi.class.getSimpleName(), "2016-03-30");
|
||||
properties.put(API_VERSION_PREFIX + LoadBalancerApi.class.getSimpleName(), "2018-08-01");
|
||||
properties.put(API_VERSION_PREFIX + AvailabilitySetApi.class.getSimpleName(), "2016-04-30-preview");
|
||||
properties.put(API_VERSION_PREFIX + DiskApi.class.getSimpleName(), "2017-03-30");
|
||||
properties.put(API_VERSION_PREFIX + ImageApi.class.getSimpleName(), "2016-04-30-preview");
|
||||
|
|
|
@ -38,7 +38,6 @@ import java.util.Comparator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -71,8 +70,6 @@ import org.jclouds.azurecompute.arm.domain.OSProfile;
|
|||
import org.jclouds.azurecompute.arm.domain.Offer;
|
||||
import org.jclouds.azurecompute.arm.domain.Plan;
|
||||
import org.jclouds.azurecompute.arm.domain.Provisionable;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.ResourceGroup;
|
||||
import org.jclouds.azurecompute.arm.domain.ResourceProviderMetaData;
|
||||
import org.jclouds.azurecompute.arm.domain.SKU;
|
||||
|
@ -84,6 +81,8 @@ import org.jclouds.azurecompute.arm.domain.VMSize;
|
|||
import org.jclouds.azurecompute.arm.domain.Version;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualMachine;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualMachineProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.features.NetworkInterfaceCardApi;
|
||||
import org.jclouds.azurecompute.arm.features.OSImageApi;
|
||||
import org.jclouds.compute.ComputeServiceAdapter;
|
||||
|
@ -510,7 +509,7 @@ public class AzureComputeServiceAdapter implements ComputeServiceAdapter<Virtual
|
|||
logger.debug(">> allocating new public ip address: %s", name);
|
||||
|
||||
PublicIPAddress ip = api.getPublicIPAddressApi(resourceGroup).createOrUpdate(name, location,
|
||||
ImmutableMap.of("jclouds", nodeName, AUTOGENERATED_IP_KEY, "true"), properties);
|
||||
ImmutableMap.of("jclouds", nodeName, AUTOGENERATED_IP_KEY, "true"), null, properties);
|
||||
|
||||
checkState(publicIpAvailable.create(resourceGroup).apply(name),
|
||||
"Public IP was not provisioned in the configured timeout");
|
||||
|
|
|
@ -46,13 +46,13 @@ import org.jclouds.azurecompute.arm.domain.Key.DeletedKeyBundle;
|
|||
import org.jclouds.azurecompute.arm.domain.Key.KeyBundle;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkSecurityGroup;
|
||||
import org.jclouds.azurecompute.arm.domain.Provisionable;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.ResourceDefinition;
|
||||
import org.jclouds.azurecompute.arm.domain.Secret.DeletedSecretBundle;
|
||||
import org.jclouds.azurecompute.arm.domain.Secret.SecretBundle;
|
||||
import org.jclouds.azurecompute.arm.domain.Vault;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualMachineInstance;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualNetwork;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.VirtualNetworkGateway;
|
||||
import org.jclouds.azurecompute.arm.functions.ParseJobStatus;
|
||||
import org.jclouds.compute.reference.ComputeServiceConstants;
|
||||
|
|
|
@ -30,7 +30,6 @@ import static org.jclouds.location.predicates.LocationPredicates.idEquals;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -42,9 +41,9 @@ import org.jclouds.azurecompute.arm.domain.IdReference;
|
|||
import org.jclouds.azurecompute.arm.domain.IpConfiguration;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkInterfaceCard;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkProfile.NetworkInterface;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.StorageProfile;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualMachine;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.collect.Memoized;
|
||||
import org.jclouds.compute.domain.Hardware;
|
||||
import org.jclouds.compute.domain.Image;
|
||||
|
|
|
@ -31,7 +31,6 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
@ -48,8 +47,8 @@ import org.jclouds.azurecompute.arm.domain.NetworkInterfaceCard;
|
|||
import org.jclouds.azurecompute.arm.domain.NetworkProfile.NetworkInterface;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkSecurityGroup;
|
||||
import org.jclouds.azurecompute.arm.domain.OSDisk;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualMachine;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.features.NetworkSecurityGroupApi;
|
||||
import org.jclouds.compute.functions.GroupNamingConvention;
|
||||
import org.jclouds.compute.reference.ComputeServiceConstants;
|
||||
|
|
|
@ -44,11 +44,11 @@ import org.jclouds.azurecompute.arm.compute.options.IpOptions;
|
|||
import org.jclouds.azurecompute.arm.domain.AddressSpace;
|
||||
import org.jclouds.azurecompute.arm.domain.AvailabilitySet;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkSecurityGroup;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.ResourceGroup;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet.SubnetProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualNetwork.VirtualNetworkProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.compute.config.CustomizationResponse;
|
||||
import org.jclouds.compute.domain.NodeMetadata;
|
||||
import org.jclouds.compute.domain.Template;
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.jclouds.azurecompute.arm.domain;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jclouds.azurecompute.arm.domain;
|
||||
package org.jclouds.azurecompute.arm.domain.loadbalancer;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.jclouds.azurecompute.arm.util.GetEnumValue;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.json.SerializedNames;
|
||||
|
||||
|
@ -34,10 +35,13 @@ public abstract class LoadBalancer {
|
|||
@Nullable public abstract Map<String, String> tags();
|
||||
@Nullable public abstract LoadBalancerProperties properties();
|
||||
|
||||
@SerializedNames({ "id", "name", "location", "etag", "tags", "properties", })
|
||||
@Nullable
|
||||
public abstract SKU sku();
|
||||
|
||||
@SerializedNames({ "id", "name", "location", "etag", "tags", "sku", "properties"})
|
||||
public static LoadBalancer create(String id, final String name, final String location, final String etag,
|
||||
final Map<String, String> tags, final LoadBalancerProperties properties) {
|
||||
return builder().id(id).name(name).location(location).etag(etag).tags(tags).properties(properties).build();
|
||||
final Map<String, String> tags, final SKU sku, final LoadBalancerProperties properties) {
|
||||
return builder().id(id).name(name).location(location).etag(etag).tags(tags).sku(sku).properties(properties).build();
|
||||
}
|
||||
|
||||
public abstract Builder toBuilder();
|
||||
|
@ -55,6 +59,8 @@ public abstract class LoadBalancer {
|
|||
public abstract Builder tags(Map<String, String> tags);
|
||||
public abstract Builder properties(LoadBalancerProperties properties);
|
||||
|
||||
public abstract Builder sku(SKU sku);
|
||||
|
||||
abstract Map<String, String> tags();
|
||||
|
||||
abstract LoadBalancer autoBuild();
|
||||
|
@ -64,4 +70,25 @@ public abstract class LoadBalancer {
|
|||
return autoBuild();
|
||||
}
|
||||
}
|
||||
|
||||
@AutoValue
|
||||
public abstract static class SKU {
|
||||
|
||||
public enum SKUName {
|
||||
Basic, Standard, Unrecognized;
|
||||
|
||||
public static SKUName fromValue(final String text) {
|
||||
return (SKUName) GetEnumValue.fromValueOrDefault(text, SKUName.Unrecognized);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract SKUName name();
|
||||
|
||||
@SerializedNames({ "name" })
|
||||
public static SKU create(final SKUName name) {
|
||||
|
||||
return new AutoValue_LoadBalancer_SKU(name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -14,10 +14,15 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jclouds.azurecompute.arm.domain;
|
||||
package org.jclouds.azurecompute.arm.domain.loadbalancer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.jclouds.azurecompute.arm.domain.BackendAddressPool;
|
||||
import org.jclouds.azurecompute.arm.domain.FrontendIPConfigurations;
|
||||
import org.jclouds.azurecompute.arm.domain.InboundNatRule;
|
||||
import org.jclouds.azurecompute.arm.domain.Probe;
|
||||
import org.jclouds.azurecompute.arm.domain.Provisionable;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.json.SerializedNames;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jclouds.azurecompute.arm.domain;
|
||||
package org.jclouds.azurecompute.arm.domain.loadbalancer;
|
||||
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.json.SerializedNames;
|
|
@ -14,8 +14,9 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jclouds.azurecompute.arm.domain;
|
||||
package org.jclouds.azurecompute.arm.domain.loadbalancer;
|
||||
|
||||
import org.jclouds.azurecompute.arm.domain.IdReference;
|
||||
import org.jclouds.azurecompute.arm.util.GetEnumValue;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.json.SerializedNames;
|
|
@ -15,10 +15,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jclouds.azurecompute.arm.domain;
|
||||
package org.jclouds.azurecompute.arm.domain.publicipaddress;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.jclouds.azurecompute.arm.util.GetEnumValue;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.json.SerializedNames;
|
||||
|
||||
|
@ -35,10 +36,13 @@ public abstract class PublicIPAddress {
|
|||
@Nullable public abstract Map<String, String> tags();
|
||||
public abstract PublicIPAddressProperties properties();
|
||||
|
||||
@SerializedNames({ "name", "id", "etag", "location", "tags", "properties" })
|
||||
@Nullable
|
||||
public abstract SKU sku();
|
||||
|
||||
@SerializedNames({ "name", "id", "etag", "location", "tags", "sku", "properties"})
|
||||
public static PublicIPAddress create(String name, String id, String etag, String location, Map<String, String> tags,
|
||||
PublicIPAddressProperties properties) {
|
||||
return builder().name(name).id(id).etag(etag).location(location).tags(tags).properties(properties).build();
|
||||
SKU sku, PublicIPAddressProperties properties) {
|
||||
return builder().name(name).id(id).etag(etag).location(location).tags(tags).sku(sku).properties(properties).build();
|
||||
}
|
||||
|
||||
PublicIPAddress() {
|
||||
|
@ -60,6 +64,8 @@ public abstract class PublicIPAddress {
|
|||
public abstract Builder tags(Map<String, String> tags);
|
||||
public abstract Builder properties(PublicIPAddressProperties properties);
|
||||
|
||||
public abstract Builder sku(SKU sku);
|
||||
|
||||
abstract Map<String, String> tags();
|
||||
abstract PublicIPAddress autoBuild();
|
||||
|
||||
|
@ -68,4 +74,24 @@ public abstract class PublicIPAddress {
|
|||
return autoBuild();
|
||||
}
|
||||
}
|
||||
|
||||
@AutoValue
|
||||
public abstract static class SKU {
|
||||
|
||||
public enum SKUName {
|
||||
Basic, Standard, Unrecognized;
|
||||
|
||||
public static SKUName fromValue(final String text) {
|
||||
return (SKUName) GetEnumValue.fromValueOrDefault(text, SKUName.Unrecognized);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract SKUName name();
|
||||
|
||||
@SerializedNames({ "name" })
|
||||
public static SKU create(final SKUName name) {
|
||||
|
||||
return new AutoValue_PublicIPAddress_SKU(name);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,13 +14,16 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jclouds.azurecompute.arm.domain;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
package org.jclouds.azurecompute.arm.domain.publicipaddress;
|
||||
|
||||
import org.jclouds.azurecompute.arm.domain.DnsSettings;
|
||||
import org.jclouds.azurecompute.arm.domain.IdReference;
|
||||
import org.jclouds.azurecompute.arm.domain.Provisionable;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.json.SerializedNames;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
|
||||
@AutoValue
|
||||
public abstract class PublicIPAddressProperties implements Provisionable {
|
||||
|
|
@ -19,7 +19,6 @@ package org.jclouds.azurecompute.arm.features;
|
|||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
|
@ -31,8 +30,9 @@ import javax.ws.rs.core.MediaType;
|
|||
|
||||
import org.jclouds.Fallbacks.EmptyListOnNotFoundOr404;
|
||||
import org.jclouds.Fallbacks.NullOnNotFoundOr404;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer.SKU;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.filters.ApiVersionFilter;
|
||||
import org.jclouds.azurecompute.arm.functions.URIParser;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
|
@ -68,6 +68,7 @@ public interface LoadBalancerApi {
|
|||
@MapBinder(BindToJsonPayload.class)
|
||||
LoadBalancer createOrUpdate(@PathParam("loadbalancername") String lbName,
|
||||
@PayloadParam("location") String location, @Nullable @PayloadParam("tags") Map<String, String> tags,
|
||||
@Nullable @PayloadParam("sku") SKU sku,
|
||||
@PayloadParam("properties") LoadBalancerProperties properties);
|
||||
|
||||
@Named("loadbalancer:delete")
|
||||
|
|
|
@ -29,8 +29,9 @@ import javax.ws.rs.core.MediaType;
|
|||
|
||||
import org.jclouds.Fallbacks.EmptyListOnNotFoundOr404;
|
||||
import org.jclouds.Fallbacks.NullOnNotFoundOr404;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress.SKU;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.filters.ApiVersionFilter;
|
||||
import org.jclouds.azurecompute.arm.functions.FalseOn204;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
|
@ -66,9 +67,9 @@ public interface PublicIPAddressApi {
|
|||
@MapBinder(BindToJsonPayload.class)
|
||||
@PUT
|
||||
PublicIPAddress createOrUpdate(@PathParam("publicipaddressname") String publicipaddressname,
|
||||
@PayloadParam("location") String location,
|
||||
@Nullable @PayloadParam("tags") Map<String, String> tags,
|
||||
@PayloadParam("properties") PublicIPAddressProperties properties);
|
||||
@PayloadParam("location") String location, @Nullable @PayloadParam("tags") Map<String, String> tags,
|
||||
@Nullable @PayloadParam("sku") SKU sku,
|
||||
@PayloadParam("properties") PublicIPAddressProperties properties);
|
||||
|
||||
@Named("publicipaddress:get")
|
||||
@Path("/resourcegroups/{resourcegroup}/providers/Microsoft.Network/publicIPAddresses/{publicipaddressname}")
|
||||
|
|
|
@ -26,9 +26,9 @@ import static org.testng.Assert.assertEquals;
|
|||
import org.jclouds.azurecompute.arm.AzureComputeApi;
|
||||
import org.jclouds.azurecompute.arm.compute.options.AzureTemplateOptions;
|
||||
import org.jclouds.azurecompute.arm.compute.options.IpOptions;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.features.PublicIPAddressApi;
|
||||
import org.jclouds.azurecompute.arm.features.SubnetApi;
|
||||
import org.jclouds.util.PasswordGenerator;
|
||||
|
|
|
@ -25,6 +25,8 @@ import static org.jclouds.azurecompute.arm.compute.options.AzureTemplateOptions.
|
|||
import static org.jclouds.azurecompute.arm.config.AzureComputeProperties.TIMEOUT_RESOURCE_DELETED;
|
||||
import static org.jclouds.azurecompute.arm.domain.IdReference.extractName;
|
||||
import static org.jclouds.azurecompute.arm.domain.InboundNatRuleProperties.Protocol.Tcp;
|
||||
import static org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer.SKU.SKUName.Basic;
|
||||
import static org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer.SKU.SKUName.Standard;
|
||||
import static org.jclouds.compute.predicates.NodePredicates.inGroup;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
@ -52,19 +54,19 @@ import org.jclouds.azurecompute.arm.domain.InboundNatRule;
|
|||
import org.jclouds.azurecompute.arm.domain.InboundNatRuleProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.IpConfiguration;
|
||||
import org.jclouds.azurecompute.arm.domain.IpConfigurationProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancingRule;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancingRuleProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancingRuleProperties.Protocol;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkInterfaceCard;
|
||||
import org.jclouds.azurecompute.arm.domain.NetworkInterfaceCardProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.Probe;
|
||||
import org.jclouds.azurecompute.arm.domain.ProbeProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.Provisionable;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualMachine;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancingRule;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancingRuleProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancingRuleProperties.Protocol;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.internal.AzureLiveTestUtils;
|
||||
import org.jclouds.compute.RunNodesException;
|
||||
import org.jclouds.compute.domain.NodeMetadata;
|
||||
|
@ -89,6 +91,8 @@ public class LoadBalancerApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
private static final String lbName = String.format("lb-%s-%s", LoadBalancerApiLiveTest.class.getSimpleName()
|
||||
.toLowerCase(), System.getProperty("user.name"));
|
||||
|
||||
private static final String lbStandardName = lbName + "Standard";
|
||||
|
||||
private Predicate<URI> resourceDeleted;
|
||||
private PublicIpAvailablePredicateFactory publicIpAvailable;
|
||||
private Predicate<Supplier<Provisionable>> resourceAvailable;
|
||||
|
@ -161,18 +165,40 @@ public class LoadBalancerApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
}
|
||||
|
||||
@Test(dependsOnMethods = "testDeleteLoadBalancerDoesNotExist")
|
||||
public void testCreateLoadBalancer() {
|
||||
LoadBalancer createLB = newLoadBalancer(lbName, location);
|
||||
public void testCreateLoadBalancerStandard() {
|
||||
LoadBalancer createLB = newLoadBalancer(lbStandardName, location);
|
||||
|
||||
PublicIPAddress publicIP = createPublicIPAddress("Ip4LoadBalancer");
|
||||
FrontendIPConfigurationsProperties fronendProps = FrontendIPConfigurationsProperties.builder()
|
||||
PublicIPAddress publicIP = createPublicIPAddress("Ip4LoadBalancerStandard",
|
||||
PublicIPAddress.SKU.create(PublicIPAddress.SKU.SKUName.Standard));
|
||||
FrontendIPConfigurationsProperties frontendProps = FrontendIPConfigurationsProperties.builder()
|
||||
.publicIPAddress(IdReference.create(publicIP.id())).build();
|
||||
FrontendIPConfigurations frontendIps = FrontendIPConfigurations.create("ipConfigs", null, fronendProps, null);
|
||||
FrontendIPConfigurations frontendIps = FrontendIPConfigurations.create("ipConfigs", null, frontendProps, null);
|
||||
LoadBalancerProperties props = LoadBalancerProperties.builder()
|
||||
.frontendIPConfigurations(ImmutableList.of(frontendIps)).build();
|
||||
|
||||
lb = lbApi.createOrUpdate(lbName, createLB.location(), createLB.tags(), props);
|
||||
lb = lbApi.createOrUpdate(lbStandardName, createLB.location(), createLB.tags(), LoadBalancer.SKU.create(Standard),
|
||||
props);
|
||||
assertNotNull(lb);
|
||||
assertEquals(lb.name(), lbStandardName);
|
||||
assertEquals(lb.sku().name(), Standard);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testDeleteLoadBalancerDoesNotExist")
|
||||
public void testCreateLoadBalancer() {
|
||||
LoadBalancer createLB = newLoadBalancer(lbName, location);
|
||||
|
||||
PublicIPAddress publicIP = createPublicIPAddress("Ip4LoadBalancer",
|
||||
PublicIPAddress.SKU.create(PublicIPAddress.SKU.SKUName.Basic));
|
||||
FrontendIPConfigurationsProperties frontendProps = FrontendIPConfigurationsProperties.builder()
|
||||
.publicIPAddress(IdReference.create(publicIP.id())).build();
|
||||
FrontendIPConfigurations frontendIps = FrontendIPConfigurations.create("ipConfigs", null, frontendProps, null);
|
||||
LoadBalancerProperties props = LoadBalancerProperties.builder()
|
||||
.frontendIPConfigurations(ImmutableList.of(frontendIps)).build();
|
||||
|
||||
lb = lbApi.createOrUpdate(lbName, createLB.location(), createLB.tags(), null, props);
|
||||
assertNotNull(lb);
|
||||
assertEquals(lb.name(), lbName);
|
||||
assertEquals(lb.sku().name(), Basic);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testCreateLoadBalancer")
|
||||
|
@ -305,7 +331,7 @@ public class LoadBalancerApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
assertResourceDeleted(uri);
|
||||
}
|
||||
|
||||
private PublicIPAddress createPublicIPAddress(final String publicIpAddressName) {
|
||||
private PublicIPAddress createPublicIPAddress(final String publicIpAddressName, final PublicIPAddress.SKU sku) {
|
||||
final PublicIPAddressApi ipApi = view.unwrapApi(AzureComputeApi.class).getPublicIPAddressApi(group);
|
||||
PublicIPAddress publicIPAddress = ipApi.get(publicIpAddressName);
|
||||
|
||||
|
@ -313,7 +339,7 @@ public class LoadBalancerApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
final Map<String, String> tags = ImmutableMap.of("testkey", "testvalue");
|
||||
PublicIPAddressProperties properties = PublicIPAddressProperties.builder().publicIPAllocationMethod("Static")
|
||||
.idleTimeoutInMinutes(4).build();
|
||||
publicIPAddress = ipApi.createOrUpdate(publicIpAddressName, location, tags, properties);
|
||||
publicIPAddress = ipApi.createOrUpdate(publicIpAddressName, location, tags, sku, properties);
|
||||
|
||||
checkState(publicIpAvailable.create(group).apply(publicIpAddressName),
|
||||
"Public IP was not provisioned in the configured timeout");
|
||||
|
@ -421,7 +447,7 @@ public class LoadBalancerApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
}
|
||||
|
||||
private LoadBalancer updateLoadBalancer(final String name, LoadBalancerProperties props) {
|
||||
lbApi.createOrUpdate(name, location, null, props);
|
||||
lbApi.createOrUpdate(name, location, null, null, props);
|
||||
resourceAvailable.apply(new Supplier<Provisionable>() {
|
||||
@Override
|
||||
public Provisionable get() {
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
package org.jclouds.azurecompute.arm.features;
|
||||
|
||||
import static com.google.common.collect.Iterables.isEmpty;
|
||||
import static org.jclouds.azurecompute.arm.config.AzureComputeProperties.API_VERSION_PREFIX;
|
||||
import static org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer.SKU.SKUName.Basic;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
@ -25,10 +27,11 @@ import static org.testng.Assert.assertTrue;
|
|||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import org.jclouds.azurecompute.arm.AzureComputeProviderMetadata;
|
||||
import org.jclouds.azurecompute.arm.domain.FrontendIPConfigurations;
|
||||
import org.jclouds.azurecompute.arm.domain.FrontendIPConfigurationsProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.internal.BaseAzureComputeApiMockTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
|
@ -38,25 +41,28 @@ import com.google.common.collect.ImmutableList;
|
|||
public class LoadBalancerApiMockTest extends BaseAzureComputeApiMockTest {
|
||||
private final String subscriptionid = "SUBSCRIPTIONID";
|
||||
private final String resourcegroup = "myresourcegroup";
|
||||
private final String apiVersion = "api-version=2016-03-30";
|
||||
private final String apiVersion = "api-version=" + AzureComputeProviderMetadata.defaultProperties()
|
||||
.getProperty(API_VERSION_PREFIX + LoadBalancerApi.class.getSimpleName());
|
||||
private final String lbName = "testLoadBalancer";
|
||||
|
||||
public void createLoadBalancer() throws InterruptedException {
|
||||
LoadBalancer nsg = newLoadBalancer();
|
||||
|
||||
server.enqueue(jsonResponse("/loadbalancercreate.json").setResponseCode(200));
|
||||
final LoadBalancerApi nsgApi = api.getLoadBalancerApi(resourcegroup);
|
||||
final LoadBalancerApi loadBalancerApi = api.getLoadBalancerApi(resourcegroup);
|
||||
|
||||
String path = String.format("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.Network/loadBalancers/%s?%s",
|
||||
subscriptionid, resourcegroup, lbName, apiVersion);
|
||||
|
||||
String json = "{\"location\":\"westeurope\",\"properties\":{\"frontendIPConfigurations\":[{\"name\":\"ipConfigs\",\"properties\":{}}]}}";
|
||||
String json = "{\"location\":\"westeurope\",\"properties\":{\"frontendIPConfigurations\":[{\"name\":\"ipConfigs"
|
||||
+ "\",\"properties\":{}}]} }";
|
||||
|
||||
LoadBalancer result = nsgApi.createOrUpdate(lbName, "westeurope", null, nsg.properties());
|
||||
LoadBalancer result = loadBalancerApi.createOrUpdate(lbName, "westeurope", null, null, nsg.properties());
|
||||
assertSent(server, "PUT", path, json);
|
||||
|
||||
assertEquals(result.name(), lbName);
|
||||
assertEquals(result.location(), "westeurope");
|
||||
assertEquals(result.sku().name(), Basic);
|
||||
}
|
||||
|
||||
public void getLoadBalancer() throws InterruptedException {
|
||||
|
@ -73,6 +79,7 @@ public class LoadBalancerApiMockTest extends BaseAzureComputeApiMockTest {
|
|||
assertEquals(result.location(), "westeurope");
|
||||
assertEquals(result.properties().loadBalancingRules().size(), 1);
|
||||
assertEquals(result.properties().loadBalancingRules().get(0).name(), "lbRule1");
|
||||
assertEquals(result.sku().name(), Basic);
|
||||
}
|
||||
|
||||
public void getLoadBalancerReturns404() throws InterruptedException {
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.jclouds.azurecompute.arm.features;
|
||||
|
||||
import static org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress.SKU.SKUName.Basic;
|
||||
import static org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress.SKU.SKUName.Standard;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
@ -25,8 +27,9 @@ import static org.testng.Assert.assertTrue;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress.SKU;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.internal.BaseAzureComputeApiLiveTest;
|
||||
import org.jclouds.util.Predicates2;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
|
@ -39,6 +42,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
public class PublicIPAddressApiLiveTest extends BaseAzureComputeApiLiveTest {
|
||||
|
||||
private final String publicIpAddressName = "myipaddress";
|
||||
private final String publicIpAddressNameStandard = "myipaddressStandard";
|
||||
private String subscriptionid;
|
||||
|
||||
@BeforeClass
|
||||
|
@ -69,7 +73,7 @@ public class PublicIPAddressApiLiveTest extends BaseAzureComputeApiLiveTest {
|
|||
.idleTimeoutInMinutes(4)
|
||||
.build();
|
||||
|
||||
PublicIPAddress ip = ipApi.createOrUpdate(publicIpAddressName, LOCATION, tags, properties);
|
||||
PublicIPAddress ip = ipApi.createOrUpdate(publicIpAddressName, LOCATION, tags, null, properties);
|
||||
|
||||
assertNotNull(ip);
|
||||
assertEquals(ip.name(), publicIpAddressName);
|
||||
|
@ -81,6 +85,34 @@ public class PublicIPAddressApiLiveTest extends BaseAzureComputeApiLiveTest {
|
|||
assertNull(ip.properties().ipAddress()); // as we don't get IP address until Succeeded state
|
||||
assertEquals(ip.properties().publicIPAllocationMethod(), "Static");
|
||||
assertEquals(ip.properties().idleTimeoutInMinutes().intValue(), 4);
|
||||
assertEquals(ip.sku().name(), Basic);
|
||||
}
|
||||
|
||||
@Test(groups = "live", dependsOnMethods = "deletePublicIPAddressResourceDoesNotExist")
|
||||
public void createPublicIPAddressStandard() {
|
||||
final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(resourceGroupName);
|
||||
|
||||
final Map<String, String> tags = ImmutableMap.of("testkey", "testvalue");
|
||||
|
||||
PublicIPAddressProperties properties = PublicIPAddressProperties.builder().publicIPAllocationMethod("Static")
|
||||
.idleTimeoutInMinutes(4).build();
|
||||
|
||||
PublicIPAddress ip = ipApi
|
||||
.createOrUpdate(publicIpAddressNameStandard, LOCATION, tags, SKU.create(Standard), properties);
|
||||
|
||||
assertNotNull(ip);
|
||||
assertEquals(ip.name(), publicIpAddressNameStandard);
|
||||
assertEquals(ip.location(), LOCATION);
|
||||
assertEquals(ip.id(),
|
||||
String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s",
|
||||
subscriptionid, resourceGroupName, publicIpAddressNameStandard));
|
||||
assertEquals(ip.tags().get("testkey"), "testvalue");
|
||||
assertNotNull(ip.properties());
|
||||
assertEquals(ip.properties().provisioningState(), "Updating");
|
||||
assertNull(ip.properties().ipAddress()); // as we don't get IP address until Succeeded state
|
||||
assertEquals(ip.properties().publicIPAllocationMethod(), "Static");
|
||||
assertEquals(ip.properties().idleTimeoutInMinutes().intValue(), 4);
|
||||
assertEquals(ip.sku().name(), Standard);
|
||||
}
|
||||
|
||||
@Test(groups = "live", dependsOnMethods = "createPublicIPAddress")
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.jclouds.azurecompute.arm.features;
|
||||
|
||||
import static org.jclouds.azurecompute.arm.config.AzureComputeProperties.API_VERSION_PREFIX;
|
||||
import static org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress.SKU.SKUName.Basic;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotNull;
|
||||
|
@ -25,9 +27,11 @@ import static org.testng.Assert.assertTrue;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jclouds.azurecompute.arm.AzureComputeProviderMetadata;
|
||||
import org.jclouds.azurecompute.arm.domain.DnsSettings;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress.SKU;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.internal.BaseAzureComputeApiMockTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
|
@ -35,12 +39,13 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.squareup.okhttp.mockwebserver.MockResponse;
|
||||
|
||||
|
||||
@Test(groups = "unit", testName = "NetworkInterfaceCardApiMockTest", singleThreaded = true)
|
||||
@Test(groups = "unit", testName = "PublicIPAddressApiMockTest", singleThreaded = true)
|
||||
public class PublicIPAddressApiMockTest extends BaseAzureComputeApiMockTest {
|
||||
|
||||
private final String subscriptionid = "SUBSCRIPTIONID";
|
||||
private final String resourcegroup = "myresourcegroup";
|
||||
private final String apiVersion = "api-version=2015-06-15";
|
||||
private final String apiVersion = "api-version=" + AzureComputeProviderMetadata.defaultProperties()
|
||||
.getProperty(API_VERSION_PREFIX + LoadBalancerApi.class.getSimpleName());
|
||||
private final String location = "northeurope";
|
||||
private final String publicIpName = "mypublicaddress";
|
||||
|
||||
|
@ -68,6 +73,7 @@ public class PublicIPAddressApiMockTest extends BaseAzureComputeApiMockTest {
|
|||
assertEquals(ip.properties().dnsSettings().fqdn(), "foobar.northeurope.cloudapp.azure.com");
|
||||
assertNotNull(ip.properties().ipConfiguration());
|
||||
assertEquals(ip.properties().ipConfiguration().id(), "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/networkInterfaces/myNic/ipConfigurations/myip1");
|
||||
assertEquals(ip.sku().name(), Basic);
|
||||
}
|
||||
|
||||
public void getPublicIPAddressInfoEmpty() throws Exception {
|
||||
|
@ -139,10 +145,12 @@ public class PublicIPAddressApiMockTest extends BaseAzureComputeApiMockTest {
|
|||
PublicIPAddressProperties properties = PublicIPAddressProperties.create(null, null, "Static", 4, null,
|
||||
DnsSettings.create("foobar", "foobar.northeurope.cloudapp.azure.com", null));
|
||||
|
||||
PublicIPAddress ip = ipApi.createOrUpdate(publicIpName, location, tags, properties);
|
||||
PublicIPAddress ip = ipApi.createOrUpdate(publicIpName, location, tags, SKU.create(Basic), properties);
|
||||
|
||||
String path = String.format("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.Network/publicIPAddresses/%s?%s", subscriptionid, resourcegroup, publicIpName, apiVersion);
|
||||
String json = String.format("{ \"location\": \"%s\", \"tags\": { \"testkey\": \"testvalue\" }, \"properties\": { \"publicIPAllocationMethod\": \"Static\", \"idleTimeoutInMinutes\": 4, \"dnsSettings\": { \"domainNameLabel\": \"foobar\", \"fqdn\": \"foobar.northeurope.cloudapp.azure.com\" } } }", location);
|
||||
String json = String.format("{ \"location\": \"%s\", \"tags\": { \"testkey\": \"testvalue\" }, \"properties\": "
|
||||
+ "{ \"publicIPAllocationMethod\": \"Static\", \"idleTimeoutInMinutes\": 4, \"dnsSettings\": { "
|
||||
+ "\"domainNameLabel\": \"foobar\", \"fqdn\": \"foobar.northeurope.cloudapp.azure.com\" } }, \"sku\": {\"name\": \"Basic\" } }", location);
|
||||
assertSent(server, "PUT", path, json);
|
||||
|
||||
assertNotNull(ip);
|
||||
|
@ -158,6 +166,7 @@ public class PublicIPAddressApiMockTest extends BaseAzureComputeApiMockTest {
|
|||
assertNotNull(ip.properties().dnsSettings());
|
||||
assertEquals(ip.properties().dnsSettings().domainNameLabel(), "foobar");
|
||||
assertEquals(ip.properties().dnsSettings().fqdn(), "foobar.northeurope.cloudapp.azure.com");
|
||||
assertEquals(ip.sku().name(), Basic);
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = IllegalArgumentException.class)
|
||||
|
@ -172,7 +181,7 @@ public class PublicIPAddressApiMockTest extends BaseAzureComputeApiMockTest {
|
|||
PublicIPAddressProperties properties = PublicIPAddressProperties.create(null, null, "Static", 4, null,
|
||||
DnsSettings.create("foobar", "foobar.northeurope.cloudapp.azure.com", null));
|
||||
|
||||
ipApi.createOrUpdate(publicIpName, location, tags, properties);
|
||||
ipApi.createOrUpdate(publicIpName, location, tags, null, properties);
|
||||
}
|
||||
|
||||
public void deletePublicIPAddress() throws InterruptedException {
|
||||
|
|
|
@ -30,11 +30,11 @@ import org.jclouds.azurecompute.arm.domain.FrontendIPConfigurations;
|
|||
import org.jclouds.azurecompute.arm.domain.FrontendIPConfigurationsProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.IdReference;
|
||||
import org.jclouds.azurecompute.arm.domain.IpAddressAvailabilityResult;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet.SubnetProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualNetwork;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancer;
|
||||
import org.jclouds.azurecompute.arm.domain.loadbalancer.LoadBalancerProperties;
|
||||
import org.jclouds.azurecompute.arm.internal.BaseAzureComputeApiLiveTest;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
@ -138,7 +138,7 @@ public class VirtualNetworkApiLiveTest extends BaseAzureComputeApiLiveTest {
|
|||
LoadBalancerProperties props = LoadBalancerProperties.builder()
|
||||
.frontendIPConfigurations(ImmutableList.of(frontendIps)).build();
|
||||
|
||||
LoadBalancer lbCreated = lbApi().createOrUpdate("lbName", LOCATION, null, props);
|
||||
LoadBalancer lbCreated = lbApi().createOrUpdate("lbName", LOCATION, null, null, props);
|
||||
assertNotNull(lbCreated);
|
||||
return lbCreated;
|
||||
}
|
||||
|
|
|
@ -29,10 +29,10 @@ import java.util.Collections;
|
|||
|
||||
import org.jclouds.azurecompute.arm.domain.IdReference;
|
||||
import org.jclouds.azurecompute.arm.domain.IpAllocationMethod;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualNetwork;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.SKU;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.SKU.SKUName;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.SKU.SKUTier;
|
||||
|
@ -71,7 +71,7 @@ public class VirtualNetworkGatewayApiLiveTest extends BaseAzureComputeApiLiveTes
|
|||
PublicIPAddressProperties props = PublicIPAddressProperties.builder()
|
||||
.publicIPAllocationMethod(IpAllocationMethod.Dynamic.name()).idleTimeoutInMinutes(4).build();
|
||||
publicIp = api.getPublicIPAddressApi(resourceGroupName).createOrUpdate(name + "-publicip", LOCATION,
|
||||
Collections.<String, String> emptyMap(), props);
|
||||
Collections.<String, String> emptyMap(), null, props);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -32,10 +32,10 @@ import org.jclouds.azurecompute.arm.domain.AddressSpace;
|
|||
import org.jclouds.azurecompute.arm.domain.IdReference;
|
||||
import org.jclouds.azurecompute.arm.domain.IpAllocationMethod;
|
||||
import org.jclouds.azurecompute.arm.domain.Provisionable;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.Subnet;
|
||||
import org.jclouds.azurecompute.arm.domain.VirtualNetwork;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddress;
|
||||
import org.jclouds.azurecompute.arm.domain.publicipaddress.PublicIPAddressProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.LocalNetworkGateway;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.LocalNetworkGatewayProperties;
|
||||
import org.jclouds.azurecompute.arm.domain.vpn.SKU;
|
||||
|
@ -98,7 +98,7 @@ public class VirtualNetworkGatewayConnectionApiLiveTest extends BaseAzureCompute
|
|||
PublicIPAddressProperties props = PublicIPAddressProperties.builder()
|
||||
.publicIPAllocationMethod(IpAllocationMethod.Dynamic.name()).idleTimeoutInMinutes(4).build();
|
||||
PublicIPAddress publicIp = api.getPublicIPAddressApi(resourceGroupName).createOrUpdate(name + "-publicip",
|
||||
LOCATION, Collections.<String, String> emptyMap(), props);
|
||||
LOCATION, Collections.<String, String> emptyMap(), null, props);
|
||||
|
||||
IpConfigurationProperties ipprops = IpConfigurationProperties.builder(IpAllocationMethod.Dynamic)
|
||||
.subnet(IdReference.create(subnet.id())).publicIPAddress(IdReference.create(publicIp.id())).build();
|
||||
|
|
|
@ -16,5 +16,8 @@
|
|||
"domainNameLabel": "foobar",
|
||||
"fqdn": "foobar.northeurope.cloudapp.azure.com"
|
||||
}
|
||||
},
|
||||
"sku": {
|
||||
"name": "Basic"
|
||||
}
|
||||
}
|
|
@ -20,5 +20,8 @@
|
|||
"ipConfiguration": {
|
||||
"id": "/subscriptions/fakeb2f5-4710-4e93-bdf4-419edbde2178/resourceGroups/myresourcegroup/providers/Microsoft.Network/networkInterfaces/myNic/ipConfigurations/myip1"
|
||||
}
|
||||
},
|
||||
"sku": {
|
||||
"name": "Basic"
|
||||
}
|
||||
}
|
|
@ -4,6 +4,9 @@
|
|||
"etag": "W/\"406af4e7-b24b-4c00-b42f-b3c4399bf61d\"",
|
||||
"type": "Microsoft.Network/loadBalancers",
|
||||
"location": "westeurope",
|
||||
"sku": {
|
||||
"name": "Basic"
|
||||
},
|
||||
"properties": {
|
||||
"provisioningState": "Succeeded",
|
||||
"resourceGuid": "112b7e75-f287-4789-9f6a-9a55a6fbe47c",
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
"etag": "W/\"b2cfb60e-4ada-4546-a336-dd71e574ead6\"",
|
||||
"type": "Microsoft.Network/loadBalancers",
|
||||
"location": "westeurope",
|
||||
"sku": {
|
||||
"name": "Basic"
|
||||
},
|
||||
"properties": {
|
||||
"provisioningState": "Succeeded",
|
||||
"resourceGuid": "0d53b121-95cc-47b5-bbc6-0391f5991028",
|
||||
|
|
Loading…
Reference in New Issue