Search in sources :

Example 6 with NetworkSecurityGroupsInner

use of com.microsoft.azure.management.network.implementation.NetworkSecurityGroupsInner in project photon-model by vmware.

the class AzureSecurityGroupService method createSecurityGroup.

private DeferredResult<AzureSecurityGroupContext> createSecurityGroup(AzureSecurityGroupContext context) {
    String rgName = context.resourceGroup.name();
    final String msg = "Creating Azure Security Group [" + context.securityGroupState.name + "] in resource group [" + rgName + "].";
    NetworkSecurityGroupsInner azureSecurityGroupClient = context.azureSdkClients.getNetworkManagementClientImpl().networkSecurityGroups();
    return AzureSecurityGroupUtils.createSecurityGroup(this, azureSecurityGroupClient, context.securityGroupState, rgName, context.securityGroupState.regionId, msg).thenApply(sg -> {
        // Populate the security group id with Azure Network Security Group ID
        context.securityGroupState.id = sg.id();
        context.securityGroup = sg;
        return context;
    });
}
Also used : NetworkSecurityGroupsInner(com.microsoft.azure.management.network.implementation.NetworkSecurityGroupsInner)

Aggregations

NetworkSecurityGroupsInner (com.microsoft.azure.management.network.implementation.NetworkSecurityGroupsInner)6 NetworkInterfaceInner (com.microsoft.azure.management.network.implementation.NetworkInterfaceInner)4 NetworkSecurityGroupInner (com.microsoft.azure.management.network.implementation.NetworkSecurityGroupInner)4 PublicIPAddressInner (com.microsoft.azure.management.network.implementation.PublicIPAddressInner)4 AzureDeferredResultServiceCallback (com.vmware.photon.controller.model.adapters.azure.utils.AzureDeferredResultServiceCallback)4 AzureSecurityGroupUtils (com.vmware.photon.controller.model.adapters.azure.utils.AzureSecurityGroupUtils)4 AzureUtils (com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils)4 SecurityGroupState (com.vmware.photon.controller.model.resources.SecurityGroupService.SecurityGroupState)4 DeferredResult (com.vmware.xenon.common.DeferredResult)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 SubResource (com.microsoft.azure.SubResource)3 IPAllocationMethod (com.microsoft.azure.management.network.IPAllocationMethod)3 NetworkInterfaceIPConfigurationInner (com.microsoft.azure.management.network.implementation.NetworkInterfaceIPConfigurationInner)3 NetworkInterfacesInner (com.microsoft.azure.management.network.implementation.NetworkInterfacesInner)3 NetworkManagementClientImpl (com.microsoft.azure.management.network.implementation.NetworkManagementClientImpl)3 PublicIPAddressesInner (com.microsoft.azure.management.network.implementation.PublicIPAddressesInner)3 Lists (com.google.common.collect.Lists)2 AvailabilitySet (com.microsoft.azure.management.compute.AvailabilitySet)2 ServiceCallback (com.microsoft.rest.ServiceCallback)2