use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class SubnetImpl method withExistingNetworkSecurityGroup.
@Override
public SubnetImpl withExistingNetworkSecurityGroup(String resourceId) {
// Workaround for REST API's expectation of an object rather than string ID - should be fixed in Swagger specs or REST
SubResource reference = new SubResource().withId(resourceId);
this.inner().withNetworkSecurityGroup(reference);
return this;
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class LoadBalancerBackendImpl method loadBalancingRules.
@Override
public Map<String, LoadBalancingRule> loadBalancingRules() {
final Map<String, LoadBalancingRule> rules = new TreeMap<>();
if (this.inner().loadBalancingRules() != null) {
for (SubResource inner : this.inner().loadBalancingRules()) {
String name = ResourceUtils.nameFromResourceId(inner.id());
LoadBalancingRule rule = this.parent().loadBalancingRules().get(name);
if (rule != null) {
rules.put(name, rule);
}
}
}
return Collections.unmodifiableMap(rules);
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class LoadBalancerFrontendImpl method withExistingPublicIPAddress.
@Override
public LoadBalancerFrontendImpl withExistingPublicIPAddress(String resourceId) {
SubResource pipRef = new SubResource().withId(resourceId);
this.inner().withPublicIPAddress(pipRef).withSubnet(null).withPrivateIPAddress(null).withPrivateIPAllocationMethod(null);
return this;
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class LoadBalancerFrontendImpl method loadBalancingRules.
@Override
public Map<String, LoadBalancingRule> loadBalancingRules() {
final Map<String, LoadBalancingRule> rules = new TreeMap<>();
if (this.inner().loadBalancingRules() != null) {
for (SubResource innerRef : this.inner().loadBalancingRules()) {
String name = ResourceUtils.nameFromResourceId(innerRef.id());
LoadBalancingRule rule = this.parent().loadBalancingRules().get(name);
if (rule != null) {
rules.put(name, rule);
}
}
}
return Collections.unmodifiableMap(rules);
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class LoadBalancerFrontendImpl method withExistingSubnet.
@Override
public LoadBalancerFrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) {
SubResource subnetRef = new SubResource().withId(parentNetworkResourceId + "/subnets/" + subnetName);
this.inner().withSubnet(subnetRef).withPublicIPAddress(// Ensure no conflicting public and private settings
null);
return this;
}
Aggregations