Package com.cloud.network.bigswitch

Examples of com.cloud.network.bigswitch.Port


                }
        }
    }

    private Answer executeRequest(CreateVnsPortCommand cmd, int numRetries) {
        Port port = new Port();
        port.setId(cmd.getPortUuid());
        port.setName(cmd.getPortName());
        port.setTenant_id(cmd.getTenantUuid());

        try {
            _bigswitchVnsApi.createPort(cmd.getNetworkUuid(), port);
            try {
                Attachment attachment = new Attachment();
View Full Code Here


                }
        }
    }

    private Answer executeRequest(UpdateVnsPortCommand cmd, int numRetries) {
        Port port = new Port();
        port.setId(cmd.getPortUuid());
        port.setName(cmd.getPortName());
        port.setTenant_id(cmd.getTenantUuid());

        try {
            _bigswitchVnsApi.modifyPort(cmd.getNetworkUuid(), port);
            return new UpdateVnsPortAnswer(cmd, true, "Network Port  " + cmd.getPortUuid() + " updated");
        } catch (BigSwitchVnsApiException e) {
View Full Code Here

    @Test
    public void testCreatePort() throws ConfigurationException, BigSwitchVnsApiException {
        _resource.configure("BigSwitchVnsResource", _parameters);

        Port networkp = mock(Port.class);
        when(networkp.getId()).thenReturn("eeee");

        CreateVnsPortCommand cntkc = new CreateVnsPortCommand("networkid", "portid", "tenantid", "portname", "aa:bb:cc:dd:ee:ff");
        CreateVnsPortAnswer cntka = (CreateVnsPortAnswer) _resource.executeRequest(cntkc);
        assertTrue(cntka.getResult());
    }
View Full Code Here

    @Test
    public void testCreatePortApiExceptionInCreate() throws ConfigurationException, BigSwitchVnsApiException {
        _resource.configure("BigSwitchVnsResource", _parameters);

        Port networkp = mock(Port.class);
        when(networkp.getId()).thenReturn("eeee");
        doThrow(new BigSwitchVnsApiException()).when(_bigswitchVnsApi).createPort((String)any(), (Port)any());

        CreateVnsPortCommand cntkc = new CreateVnsPortCommand("networkid", "portid", "tenantid", "portname", "aa:bb:cc:dd:ee:ff");
        CreateVnsPortAnswer cntka = (CreateVnsPortAnswer) _resource.executeRequest(cntkc);
        assertFalse(cntka.getResult());
View Full Code Here

    @Test
    public void testCreatePortApiExceptionInModify() throws ConfigurationException, BigSwitchVnsApiException {
        _resource.configure("BigSwitchVnsResource", _parameters);

        Port networkp = mock(Port.class);
        when(networkp.getId()).thenReturn("eeee");
        doThrow(new BigSwitchVnsApiException()).when(_bigswitchVnsApi).modifyPortAttachment((String)any(), (String)any(), (String)any(), (Attachment)any());

        CreateVnsPortCommand cntkc = new CreateVnsPortCommand("networkid", "portid", "tenantid", "portname", "aa:bb:cc:dd:ee:ff");
        CreateVnsPortAnswer cntka = (CreateVnsPortAnswer) _resource.executeRequest(cntkc);
        assertFalse(cntka.getResult());
View Full Code Here

TOP

Related Classes of com.cloud.network.bigswitch.Port

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.