当前位置: 首页>>代码示例>>Java>>正文


Java NeutronSubnet.setSubnetUUID方法代码示例

本文整理汇总了Java中org.opendaylight.controller.networkconfig.neutron.NeutronSubnet.setSubnetUUID方法的典型用法代码示例。如果您正苦于以下问题:Java NeutronSubnet.setSubnetUUID方法的具体用法?Java NeutronSubnet.setSubnetUUID怎么用?Java NeutronSubnet.setSubnetUUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.controller.networkconfig.neutron.NeutronSubnet的用法示例。


在下文中一共展示了NeutronSubnet.setSubnetUUID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defaultSubnetObject

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
public NeutronSubnet defaultSubnetObject() {
    NeutronSubnet subnet = new NeutronSubnet();
    List<NeutronSubnet_IPAllocationPool> allocationPools = new ArrayList<NeutronSubnet_IPAllocationPool>();
    NeutronSubnet_IPAllocationPool neutronSubnet_IPAllocationPool = new NeutronSubnet_IPAllocationPool();
    subnet.setNetworkUUID("6b9570f2-17b1-4fc3-99ec-1b7f7778a29b");
    subnet.setSubnetUUID("7b9570f2-17b1-4fc3-99ec-1b7f7778a29b");
    subnet.setCidr("10.0.0.0/24");
    subnet.setGatewayIP("10.0.0.254");
    neutronSubnet_IPAllocationPool.setPoolStart("10.0.0.1");
    neutronSubnet_IPAllocationPool.setPoolEnd("10.0.0.254");
    allocationPools.add(neutronSubnet_IPAllocationPool);
    subnet.setAllocationPools(allocationPools);
    subnet.setEnableDHCP(true);
    return subnet;
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:16,代码来源:SubnetHandlerTest.java

示例2: defaultDeltaSubnet

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
public NeutronSubnet defaultDeltaSubnet() {
    NeutronSubnet subnet = new NeutronSubnet();
    subnet.setNetworkUUID("6b9570f2-17b1-4fc399ec-1b7f7778a29b");
    subnet.setSubnetUUID("7b9570f2-17b1-4fc399ec-1b7f7778a29b");
    subnet.setCidr("10.0.0.0/24");
    subnet.setGatewayIP("10.0.0.254");
    return subnet;
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:9,代码来源:SubnetHandlerTest.java

示例3: testGetIpPrefixInvalid

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testGetIpPrefixInvalid() {
    SubnetHandler.apiConnector = mockedApiConnector;
    NeutronSubnet neutronSubnet = new NeutronSubnet();
    neutronSubnet.setNetworkUUID("6b9570f2-17b1-4fc399ec-1b7f7778a29b");
    neutronSubnet.setSubnetUUID("7b9570f2-17b1-4fc399ec-1b7f7778a29b");
    neutronSubnet.setCidr("10.0.0.0");
    subnetHandler.getIpPrefix(neutronSubnet);
}
 
开发者ID:opendaylight,项目名称:archived-plugin2oc,代码行数:10,代码来源:SubnetHandlerTest.java

示例4: defaultSubnetObject

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
public NeutronSubnet defaultSubnetObject() {
    NeutronSubnet subnet = new NeutronSubnet();
    subnet.setNetworkUUID("6b9570f2-17b1-4fc399ec-1b7f7778a29b");
    subnet.setSubnetUUID("7b9570f2-17b1-4fc399ec-1b7f7778a29b");
    subnet.setCidr("10.0.0.1/24");
    subnet.setGatewayIP("10.0.0.0");
    return subnet;
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:9,代码来源:SubnetHandlerTest.java

示例5: testCanCreateSubnetExistsWithCIDRNull

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
@Test
public void testCanCreateSubnetExistsWithCIDRNull() throws IOException {
    Activator.apiConnector = mockedApiConnector;
    NeutronSubnet neutronSubnet = new NeutronSubnet();
    neutronSubnet.setNetworkUUID("6b9570f2-17b1-4fc399ec-1b7f7778a29b");
    neutronSubnet.setSubnetUUID("7b9570f2-17b1-4fc399ec-1b7f7778a29b");
    when(mockedApiConnector.findById(VirtualNetwork.class, neutronSubnet.getNetworkUUID())).thenReturn(mockedVirtualNetwork);
    VnSubnetsType vnSubnetType = new VnSubnetsType();
    ObjectReference<VnSubnetsType> ref = new ObjectReference<>();
    List<ObjectReference<VnSubnetsType>> ipamRefs = new ArrayList<ObjectReference<VnSubnetsType>>();
    List<VnSubnetsType.IpamSubnetType> subnets = new ArrayList<VnSubnetsType.IpamSubnetType>();
    VnSubnetsType.IpamSubnetType subnetType = new VnSubnetsType.IpamSubnetType();
    SubnetType type = new SubnetType();
    List<String> temp = new ArrayList<String>();
    for (int i = 0; i < 1; i++) {
        subnetType.setSubnet(type);
        subnetType.getSubnet().setIpPrefix("10.0.0.1");
        subnetType.getSubnet().setIpPrefixLen(24);
        subnets.add(subnetType);
        vnSubnetType.addIpamSubnets(subnetType);
        ref.setReference(temp, vnSubnetType, "", "");
        ipamRefs.add(ref);
    }
    when(mockedVirtualNetwork.getNetworkIpam()).thenReturn(ipamRefs);
    assertTrue(subnetType.getSubnet().getIpPrefix().matches("10.0.0.1"));
    assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, subnetHandler.canCreateSubnet(neutronSubnet));
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:28,代码来源:SubnetHandlerTest.java

示例6: testGetIpPrefixNull

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
@Test(expected = NullPointerException.class)
public void testGetIpPrefixNull() {
    SubnetHandler.apiConnector = mockedApiConnector;
    NeutronSubnet neutronSubnet = new NeutronSubnet();
    neutronSubnet.setNetworkUUID("6b9570f2-17b1-4fc399ec-1b7f7778a29b");
    neutronSubnet.setSubnetUUID("7b9570f2-17b1-4fc399ec-1b7f7778a29b");
    subnetHandler.getIpPrefix(neutronSubnet);
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:9,代码来源:SubnetHandlerTest.java

示例7: testGetIpPrefixInvalid

import org.opendaylight.controller.networkconfig.neutron.NeutronSubnet; //导入方法依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testGetIpPrefixInvalid() {
    SubnetHandler.apiConnector = mockedApiConnector;
    NeutronSubnet neutronSubnet = new NeutronSubnet();
    neutronSubnet.setNetworkUUID("6b9570f2-17b1-4fc399ec-1b7f7778a29b");
    neutronSubnet.setSubnetUUID("7b9570f2-17b1-4fc399ec-1b7f7778a29b");
    neutronSubnet.setCidr("10.0.0.1");
    subnetHandler.getIpPrefix(neutronSubnet);
}
 
开发者ID:Juniper,项目名称:odl-opencontrail-plugin,代码行数:10,代码来源:SubnetHandlerTest.java


注:本文中的org.opendaylight.controller.networkconfig.neutron.NeutronSubnet.setSubnetUUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。